:root{
  --bg0:#070A12;
  --bg1:#0B1020;
  --bg2:#101A33;
  --card:#0D1630;
  --card2:#0E1B3A;
  --stroke:rgba(255,255,255,.08);
  --stroke2:rgba(255,255,255,.12);
  --text:#EAF0FF;
  --muted:rgba(234,240,255,.68);
  --muted2:rgba(234,240,255,.50);
  --shadow: 0 24px 80px rgba(0,0,0,.55);
  --shadow2: 0 12px 34px rgba(0,0,0,.35);

  --brandA:#6EE7FF;
  --brandB:#A78BFA;
  --brandC:#34D399;
  --danger:#FB7185;
  --warn:#FBBF24;
  --ok:#34D399;

  --radius:18px;
  --radius2:14px;
  --pad:16px;
  --pad2:12px;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background:
    radial-gradient(1200px 900px at 25% 10%, rgba(110,231,255,.12), transparent 55%),
    radial-gradient(900px 700px at 80% 20%, rgba(167,139,250,.11), transparent 55%),
    radial-gradient(700px 500px at 70% 90%, rgba(52,211,153,.08), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 40%, var(--bg0));
}

.app-shell{
  height:100%;
  display:grid;
  grid-template-columns: 280px 1fr;
}

.sidebar{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border-right:1px solid var(--stroke);
  padding:18px 14px;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px;
  border:1px solid var(--stroke);
  border-radius:16px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  box-shadow: var(--shadow2);
}
.logo{
  width:44px; height:44px;
  border-radius:14px;
  display:grid; place-items:center;
  font-weight:800;
  color:#051018;
  background: linear-gradient(135deg, var(--brandA), var(--brandB));
}
.brand-title{ font-weight:800; letter-spacing:.2px; }
.brand-sub{ color:var(--muted); font-size:12px; margin-top:2px; }

.nav{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:6px;
}
.nav-item{
  cursor:pointer;
  border:1px solid transparent;
  background:transparent;
  color:var(--text);
  font: inherit;
  text-align:left;
  display:flex;
  gap:10px;
  align-items:center;
  padding:12px 12px;
  border-radius:14px;
  transition: .18s ease;
}
.nav-item:hover{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.06);
}
.nav-item.is-active{
  background: linear-gradient(135deg, rgba(110,231,255,.14), rgba(167,139,250,.10));
  border-color: rgba(110,231,255,.22);
}
.nav-ico{ width:22px; display:inline-flex; justify-content:center; }

.sidebar-footer{
  margin-top:auto;
  padding:12px;
  border:1px solid var(--stroke);
  border-radius:16px;
  background: rgba(255,255,255,.03);
  display:flex;
  flex-direction:column;
  gap:10px;
}

.pill{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  font-size:13px;
}
.dot{ width:9px; height:9px; border-radius:50%; }
.dot-green{ background: var(--ok); box-shadow: 0 0 0 4px rgba(52,211,153,.10); }

.btn-row{ display:flex; gap:10px; }
.tiny{ font-size:12px; }
.muted{ color:var(--muted); }

.main{ display:flex; flex-direction:column; min-width:0; }
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 20px;
  border-bottom:1px solid var(--stroke);
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
}
.page-title{ font-size:20px; font-weight:900; letter-spacing:.2px; }
.page-sub{ margin-top:4px; color:var(--muted); font-size:13px; }

.topbar-right{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 520px;
  justify-content:flex-end;
}

.search{
  flex: 1;
  min-width: 240px;
  max-width: 420px;
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.20);
  border-radius: 14px;
  padding:10px 12px;
}
.search-ico{ opacity:.7; }
.search input{
  border:none;
  outline:none;
  background:transparent;
  color:var(--text);
  width:100%;
  font-size:14px;
}
.search input::placeholder{ color: rgba(234,240,255,.45); }

.chip{
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--stroke);
  border-radius: 999px;
  padding:10px 12px;
  font-size:13px;
  background: rgba(255,255,255,.03);
}
.chip-ico{ opacity:.8; }

.content{
  padding:18px 20px 26px;
  overflow:auto;
}

.route{ display:none; }
.route.is-visible{ display:block; }

.grid{
  display:grid;
  gap:14px;
}
.grid.cols-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 1100px){
  .app-shell{ grid-template-columns: 1fr; }
  .sidebar{ display:none; }
  .topbar-right{ min-width:0; }
  .grid.cols-3{ grid-template-columns: 1fr; }
  .grid.cols-2{ grid-template-columns: 1fr; }
}

.card{
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  box-shadow: var(--shadow2);
  overflow:hidden;
}
.card-head{
  padding:14px 16px;
  border-bottom:1px solid var(--stroke);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.card-title{ font-weight:900; letter-spacing:.2px; }
.card-sub{ color:var(--muted); font-size:12px; margin-top:4px; }
.card-body{ padding:14px 16px; }

.kpis{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:12px;
}
@media(max-width: 1100px){
  .kpis{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
.kpi{
  padding:14px 14px;
  border-radius: 16px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
}
.kpi .label{ color:var(--muted); font-size:12px; }
.kpi .value{ font-size:22px; font-weight:900; margin-top:6px; }
.kpi .hint{ color:var(--muted2); font-size:12px; margin-top:4px; }

.btn{
  cursor:pointer;
  border:none;
  border-radius: 14px;
  padding:10px 12px;
  font-weight:800;
  letter-spacing:.1px;
  color:var(--text);
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  transition: .16s ease;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.08); }
.btn:active{ transform: translateY(0); }
.btn-primary{
  background: linear-gradient(135deg, rgba(110,231,255,.28), rgba(167,139,250,.22));
  border-color: rgba(110,231,255,.25);
}
.btn-ghost{
  background: transparent;
  border-color: rgba(255,255,255,.10);
}
.icon-btn{
  cursor:pointer;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  width:40px; height:40px;
  display:grid; place-items:center;
  color:var(--text);
}
.icon-btn:hover{ background: rgba(255,255,255,.08); }

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(0,0,0,.16);
}
.table th, .table td{
  padding:12px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align:middle;
  text-align:left;
  font-size:13px;
}
.table th{
  color: rgba(234,240,255,.76);
  font-weight:900;
  background: rgba(255,255,255,.04);
  position:sticky;
  top:0;
  z-index:2;
}
.table tr:hover td{ background: rgba(255,255,255,.03); }
.table .right{ text-align:right; }
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius: 999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.03);
  font-size:12px;
  font-weight:800;
}
.badge .b-dot{ width:8px; height:8px; border-radius:50%; }
.b-ok{ background: rgba(52,211,153,.14); border-color: rgba(52,211,153,.20); }
.b-ok .b-dot{ background: var(--ok); }
.b-warn{ background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.18); }
.b-warn .b-dot{ background: var(--warn); }
.b-bad{ background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.18); }
.b-bad .b-dot{ background: var(--danger); }
.b-info{ background: rgba(110,231,255,.12); border-color: rgba(110,231,255,.18); }
.b-info .b-dot{ background: var(--brandA); }

.split{
  display:grid;
  grid-template-columns: 1.3fr 1fr;
  gap:14px;
}
@media(max-width: 1100px){
  .split{ grid-template-columns: 1fr; }
}

.form{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.form .full{ grid-column:1 / -1; }
.field{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.field label{
  font-size:12px;
  color:var(--muted);
  font-weight:900;
}
.field input, .field select, .field textarea{
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  color:var(--text);
  border-radius: 14px;
  padding:10px 12px;
  outline:none;
  font-size:14px;
}
.field textarea{ min-height: 90px; resize: vertical; }
.help{ font-size:12px; color:var(--muted2); margin-top:2px; }

.hr{ height:1px; background: rgba(255,255,255,.08); margin:12px 0; }

.modal-backdrop{
  position:fixed;
  inset:0;
  display:none;
  place-items:center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  z-index: 999;
}
.modal-backdrop.is-open{ display:grid; }
.modal{
  width:min(980px, calc(100vw - 28px));
  border-radius: 20px;
  border:1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(16,26,51,.96), rgba(11,16,32,.94));
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-header{
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.modal-title{ font-weight:1000; font-size:16px; }
.modal-sub{ color:var(--muted); font-size:12px; margin-top:4px; }
.modal-body{ padding:14px 16px; }
.modal-footer{
  padding:14px 16px;
  border-top:1px solid rgba(255,255,255,.08);
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.small{ font-size:12px; color:var(--muted); }
.mono{ font-family:var(--mono); }

.forecast-wrap{
  border:1px solid var(--stroke);
  border-radius: 16px;
  overflow:auto;
  background: rgba(0,0,0,.18);
}
.forecast-table{
  border-collapse:separate;
  border-spacing:0;
  min-width: 1050px;
  width:100%;
}
.forecast-table th, .forecast-table td{
  border-bottom:1px solid rgba(255,255,255,.06);
  border-right:1px solid rgba(255,255,255,.05);
  padding:10px 10px;
  font-size:12px;
}
.forecast-table th{
  position:sticky;
  top:0;
  z-index:3;
  background: rgba(255,255,255,.05);
  font-weight:1000;
  white-space:nowrap;
}
.forecast-table th:first-child,
.forecast-table td:first-child{
  position:sticky;
  left:0;
  z-index:4;
  background: rgba(12,18,40,.92);
  font-weight:1000;
  min-width: 180px;
}
.cell{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  white-space:nowrap;
}
.mini{
  font-size:11px;
  color: rgba(234,240,255,.75);
  font-family:var(--mono);
}
.heat{
  border-radius: 10px;
  padding:6px 8px;
  border: 1px solid rgba(255,255,255,.08);
}
.heat.ok{ background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.18); }
.heat.warn{ background: rgba(251,191,36,.10); border-color: rgba(251,191,36,.16); }
.heat.bad{ background: rgba(251,113,133,.10); border-color: rgba(251,113,133,.16); }

.flex{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.spread{ display:flex; align-items:center; justify-content:space-between; gap:12px; }