:root{
  --bg:#0b0f16;
  --card:#121a24;
  --text:#e8eef7;
  --muted:#b7c6da;
  --line:#233245;
  --accent:#ff7a00;
  --danger:#ff3b3b;
  --control:#1a2533;
}
*{box-sizing:border-box}
html{color-scheme:dark}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:var(--bg);
  color:var(--text);
  line-height:1.35;
}
.wrap{width:min(1200px,calc(100% - 24px));margin:0 auto}
.topbar{
  position:sticky;top:0;
  background:rgba(10,14,20,.92);
  border-bottom:1px solid var(--line);
  backdrop-filter:blur(10px);
}
.topbar .wrap{display:flex;align-items:center;justify-content:space-between;padding:12px 0}
.brand{font-weight:750;letter-spacing:.2px;font-size:18px}
.nav{display:flex;gap:10px;align-items:center}
.navlink{
  color:var(--text);
  text-decoration:none;
  padding:9px 12px;
  border-radius:12px;
  border:1px solid transparent;
  font-weight:600;
}
.navlink:hover{border-color:var(--line);background:rgba(255,255,255,.04)}
.main{padding:18px 0 28px}
.card{
  background:linear-gradient(180deg, rgba(18,26,36,.92), rgba(12,18,28,.92));
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px;
  margin:12px 0;
  box-shadow:0 14px 36px rgba(0,0,0,.28);
}
h1{margin:0 0 10px;font-size:38px;letter-spacing:.2px}
h2{margin:0 0 10px;font-size:18px}
.muted{color:var(--muted);font-size:14px}
.hr{height:1px;background:var(--line);margin:12px 0}
.row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
@media (max-width:900px){.row{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:520px){.row{grid-template-columns:1fr}}
.field label{display:block;color:var(--muted);font-size:13px;margin-bottom:6px;font-weight:650}
input[type=text],input[type=password],select{
  width:100%;
  padding:11px 12px;
  border-radius:14px;
  border:1px solid rgba(35,50,69,.95);
  background:rgba(26,37,51,.65);
  color:var(--text);
  outline:none;
}
input[type=text]::placeholder{color:rgba(183,198,218,.75)}
select{
  color-scheme:dark;
  background:rgba(26,37,51,.75);
}
select:focus,input:focus{
  border-color:rgba(255,122,0,.55);
  box-shadow:0 0 0 3px rgba(255,122,0,.12);
}
select[multiple]{height:240px}
option{
  background:var(--control);
  color:var(--text);
}
button,.btn{
  appearance:none;
  border:1px solid rgba(35,50,69,.95);
  background:rgba(255,255,255,.05);
  color:var(--text);
  padding:10px 14px;
  border-radius:14px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  gap:8px;
  align-items:center;
  font-weight:700;
}
button:hover,.btn:hover{background:rgba(255,255,255,.08)}
button.secondary,.btn.secondary{background:transparent}
button.danger{
  background:rgba(255,59,59,.12);
  border-color:rgba(255,59,59,.38);
}
.inline{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(35,50,69,.95);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.ok{color:#6ee7b7}
.err{color:#ffb4b4}
table{width:100%;border-collapse:collapse;font-size:14px}
thead th{
  color:rgba(183,198,218,.92);
  font-weight:800;
  letter-spacing:.2px;
  background:rgba(15,22,32,.35);
}
th,td{border-bottom:1px solid rgba(35,50,69,.85);padding:12px 10px;vertical-align:top}
tbody tr:hover{background:rgba(255,255,255,.03)}
.pager{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.pager a{
  text-decoration:none;color:var(--text);
  padding:6px 10px;border:1px solid rgba(35,50,69,.95);
  border-radius:12px;background:rgba(255,255,255,.03);
  font-weight:800;
}
.pager a.active{border-color:rgba(255,122,0,.6);background:rgba(255,122,0,.14)}
.footer{border-top:1px solid var(--line);padding:18px 0;margin-top:18px}


/* Tables */
.table-wrap{ overflow:auto; }
table.zebra{ width:100%; border-collapse:collapse; }
table.zebra thead th{ position:sticky; top:0; background:var(--control); z-index:3; }
table.zebra th, table.zebra td{ border-bottom:1px solid rgba(255,255,255,0.06); padding:10px 12px; vertical-align:top; }
table.zebra tbody tr:nth-child(even){ background:rgba(255,255,255,0.03); }
table.zebra tbody tr:hover{ background:rgba(255,255,255,0.06); }

.thlink{ color:inherit; text-decoration:none; }
.thlink:hover{ text-decoration:underline; }

.sticky{ position:sticky; z-index:2; background:var(--card); }
.sticky-1{ left:0; min-width:220px; }
.sticky-2{ left:220px; min-width:110px; }
.sticky-mini{ left:0; min-width:70px; }

/* Controls readability */
select, option{ color:var(--text); }
select{ background:var(--control); border:1px solid rgba(255,255,255,0.12); }
select option{ background:#0b0f16; color:var(--text); }
.status-select{ min-width:150px; }

/* Layout helpers */
.grid-2{ display:grid; grid-template-columns: 1fr 320px; gap:12px; align-items:start; }
.basket-list{ list-style:none; padding-left:0; margin:0; }
.basket-list li{ padding:6px 0; border-bottom:1px dashed rgba(255,255,255,0.10); }
.btn{ display:inline-block; text-decoration:none; }

/* Sticky header + sticky columns layering */
table.zebra thead th.sticky{ background:var(--control); z-index:4; }
