/* =========================================================
   TG MANDI — Admin Console
   Layout, navigation and page-level structures.
   ========================================================= */

/* ---------------- Shell ---------------- */
body.admin{background:var(--bg);font-size:14px}
.adm{display:flex;min-height:100vh;align-items:stretch}

/* ---------------- Sidebar ---------------- */
.side{
  width:var(--side-w);flex:none;background:var(--surface);
  border-right:1px solid var(--line);
  display:flex;flex-direction:column;
  position:sticky;top:0;height:100vh;z-index:40;
  padding:14px 12px 12px;
}
.side .brand{display:flex;align-items:center;gap:10px;padding:4px 6px 14px;margin-bottom:6px;border-bottom:1px solid var(--line)}
.side .brand-mark{
  width:32px;height:32px;border-radius:8px;background:var(--text);display:grid;place-items:center;flex:none;
}
.side .brand-mark svg{width:17px;height:17px;color:#fff}
.side .brand-mark{width:30px;height:30px}
.side .brand-name{font-size:13.5px;font-weight:650;color:var(--text);letter-spacing:-.015em;line-height:1.25;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.side .brand small{display:block;font-size:10px;color:var(--faint);font-weight:600;letter-spacing:.07em;text-transform:uppercase;margin-top:1px}
.side .nav{flex:1;overflow-y:auto;padding-bottom:8px;margin:0 -4px;padding-left:4px;padding-right:4px}
.nav-l{font-size:10px;font-weight:600;color:var(--faint);text-transform:uppercase;letter-spacing:.07em;margin:14px 8px 5px}
.nav-l:first-child{margin-top:2px}
.nav a{
  display:flex;align-items:center;gap:9px;padding:7px 9px;border-radius:7px;
  color:var(--text-2);font-weight:500;font-size:13px;margin-bottom:1px;
  transition:background .12s,color .12s;position:relative;
}
.nav a .ic{width:16px;height:16px;color:var(--faint);transition:color .12s;stroke-width:1.8}
.nav a:hover{background:var(--surface-3);color:var(--text)}
.nav a:hover .ic{color:var(--text-2)}
.nav a.on{background:var(--accent-soft);color:var(--accent-text);font-weight:600}
.nav a.on .ic{color:var(--accent)}
.nav a.on::before{content:"";position:absolute;left:-4px;top:6px;bottom:6px;width:2.5px;border-radius:99px;background:var(--accent)}
.side-foot{margin-top:auto;padding-top:12px;border-top:1px solid var(--line);display:grid;gap:6px}
.side-foot .btn{height:32px;font-size:12.5px;justify-content:flex-start;box-shadow:none;background:transparent;border-color:transparent;color:var(--muted);font-weight:500;padding:0 9px;border-radius:7px}
.side-foot .btn:hover{background:var(--surface-3);color:var(--text)}
.side-foot .btn.btn-danger{color:var(--red-text)}
.side-foot .btn.btn-danger:hover{background:var(--red-soft)}

/* ---------------- Main ---------------- */
.main{flex:1;min-width:0;padding:0 0 64px;display:flex;flex-direction:column}

/* Top bar */
.topbar{
  position:sticky;top:0;z-index:30;background:color-mix(in srgb,var(--surface) 90%,transparent);
  -webkit-backdrop-filter:saturate(180%) blur(8px);backdrop-filter:saturate(180%) blur(8px);
  border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:12px;
  padding:0 24px;height:57px;flex:none;
}
.topbar .tb-title{min-width:0;display:flex;flex-direction:column;justify-content:center;gap:1px}
.topbar h1{font-size:15px;font-weight:600;letter-spacing:-.015em;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .tb-sub{font-size:12px;color:var(--muted);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .tb-actions{margin-left:auto;display:flex;align-items:center;gap:8px;flex:none}
.tb-divider{width:1px;height:22px;background:var(--line);flex:none}
.tb-user{display:flex;align-items:center;gap:8px;padding:3px 8px 3px 3px;border-radius:99px;border:1px solid transparent;transition:background .14s}
.tb-user:hover{background:var(--surface-3)}
.tb-user .avatar{width:27px;height:27px;border-radius:50%;font-size:11px}
.tb-user b{font-size:12.5px;font-weight:550;color:var(--text-2);max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.menu-btn{display:none}

/* Content container */
.content{padding:22px 24px 0;width:100%;max-width:1480px;margin:0 auto;flex:1}
.page-foot{padding:20px 24px 0;border-top:1px solid var(--line);margin-top:24px;display:flex;gap:12px;justify-content:space-between;flex-wrap:wrap;font-size:11.5px;color:var(--faint)}
.page-foot a:hover{color:var(--text-2)}

/* Legacy header alias (used inside pages via admin_title) */
.mhead{display:none}

/* Flash messages */
.flash{margin-bottom:14px}

/* ---------------- Page headers ---------------- */
.ph{display:flex;align-items:flex-start;gap:16px;flex-wrap:wrap;margin-bottom:20px}
.ph-main{min-width:0;flex:1}
.ph h2{font-size:19px;font-weight:650;letter-spacing:-.025em;line-height:1.3}
.ph .ph-sub{font-size:13px;color:var(--muted);margin-top:3px;line-height:1.45}
.ph-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}

/* Section heading inside a page */
.sec-h{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:24px 0 12px}
.sec-h h3{font-size:13.5px;font-weight:600;display:flex;align-items:center;gap:8px}
.sec-h h3 .ic{width:16px;height:16px;color:var(--faint)}
.sec-h:first-child{margin-top:0}

/* ---------------- KPI cards ---------------- */
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}
.kpi{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);
  padding:14px 15px;display:flex;flex-direction:column;gap:0;box-shadow:var(--shadow-xs);
  transition:border-color .14s,box-shadow .14s;min-width:0;
}
.kpi:hover{border-color:var(--line-2);box-shadow:var(--shadow-sm)}
.kpi .k-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.kpi .k-lbl{color:var(--muted);font-size:12px;font-weight:500;letter-spacing:0}
.kpi .s-ic{
  width:26px;height:26px;border-radius:7px;display:grid;place-items:center;flex:none;
  background:var(--surface-3);color:var(--muted);
}
.kpi .s-ic .ic{width:14px;height:14px;stroke-width:1.9}
.kpi .s-ic.tone-green{background:var(--green-soft);color:var(--green-text)}
.kpi .s-ic.tone-red{background:var(--red-soft);color:var(--red-text)}
.kpi .s-ic.tone-amber{background:var(--amber-soft);color:var(--amber-text)}
.kpi .s-ic.tone-blue{background:var(--blue-soft);color:var(--blue-text)}
.kpi .s-ic.tone-violet{background:var(--violet-soft);color:var(--violet-text)}
.kpi .k-val{font-size:23px;font-weight:650;letter-spacing:-.035em;color:var(--text);margin-top:10px;line-height:1.15;font-variant-numeric:tabular-nums}
.kpi .k-val.sm{font-size:17px}
.kpi .k-sub{font-size:11.5px;color:var(--faint);margin-top:3px;line-height:1.4;display:flex;align-items:center;gap:5px}
.kpi .k-sub .ic{width:12px;height:12px}
.kpi .k-sub strong{font-weight:600;color:var(--muted)}

/* ---------------- Layout grids ---------------- */
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start}
.grid-1-2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:14px;align-items:start}
.grid-2-1{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:14px;align-items:start}
.stack{display:grid;gap:14px}

/* ---------------- Forms ---------------- */
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}
.form-grid .full{grid-column:1/-1}
.form-section{padding:16px}
.form-section + .form-section{border-top:1px solid var(--line)}
.form-section-h{display:flex;align-items:center;gap:8px;font-size:12.5px;font-weight:600;color:var(--text);margin-bottom:14px;letter-spacing:-.005em}
.form-section-h .ic{width:15px;height:15px;color:var(--faint)}
.form-actions{
  position:sticky;bottom:0;z-index:15;
  display:flex;align-items:center;gap:10px;justify-content:flex-end;
  padding:12px 16px;background:color-mix(in srgb,var(--surface) 94%,transparent);
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  border-top:1px solid var(--line);border-radius:0 0 var(--radius-lg) var(--radius-lg);
}
.form-actions .hint{margin-right:auto;font-size:12px;color:var(--muted)}
.sticky-save{position:sticky;bottom:16px;z-index:12;display:flex;justify-content:flex-end;gap:8px;padding-top:12px}

/* ---------------- Tables inside boxes ---------------- */
.box > .tbl-wrap{border-radius:0}
.box > .tbl-wrap:last-child{border-bottom-left-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg);overflow:hidden}

/* ---------------- Rows / detail lists ---------------- */
.dl{display:grid;gap:0}
.dl > div{display:flex;align-items:flex-start;gap:16px;padding:9px 0;border-bottom:1px solid var(--line);font-size:13px}
.dl > div:last-child{border-bottom:0}
.dl dt,.dl .k{color:var(--muted);font-size:12.5px;flex:none;min-width:132px}
.dl .v{color:var(--text);font-weight:500;min-width:0;flex:1;text-align:right;word-break:break-word}

/* ---------------- Rate / preview cards ---------------- */
.rate-card{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:4px 0 14px}
.rate-card > div{padding:11px 13px;border-radius:var(--radius);background:var(--surface-2);border:1px solid var(--line)}
.rate-card small{display:block;font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-weight:600}
.rate-card b{display:block;font-size:15px;margin-top:3px;font-weight:600;font-variant-numeric:tabular-nums}
.rate-card > div:first-child b{color:var(--green-text)}

.preview-calc{background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius);padding:14px}
.preview-calc .kv{color:var(--muted);font-size:12.5px}
.preview-calc .kv b{color:var(--text);font-weight:600}
.prov-bal{font-size:12px;color:var(--muted);margin-top:3px}

/* ---------------- Review (deposit proof) ---------------- */
.rev-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:20px;align-items:start}
.rev-shot{background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius);padding:8px;text-align:center}
.rev-shot img{max-width:100%;max-height:58vh;border-radius:6px;display:block;margin:0 auto}
.rev-form{margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
.proof-thumb{width:38px;height:38px;border-radius:7px;overflow:hidden;border:1px solid var(--line-2);background:var(--surface-2);display:block;padding:0;cursor:zoom-in}
.proof-thumb img{width:100%;height:100%;object-fit:cover;display:block}
@media (max-width:820px){.rev-grid{grid-template-columns:1fr}}

/* ---------------- Steps ---------------- */
.steps{counter-reset:s;display:grid;gap:9px;margin:0;padding:0}
.steps li{
  list-style:none;position:relative;padding-left:28px;min-height:20px;
  font-size:12.5px;line-height:1.6;color:var(--muted);
}
.steps li b{color:var(--text-2);font-weight:550}
.steps li::before{
  counter-increment:s;content:counter(s);position:absolute;left:0;top:1px;
  width:18px;height:18px;border-radius:50%;background:var(--surface-3);
  display:grid;place-items:center;font-size:10.5px;font-weight:600;color:var(--muted);
}

/* ---------------- Misc ---------------- */
.brand-mark{width:32px;height:32px;border-radius:50%;background:transparent;display:grid;place-items:center;flex:none;overflow:hidden}
.brand-mark svg{width:17px;height:17px;color:#fff}
.brand-mark .brand-img{width:100%;height:100%}
.flag{display:inline-block;border-radius:2px;vertical-align:middle;box-shadow:0 0 0 1px rgba(16,24,40,.08)}
.c-row td{padding:9px 14px}
.c-row .flag{width:22px;height:16px;border-radius:3px}
.actions-row .btn{box-shadow:none}

/* ---------------- Responsive ---------------- */
@media (max-width:1240px){
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:1080px){
  .grid-2,.grid-1-2,.grid-2-1{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:900px){
  :root{--side-w:264px}
  .side{
    position:fixed;left:0;top:0;z-index:70;transform:translateX(-100%);
    transition:transform .22s cubic-bezier(.32,.72,0,1);box-shadow:var(--shadow-xl);
    border-right:1px solid var(--line);
  }
  .side.open{transform:none}
  .side-bg{display:none}
  .side-bg.open{display:block;position:fixed;inset:0;z-index:65;background:rgba(16,24,40,.4);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}
  .menu-btn{display:inline-grid}
  .topbar{padding:0 14px;height:53px;gap:10px}
  .content{padding:16px 14px 0}
  .page-foot{padding:16px 14px 0}
  .kpis{gap:10px}
  .form-grid{grid-template-columns:minmax(0,1fr)}
  .ph h2{font-size:17px}
  .topbar .tb-sub{display:none}
  .tb-user b{display:none}
}
@media (max-width:640px){
  .grid-3{grid-template-columns:minmax(0,1fr)}
  .kpi .k-val{font-size:20px}
  .rate-card{grid-template-columns:1fr}
  .toolbar .input,.toolbar select.input{max-width:none;flex:1 1 140px}
  .ph-actions{width:100%}
  .ph-actions .btn{flex:1}
  .form-actions{padding:10px 12px;flex-wrap:wrap}
  .form-actions .btn{flex:1}
  .form-actions .hint{width:100%;margin-bottom:2px}
}
@media (max-width:430px){
  .kpis{grid-template-columns:minmax(0,1fr)}
}
@media print{
  .side,.topbar,.form-actions,.ph-actions,.pager{display:none!important}
  .main{padding:0}
  body{background:#fff}
  .box{box-shadow:none;break-inside:avoid}
}

/* =========================================================
   Auth screens (admin + storefront sign in)
   ========================================================= */
body.admin-auth{background:var(--surface-3);display:grid;place-items:center;min-height:100vh;padding:28px 16px;font-size:14px}
.auth{width:100%;max-width:376px}
.auth-brand{display:flex;align-items:center;gap:10px;margin:0 auto 18px;justify-content:flex-start;width:100%;max-width:376px}
.auth-brand .brand-mark{width:42px;height:42px;border-radius:50%}
.auth-brand .brand-mark svg{width:18px;height:18px}
.auth-brand b{display:block;font-size:14px;font-weight:600;line-height:1.25;letter-spacing:-.015em}
.auth-brand .ab-txt small{display:block;font-size:11px;color:var(--muted);letter-spacing:.04em;text-transform:uppercase;font-weight:600}
.auth .panel{
  background:var(--surface);border:1px solid var(--line);border-radius:14px;
  padding:26px 24px;box-shadow:var(--shadow-lg);width:100%;
}
.auth .panel h1{font-size:18px;font-weight:650;letter-spacing:-.02em}
.auth .panel .sub{color:var(--muted);font-size:12.5px;margin:4px 0 20px;line-height:1.5}
.auth .field{margin-bottom:14px}
.auth .btn-lg{height:40px;font-size:13.5px}
.auth-foot{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:18px;font-size:12px;color:var(--muted)}
.auth-foot a{display:inline-flex;align-items:center;gap:5px;color:var(--muted)}
.auth-foot a:hover{color:var(--text-2)}
.auth-foot .ic{width:14px;height:14px}
.auth-foot span{color:var(--line-3)}
.center-msg{min-height:100vh;display:grid;place-items:center;text-align:center;padding:24px}
.center-msg .box{max-width:400px;padding:32px 26px}
.center-msg h1{font-size:19px;margin:16px 0 6px;letter-spacing:-.02em}
.center-msg p{color:var(--muted);font-size:13px;line-height:1.55}

/* ---------------- Row action menu ---------------- */
.sess-acts{display:inline-flex;gap:5px;align-items:center;justify-content:flex-end;flex-wrap:nowrap;position:relative}
details.act-menu{position:relative;display:inline-block}
details.act-menu > summary{list-style:none;cursor:pointer}
details.act-menu > summary::-webkit-details-marker{display:none}
details.act-menu > summary::marker{display:none}
details.act-menu .act-menu-body{
  position:absolute;right:0;top:calc(100% + 5px);z-index:120;min-width:228px;
  background:var(--surface);border:1px solid var(--line-2);border-radius:var(--radius);
  box-shadow:var(--shadow-lg);padding:5px;text-align:left;
  animation:fadeUp .12s ease;
}
details.act-menu[open] > summary{background:var(--surface-3);border-color:var(--line-3)}
.act-menu-body form{margin:0}
.act-item{
  display:flex;align-items:center;gap:8px;width:100%;padding:7px 9px;border-radius:6px;
  font-size:12.5px;font-weight:450;color:var(--text-2);text-align:left;background:none;border:0;
  transition:background .12s,color .12s;white-space:nowrap;
}
.act-item .ic{width:14px;height:14px;color:var(--faint);flex:none}
.act-item:hover{background:var(--surface-3);color:var(--text)}
.act-item:hover .ic{color:var(--text-2)}
.act-item.danger{color:var(--red-text)}
.act-item.danger .ic{color:var(--red-text)}
.act-item.danger:hover{background:var(--red-soft)}
.act-sep{height:1px;background:var(--line);margin:5px 3px}
@media (max-width:900px){
  details.act-menu .act-menu-body{right:0;left:auto}
  .tbl td .sess-acts{flex-wrap:wrap}
}

/* ---------------- Top bar breadcrumb ---------------- */
.tb-crumb{display:flex;align-items:center;gap:6px;font-size:13px;min-width:0}
.tb-crumb .tb-root{color:var(--faint);font-weight:500}
.tb-crumb .ic{width:14px;height:14px;color:var(--line-3)}
.tb-crumb .tb-here{color:var(--text);font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* =========================================================
   Storefront sign in — split layout
   ========================================================= */
body.auth-body{background:var(--surface);font-size:14px}
.auth-split{display:grid;grid-template-columns:minmax(380px,44%) 1fr;min-height:100vh}
.auth-aside{
  background:var(--surface-3);border-right:1px solid var(--line);
  padding:34px 40px;display:flex;flex-direction:column;gap:32px;
  position:relative;overflow:hidden;
}
.auth-aside::after{
  content:"";position:absolute;inset:auto -120px -160px -120px;height:320px;
  background:radial-gradient(closest-side, rgba(37,99,235,.10), transparent);
  pointer-events:none;
}
.aa-brand{margin-bottom:8px}
.aa-brand .brand2{display:flex;align-items:center;gap:11px}
.aa-brand .brand-mark{width:40px;height:40px;border-radius:50%}
.aa-brand .brand-mark svg{width:19px;height:19px}
.aa-brand .b-txt b{display:block;font-size:14.5px;font-weight:650;letter-spacing:-.02em;line-height:1.2}
.aa-brand .b-txt span{display:block;font-size:10.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;font-weight:600}
.aa-body{flex:1;display:flex;flex-direction:column;justify-content:center;max-width:440px}
.aa-body h1{font-size:30px;line-height:1.2;letter-spacing:-.035em;font-weight:650;color:var(--text)}
.aa-lead{font-size:14px;line-height:1.65;color:var(--muted);margin-top:14px}
.aa-feats{list-style:none;margin:30px 0 0;padding:0;display:grid;gap:16px}
.aa-feats li{display:flex;gap:12px;align-items:flex-start}
.af-ic{width:30px;height:30px;border-radius:8px;background:var(--surface);border:1px solid var(--line);display:grid;place-items:center;flex:none;color:var(--accent-text);box-shadow:var(--shadow-xs)}
.af-ic .ic{width:15px;height:15px}
.aa-feats b{display:block;font-size:13px;font-weight:600;color:var(--text);letter-spacing:-.01em}
.aa-feats span{display:block;font-size:12.5px;color:var(--muted);line-height:1.5;margin-top:1px}
.aa-foot{display:flex;align-items:center;gap:8px;font-size:11.5px;color:var(--muted);border-top:1px solid var(--line-2);padding-top:16px}
.status-dot{width:6px;height:6px;border-radius:50%;background:var(--green);box-shadow:0 0 0 3px rgba(5,150,105,.12)}
.aa-foot-sep{width:1px;height:11px;background:var(--line-2);margin:0 2px}

.auth-pane{padding:36px 32px;display:flex;flex-direction:column;align-items:center;justify-content:center}
.auth-box{width:100%;max-width:376px}
.ab-mobile-brand{display:none;margin-bottom:22px}
.ab-title{font-size:21px;font-weight:650;letter-spacing:-.025em}
.ab-sub{font-size:13px;color:var(--muted);margin:5px 0 20px;line-height:1.5}
.ab-tabs{display:flex;gap:2px;padding:3px;background:var(--surface-3);border:1px solid var(--line);border-radius:9px;margin-bottom:20px}
.ab-tabs button{flex:1;height:30px;border-radius:7px;font-size:12.5px;font-weight:500;color:var(--muted);transition:background .14s,color .14s,box-shadow .14s}
.ab-tabs button:hover{color:var(--text)}
.ab-tabs button.on{background:var(--surface);color:var(--text);font-weight:600;box-shadow:var(--shadow-xs)}
.auth-box .field{margin-bottom:14px}
.auth-box .btn-lg{height:40px;font-size:13.5px}
.dropzone{
  display:flex;align-items:center;justify-content:center;gap:8px;flex-direction:column;
  padding:22px 14px;border:1px dashed var(--line-3);border-radius:var(--radius);
  background:var(--surface-2);font-size:12.5px;color:var(--muted);cursor:pointer;
  transition:border-color .14s,background .14s;
}
.dropzone:hover{border-color:var(--accent);background:var(--accent-soft)}
.dropzone .ic{width:18px;height:18px;color:var(--faint)}
.ab-or{display:flex;align-items:center;gap:12px;font-size:11.5px;color:var(--faint);text-transform:uppercase;letter-spacing:.05em;font-weight:600;margin:22px 0 14px}
.ab-or::before,.ab-or::after{content:"";height:1px;flex:1;background:var(--line)}
.ab-tg{display:flex;justify-content:center;min-height:44px}
.ab-secure{display:flex;align-items:center;justify-content:center;gap:6px;font-size:11.5px;color:var(--faint);margin-top:14px}
.ab-secure .ic{width:13px;height:13px}
.reseller-strip{
  display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;
  margin-top:24px;padding:13px 14px;border:1px solid var(--line);border-radius:var(--radius);
  background:var(--surface-2);
}
.reseller-strip b{display:block;font-size:12.5px;font-weight:600;color:var(--text)}
.reseller-strip span{display:block;font-size:11.5px;color:var(--muted);margin-top:1px}
.reseller-strip .btn .ic,.reseller-strip .btn svg{display:none}
.auth-legal{display:flex;align-items:center;gap:8px;font-size:11.5px;color:var(--faint);margin-top:26px}
.auth-legal a:hover{color:var(--text-2)}
.auth-legal span{color:var(--line-3)}
@media (max-width:980px){
  .auth-split{grid-template-columns:1fr}
  .auth-aside{display:none}
  .ab-mobile-brand{display:block}
  .auth-pane{padding:28px 20px;justify-content:flex-start;min-height:100vh}
  .ab-title{font-size:20px}
}

/* =========================================================
   Legal / policy page (terms.php)
   ========================================================= */
body.legal-body{display:block;background:var(--bg);min-height:100vh;padding:28px 18px 56px}
.legal-wrap{max-width:760px;margin:0 auto}
.legal-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px}
.legal-brand{display:flex;align-items:center;gap:10px;min-width:0}
.legal-mark{width:38px;height:38px;border-radius:50%;background:transparent;color:#fff;display:grid;place-items:center;flex:none;overflow:hidden}
.legal-mark .brand-img{width:100%;height:100%}
.legal-mark svg{width:17px;height:17px}
.legal-brand-txt b{display:block;font-size:13.5px;font-weight:600;color:var(--text);line-height:1.3}
.legal-brand-txt small{display:block;font-size:11.5px;color:var(--muted);line-height:1.35}
.legal-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:24px}
.legal-intro{display:flex;align-items:flex-start;gap:12px;padding-bottom:18px;border-bottom:1px solid var(--line);margin-bottom:18px}
.legal-ic{width:34px;height:34px;border-radius:9px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;flex:none}
.legal-ic svg{width:17px;height:17px}
.legal-intro h1{font-size:17px;font-weight:650;letter-spacing:-.025em;color:var(--text);margin:0}
.legal-intro p{font-size:12px;color:var(--muted);margin-top:3px}
.legal-list{display:grid;gap:10px}
.legal-item{border:1px solid var(--line);border-radius:var(--radius);padding:13px 15px;background:var(--surface-2)}
.legal-item h2{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--text);margin:0 0 5px}
.legal-item h2 svg{width:15px;height:15px;flex:none}
.legal-item p{font-size:12.5px;line-height:1.65;color:var(--text-2);margin:0}
.legal-item.danger{background:var(--red-soft);border-color:var(--red-line)}
.legal-item.danger h2{color:var(--red-text)}
.legal-item.warning{background:var(--amber-soft);border-color:var(--amber-line)}
.legal-item.warning h2{color:var(--amber-text)}
.legal-item.info{background:var(--blue-soft);border-color:var(--blue-line)}
.legal-item.info h2{color:var(--blue-text)}
.legal-item.violet{background:var(--violet-soft);border-color:var(--violet-line)}
.legal-item.violet h2{color:var(--violet-text)}
.legal-item.success{background:var(--green-soft);border-color:var(--green-line)}
.legal-item.success h2{color:var(--green-text)}
.legal-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.legal-foot span{font-size:12.5px;color:var(--muted)}
.legal-note{text-align:center;font-size:11.5px;color:var(--faint);margin-top:16px}
@media (max-width:620px){
  body.legal-body{padding:18px 12px 40px}
  .legal-card{padding:18px}
  .legal-intro h1{font-size:15.5px}
}

/* =========================================================
   DARK THEME — admin console touch-ups
   ========================================================= */
html[data-theme="dark"] .side{background:var(--surface);border-right-color:var(--line)}
html[data-theme="dark"] .topbar{background:color-mix(in srgb,var(--bg) 88%,transparent);border-bottom-color:var(--line)}
html[data-theme="dark"] .tbl thead th,html[data-theme="dark"] table.data thead th{background:var(--surface-2);color:var(--muted)}
html[data-theme="dark"] .tbl tbody tr:hover,html[data-theme="dark"] table.data tbody tr:hover{background:var(--surface-2)}
html[data-theme="dark"] .pill,html[data-theme="dark"] .badge{border-color:transparent}
html[data-theme="dark"] .aa-brand .brand-mark{box-shadow:0 0 0 1px rgba(255,255,255,.08)}
html[data-theme="dark"] .auth-page,html[data-theme="dark"] .admin-auth{background:var(--bg)}
html[data-theme="dark"] .legal-mark{background:transparent}
html[data-theme="dark"] code,html[data-theme="dark"] .mono{color:var(--text-2)}
@media print{html[data-theme="dark"] body{background:#fff;color:#000}}
