:root{
  --bg:#08090b;
  --sidebar:#0c0f12;
  --panel:#12161b;
  --panel2:#171b21;
  --border:#282d35;
  --text:#f6f7f9;
  --muted:#89919e;
  --yellow:#ffd400;
  --yellow-soft:rgba(255,212,0,.11);
  --green:#25d889;
  --red:#ff6565;
  --orange:#ffa142;
}

*{
  box-sizing:border-box;
}

html,body{
  margin:0;
  min-height:100%;
  background:var(--bg);
  color:var(--text);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input,
select{
  font:inherit;
}

button{
  cursor:pointer;
}

.app{
  display:grid;
  grid-template-columns:240px minmax(0,1fr);
  min-height:100vh;
}

.sidebar{
  height:100vh;
  position:sticky;
  top:0;
  padding:25px 19px;
  background:var(--sidebar);
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:37px;
}

.logo{
  width:45px;
  height:45px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background:var(--yellow);
  color:#080808;
  font-weight:950;
  font-size:18px;
  box-shadow:
    0 0 30px rgba(255,212,0,.13);
}

.brand strong,
.brand small{
  display:block;
}

.brand strong{
  font-size:16px;
}

.brand small{
  margin-top:2px;
  color:var(--muted);
  font-size:11px;
}

nav{
  display:flex;
  flex-direction:column;
  gap:5px;
}

.nav-item{
  width:100%;
  text-align:left;
  border:1px solid transparent;
  border-radius:11px;
  padding:11px 13px;
  background:transparent;
  color:#919aa8;
  font-size:14px;
}

.nav-item:hover:not(.disabled){
  background:#15191e;
  color:#d8dce2;
}

.nav-item.active{
  color:var(--yellow);
  border-color:rgba(255,212,0,.12);
  background:var(--yellow-soft);
}

.nav-item.disabled{
  opacity:.35;
  cursor:not-allowed;
}

.sidebar-bottom{
  margin-top:auto;
  padding-top:18px;
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:10px;
}

.status-dot{
  display:inline-block;
  width:7px;
  height:7px;
  margin-right:6px;
  border-radius:50%;
  background:var(--green);
  box-shadow:
    0 0 10px rgba(37,216,137,.65);
}

.content{
  width:100%;
  max-width:1600px;
  margin:0 auto;
  padding:30px 32px 60px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
}

.eyebrow{
  display:block;
  margin-bottom:7px;
  color:var(--yellow);
  font-size:10px;
  font-weight:900;
  letter-spacing:.15em;
}

h1,h2{
  margin:0;
}

h1{
  font-size:29px;
  letter-spacing:-.035em;
}

h2{
  font-size:19px;
  letter-spacing:-.02em;
}

.top-actions{
  display:flex;
  align-items:center;
  gap:14px;
}

.account{
  display:flex;
  align-items:center;
  gap:13px;
}

.account>div{
  text-align:right;
}

.account strong,
.account small{
  display:block;
}

.account strong{
  font-size:13px;
}

.account small{
  margin-top:2px;
  color:var(--muted);
  font-size:10px;
}

.logout,
.secondary-button{
  border:1px solid var(--border);
  border-radius:9px;
  padding:9px 13px;
  background:transparent;
  color:#c9ced6;
}

.logout:hover,
.secondary-button:hover{
  border-color:#464d58;
  background:#161a20;
}

.range-wrap select,
.search{
  min-height:38px;
  padding:0 12px;
  outline:none;
  border:1px solid var(--border);
  border-radius:9px;
  background:#101318;
  color:var(--text);
}

.range-wrap select{
  min-width:130px;
}

.search{
  width:230px;
}

.search:focus,
.range-wrap select:focus{
  border-color:rgba(255,212,0,.42);
}

.hidden{
  display:none!important;
}

.livebar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin:16px 0 22px;
  color:var(--muted);
  font-size:10px;
}

.metrics{
  display:grid;
  grid-template-columns:
    repeat(4,minmax(0,1fr));
  gap:12px;
}

.metric{
  min-height:135px;
  padding:19px;
  border:1px solid var(--border);
  border-radius:18px;
  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.018),
      transparent
    ),
    var(--panel);
  display:flex;
  flex-direction:column;
}

.metric.highlight{
  border-color:
    rgba(255,212,0,.36);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(255,212,0,.13),
      transparent 58%
    ),
    var(--panel);
}

.metric.success{
  border-color:
    rgba(37,216,137,.18);
}

.metric.danger{
  border-color:
    rgba(255,101,101,.22);
}

.metric.warning{
  border-color:
    rgba(255,161,66,.20);
}

.metric>span{
  color:#9ca5b3;
  font-size:11px;
}

.metric strong{
  margin-top:auto;
  margin-bottom:6px;
  font-size:31px;
  line-height:1;
  letter-spacing:-.04em;
}

.metric small{
  color:#69727f;
  font-size:10px;
}

.split{
  display:grid;
  grid-template-columns:
    minmax(0,1.4fr)
    minmax(320px,.6fr);
  gap:13px;
  margin-top:13px;
}

.full-panel{
  margin-top:13px;
}

.panel{
  border:1px solid var(--border);
  border-radius:18px;
  padding:20px;
  background:var(--panel);
  min-height:250px;
}

.panel-head{
  margin-bottom:20px;
}

.pulse{
  display:grid;
  grid-template-columns:
    repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:28px;
}

.pulse>div{
  padding:20px;
  border:1px solid #232831;
  border-radius:13px;
  background:var(--panel2);
}

.pulse span{
  color:var(--muted);
  font-size:10px;
}

.pulse strong{
  display:block;
  margin-top:8px;
  font-size:20px;
}

.system-list>div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:13px 0;
  border-bottom:1px solid #22272e;
  font-size:11px;
}

.system-list span{
  color:var(--muted);
}

.good{
  color:var(--green);
}

.toolbar-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  margin-bottom:13px;
  padding:13px 15px;
  border:1px solid var(--border);
  border-radius:13px;
  background:#0f1216;
}

.toolbar-row strong,
.toolbar-row small{
  display:block;
}

.toolbar-row strong{
  font-size:12px;
}

.toolbar-row small{
  margin-top:3px;
  color:var(--muted);
  font-size:10px;
}

.toolbar-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.chart{
  height:230px;
  display:flex;
  align-items:flex-end;
  gap:7px;
  overflow-x:auto;
  padding:12px 2px 0;
}

.bar-col{
  min-width:20px;
  flex:1;
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  align-items:center;
}

.bar-value{
  margin-bottom:6px;
  color:#7e8794;
  font-size:8px;
  white-space:nowrap;
}

.bar{
  width:min(34px,70%);
  min-height:5px;
  border-radius:7px 7px 3px 3px;
  background:
    linear-gradient(
      180deg,
      var(--yellow),
      #9e8500
    );
  box-shadow:
    0 0 20px rgba(255,212,0,.08);
}

.bar-label{
  margin-top:7px;
  color:#69727f;
  font-size:8px;
  white-space:nowrap;
}

.rank-list{
  display:flex;
  flex-direction:column;
}

.rank-row{
  min-height:56px;
  display:grid;
  grid-template-columns:
    auto minmax(0,1fr) auto;
  gap:11px;
  align-items:center;
  border-bottom:1px solid #22272d;
}

.rank-row:last-child{
  border-bottom:0;
}

.rank{
  width:25px;
  height:25px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#1b2026;
  color:#939ba6;
  font-size:10px;
}

.rank-row strong,
.rank-row small{
  display:block;
}

.rank-row strong{
  font-size:11px;
}

.rank-row small{
  margin-top:3px;
  color:var(--muted);
  font-size:9px;
}

.right{
  text-align:right;
}

.table-wrap{
  width:100%;
  overflow:auto;
}

table{
  width:100%;
  border-collapse:collapse;
  min-width:760px;
}

th{
  padding:11px 10px;
  text-align:left;
  border-bottom:1px solid var(--border);
  color:#737d8a;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.06em;
}

td{
  padding:12px 10px;
  border-bottom:1px solid #20252c;
  color:#c7cbd2;
  font-size:11px;
}

tbody tr:hover{
  background:#15191e;
}

.money{
  color:#f2f3f5;
  font-weight:700;
  white-space:nowrap;
}

.rank-badge{
  width:25px;
  height:25px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#1c2026;
  color:#a4acb7;
  font-size:10px;
}

.dealer-cell strong,
.dealer-cell small{
  display:block;
}

.dealer-cell strong{
  color:#f0f1f3;
  font-size:11px;
}

.dealer-cell small{
  margin-top:3px;
  color:#707986;
  font-size:9px;
}

.badge{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:0 8px;
  border-radius:999px;
  font-size:9px;
  font-weight:700;
}

.badge.active{
  color:#62e7a8;
  background:
    rgba(37,216,137,.09);
}

.badge.inactive{
  color:#b5bbc4;
  background:#20242a;
}

.warn-text{
  color:var(--orange);
  font-weight:700;
}

.loading,
.empty,
.error-box{
  min-height:180px;
  display:grid;
  place-items:center;
  text-align:center;
  color:var(--muted);
  font-size:12px;
}

.error-box{
  border:1px solid rgba(255,101,101,.18);
  border-radius:15px;
  background:rgba(255,101,101,.03);
  color:#ff9999;
}

.table-empty{
  height:130px;
  text-align:center;
  color:var(--muted);
}

@media(max-width:1100px){

  .metrics{
    grid-template-columns:
      repeat(2,minmax(0,1fr));
  }

  .split{
    grid-template-columns:1fr;
  }

}

@media(max-width:760px){

  .app{
    grid-template-columns:1fr;
  }

  .sidebar{
    display:none;
  }

  .content{
    padding:20px 14px 50px;
  }

  .topbar{
    align-items:flex-start;
  }

  h1{
    font-size:22px;
  }

  .account>div{
    display:none;
  }

  .toolbar-row{
    align-items:flex-start;
    flex-direction:column;
  }

  .toolbar-actions{
    width:100%;
  }

  .search{
    width:100%;
  }

}

@media(max-width:470px){

  .metrics{
    grid-template-columns:1fr;
  }

  .pulse{
    grid-template-columns:1fr;
  }

  .top-actions{
    gap:7px;
  }

  .range-wrap select{
    min-width:105px;
  }

}


/* KPI V3 EXTRAS START */

.bh-1{height:5%}
.bh-2{height:10%}
.bh-3{height:15%}
.bh-4{height:20%}
.bh-5{height:25%}
.bh-6{height:30%}
.bh-7{height:35%}
.bh-8{height:40%}
.bh-9{height:45%}
.bh-10{height:50%}
.bh-11{height:55%}
.bh-12{height:60%}
.bh-13{height:65%}
.bh-14{height:70%}
.bh-15{height:75%}
.bh-16{height:80%}
.bh-17{height:85%}
.bh-18{height:90%}
.bh-19{height:95%}
.bh-20{height:100%}

.page{
  width:100%;
}

.panel h2{
  margin:0;
}

.full-panel{
  width:100%;
}

.table-wrap{
  scrollbar-width:thin;
}

table td{
  vertical-align:middle;
}

table tr:last-child td{
  border-bottom:0;
}

.metric.warning{
  border-color:
    rgba(255,161,66,.28);
}

.metric.success{
  border-color:
    rgba(37,216,137,.24);
}

.metric.danger{
  border-color:
    rgba(255,101,101,.25);
}

.error-box small{
  color:#8f97a4;
}

@media(max-width:600px){

  .topbar{
    flex-direction:column;
    align-items:stretch;
  }

  .top-actions{
    justify-content:space-between;
  }

  .range-wrap{
    flex:1;
  }

  .range-wrap select{
    width:100%;
  }

  .account{
    flex-shrink:0;
  }

}

/* KPI V3 EXTRAS END */



/* ==================================================
   KPI LOGIN PAGE
================================================== */

.login-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;

  background:
    radial-gradient(
      circle at 50% 15%,
      rgba(255,212,0,.10),
      transparent 34%
    ),
    radial-gradient(
      circle at 80% 90%,
      rgba(255,212,0,.035),
      transparent 28%
    ),
    #08090b;
}

.login-box{
  width:min(420px,100%);
  padding:36px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.025),
      transparent
    ),
    #12161b;

  border:1px solid #282d35;
  border-radius:24px;

  box-shadow:
    0 35px 100px rgba(0,0,0,.55),
    0 0 60px rgba(255,212,0,.035);
}

.login-box > .logo{
  width:52px;
  height:52px;

  border-radius:15px;

  font-size:20px;

  box-shadow:
    0 0 35px rgba(255,212,0,.17);
}

.login-title{
  margin-top:26px;
}

.login-title > span{
  display:block;

  color:#ffd400;

  font-size:10px;
  font-weight:900;

  letter-spacing:.17em;
}

.login-title h1{
  margin:7px 0 0;

  font-size:30px;
  line-height:1.1;

  letter-spacing:-.04em;
}

.login-title p{
  margin:10px 0 0;

  color:#89919e;

  font-size:12px;
  line-height:1.65;
}

.login-form{
  display:grid;
  gap:17px;

  margin-top:30px;
}

.login-form label{
  display:grid;
  gap:8px;

  color:#a9b0bb;

  font-size:11px;
  font-weight:600;
}

.login-form input{
  width:100%;
  min-height:46px;

  padding:0 14px;

  border:1px solid #282d35;
  border-radius:11px;

  outline:none;

  background:#0b0e12;
  color:#f6f7f9;

  font-size:14px;

  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.login-form input:hover{
  border-color:#343a44;
}

.login-form input:focus{
  border-color:rgba(255,212,0,.55);

  background:#0d1014;

  box-shadow:
    0 0 0 3px
    rgba(255,212,0,.08);
}

.login-form button{
  width:100%;
  min-height:46px;

  margin-top:3px;

  border:0;
  border-radius:11px;

  background:#ffd400;
  color:#080808;

  font-size:13px;
  font-weight:900;

  cursor:pointer;

  box-shadow:
    0 10px 30px
    rgba(255,212,0,.10);

  transition:
    transform .15s ease,
    background .15s ease;
}

.login-form button:hover{
  background:#ffe033;
  transform:translateY(-1px);
}

.login-form button:active{
  transform:translateY(0);
}

.readonly{
  margin-top:24px;

  text-align:center;

  color:#68717e;

  font-size:9px;
  font-weight:700;

  letter-spacing:.12em;
}

.readonly::before{
  content:"";

  display:inline-block;

  width:6px;
  height:6px;

  margin-right:7px;

  border-radius:50%;

  background:#25d889;

  box-shadow:
    0 0 10px
    rgba(37,216,137,.55);
}

@media(max-width:520px){

  .login-page{
    padding:16px;
  }

  .login-box{
    padding:28px 22px;
    border-radius:20px;
  }

  .login-title h1{
    font-size:26px;
  }

}
