/* Card2Sheet — green system, light + dark */
:root {
  --paper:#f6faf7; --surface:#ffffff; --surface-2:#eaf3ee; --line:#d8e6dd; --line-2:#b9cfc3;
  --ink:#0f1d17; --ink-2:#4d6157; --ink-3:#7d938a;
  --brand:#0f7a4f; --brand-2:#11a367; --brand-ink:#ffffff; --brand-soft:#dff1e7;
  --amber:#9a6410; --amber-soft:#faeed7;
  --rose:#a8342b; --rose-soft:#f8e3e0;
  --star:#c88a00;
  --shadow:0 1px 2px rgba(15,29,23,.05), 0 10px 28px -16px rgba(15,29,23,.28);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:#0c1411; --surface:#121d18; --surface-2:#18261f; --line:#22352c; --line-2:#365044;
    --ink:#e4f0e9; --ink-2:#9fb5aa; --ink-3:#71877d;
    --brand:#3fc38a; --brand-2:#56d69c; --brand-ink:#042014; --brand-soft:#14301f;
    --amber:#d9a75c; --amber-soft:#2e2411;
    --rose:#e0857c; --rose-soft:#341d1a;
    --star:#e5b33d;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 12px 30px -18px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"] {
  --paper:#0c1411; --surface:#121d18; --surface-2:#18261f; --line:#22352c; --line-2:#365044;
  --ink:#e4f0e9; --ink-2:#9fb5aa; --ink-3:#71877d;
  --brand:#3fc38a; --brand-2:#56d69c; --brand-ink:#042014; --brand-soft:#14301f;
  --amber:#d9a75c; --amber-soft:#2e2411;
  --rose:#e0857c; --rose-soft:#341d1a;
  --star:#e5b33d;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 12px 30px -18px rgba(0,0,0,.8);
}

* { box-sizing:border-box; }
html, body { margin:0; }
body {
  background:var(--paper); color:var(--ink);
  font-family:"IBM Plex Sans","Noto Sans Gujarati",system-ui,sans-serif;
  font-size:15px; line-height:1.5; -webkit-text-size-adjust:100%;
  padding-bottom:env(safe-area-inset-bottom);
}
.wrap { max-width:1180px; margin:0 auto; padding-inline:18px; padding-block:0 70px; }
h1,h2,h3 { font-family:"Gabarito","Noto Sans Gujarati",system-ui,sans-serif; margin:0; text-wrap:balance; letter-spacing:-.015em; }
button, input, select, textarea { font:inherit; color:inherit; }
img { max-width:100%; }
.num { font-family:"IBM Plex Mono",ui-monospace,monospace; font-variant-numeric:tabular-nums; }
[hidden] { display:none !important; }

.boot { display:flex; align-items:center; justify-content:center; gap:10px; min-height:60vh; color:var(--ink-2); }
.spin { width:16px; height:16px; border-radius:50%; border:2px solid var(--line-2); border-top-color:var(--brand); animation:sp .8s linear infinite; }
@keyframes sp { to { transform:rotate(360deg); } }

header.top { display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  padding-block:18px 14px; border-bottom:1px solid var(--line); margin-bottom:20px; }
.mark { width:38px; height:38px; border-radius:10px; flex:none; background:var(--brand); color:var(--brand-ink);
  display:grid; place-items:center; font-family:"Gabarito",sans-serif; font-weight:800; font-size:16px; }
.titles { flex:1 1 190px; min-width:0; }
.titles h1 { font-size:21px; font-weight:800; }
.titles p { margin:1px 0 0; color:var(--ink-2); font-size:13px; }
.top-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.who { display:inline-flex; align-items:center; gap:7px; font-size:13px; color:var(--ink-2);
  background:var(--surface-2); border-radius:999px; padding:5px 12px; max-width:220px; overflow:hidden; }
.who b { color:var(--ink); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:9px 15px; border-radius:9px; cursor:pointer; min-height:40px;
  border:1px solid var(--line-2); background:var(--surface);
  font-weight:500; font-size:14px; white-space:nowrap;
  transition:background .12s ease, border-color .12s ease; }
.btn:hover { border-color:var(--ink-3); }
.btn:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.btn.primary { background:var(--brand); border-color:var(--brand); color:var(--brand-ink); font-weight:600; }
.btn.primary:hover { filter:brightness(1.08); }
.btn.big { min-height:48px; font-size:15.5px; width:100%; }
.btn.danger { color:var(--rose); border-color:var(--rose); background:transparent; }
.btn[disabled] { opacity:.45; cursor:not-allowed; }
.btn.sm { padding:5px 11px; min-height:32px; font-size:13px; }
.btn.ghost { border-color:transparent; background:transparent; color:var(--ink-2); }
.btn.ghost:hover { background:var(--surface-2); border-color:transparent; }

.gate { max-width:430px; margin:6vh auto 0; }
.gate .card { background:var(--surface); border:1px solid var(--line); border-radius:16px;
  box-shadow:var(--shadow); padding:26px; display:grid; gap:15px; }
.gate h2 { font-size:21px; font-weight:800; }
.brandline { display:flex; align-items:center; gap:12px; }
.lede { color:var(--ink-2); font-size:13.5px; margin:0; }
.fine { color:var(--ink-3); font-size:11.5px; margin:0; line-height:1.45; }
.sell { margin:0; padding-left:18px; color:var(--ink-2); font-size:14px; display:grid; gap:5px; }
.sell b { color:var(--brand); }

.field, .listf { display:grid; gap:5px; }
.field label, .listf > label { font-size:11.5px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-2); }
.field input, .field textarea, .lrow input {
  background:var(--paper); border:1px solid var(--line-2); border-radius:8px;
  padding:10px 11px; outline:none; width:100%; }
.field input:focus, .field textarea:focus, .lrow input:focus { border-color:var(--brand); }
.field textarea { resize:vertical; min-height:56px; }
.field.flag input, .field.flag textarea, .listf.flag .lrow input { border-color:var(--amber); background:var(--amber-soft); }
.pair { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.err { color:var(--rose); font-size:13px; margin:0; min-height:18px; }

.lrow { display:flex; gap:6px; align-items:center; margin-bottom:6px; }
.mini { width:36px; height:40px; flex:none; border-radius:8px; border:1px solid var(--line-2);
  background:var(--surface); cursor:pointer; color:var(--ink-2); font-size:15px; line-height:1; }
.mini:hover { border-color:var(--rose); color:var(--rose); }
.mini.act:hover { border-color:var(--brand); color:var(--brand); }
.addbtn { justify-self:start; border:1px dashed var(--line-2); background:transparent; color:var(--brand);
  border-radius:9px; padding:7px 13px; cursor:pointer; font-size:13px; font-weight:500; }
.addbtn:hover { border-color:var(--brand); background:var(--brand-soft); }
.chips { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:2px; }
.chip { border:1px solid var(--line-2); background:var(--surface); border-radius:999px;
  padding:7px 13px; font-size:13px; cursor:pointer; color:var(--ink-2); }
.chip:hover { border-color:var(--brand); }
.chip[aria-pressed="true"] { background:var(--brand); border-color:var(--brand); color:var(--brand-ink); font-weight:600; }
.chip .x { margin-left:7px; opacity:.65; font-weight:400; }

.scan { background:var(--surface); border:1px solid var(--line); border-radius:16px;
  box-shadow:var(--shadow); padding:20px; margin-bottom:16px;
  display:grid; grid-template-columns:1fr auto; gap:20px; align-items:center; }
.scan.drag { border-color:var(--brand); background:var(--brand-soft); }
.scan h2 { font-size:17px; font-weight:600; }
.scan p { margin:5px 0 0; color:var(--ink-2); font-size:13.5px; max-width:54ch; }
.scan-buttons { display:flex; gap:9px; flex-wrap:wrap; }
@media (max-width:720px) { .scan { grid-template-columns:1fr; padding:17px; gap:15px; } }

.quota { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px 15px; margin-bottom:16px; }
.quota .qr { display:flex; justify-content:space-between; align-items:baseline; gap:12px; font-size:13.5px; }
.quota .track { height:7px; border-radius:99px; background:var(--surface-2); margin-top:8px; overflow:hidden; }
.quota .fill { height:100%; background:var(--brand); border-radius:99px; }
.quota.low .fill { background:var(--amber); }
.quota.out .fill { background:var(--rose); }
.quota .msg { font-size:13px; margin-top:7px; }
.quota.low .msg { color:var(--amber); }
.quota.out .msg { color:var(--rose); }

.queue { display:grid; gap:8px; margin-bottom:16px; }
.qitem { display:flex; align-items:center; gap:12px; background:var(--surface);
  border:1px solid var(--line); border-radius:11px; padding:9px 12px; font-size:13.5px; }
.qthumb { width:46px; height:29px; border-radius:5px; object-fit:cover; background:var(--surface-2); flex:none; }
.qname { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink-2); }
.pill { font-size:11.5px; font-weight:600; letter-spacing:.04em; text-transform:uppercase;
  padding:3px 9px; border-radius:999px; white-space:nowrap; }
.pill.wait { background:var(--surface-2); color:var(--ink-2); }
.pill.work { background:var(--brand-soft); color:var(--brand); }
.pill.fail { background:var(--rose-soft); color:var(--rose); }
.pill.rev  { background:var(--amber-soft); color:var(--amber); }

.bar { display:flex; gap:9px; flex-wrap:wrap; align-items:center; margin-bottom:12px; }
.search { flex:1 1 200px; min-width:0; display:flex; align-items:center; gap:8px;
  background:var(--surface); border:1px solid var(--line-2); border-radius:9px; padding:0 11px; }
.search input { border:0; background:transparent; outline:none; padding:10px 0; width:100%; }
.search svg { flex:none; color:var(--ink-3); }
select.filter { background:var(--surface); border:1px solid var(--line-2); border-radius:9px;
  padding:10px; cursor:pointer; min-height:40px; max-width:170px; }
.toggle { display:inline-flex; align-items:center; gap:6px; background:var(--surface);
  border:1px solid var(--line-2); border-radius:9px; padding:9px 12px; cursor:pointer; font-size:14px; min-height:40px; }
.toggle[aria-pressed="true"] { background:var(--brand-soft); border-color:var(--brand); color:var(--brand); font-weight:600; }
.count { color:var(--ink-2); font-size:13.5px; margin-left:auto; }

.sheet { background:var(--surface); border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.rowgrid { display:grid; grid-template-columns:28px minmax(0,1.9fr) minmax(0,1.4fr) 128px minmax(0,.85fr) 82px 74px;
  gap:11px; align-items:center; padding:11px 15px; }
.rowgrid.admin { grid-template-columns:28px minmax(0,1.7fr) minmax(0,1.2fr) 126px minmax(0,.75fr) minmax(0,.75fr) 80px 74px; }
.head { background:var(--surface-2); border-bottom:1px solid var(--line);
  font-size:11.5px; font-weight:600; letter-spacing:.07em; text-transform:uppercase; color:var(--ink-2); padding-block:9px; }
.row { border-bottom:1px solid var(--line); cursor:pointer; }
.row:last-child { border-bottom:0; }
.row:hover { background:var(--surface-2); }
.row:focus-visible { outline:2px solid var(--brand); outline-offset:-2px; }
.cell { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.co { font-weight:600; }
.sub { font-size:12.5px; color:var(--ink-3); }
.muted { color:var(--ink-3); }
.plus { font-size:11px; color:var(--brand); font-weight:600; margin-left:5px; }
.star { background:none; border:0; cursor:pointer; font-size:17px; line-height:1; padding:2px; color:var(--ink-3); }
.star.on { color:var(--star); }
.quick { display:inline-flex; gap:5px; }
.quick a { width:30px; height:30px; border-radius:8px; display:grid; place-items:center;
  background:var(--surface-2); color:var(--ink-2); text-decoration:none; font-size:14px; }
.quick a:hover { background:var(--brand-soft); color:var(--brand); }
@media (max-width:780px) {
  .head { display:none; }
  .rowgrid, .rowgrid.admin { grid-template-columns:26px 1fr auto; gap:3px 10px; padding:12px 13px; }
  .row .c-star { grid-column:1; grid-row:1; }
  .row .c-co   { grid-column:2; grid-row:1; }
  .row .c-quick{ grid-column:3; grid-row:1 / span 2; align-self:center; }
  .row .c-name { grid-column:2; grid-row:2; }
  .row .c-mobile { grid-column:2; grid-row:3; }
  .row .c-city { grid-column:2; grid-row:4; font-size:12.5px; color:var(--ink-3); }
  .row .c-user { grid-column:3; grid-row:3; text-align:right; font-size:12.5px; color:var(--ink-3); }
  .row .c-date { grid-column:3; grid-row:4; text-align:right; font-size:12.5px; color:var(--ink-3); }
}
.empty { padding:32px 18px; text-align:center; color:var(--ink-2); }
.empty strong { display:block; color:var(--ink); font-size:15px; margin-bottom:4px; }

.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(145px,1fr)); gap:12px; margin-bottom:18px; }
.tile { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:14px 16px; }
.tile .k { font-size:11px; font-weight:600; letter-spacing:.07em; text-transform:uppercase; color:var(--ink-2); }
.tile .v { font-family:"Gabarito",sans-serif; font-weight:800; font-size:25px; margin-top:2px; }
.userlist { display:grid; gap:8px; margin-bottom:20px; }
.urow { display:flex; align-items:center; gap:11px; background:var(--surface);
  border:1px solid var(--line); border-radius:11px; padding:10px 14px; flex-wrap:wrap; }
.urow .nm { flex:1 1 150px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:500; }
.urow .nm small { display:block; font-weight:400; color:var(--ink-3); font-size:12px; }
.badge { font-size:11px; font-weight:600; letter-spacing:.05em; text-transform:uppercase;
  background:var(--brand-soft); color:var(--brand); padding:2px 8px; border-radius:999px; }
.badge.off { background:var(--rose-soft); color:var(--rose); }
h3.sec { font-size:12.5px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-2); margin:0 0 10px; }

.scrim { position:fixed; inset:0; background:rgba(9,20,15,.5); display:flex; justify-content:flex-end; z-index:40; }
.drawer { background:var(--surface); width:min(520px,100%); height:100%; overflow-y:auto;
  border-left:1px solid var(--line); padding:20px 20px 44px; display:flex; flex-direction:column; gap:13px; }
.drawer-head { display:flex; align-items:flex-start; gap:10px; }
.drawer-head h2 { font-size:18px; font-weight:600; flex:1; min-width:0; }
.cardimg { width:100%; border-radius:10px; border:1px solid var(--line); display:block; }
.drawer-foot { display:flex; gap:8px; margin-top:4px; flex-wrap:wrap; }
.drawer-foot .btn.primary { flex:1 1 140px; }
.actions { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.actions a { display:flex; flex-direction:column; align-items:center; gap:3px; padding:10px 4px;
  border:1px solid var(--line-2); border-radius:10px; text-decoration:none; color:var(--ink);
  font-size:12px; background:var(--surface); }
.actions a:hover { border-color:var(--brand); color:var(--brand); }
.actions a[aria-disabled="true"] { opacity:.35; pointer-events:none; }
.actions .ic { font-size:17px; }
.note { border-radius:10px; padding:10px 13px; font-size:13px; }
.note.warn { background:var(--amber-soft); color:var(--amber); }
.note.info { background:var(--brand-soft); color:var(--brand); }
.note.bad  { background:var(--rose-soft); color:var(--rose); }
.starbig { display:flex; align-items:center; gap:9px; background:var(--surface-2);
  border-radius:10px; padding:9px 13px; cursor:pointer; font-size:14px; border:1px solid transparent; }
.starbig[aria-pressed="true"] { background:var(--amber-soft); color:var(--amber); font-weight:600; border-color:var(--amber); }

.cropwrap { position:fixed; inset:0; background:#08120e; z-index:50; display:flex; flex-direction:column; }
.crophead { display:flex; align-items:center; gap:12px; padding:12px 16px; color:#9fb5aa; font-size:13px; }
.crophead h2 { font-size:16px; font-weight:600; flex:1; color:#fff; }
.cropstage { flex:1; position:relative; overflow:hidden; display:grid; place-items:center; padding:8px 16px; }
.cropbox { position:relative; touch-action:none; max-width:100%; max-height:100%; }
.cropbox img { display:block; max-width:100%; max-height:62vh; user-select:none; -webkit-user-drag:none; }
.cropsel { position:absolute; border:2px solid #56d69c; box-shadow:0 0 0 9999px rgba(8,18,14,.62); cursor:move; }
.hnd { position:absolute; width:26px; height:26px; border-radius:50%; background:#56d69c; border:2px solid #08120e; touch-action:none; }
.hnd.tl { left:-13px; top:-13px; } .hnd.tr { right:-13px; top:-13px; }
.hnd.bl { left:-13px; bottom:-13px; } .hnd.br { right:-13px; bottom:-13px; }
.cropfoot { display:flex; gap:9px; padding:14px 16px calc(22px + env(safe-area-inset-bottom)); flex-wrap:wrap; justify-content:center; }
.cropfoot .btn { background:rgba(255,255,255,.1); border-color:rgba(255,255,255,.22); color:#e4f0e9; }
.cropfoot .btn.primary { background:var(--brand-2); border-color:var(--brand-2); color:#042014; }

.toast { position:fixed; left:50%; bottom:22px; transform:translateX(-50%); background:var(--ink); color:var(--paper);
  padding:10px 16px; border-radius:999px; font-size:13.5px; z-index:60; box-shadow:var(--shadow); max-width:calc(100% - 32px); }
.tsvbox { width:100%; min-height:170px; font-family:"IBM Plex Mono",monospace; font-size:12px;
  background:var(--paper); border:1px solid var(--line-2); border-radius:8px; padding:10px; }
@media (prefers-reduced-motion:reduce) { * { transition:none!important; animation:none!important; } }

/* ---- pending shots tray ---- */
.tray { background:var(--surface); border:1px solid var(--brand); border-radius:14px;
  padding:14px 16px; margin-bottom:16px; box-shadow:var(--shadow); }
.tray h3 { font-family:"Gabarito",sans-serif; font-size:15px; font-weight:600; margin:0 0 3px; }
.tray p.hint { margin:0 0 11px; font-size:13px; color:var(--ink-2); }
.shots { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.shot { position:relative; width:104px; }
.shot img { width:104px; height:66px; object-fit:cover; border-radius:8px; border:1px solid var(--line); display:block; }
.shot .rm { position:absolute; top:-8px; right:-8px; width:24px; height:24px; border-radius:50%;
  border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); cursor:pointer;
  font-size:14px; line-height:1; display:grid; place-items:center; }
.shot .rm:hover { border-color:var(--rose); color:var(--rose); }
.shot .lbl { font-size:11px; color:var(--ink-3); text-align:center; margin-top:4px; }
.shot .qr { display:inline-block; font-size:10px; font-weight:600; letter-spacing:.04em; text-transform:uppercase;
  background:var(--brand-soft); color:var(--brand); padding:1px 6px; border-radius:999px; margin-top:3px; }
.tray-acts { display:flex; gap:8px; flex-wrap:wrap; }
.errdetail { font-family:"IBM Plex Mono",monospace; font-size:11.5px; color:var(--ink-3);
  word-break:break-word; margin-top:5px; }

/* ---- reseller customer record ---- */
.trio { display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; }
@media (max-width:520px) { .trio { grid-template-columns:1fr 1fr; } }
.field select { background:var(--paper); border:1px solid var(--line-2); border-radius:8px;
  padding:10px 11px; outline:none; width:100%; }
.sub.due { color:var(--amber); font-weight:600; }
.paylist { display:grid; gap:7px; }
.payrow { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap;
  background:var(--surface-2); border-radius:9px; padding:8px 12px; }
.payrow .num:first-child { font-weight:600; }
.payadd { border:1px dashed var(--line-2); border-radius:11px; padding:12px 14px; }
.payadd summary { cursor:pointer; font-weight:500; color:var(--brand); }
.payadd > *:not(summary) { margin-top:10px; }
.urow .sub { white-space:nowrap; }

/* ---- "you are viewing a customer" bar ---- */
.viewbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  background:var(--brand-soft); border:1px solid var(--brand); border-radius:12px;
  padding:12px 16px; margin-bottom:14px; }
.viewbar .eye { font-size:17px; }
.viewbar .txt { flex:1 1 240px; min-width:0; font-size:13.5px; color:var(--brand); }
.viewbar .txt b { font-weight:700; }

/* ---- packages: your side ---- */
.sec-row { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.planlist { display:grid; gap:8px; margin-bottom:6px; }
.prow { display:grid; grid-template-columns:1fr auto auto auto; align-items:center; gap:12px;
  background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:11px 14px; }
.prow.off { opacity:.55; }
.prow .nm { display:flex; flex-direction:column; gap:2px; font-weight:600; min-width:0; }
.prow .nm small { font-weight:400; font-size:12px; color:var(--ink-3); }
@media (max-width:560px) { .prow { grid-template-columns:1fr auto; } .prow .badge { grid-column:2; } }

/* ---- packages: what the customer sees ---- */
.plans-link { margin:10px 0 0; font-size:13px; }
.plans-link a { color:var(--brand); }
.plans { margin-top:16px; }
.plans .sub { margin:0 0 12px; max-width:60ch; }
.plangrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; }
.plan { position:relative; display:flex; flex-direction:column; gap:5px;
  background:var(--surface); border:1px solid var(--line-2); border-radius:14px; padding:16px 16px 14px; }
.plan.pop { border-color:var(--brand); box-shadow:0 0 0 1px var(--brand) inset; }
.plan .tag { position:absolute; top:-9px; left:14px; background:var(--brand); color:#fff;
  font-size:10.5px; font-weight:600; letter-spacing:.04em; text-transform:uppercase;
  padding:2px 9px; border-radius:999px; }
.plan .pn { font-weight:700; font-size:15px; }
.plan .pp { font-family:"Gabarito",sans-serif; font-weight:800; font-size:26px; color:var(--brand); line-height:1.1; }
.plan .pc { font-size:13px; color:var(--ink-2); }
.plan .pb { font-size:12.5px; color:var(--ink-3); flex:1; }
.plan .btn { margin-top:8px; justify-content:center; text-decoration:none; }
