
:root{
  --bg:#06101a;
  --bg2:#0b1522;
  --panel:#0f1b2a;
  --panel2:#121f31;
  --line:#23364d;
  --text:#f5f7fb;
  --muted:#92a0b5;
  --pink:#ff0f6c;
  --pink2:#ff3b8e;
  --green:#1fd68a;
  --blue:#3994ff;
  --amber:#ffbd3d;
  --red:#ff5f6d;
  --white:#fff;
  --sidebar:256px;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}
body{min-height:100vh;background:
radial-gradient(circle at 18% 0%,rgba(255,15,108,.12),transparent 28%),
linear-gradient(180deg,#07111e 0%,#050b13 100%)}
button,input,select{font:inherit}
button{cursor:pointer}
a{color:inherit}
.hidden{display:none!important}
.muted{color:var(--muted)}
.success{color:var(--green)}
.danger{color:var(--red)}
.pink{color:var(--pink2)}
.amber{color:var(--amber)}
.app-shell{display:grid;grid-template-columns:var(--sidebar) 1fr;min-height:100vh}
.sidebar{
  position:sticky;top:0;height:100vh;display:flex;flex-direction:column;
  padding:22px 16px 18px;background:
  linear-gradient(180deg,rgba(4,14,23,.98),rgba(5,11,18,.99));
  border-right:1px solid #1d3043;z-index:20
}
.logo-wrap{background:#fff;border-radius:18px;padding:11px;margin:0 0 12px}
.logo-wrap img{width:100%;display:block}
.powered{font-size:11px;color:#9ba8ba;padding:0 6px 18px;border-bottom:1px solid #1c2c3f;margin-bottom:12px}
.nav{display:flex;flex-direction:column;gap:5px;overflow:auto}
.nav button{
  display:flex;align-items:center;gap:12px;width:100%;border:0;color:#e8edf5;
  background:transparent;padding:12px 13px;border-radius:11px;text-align:left;
  transition:.18s ease
}
.nav button:hover{background:#111f30}
.nav button.active{background:linear-gradient(90deg,var(--pink),#ec1765);box-shadow:0 12px 28px rgba(255,15,108,.18)}
.nav .ico{width:21px;text-align:center;opacity:.95}
.sidebar-foot{margin-top:auto;border-top:1px solid #1c2c3f;padding:16px 6px 0}
.sidebar-tag{font-weight:800;letter-spacing:.08em;font-size:12px}
.sidebar-tag span{color:var(--pink2)}
.main{min-width:0}
.topbar{
  position:sticky;top:0;z-index:15;display:flex;align-items:center;justify-content:space-between;gap:20px;
  padding:15px 24px;background:rgba(248,250,252,.97);color:#10203a;border-bottom:1px solid #dde4ee
}
.welcome h1{margin:0;font-size:22px}
.welcome p{margin:3px 0 0;font-size:13px;color:#62728a}
.top-actions{display:flex;align-items:center;gap:12px}
.top-actions select{min-width:180px}
.user-chip{display:flex;align-items:center;gap:9px;padding-left:12px;border-left:1px solid #d7dee8}
.avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#0b4c99;color:#fff;font-weight:800}
.user-meta strong{display:block;font-size:13px}
.user-meta small{color:#62728a}
.logout-btn,.btn{
  border:1px solid #2b3b51;background:#142136;color:#f4f7fb;border-radius:11px;padding:10px 14px;font-weight:700
}
.logout-btn{background:#fff;color:#ed165f;border-color:#ff6c9f}
.btn.primary{border:0;background:linear-gradient(90deg,var(--pink2),#ed145d);color:#fff}
.btn.success{border:0;background:#143c30;color:#61e7b3}
.btn.ghost{background:transparent}
.btn.sm{padding:7px 10px;font-size:12px}
.content{padding:20px 24px 42px;max-width:1600px;margin:auto}
.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.kpi{
  background:#fff;color:#10203a;border:1px solid #e1e7ef;border-radius:13px;padding:16px;
  box-shadow:0 8px 24px rgba(21,38,62,.07)
}
.kpi-top{display:flex;justify-content:space-between;align-items:center}
.kpi-icon{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;color:#fff;font-size:20px;background:linear-gradient(145deg,var(--pink),#fb3b8b)}
.kpi.blue .kpi-icon{background:linear-gradient(145deg,#0677e8,#4aa4ff)}
.kpi.green .kpi-icon{background:linear-gradient(145deg,#0da973,#36d69a)}
.kpi.amber .kpi-icon{background:linear-gradient(145deg,#e89d0d,#ffc84f)}
.kpi strong{font-size:28px;display:block;margin-top:10px}
.kpi small{color:#6f7d91}
.dashboard-grid{display:grid;grid-template-columns:1.35fr 1fr 1fr;gap:12px;margin-top:12px}
.panel{
  background:#fff;color:#10203a;border:1px solid #e1e7ef;border-radius:13px;padding:16px;
  box-shadow:0 8px 24px rgba(21,38,62,.06);min-width:0
}
.panel.dark{background:#0f1b2a;color:#f5f7fb;border-color:#24374d}
.panel h2,.panel h3{margin:0 0 14px}
.panel-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
.panel-head h3{margin:0}
.empty{min-height:150px;display:grid;place-items:center;text-align:center;color:#8491a3;border:1px dashed #d8e0ea;border-radius:12px;padding:24px}
.empty.dark{border-color:#2b3d53;color:#8191a8}
.stat-list{display:grid;gap:9px}
.stat-row{display:flex;justify-content:space-between;align-items:center;padding:9px 0;border-bottom:1px solid #eef2f7}
.stat-row:last-child{border-bottom:0}
.quick-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.quick{
  border:1px solid #e3e8ef;background:#f8fafc;border-radius:10px;padding:11px;text-align:left;color:#24334a;font-weight:700
}
.quick:hover{border-color:#ff78a6;background:#fff5f9}
.status-list{display:grid;gap:8px}
.status-item{display:flex;justify-content:space-between;align-items:center;padding:7px 0;border-bottom:1px solid #edf1f5;font-size:13px}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block;margin-right:7px;background:var(--green)}
.table-wrap{overflow:auto;border:1px solid #e1e7ef;border-radius:12px}
table{width:100%;border-collapse:collapse;min-width:760px}
th,td{padding:11px 12px;border-bottom:1px solid #e6ebf1;text-align:left;font-size:13px;white-space:nowrap}
th{background:#f7f9fc;color:#3c4b60;font-weight:800}
tbody tr:hover{background:#fafcff}
.badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800;background:#e9eef5;color:#435167}
.badge.green{background:#d9f7ea;color:#08754f}
.badge.blue{background:#dceeff;color:#1268b6}
.badge.amber{background:#fff0cf;color:#9f6700}
.badge.red{background:#ffe1e3;color:#a52a39}
.section-title{display:flex;justify-content:space-between;align-items:end;gap:16px;margin-bottom:16px}
.section-title h1{margin:0;font-size:28px}
.section-title p{margin:4px 0 0;color:#91a0b4}
.form-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:12px;font-weight:800;color:#5f6e83}
.panel.dark .field label{color:#9dacbf}
input,select{
  width:100%;border:1px solid #d6dee8;background:#fff;color:#15263e;border-radius:10px;
  padding:11px 12px;outline:none
}
.panel.dark input,.panel.dark select{background:#0a1420;color:#f4f7fb;border-color:#32465f}
input:focus,select:focus{border-color:#ff4a8a;box-shadow:0 0 0 3px rgba(255,15,108,.08)}
.action-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.card-list{display:grid;gap:10px}
.list-card{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #e4e9f0;border-radius:12px;padding:12px;background:#fff}
.list-card .left{display:flex;align-items:center;gap:11px;min-width:0}
.list-card .round{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#eaf2fb;color:#225b99;font-weight:800}
.list-card strong,.list-card small{display:block}
.list-card small{color:#7d8999;margin-top:2px}
.mobile-top,.bottom-nav{display:none}
.auth-page{min-height:100vh;display:grid;grid-template-columns:1.05fr .95fr;background:
radial-gradient(circle at 10% 5%,rgba(255,15,108,.13),transparent 30%),#06101a}
.auth-hero{position:relative;padding:60px;display:flex;flex-direction:column;justify-content:center;overflow:hidden}
.auth-hero:after{content:"";position:absolute;right:-140px;bottom:-120px;width:520px;height:520px;border-radius:50%;border:1px solid rgba(255,255,255,.05);box-shadow:0 0 0 70px rgba(255,255,255,.018),0 0 0 140px rgba(255,255,255,.012)}
.auth-logo{width:min(430px,85%);background:#fff;padding:14px 20px;border-radius:24px;position:relative;z-index:1}
.auth-kicker{color:var(--pink2);font-weight:900;letter-spacing:.18em;margin-top:26px}
.auth-hero h1{font-size:54px;line-height:1.02;margin:10px 0;color:#fff;max-width:620px;position:relative;z-index:1}
.auth-hero p{color:#91a2b8;max-width:560px;font-size:17px;line-height:1.6;position:relative;z-index:1}
.auth-side{display:grid;place-items:center;padding:30px;background:linear-gradient(180deg,#0b1725,#07111d)}
.auth-card{width:min(460px,100%);background:#101c2b;border:1px solid #263a51;border-radius:26px;padding:28px;box-shadow:0 30px 90px rgba(0,0,0,.38)}
.auth-card h2{font-size:27px;margin:0 0 5px}
.auth-card .sub{color:#91a0b4;margin:0 0 22px}
.auth-card .field{margin-bottom:12px}
.auth-card .field label{color:#a8b4c5}
.auth-card .btn{width:100%;margin-top:6px;text-align:center}
.auth-note{font-size:12px;color:#8190a4;text-align:center;margin-top:15px}
.qr-box{background:#fff;border-radius:18px;padding:14px;display:grid;place-items:center;width:260px;max-width:100%;aspect-ratio:1;margin:16px auto}
.qr-box img{width:100%;height:100%;object-fit:contain;image-rendering:pixelated}
.otp{font-size:28px;font-weight:900;letter-spacing:.35em;text-align:center}
.workflow{display:flex;gap:6px;align-items:center;margin-bottom:16px;overflow:auto}
.step{min-width:110px;padding:9px 10px;border-radius:10px;background:#e9eef5;color:#657287;font-size:12px;font-weight:800;text-align:center}
.step.active{background:#ffe1ec;color:#d9145a}
.step.done{background:#d9f7ea;color:#08754f}
.choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.choice{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px;border:1px solid #dce4ee;border-radius:12px;background:#fff}
.camera{background:#050a10;border:1px solid #25384d;border-radius:15px;overflow:hidden;aspect-ratio:4/3}
.camera video,.camera canvas{width:100%;height:100%;object-fit:cover}
.slots{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.slot{border:1px solid #dce4ed;border-radius:11px;padding:10px;text-align:center;font-size:12px}
.slot.done{background:#daf8ea;border-color:#7ce7ba;color:#08754f}
.mobile-card{display:none}
@media(max-width:1100px){
  .kpi-grid{grid-template-columns:repeat(2,1fr)}
  .dashboard-grid{grid-template-columns:1fr 1fr}
  .dashboard-grid .wide{grid-column:1/-1}
  .form-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:820px){
  :root{--sidebar:0px}
  .app-shell{display:block}
  .sidebar,.topbar{display:none}
  .mobile-top{
    display:flex;position:sticky;top:0;z-index:20;align-items:center;justify-content:space-between;
    padding:12px 14px;background:#07131f;border-bottom:1px solid #1c3043
  }
  .mobile-brand{display:flex;align-items:center;gap:10px}
  .mobile-brand img{width:110px;background:#fff;border-radius:10px;padding:4px}
  .mobile-brand strong{font-size:14px}
  .content{padding:14px 12px 84px}
  .bottom-nav{
    position:fixed;left:0;right:0;bottom:0;z-index:30;display:grid;grid-template-columns:repeat(5,1fr);
    background:rgba(5,14,23,.98);border-top:1px solid #20344a;padding:7px 4px calc(7px + env(safe-area-inset-bottom))
  }
  .bottom-nav button{background:none;border:0;color:#8f9eb2;font-size:10px;padding:5px 2px}
  .bottom-nav button span{display:block;font-size:18px;margin-bottom:2px}
  .bottom-nav button.active{color:var(--pink2)}
  .kpi-grid{grid-template-columns:repeat(2,1fr)}
  .kpi{background:#0f1b2a;color:#f3f6fa;border-color:#24384e}
  .kpi small{color:#91a0b3}
  .dashboard-grid{grid-template-columns:1fr}
  .panel{background:#0f1b2a;color:#f3f6fa;border-color:#24384e;box-shadow:none}
  .table-wrap{border-color:#263b51}
  th{background:#0b1623;color:#c8d2df}
  td,th{border-color:#25384d}
  tbody tr:hover{background:#111f30}
  .empty{border-color:#2b4056;color:#8393a7}
  .quick{background:#101e2e;color:#f3f6fa;border-color:#263c52}
  .stat-row,.status-item{border-color:#26394e}
  .section-title h1{font-size:22px}
  .section-title p{font-size:13px}
  .form-grid,.choice-grid{grid-template-columns:1fr}
  .field label{color:#9aa9bd}
  input,select{background:#08131f;color:#f4f7fb;border-color:#31465e}
  .list-card{background:#0f1b2a;border-color:#263b52;color:#f4f7fb}
  .list-card small{color:#94a2b4}
  .slots{grid-template-columns:repeat(2,1fr)}
  .slot{border-color:#2b4057}
  .mobile-card{display:block}
  .auth-page{display:block}
  .auth-hero{padding:32px 20px 14px;text-align:center;align-items:center}
  .auth-hero h1{font-size:34px}
  .auth-hero p{font-size:14px}
  .auth-side{padding:18px 12px 30px}
  .auth-card{border-radius:22px;padding:22px}
}
@media(max-width:520px){
  .kpi-grid{gap:8px}
  .kpi{padding:13px}
  .kpi strong{font-size:23px}
  .quick-grid{grid-template-columns:1fr}
  .auth-logo{width:85%}
  .auth-hero h1{font-size:30px}
  .workflow{margin-left:-2px;margin-right:-2px}
}

/* V2.2.2: keep administrative tables readable on dark panels in every viewport. */
.panel.dark .table-wrap{border-color:#263b51}
.panel.dark table{color:#f3f6fa}
.panel.dark th{background:#0b1623;color:#c8d2df;border-color:#25384d}
.panel.dark td{color:#f3f6fa;border-color:#25384d;background:#0f1b2a}
.panel.dark tbody tr:hover td{background:#111f30;color:#fff}
.panel.dark tbody tr:focus-within td{background:#111f30;color:#fff}
.panel.dark .muted{color:#9eacbd}
