:root{
  --bg:#080b10;
  --bg-2:#0d1118;
  --bg-3:#111827;
  --sidebar:#0b0f15;
  --sidebar-2:#101620;

  --card:rgba(18,24,35,.92);
  --card-2:rgba(22,31,45,.96);
  --glass:rgba(255,255,255,.045);

  --border:rgba(255,255,255,.08);
  --border-strong:rgba(255,255,255,.15);

  --text:#f4f7fb;
  --muted:#9aa6b8;
  --muted-2:#6f7b8d;

  --primary:#8ea7ff;
  --primary-2:#b2c3ff;
  --primary-soft:rgba(142,167,255,.14);

  --danger:#ef5350;
  --success:#47d18c;
  --warning:#e6a23c;

  --shadow:0 18px 55px rgba(0,0,0,.34);
  --shadow-soft:0 10px 28px rgba(0,0,0,.24);
  --radius:18px;

  --sidebar-width:285px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;min-height:100%}

body{
  font-family:Inter,"Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,Arial,sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(142,167,255,.10), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(71,209,140,.055), transparent 24%),
    linear-gradient(135deg,#070a0f 0%,#0b0f17 48%,#111827 100%);
  color:var(--text);
  overflow-x:hidden;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.017) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.017) 1px, transparent 1px);
  background-size:46px 46px;
  opacity:.55;
}

a{color:var(--text);text-decoration:none}

.app-shell{
  min-height:100vh;
  display:flex;
}

.sidebar{
  position:fixed;
  inset:0 auto 0 0;
  width:var(--sidebar-width);
  background:
    linear-gradient(180deg,rgba(15,21,31,.98),rgba(8,12,18,.98));
  border-right:1px solid var(--border);
  box-shadow:18px 0 50px rgba(0,0,0,.28);
  display:flex;
  flex-direction:column;
  z-index:100;
}

.sidebar-brand{
  min-height:128px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px 18px 12px;
}

.brand-link{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
}

.site-logo{
  max-width:220px;
  max-height:96px;
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
  filter:drop-shadow(0 10px 20px rgba(0,0,0,.35));
}

.sidebar-user{
  margin:0 16px 18px;
  padding:14px;
  display:flex;
  align-items:center;
  gap:12px;
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(255,255,255,.045);
}

.user-avatar{
  width:42px;
  height:42px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
  color:#111827;
  font-weight:950;
}

.sidebar-username{
  font-weight:850;
  line-height:1.15;
}

.sidebar-role{
  color:var(--muted);
  font-size:12px;
  margin-top:3px;
}

.side-nav{
  padding:0 12px;
  display:flex;
  flex-direction:column;
  gap:6px;
  overflow-y:auto;
  flex:1;
}

.side-nav a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 13px;
  border-radius:15px;
  color:var(--muted);
  font-weight:780;
  border:1px solid transparent;
  transition:.16s ease;
}

.side-nav a:hover{
  background:rgba(255,255,255,.055);
  color:#fff;
  border-color:var(--border);
}

.side-nav a.active{
  background:linear-gradient(135deg,rgba(142,167,255,.18),rgba(255,255,255,.055));
  color:#fff;
  border-color:rgba(142,167,255,.32);
  box-shadow:inset 3px 0 0 var(--primary);
}

.nav-icon{
  width:24px;
  display:inline-flex;
  justify-content:center;
  opacity:.95;
}

.sidebar-footer{
  padding:16px;
  border-top:1px solid var(--border);
}

.logout-btn{
  width:100%;
}

.main-area{
  margin-left:var(--sidebar-width);
  min-height:100vh;
  width:calc(100% - var(--sidebar-width));
}

.page-container{
  max-width:1500px;
  margin:0 auto;
  padding:28px;
}

.mobile-topbar{
  display:none;
}

.container,
.container.narrow{
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
}

.topnav{
  display:none !important;
}

.card{
  position:relative;
  background:linear-gradient(180deg,var(--card),rgba(13,18,27,.92));
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:26px;
  margin-bottom:22px;
  box-shadow:var(--shadow-soft);
  overflow:hidden;
}

.card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(120deg,rgba(255,255,255,.045),transparent 36%,transparent 76%,rgba(255,255,255,.025));
}

.card > *{
  position:relative;
  z-index:1;
}

.card:hover{
  border-color:var(--border-strong);
}

.narrow-card{max-width:720px}

h1,h2,h3{
  margin:0 0 18px 0;
  line-height:1.18;
  letter-spacing:-.025em;
}

h1{font-size:34px}
h2{font-size:23px}
h3{font-size:18px}

p{
  margin:0 0 12px 0;
  color:var(--muted);
}

.grid{
  display:grid;
  gap:16px;
}

.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.full{grid-column:1/-1}

.stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-bottom:22px;
}

.stat{
  min-height:126px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:24px;
  background:linear-gradient(180deg,var(--card-2),rgba(15,22,34,.95));
  border:1px solid var(--border);
  border-radius:20px;
  box-shadow:var(--shadow-soft);
  transition:.16s ease;
}

.stat:hover{
  transform:translateY(-2px);
  border-color:var(--border-strong);
}

.number{
  font-size:31px;
  font-weight:950;
  margin-bottom:14px;
  color:#fff;
}

label{
  display:block;
  margin-bottom:8px;
  color:var(--muted);
  font-size:14px;
  font-weight:750;
}

input,select,textarea,button{
  font:inherit;
}

input,select,textarea{
  width:100%;
  background:rgba(7,11,17,.82);
  color:#fff;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  padding:13px 15px;
  outline:none;
  transition:.16s ease;
}

input:focus,select:focus,textarea:focus{
  border-color:rgba(142,167,255,.58);
  box-shadow:0 0 0 4px rgba(142,167,255,.11);
}

textarea{
  resize:vertical;
  min-height:110px;
}

button,.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:12px 18px;
  border:1px solid rgba(142,167,255,.30);
  border-radius:14px;
  background:linear-gradient(135deg,rgba(142,167,255,.92),rgba(178,195,255,.82));
  color:#08101f;
  cursor:pointer;
  font-weight:900;
  box-shadow:0 10px 22px rgba(0,0,0,.20);
  transition:.16s ease;
}

button:hover,.btn:hover{
  transform:translateY(-1px);
  filter:brightness(1.05);
}

.btn.small,button.small{
  padding:8px 12px;
  border-radius:12px;
  font-size:13px;
}

.btn.ghost,button.ghost{
  background:rgba(255,255,255,.055);
  color:#fff;
  box-shadow:none;
  border:1px solid rgba(255,255,255,.10);
}

button.danger,.btn.danger,.danger{
  background:linear-gradient(135deg,#ef5350,#a83232) !important;
  color:#fff !important;
  border-color:rgba(255,255,255,.08) !important;
}

.secondary{
  background:rgba(255,255,255,.075) !important;
  border:1px solid rgba(255,255,255,.10) !important;
  color:#fff !important;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(142,167,255,.16);
  border:1px solid rgba(142,167,255,.35);
  color:#dce7ff;
  font-size:12px;
  font-weight:850;
  padding:7px 12px;
  border-radius:999px;
}

.alert{
  padding:14px 16px;
  border-radius:14px;
  margin-bottom:18px;
  border:1px solid transparent;
}

.alert.success{
  background:rgba(71,209,140,.12);
  border-color:rgba(71,209,140,.30);
  color:#c9ffe1;
}

.alert.error{
  background:rgba(239,83,80,.12);
  border-color:rgba(239,83,80,.30);
  color:#ffd2d2;
}

.table-responsive{
  overflow-x:auto;
}

table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 8px;
}

th,td{
  padding:14px 13px;
  text-align:left;
  vertical-align:top;
}

th{
  color:var(--muted);
  font-weight:850;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
  border-bottom:1px solid var(--border);
}

td{
  background:rgba(255,255,255,.035);
  border-top:1px solid rgba(255,255,255,.055);
  border-bottom:1px solid rgba(255,255,255,.055);
}

td:first-child{
  border-left:1px solid rgba(255,255,255,.055);
  border-radius:14px 0 0 14px;
}

td:last-child{
  border-right:1px solid rgba(255,255,255,.055);
  border-radius:0 14px 14px 0;
}

tr:hover td{
  background:rgba(255,255,255,.055);
}

.wrap{
  white-space:normal;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.long{max-width:420px}
.actions{min-width:320px}

.actions details{
  background:rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
}

.actions summary{
  cursor:pointer;
  font-weight:850;
  margin-bottom:10px;
}

.stack{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
}

.check-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin:12px 0 20px;
}

.check-card{
  display:flex;
  align-items:center;
  gap:14px;
  min-height:74px;
  padding:16px 18px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(8,12,19,.52);
}

.check-card input{
  width:20px;
  height:20px;
  min-width:20px;
  margin:0;
  flex:0 0 20px;
}

.openbox{
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  margin-bottom:12px;
  background:rgba(255,255,255,.035);
}

.progressline{
  background:rgba(255,255,255,.08);
  border-radius:999px;
  overflow:hidden;
  height:14px;
  margin:12px 0;
}

.progressline > div{
  height:100%;
  background:linear-gradient(90deg,#8ea7ff,#c3d0ff);
}

.question-box{
  padding:14px 16px;
  border-radius:14px;
  background:rgba(8,12,19,.62);
  border:1px solid var(--border);
  margin-bottom:14px;
}

.question-box.subtle{color:var(--muted)}

.big-result{
  font-size:60px;
  font-weight:950;
  margin:10px 0;
}

.result-badge{
  display:inline-block;
  padding:10px 14px;
  border-radius:14px;
  font-weight:850;
  margin-bottom:12px;
  border:1px solid rgba(255,255,255,.10);
}

.result-badge.green,.ok{
  background:rgba(71,209,140,.13);
  color:#c8ffdf;
}

.result-badge.orange,.warn{
  background:rgba(230,162,60,.13);
  color:#ffe2ad;
}

.result-badge.red,.bad{
  background:rgba(239,83,80,.13);
  color:#ffc4c4;
}

.chart-vertical{
  display:flex;
  align-items:flex-end;
  gap:26px;
  height:220px;
  margin-top:20px;
}

.chart-bar{
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  align-items:center;
}

.chart-bar div{
  width:100%;
  max-width:120px;
  background:linear-gradient(180deg,#8ea7ff,#c3d0ff);
  border-radius:12px 12px 0 0;
}

.chart-bar span{
  margin-top:10px;
  font-size:13px;
  color:var(--muted);
  text-align:center;
}

.bars .bar{margin:14px 0}

.bars .bar span{
  display:block;
  margin-bottom:8px;
}

.bars .bar div{
  height:16px;
  border-radius:999px;
  background:linear-gradient(90deg,#8ea7ff,#c3d0ff);
}

.align-end{
  display:flex;
  align-items:flex-end;
}

.dashboard-hero{
  min-height:118px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.dashboard-hero h1{
  font-size:34px;
}

.dashboard-hero p{
  max-width:720px;
}

@media (max-width:1200px){
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid.four{grid-template-columns:repeat(2,minmax(0,1fr))}
  .check-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:900px){
  .sidebar{
    transform:translateX(-105%);
    transition:.2s ease;
  }

  .sidebar.open{
    transform:translateX(0);
  }

  .main-area{
    margin-left:0;
    width:100%;
  }

  .mobile-topbar{
    position:sticky;
    top:0;
    z-index:60;
    display:flex;
    align-items:center;
    gap:12px;
    padding:14px 18px;
    background:rgba(10,14,21,.86);
    backdrop-filter:blur(16px);
    border-bottom:1px solid var(--border);
  }

  .mobile-topbar small{
    display:block;
    color:var(--muted);
    font-size:12px;
    margin-top:2px;
  }

  .sidebar-toggle{
    width:42px;
    height:42px;
    padding:0;
    border-radius:12px;
    color:#fff;
    background:rgba(255,255,255,.07);
  }

  .page-container{
    padding:18px;
  }
}

@media (max-width:760px){
  .stats,
  .grid.two,
  .grid.three,
  .grid.four,
  .check-grid{
    grid-template-columns:1fr;
  }

  .long{max-width:260px}
  h1{font-size:27px}
  .card{padding:20px}

  table{
    border-spacing:0 6px;
  }

  th,td{
    padding:12px 10px;
  }
}
