/* ============================================================
   A.N.C. Jewellers — Admin console stylesheet
   Self-contained (does not depend on the storefront styles.css).
   Type: Cormorant Garamond (page titles / big figures) + Inter (all UI).
   Same pairing as the storefront + receipt. Loaded via <link> per page.
   ============================================================ */

:root {
  --bg:        #f4f5f7;
  --panel:     #ffffff;
  --panel-2:   #fafafa;
  --border:    #e4e7ec;
  --border-2:  #eef0f3;
  --text:      #1c2430;
  --text-dim:  #55617a;
  --text-mut:  #8a94a6;
  --accent:    #9a6b2f;          /* warm bronze/gold — on-brand, not garish */
  --accent-2:  #7d5623;
  --accent-ink:#ffffff;
  --accent-tint:#f6efe4;
  --ok:        #1a7f4b;
  --ok-bg:     #e7f5ee;
  --warn:      #9a6b2f;
  --warn-bg:   #f6efe4;
  --err:       #b23b3b;
  --err-bg:    #fbeaea;
  --side:      #4a0e18;           /* left panel — deep maroon */
  --side-gold: #e3c988;
  --sb:        216px;             /* sidebar width */
  --radius:    12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow:    0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.16);
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --serif:     'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  /* lets full-bleed sections (e.g. the dashboard welcome banner) size
     themselves off 100vw without the vertical scrollbar's width causing
     a stray horizontal scrollbar / gray sliver on the edge */
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.011em; color: var(--text); }
h1 { font-family: var(--serif); font-size: 1.65rem; font-weight: 700; letter-spacing: .01em; }
h2 { font-size: 1rem; }
h3 { font-size: .95rem; }
p  { margin: 0 0 .8em; }
.muted { color: var(--text-mut); }
.sm    { font-size: .82rem; }
.mono  { font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace; font-size: .82em; letter-spacing: -0.01em; }

/* ---------- shell / sidebar ---------- */
admin-shell { display: contents; }

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sb);
  background: var(--side);
  color: rgba(255,255,255,.72);
  border-right: 1px solid rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 4px;
  z-index: 40;
  overflow-y: auto;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 10px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.admin-brand img { height: 26px; width: auto; }
.admin-brand-logo { height: 42px !important; width: auto; max-width: 100%; object-fit: contain; }
.admin-brand-avatar {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.14) center/cover no-repeat;
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700;
  color: var(--side-gold, #e3c988);
  letter-spacing: 0; text-transform: uppercase;
}
.admin-brand span {
  font-size: .6rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255,255,255,.45);
}
/* ---------- global admin search ---------- */
.admin-search { position: relative; padding: 0 4px 8px; margin-bottom: 4px; }
.admin-search input {
  width: 100%;
  font-family: var(--font);
  font-size: .82rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: #fff;
}
.admin-search input::placeholder { color: rgba(255,255,255,.5); }
.admin-search input:focus { outline: none; border-color: var(--side-gold, #e3c988); background: rgba(255,255,255,.14); }
.admin-search-results {
  position: absolute;
  left: 4px;
  top: calc(100% - 2px);
  z-index: 60;
  width: max(300px, 100%);
  max-height: min(70vh, 460px);
  overflow-y: auto;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 5px;
}
.adm-ss-hint { margin: 6px 8px; font-size: .8rem; color: var(--text-mut); }
.adm-ss-dym {
  display: block; width: 100%; text-align: left;
  background: var(--accent-tint); border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 9px; margin-bottom: 5px;
  font-family: var(--font); font-size: .8rem; color: var(--text-dim); cursor: pointer;
}
.adm-ss-dym strong { color: var(--accent-2); }
.adm-ss-row {
  display: flex; align-items: baseline; gap: 9px;
  padding: 8px 8px; border-radius: 6px; border-bottom: 1px solid var(--border-2);
}
.adm-ss-row:last-child { border-bottom: none; }
.adm-ss-row:hover, .adm-ss-row.is-active { background: var(--accent-tint); }
.adm-ss-type {
  flex-shrink: 0; width: 66px;
  font-size: .58rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
}
.adm-ss-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.adm-ss-main > span { font-size: .85rem; color: var(--text); }
.adm-ss-main small { font-size: .72rem; color: var(--text-mut); }

.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-group-label {
  margin: 9px 10px 3px;
  font-size: .64rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255,255,255,.35);
}
.admin-nav-group-label:first-child { margin-top: 2px; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: .83rem;
  font-weight: 500;
  color: rgba(255,255,255,.72);
  transition: background .12s, color .12s;
}
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a[aria-current="page"] {
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--side-gold);
}
.admin-nav a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .8; }
.admin-nav a[aria-current="page"] svg { opacity: 1; color: var(--side-gold); }
.admin-nav-badge {
  margin-left: auto;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--err);
  color: #fff;
  font-size: .64rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.admin-sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-link {
  font-size: .76rem;
  color: rgba(255,255,255,.5);
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.admin-link svg { width: 13px; height: 13px; flex-shrink: 0; }
.admin-link:hover { color: #fff; }
.admin-sidebar-foot .btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,.25);
  color: rgba(255,255,255,.8);
}
.admin-sidebar-foot .btn-outline:hover { border-color: rgba(255,255,255,.5); color: #fff; background: rgba(255,255,255,.06); }
.admin-sidebar-foot .btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---------- main ---------- */
.admin-main {
  margin-left: var(--sb);
  padding: 30px clamp(18px, 4vw, 44px) 80px;
  max-width: 1180px;
}
/* Dashboard page runs wider than the other admin pages so the welcome
   banner and stat rows make better use of large screens */
#adminOverview.admin-main { max-width: 1440px; }
.admin-main.is-loading { opacity: .5; pointer-events: none; }
.admin-main > h1 { margin-bottom: 22px; }
.admin-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.admin-block-head h1 { margin: 0; }
.admin-block-head-actions { display: flex; align-items: center; gap: 14px; }

.admin-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 22px;
}
.admin-block > h2 { margin-bottom: 4px; }
.admin-block > h2 + .sm { margin-top: 0; margin-bottom: 16px; }
.admin-block > h2:only-child,
.admin-block > .admin-block-head { margin-bottom: 16px; }
.admin-block-head h2 { margin: 0; }

/* ---------- stat cards ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  position: relative;
  background: linear-gradient(165deg, var(--panel) 0%, var(--panel-2) 130%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent) 45%, var(--side-gold, #e3c988));
  opacity: .9;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--side-gold, #e3c988);
}
/* stat numbers stay in Inter — never the display serif on figures */
/* sized to the screen so a 7-figure amount (₹1,02,14,500) fits a card on one line */
.stat-val { font-family: var(--font); font-size: clamp(1.2rem, 1.5vw, 1.5rem); font-weight: 800; letter-spacing: -0.02em; color: var(--text); line-height: 1.15; white-space: nowrap; }
.stat-lbl {
  display: flex; align-items: center; gap: 6px;
  font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mut); font-weight: 700;
}
.stat-lbl::before {
  content: ''; flex: none;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}
.stat-sub { font-size: .72rem; color: var(--text-mut); }

.stat-card-ico { display: none; }

/* ---------- overview: pastel stat cards — MOBILE ONLY; desktop keeps the
   original plain white card with the gold top bar (icon badge hidden there) ---------- */
@media (max-width: 900px) {
  .stat-card--blue, .stat-card--pink, .stat-card--green, .stat-card--amber, .stat-card--purple {
    align-items: center;
    text-align: center;
    border: none;
    gap: 8px;
  }
  .stat-card--blue::before, .stat-card--pink::before, .stat-card--green::before,
  .stat-card--amber::before, .stat-card--purple::before { display: none; }
  .stat-card--blue .stat-lbl, .stat-card--pink .stat-lbl, .stat-card--green .stat-lbl,
  .stat-card--amber .stat-lbl, .stat-card--purple .stat-lbl { justify-content: center; text-transform: none; letter-spacing: 0; font-size: .82rem; font-weight: 600; color: var(--text-dim); }
  .stat-card--blue .stat-lbl::before, .stat-card--pink .stat-lbl::before, .stat-card--green .stat-lbl::before,
  .stat-card--amber .stat-lbl::before, .stat-card--purple .stat-lbl::before { display: none; }
  .stat-card--blue .stat-sub, .stat-card--pink .stat-sub, .stat-card--green .stat-sub,
  .stat-card--amber .stat-sub, .stat-card--purple .stat-sub,
  .stat-card--blue .stat-val, .stat-card--pink .stat-val, .stat-card--green .stat-val,
  .stat-card--amber .stat-val, .stat-card--purple .stat-val { text-align: center; }
  .stat-card-ico {
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 2px;
  }
  .stat-card-ico svg { width: 30px; height: 30px; }
  .stat-card--blue   { background: #e3f0fd; }
  .stat-card--pink   { background: #fbe0e6; }
  .stat-card--green  { background: #dcf5e6; }
  .stat-card--amber  { background: #fbedcf; }
  .stat-card--purple { background: #ece4fa; }
  .stat-card--blue .stat-card-ico   { color: #1864ab; }
  .stat-card--pink .stat-card-ico   { color: #c2255c; }
  .stat-card--green .stat-card-ico  { color: #1a7f4b; }
  .stat-card--amber .stat-card-ico  { color: #a8710a; }
  .stat-card--purple .stat-card-ico { color: #6b3fa0; }
}

/* ---------- overview: welcome banner (shown on both desktop and mobile;
   quick actions / donut / promos below it remain mobile-only) ---------- */
/* banner photo is embedded as a data: URI directly on the element (inline
   style, set in index.html) rather than linked as a separate file — that
   guarantees it displays with zero extra network request, sidestepping the
   CDN edge-caching issue that kept serving a stale 404 for the linked file */
.welcome-banner {
  display: flex;
  position: relative;
  align-items: center;
  /* matches the source photo's own 2172x724 proportions exactly, so
     background-size:cover never crops it — what you see in the original
     file is exactly what renders, at any screen width */
  aspect-ratio: 2172 / 724;
  overflow: hidden;
  background-color: #fdf9f3;
  background-position: right center;
  background-size: cover;
  background-repeat: no-repeat;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.welcome-banner-text { position: relative; z-index: 1; max-width: 52%; }
.welcome-banner-eyebrow { margin: 0 0 4px; font-family: var(--serif); font-size: 1.3rem; font-weight: 700; letter-spacing: .01em; color: var(--side, #4a0e18); }
.welcome-banner-text h2 { font-family: var(--serif); font-size: 1.15rem; line-height: 1.2; font-weight: 700; color: var(--side, #4a0e18); margin-bottom: 5px; }
.welcome-banner-text p { margin: 0; font-size: .78rem; line-height: 1.4; color: var(--text-dim); }

/* desktop: the card is far wider than the mobile strip this photo was
   sized for, so honouring the full 2172:724 aspect-ratio makes it huge —
   cap the height instead and let background-size:cover crop it to a
   proper short banner, same way a normal hero banner behaves */
@media (min-width: 901px) {
  .welcome-banner {
    aspect-ratio: auto;
    height: 170px;
    padding: 0 32px;
    /* true full-bleed: from the right edge of the sidebar all the way to
       the right edge of the browser window, ignoring .admin-main's own
       padding and max-width entirely (body has overflow-x:hidden so the
       scrollbar's width can't create a stray horizontal scrollbar here) */
    width: calc(100vw - var(--sb));
    margin-left: calc(-1 * clamp(18px, 4vw, 44px));
    margin-right: calc(-1 * clamp(18px, 4vw, 44px));
    /* also cancel .admin-main's top padding so the banner sits flush
       against the top of the page instead of leaving a gray gap above it */
    margin-top: -30px;
    border-radius: 0;
    border-top: 0;
    border-left: 0;
    border-right: 0;
  }
  .welcome-banner-text { max-width: 44%; }
  .welcome-banner-eyebrow { font-size: 2rem; margin-bottom: 10px; }
  .welcome-banner-text h2 { font-size: 1.4rem; margin-bottom: 7px; }
  .welcome-banner-text p { font-size: .88rem; }
}

@media (max-width: 360px) {
  .welcome-banner-text p { display: none; }
}

.quick-actions {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 10px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.qa-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none; color: var(--text); font-size: .7rem; font-weight: 600; text-align: center; line-height: 1.2; }
.qa-tile-ico {
  display: flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 15px;
  background: var(--accent-tint); color: var(--accent-2);
}
.qa-tile-ico svg { width: 24px; height: 24px; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-ring {
  width: 136px; height: 136px; flex: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.donut-hole {
  width: 72%; height: 72%;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 6px;
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--border-2);
}
.donut-hole strong { font-size: 1.4rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.donut-hole span { width: 100%; font-size: .56rem; color: var(--text-mut); text-transform: uppercase; letter-spacing: .03em; line-height: 1.3; margin-top: 2px; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; font-size: .86rem; color: var(--text-dim); min-width: 140px; }
.donut-legend li { display: flex; align-items: center; gap: 9px; }
.donut-legend b { color: var(--text); font-size: .95rem; margin-left: auto; padding-left: 14px; }
.donut-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

.pay-mini-list { list-style: none; margin: 0; padding: 0; }
.pay-mini-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-2); }
.pay-mini-item:last-child { border-bottom: none; padding-bottom: 0; }
.pay-mini-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.pay-mini-main { min-width: 0; flex: 1; }
.pay-mini-name { margin: 0; font-weight: 600; font-size: .85rem; color: var(--text); }
.pay-mini-time { margin: 2px 0 0; font-size: .72rem; color: var(--text-mut); }
.pay-mini-amt { flex: none; font-weight: 700; font-size: .88rem; color: var(--text); }

.desktop-only { display: block; }
.dash-two-col.mobile-only { display: none; }

.gold-link { color: var(--accent-2); font-weight: 600; text-decoration: none; font-size: .85rem; white-space: nowrap; }
.gold-link:hover { text-decoration: underline; }
.ph-back { text-decoration: none; color: inherit; margin-right: 8px; }

/* ---------- registered customers: mobile card list ---------- */
.cust-cards { display: none; }
.cust-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.cust-card-avatar {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent, #9a6b2f);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .92rem;
}
.cust-card-main { min-width: 0; }
.cust-card-name { margin: 0; font-weight: 700; color: var(--text); font-size: .92rem; }
.cust-card-sub { margin: 2px 0 0; font-size: .84rem; color: var(--text-dim); }
.mem-status { text-transform: capitalize; font-weight: 600; }
.mem-status--active { color: var(--ok, #1a7f4b); }
.mem-status--completed { color: var(--accent-2); }
.mem-status--cancelled { color: var(--err, #b23b3b); }
.cust-card .admin-actions { flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 900px) {
  .cust-table-wrap { display: none; }
  .cust-cards { display: block; }
}

/* ---------- payments page: mobile card list (pending queue + all payments) ---------- */
.pay-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.pay-card:last-child { margin-bottom: 0; }
.pay-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pay-card-cust { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pay-card-name { margin: 0; font-weight: 700; color: var(--text); font-size: .92rem; }
.pay-card-sub { margin: 2px 0 0; font-size: .82rem; color: var(--text-dim); }
.pay-card-amt { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.pay-card-amt-val { font-weight: 700; font-size: 1.05rem; color: var(--text); white-space: nowrap; }
.pay-card-meta {
  display: flex; flex-direction: column; gap: 6px;
  font-size: .83rem; color: var(--text);
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border-2);
}
.pay-card-meta-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pay-card-meta-row > span:first-child {
  flex: none;
  color: var(--text-mut);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.pay-card-meta-row > span:last-child { text-align: right; color: var(--text-dim); }
.pay-card-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-2); }
.pay-card-actions .btn { flex: 1 1 auto; }

/* ---------- products page: mobile card list (Collections) ---------- */
.cat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.cat-card:last-child { margin-bottom: 0; }
.cat-card-top { display: flex; align-items: center; gap: 10px; }
.cat-card-order {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-2);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700;
}
.cat-card-main { min-width: 0; }
.cat-card-name { margin: 0; font-weight: 700; color: var(--text); font-size: .95rem; }
.cat-card-sub { margin: 2px 0 0; font-size: .78rem; color: var(--text-mut); }
.cat-card-blurb { margin: 10px 0 0; font-size: .84rem; color: var(--text-dim); line-height: 1.5; }
.cat-card-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-2); }
.cat-card-actions .btn { flex: 1 1 auto; }

/* ---------- responsive tables: every remaining .admin-table folds into a
   stacked card list below 900px (same breakpoint as the sidebar/cust-cards),
   driven by data-label attributes already present on each <td> ---------- */
@media (max-width: 900px) {
  .admin-table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
  }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tbody tr {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--panel);
    padding: 14px 16px;
  }
  .admin-table tbody tr:last-child { margin-bottom: 0; }
  .admin-table tbody tr:hover td { background: none; }
  .admin-table td {
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid var(--border-2);
    vertical-align: top;
  }
  .admin-table td:first-child { padding-top: 0; }
  .admin-table td:last-child { padding-bottom: 0; border-bottom: none; }
  .admin-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: .64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-mut);
    margin-bottom: 4px;
  }
  .admin-table td.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
    margin-top: 2px;
    border-top: 1px solid var(--border-2);
  }
  .admin-table td.admin-actions .btn { flex: 1 1 auto; }
}

/* small phones: tighten a little further */
@media (max-width: 480px) {
  .admin-main { padding: 16px 14px 56px; }
  .stat-row { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .admin-block { padding: 16px; }
  h1 { font-size: 1.4rem; }
}

/* ---------- overview: revenue chart ---------- */
.rv-chart-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.rv-chart-total { font-family: var(--font); font-size: 1.5rem; font-weight: 700; color: var(--text); }
.rv-chart { width: 100%; height: 160px; display: block; }
.rv-bar { fill: url(#rvBarGrad); transition: opacity .12s ease; }
.rv-bar:hover { opacity: .8; }
.rv-grid { stroke: var(--border); stroke-width: 1; }
.rv-axis { font-size: 9px; fill: var(--text-mut); }

/* ---------- overview: two-column layout ---------- */
.dash-two-col {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 22px;
  align-items: start;
}
.dash-two-col .admin-block { margin-bottom: 0; }
@media (max-width: 900px) {
  .dash-two-col { grid-template-columns: 1fr; }
  /* mobile Overview leads with stats, pending payments and recent activity —
     the revenue chart, scheme summary and most-viewed list stay desktop-only,
     each already reachable from its own dedicated admin page */
  .mobile-hide { display: none; }
  .desktop-only { display: none; }
  .welcome-banner {
    /* full-bleed edge-to-edge regardless of the parent's actual padding —
       sized from the viewport directly rather than a hardcoded negative
       margin that has to exactly match .admin-main's padding */
    width: 100vw;
    margin-top: -20px;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: 20px;
    border-radius: 0;
    border: 0;
  }
  .quick-actions { display: grid; }
  .dash-two-col.mobile-only { display: grid; grid-template-columns: 1fr; }

  /* Overview's stat row scrolls horizontally as a single row instead of
     wrapping into a tall grid — swipe sideways through the 9 cards */
  #statCards {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -16px 24px;
    padding: 0 16px 4px;
  }
  #statCards::-webkit-scrollbar { display: none; }
  /* compact mobile card: icon badge top-left, amount on ONE line at a phone-sized
     font, label + sub-line underneath — all left-aligned so ₹1,02,14,500 fits */
  #statCards .stat-card {
    flex: 0 0 clamp(150px, 44vw, 190px);
    min-width: 0;
    scroll-snap-align: start;
    align-items: flex-start;
    text-align: left;
    gap: 3px;
    padding: 14px 14px 12px;
    border-radius: 16px;
  }
  #statCards .stat-card-ico {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .72);
    margin-bottom: 8px;
  }
  #statCards .stat-card-ico svg { width: 18px; height: 18px; }
  #statCards .stat-val {
    font-size: clamp(1rem, 4.6vw, 1.2rem);
    letter-spacing: -0.01em;
    white-space: nowrap;
    text-align: left;
  }
  #statCards .stat-lbl {
    justify-content: flex-start;
    text-align: left;
    font-size: .74rem;
    line-height: 1.3;
  }
  #statCards .stat-sub { font-size: .68rem; text-align: left; line-height: 1.35; }
}

/* small phones: keep the 4-column layout but shrink the tiles a touch so
   they don't get cramped against the screen edges */
@media (max-width: 400px) {
  .quick-actions { gap: 14px 4px; padding: 16px 6px; }
  .qa-tile-ico { width: 46px; height: 46px; border-radius: 13px; }
  .qa-tile-ico svg { width: 20px; height: 20px; }
  .qa-tile { font-size: .62rem; }
}

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.admin-table thead th {
  text-align: left;
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-mut);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--panel-2);
}
.admin-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: top;
  color: var(--text-dim);
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--panel-2); }
.admin-actions { white-space: nowrap; display: flex; gap: 6px; }

.pill {
  display: inline-block;
  font-size: .58rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--accent-tint);
  color: var(--accent-2);
  padding: .2em .5em;
  border-radius: 4px;
}

/* status chips (reused names from admin.js) */
.pay-status {
  display: inline-block;
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: capitalize;
  font-weight: 600;
  padding: .25em .7em;
  border-radius: 999px;
  border: 1px solid transparent;
}
.pay-status--paid      { background: var(--ok-bg);   color: var(--ok);   }
.pay-status--pending   { background: var(--warn-bg); color: var(--warn); }
.pay-status--failed    { background: var(--err-bg);  color: var(--err);  }
.pay-status--redeemed  { background: #eef0f7;        color: #4a5578;     }   /* Digi Gold taken at the showroom */

/* ---------- category filter chips (Products page) ---------- */
/* always a single row — scrolls sideways when the chips don't fit */
.filter-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.filter-bar::-webkit-scrollbar { display: none; }
/* jump-to-section nav (e.g. Offline Payment page) — target sections need
   room so the sticky mobile header doesn't cover their heading after
   scrollIntoView() */
#offlineCustomersSection, #offlineListSection { scroll-margin-top: 76px; }
.filter-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip .count {
  margin-left: 6px;
  font-size: .72rem;
  font-weight: 700;
  opacity: .6;
}
.filter-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.filter-chip.is-active .count { opacity: .8; }

/* plain text-link button (used inline in table cells) */
.plan-row { padding: 1px 0; }
.plan-row + .plan-row { margin-top: 3px; }
.link-btn {
  font: inherit;
  font-size: .74rem;
  font-weight: 600;
  background: none;
  border: 0;
  padding: 0 2px;
  cursor: pointer;
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--text); }
.link-btn--danger { color: var(--err); }
.link-btn--danger:hover { color: #7d2626; }
.link-btn:disabled { opacity: .5; cursor: default; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s, opacity .12s;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-gold { background: var(--accent); color: var(--accent-ink); }
.btn-gold:hover:not(:disabled) { background: var(--accent-2); }
.btn-outline { background: var(--panel); border-color: var(--border); color: var(--text-dim); }
.btn-outline:hover:not(:disabled) { border-color: var(--text-mut); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: .76rem; }

/* ---------- forms ---------- */
.stack-form { display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
.stack-form .field { display: flex; flex-direction: column; gap: 6px; }
.stack-form label,
.field > label {
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-mut);
}
.stack-form input,
.stack-form select,
.stack-form textarea {
  font-family: var(--font);
  font-size: .9rem;
  color: var(--text);
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  width: 100%;
}
.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(154,107,47,.15);
}
.stack-form input:disabled { background: var(--panel-2); color: var(--text-mut); }
.stack-form input.is-error { border-color: var(--err); }
.stack-form textarea { resize: vertical; min-height: 72px; }
.field-check { flex-direction: row !important; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-dim); text-transform: none; letter-spacing: 0; font-weight: 500; }
.field-check input { width: auto; }
.field-hint { font-size: .72rem; color: var(--text-mut); margin-top: 4px; text-transform: none; letter-spacing: 0; }
.avatar-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.admin-avatar {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid var(--border, #e2e2e2);
  display: flex; align-items: center; justify-content: center;
}
.admin-avatar--empty { font-size: 1.5rem; font-weight: 700; color: var(--accent, #9a6b2f); text-transform: uppercase; }
.avatar-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pay-mode {
  display: inline-block;
  font-size: .62rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 700;
  padding: .18em .55em;
  border-radius: 999px;
}
.pay-mode--online  { background: #e6f4ea; color: #2e7d32; }
.pay-mode--offline { background: #fef3e0; color: #a15c14; }
.block-more { margin: 12px 2px 0; font-size: .82rem; }
.block-more a { color: var(--accent-2); font-weight: 600; text-decoration: none; }
.block-more a:hover { text-decoration: underline; }
.rates-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 14px; }
.rates-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stack-form input[readonly] { background: var(--panel-2); color: var(--text-mut); }

/* ---------- push notifications ---------- */
.pn-radio-row { display: flex; flex-wrap: wrap; gap: 14px; }
.pn-radio-row label { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-dim); }
.pn-radio-row input { width: auto; }
.pn-customer-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); margin-top: 6px; }
.pn-customer-list label { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: .85rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text); border-bottom: 1px solid var(--border); cursor: pointer; }
.pn-customer-list label:last-child { border-bottom: 0; }
.pn-customer-list label:hover { background: var(--panel-2); }
.pn-customer-list input { width: auto; flex: none; }
.pn-customer-list small { color: var(--text-mut); }
.pn-btn-row { display: flex; gap: 10px; }
.pn-preview { display: flex; gap: 10px; max-width: 380px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); }
.pn-preview-icon { width: 36px; height: 36px; border-radius: 8px; overflow: hidden; flex: none; background: #fff; display: flex; align-items: center; justify-content: center; }
.pn-preview-icon img { width: 100%; height: 100%; object-fit: contain; }
.pn-preview-body { flex: 1; min-width: 0 }
.pn-preview-top { display: flex; justify-content: space-between; font-size: .68rem; color: var(--text-mut); margin-bottom: 2px; }
.pn-preview-title { font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.pn-preview-msg { font-size: .8rem; color: var(--text-dim); line-height: 1.4; }
.hero-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.4rem; }
.hero-img-grid .field { display: flex; flex-direction: column; gap: 6px; }
.hero-img-grid input[type="text"],
.hero-img-grid textarea {
  font-family: var(--font);
  font-size: .9rem;
  color: var(--text);
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  width: 100%;
}
.hero-img-grid input[type="text"]:focus,
.hero-img-grid textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(154,107,47,.15);
}
.hero-img-grid textarea { resize: vertical; min-height: 56px; font-family: inherit; }
.hero-img-preview {
  width: 100%; height: 110px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.img-upload {
  display: inline-block;
  margin-top: 4px;
  font-size: .72rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-2);
  cursor: pointer;
}
.img-upload input { display: block; margin-top: 6px; font-size: .8rem; }
.inline-msg { font-size: .8rem; color: var(--text-mut); }
.inline-msg.is-ok { color: var(--ok); }
.inline-msg.is-error { color: var(--err); }
.pay-qr {
  width: 168px; height: 168px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

/* ---------- dialog (full-screen editor) ---------- */
.admin-dialog {
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  box-shadow: none;
  color: var(--text);
  background: var(--panel);
}
.admin-dialog::backdrop { background: rgba(16,24,40,.55); backdrop-filter: blur(2px); }
.admin-dialog .stack-form {
  max-width: none;
  width: 100%;
  height: 100%;
  gap: 0;
}
.admin-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.admin-dialog-head h3 { margin: 0; font-size: 1.15rem; }
.admin-dialog-close {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--text-mut);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.admin-dialog-close:hover { color: var(--text); border-color: var(--accent); }
.admin-dialog-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.admin-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
}
.admin-dialog-foot .inline-msg { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-left: auto; }

/* ---------- multi-image uploader (product photos) ---------- */
.imglist-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.imglist-tile {
  position: relative;
  width: 110px; height: 110px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  flex: 0 0 auto;
  background: var(--panel-2);
}
.imglist-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imglist-tile.is-cover { border-color: var(--accent); }
.imglist-cover-badge {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(16,24,40,.72);
  color: #f4d78a;
  font-size: .6rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 700;
  text-align: center;
  padding: 3px 0;
}
.imglist-remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(16,24,40,.72);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.imglist-remove:hover { background: var(--err); }
.imglist-add {
  width: 110px; height: 110px;
  border-radius: 10px;
  border: 2px dashed var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  color: var(--text-mut);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
}
.imglist-add:hover { border-color: var(--accent); color: var(--accent); }
.imglist-add input { display: none; }
.imglist-add-ic { font-size: 1.6rem; line-height: 1; font-weight: 400; }

/* ---------- overview: recent activity ---------- */
.admin-notes { list-style: none; margin: 0; padding: 0; }
.admin-notes li {
  display: grid;
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-2);
}
.admin-notes li:last-child { border-bottom: none; }
.admin-notes li.is-unread { position: relative; padding-left: 14px; }
.admin-notes li.is-unread::before {
  content: '';
  position: absolute;
  left: 0; top: 17px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.admin-notes strong { font-size: .88rem; color: var(--text); font-weight: 600; }
.admin-notes span { font-size: .83rem; color: var(--text-dim); }
.admin-notes time { font-size: .7rem; color: var(--text-mut); }

/* ---------- notifications page ---------- */
.notif-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}
.notif-filters select {
  font-family: var(--font);
  font-size: .82rem;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
}
.notif-filters .spacer { flex: 1; }
.notif-count { font-size: .8rem; color: var(--text-mut); }

/* ---------- list toolbar (search + filters + export) ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
}
.tb-search,
.tb-select {
  font-family: var(--font);
  font-size: .84rem;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
}
.tb-search { min-width: 220px; flex: 0 1 280px; }
.tb-search:focus,
.tb-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(154,107,47,.15); }
.tb-spacer { flex: 1; }

.export { position: relative; }
.export > summary {
  list-style: none;
  cursor: pointer;
}
.export > summary::-webkit-details-marker { display: none; }
.export > summary::after { content: ' \25BE'; }
.export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 172px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 5px;
  display: flex;
  flex-direction: column;
}
.export-menu button {
  text-align: left;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-family: var(--font);
  font-size: .82rem;
  color: var(--text-dim);
  cursor: pointer;
}
.export-menu button:hover { background: var(--panel-2); color: var(--text); }

.notif-log { list-style: none; margin: 0; padding: 0; }
.notif-item {
  display: flex;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-2);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.is-unread { background: linear-gradient(90deg, rgba(154,107,47,.06), transparent 55%); }
.notif-item--link { cursor: pointer; }
.notif-item--link:hover { background: var(--panel-2); }
.notif-ico {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.notif-ico svg { width: 16px; height: 16px; }
.notif-ico.t-payment_success { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.notif-ico.t-payment_review,
.notif-ico.t-payment_due { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.notif-ico.t-scheme_join { background: var(--warn-bg); color: var(--accent-2); border-color: transparent; }
.notif-ico.t-signup { background: var(--panel-2); color: var(--text-dim); border-color: var(--border); }
.notif-main { min-width: 0; flex: 1; }
.notif-title { margin: 0 0 2px; font-size: .9rem; font-weight: 600; color: var(--text); }
.notif-body { margin: 0 0 4px; font-size: .84rem; color: var(--text-dim); }
.notif-meta { display: flex; gap: 10px; align-items: center; font-size: .72rem; color: var(--text-mut); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; align-self: center; }
.notif-more { text-align: center; margin-top: 16px; }

/* ---------- login page ---------- */
.admin-body { background: var(--bg); }
.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-login-wrap .auth-card { width: min(400px, 100%); text-align: center; }
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.admin-login-logo { height: 60px; width: auto; max-width: 90%; margin: 0 auto 14px; }
.admin-login-wrap h1 { font-size: 1.15rem; margin-bottom: 18px; }
.admin-login-wrap .stack-form { text-align: left; max-width: none; }
.auth-msg { font-size: .82rem; margin: 12px 0 0; min-height: 1.2em; }
.auth-msg--error { color: var(--err); }
.auth-msg--ok { color: var(--ok); }

/* ---------- password toggle ---------- */
.pw-wrap { position: relative; width: 100%; }
.pw-wrap input { padding-right: 2.6rem; }
.pw-toggle {
  position: absolute;
  right: .5rem; top: 50%;
  transform: translateY(-50%);
  display: flex;
  line-height: 0;
  padding: .3rem;
  border: none;
  background: none;
  color: var(--text-mut);
  cursor: pointer;
}
.pw-toggle:hover { color: var(--text); }

/* ---------- responsive: sidebar -> top bar + bottom tab bar ---------- */
/* mobile header bell — desktop already shows
   Notifications (with its own badge) in the always-visible sidebar nav */
.admin-notif-toggle {
  display: none;
  position: relative;
  flex-shrink: 0;
  width: 34px; height: 34px;
  align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
}
.admin-notif-toggle:hover { background: rgba(255,255,255,.12); }
.admin-notif-toggle .icon { width: 18px; height: 18px; }
.admin-notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 16px; height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--err, #b23b3b);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
/* desktop: invisible wrapper, nav + foot behave as direct sidebar children */
.admin-nav-drawer { display: contents; }
.admin-bottom-nav { display: none; }
.admin-nav-scrim {
  position: fixed; inset: 0;
  background: rgba(20,10,10,.4);
  z-index: 39;
}
.admin-nav-scrim[hidden] { display: none; }

@media (max-width: 900px) {
  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 41;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,.2);
  }
  .admin-brand { border: none; padding: 0 8px 0 0; margin: 0; flex-shrink: 0; }
  .admin-brand span { display: none; }
  .admin-notif-toggle { display: flex; order: 3; margin-left: auto; }
  .admin-search { order: 2; flex: 1 1 130px; min-width: 100px; max-width: 260px; padding: 0; margin: 0; position: static; }
  .admin-search input { font-size: .8rem; padding: 7px 9px; }
  /* the sidebar is a wrapping row on mobile, so the search dropdown must escape it */
  .admin-search-results {
    position: fixed;
    left: 8px; right: 8px; top: 56px;
    width: auto;
  }

  /* nav + sign-out/view-site live together in one "More" sheet, opened by the
     bottom tab bar's More button — slides up from the bottom so it opens from
     where it was tapped, like a native action sheet. */
  .admin-nav-drawer {
    display: none;
    position: fixed;
    /* stops above the fixed bottom tab bar entirely, rather than overlapping
       it and relying on z-index to paint over it — that overlap was hiding
       "Sign out" behind the tab bar on some devices */
    left: 8px; right: 8px; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); top: auto;
    z-index: 50;
    flex-direction: column;
    gap: 8px;
    background: var(--side);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,.4);
    padding: 14px 10px;
    max-height: 70vh;
    max-height: 70dvh; /* dvh accounts for the mobile browser's address bar, where plain vh can overshoot */
    overflow-y: auto;
  }
  .admin-sidebar.is-open .admin-nav-drawer { display: flex; }
  .admin-nav { flex-direction: column; }
  .admin-nav a { padding: 10px 12px; white-space: nowrap; border-radius: var(--radius-sm); }
  .admin-nav a span.label { display: inline; }
  .admin-nav-badge { margin-left: auto; }
  /* pinned to the bottom of the sheet's scroll area so "Sign out" is always
     reachable without scrolling, regardless of how tall the nav list is */
  .admin-sidebar-foot {
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 10px 2px 2px; margin-top: 4px;
    position: sticky; bottom: 0;
    background: var(--side);
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .admin-link { display: inline-flex; }
  .admin-main { margin-left: 0; padding: 20px 16px calc(76px + env(safe-area-inset-bottom, 0px)); }

  /* ---------- bottom tab bar ---------- */
  .admin-bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 42;
    display: flex;
    height: 60px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--side);
    border-top: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 -4px 16px rgba(0,0,0,.18);
  }
  .abn-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: none;
    cursor: pointer;
    color: rgba(255,255,255,.58);
    font-family: var(--font);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .01em;
  }
  .abn-item svg { width: 19px; height: 19px; }
  .abn-item[aria-current="page"] { color: var(--side-gold, #e3c988); }
  .abn-item[aria-expanded="true"] { color: var(--side-gold, #e3c988); }
}

/* ---------- Estimate Printer ---------- */
.est-menu { display: flex; flex-direction: column; gap: 14px; max-width: 640px; margin-top: 18px; }
.est-menu-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
  text-decoration: none; color: var(--text); transition: transform .12s ease, box-shadow .12s ease;
}
.est-menu-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.est-menu-ico {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.est-menu-ico svg { width: 22px; height: 22px; }
.est-menu-card--blue  { border-color: #bcdcfa; } .est-menu-card--blue .est-menu-ico  { background: #e3f0fd; color: #1864ab; }
.est-menu-card--green { border-color: #b9ecc9; } .est-menu-card--green .est-menu-ico { background: #dcf5e6; color: #1a7f4b; }
.est-menu-card--amber { border-color: #f3d896; } .est-menu-card--amber .est-menu-ico { background: #fbedcf; color: #a8710a; }
.est-menu-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.est-menu-body b { font-size: .96rem; }
.est-menu-body small { color: var(--text-mut); font-size: .8rem; }
.est-menu-chev { flex: none; width: 20px; height: 20px; color: var(--text-mut); }

.est-actions { display: flex; gap: 10px; margin-top: 4px; }
.est-actions .btn { flex: 1; }

.est-result-head {
  display: flex; justify-content: space-between; font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim);
  padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.est-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border-light, var(--border));
  font-size: .88rem;
}
.est-row:last-child { border-bottom: none; }
.est-row-label { color: var(--text-dim); }
.est-row-sub { display: block; font-size: .72rem; color: var(--text-mut); margin-top: 2px; }
.est-row-amt { font-weight: 600; white-space: nowrap; }
.est-row--total .est-row-label, .est-row--total .est-row-amt { font-weight: 700; color: var(--text); font-size: .95rem; }
.est-print-btn { width: 100%; margin-top: 16px; }
.est-menu-card--maroon { border-color: #e6bcc3; } .est-menu-card--maroon .est-menu-ico { background: #f8e3e6; color: #7a1120; }

/* ---------- Billing (admin/billing.html) ---------- */
.bill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 12px; }
.bill-grid .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bill-span-2 { grid-column: span 2; }
.bill-grid input, .bill-grid select {
  font-family: var(--font); font-size: .9rem; color: var(--text); padding: 9px 12px; width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel);
}
.bill-grid input:focus, .bill-grid select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(154,107,47,.15); }
@media (max-width: 900px) { .bill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .bill-grid { grid-template-columns: 1fr; } .bill-span-2 { grid-column: auto; } }

.bill-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 12px; background: var(--panel-2); }
.bill-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: .88rem; }
.bill-item-amt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  border-top: 1px dashed var(--border); padding-top: 10px; }
.bill-item-amt b { font-size: 1rem; white-space: nowrap; }
.bill-exch-add { display: flex; gap: 8px; flex-wrap: wrap; }
.bill-item-tag { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; margin-left: 6px; }
.bill-item-tag--gold { background: #fbedcf; color: #a8710a; }
.bill-item-tag--silver { background: #eceff3; color: #4a5563; }
.bill-item-tag--diamond { background: #e3f0fd; color: #1864ab; }
.bill-item-tag--mixed { background: #f8e3e6; color: #7a1120; }
/* ---------- GST Report (admin/gst-report.html) ---------- */
.gst-toolbar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.gst-toolbar .field { display: flex; flex-direction: column; gap: 6px; }
.gst-toolbar input { font-family: var(--font); font-size: .9rem; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); }
.gst-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.gst-stat { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--panel-2); display: flex; flex-direction: column; gap: 4px; }
.gst-stat span { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--text-mut); font-weight: 600; }
.gst-stat b { font-size: 1.05rem; }
.gst-stat small { font-weight: 500; color: var(--text-mut); font-size: .75rem; }
/* Savings scheme members: gold / silver locked totals above the list */
.scheme-locked-stats { margin: 14px 0 16px; max-width: 640px; }
/* Transaction Report */
.txn-dates { margin: 12px 0; }
#txnStats { margin: 14px 0 16px; }
.txn-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.txn-pager:empty { display: none; }
#txnUploadBox summary { cursor: pointer; }
.txn-table th, .txn-table td { white-space: nowrap; }
/* Customers -> Bulk send login links (WhatsApp quick-send queue) */
.bulk-link-panel { margin: 12px 0 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--accent-tint); }
.bulk-link-panel h3 { margin: 0 0 6px; font-size: 1rem; }
.bulk-link-panel .admin-actions { flex-wrap: wrap; margin-top: 10px; }
.bulk-progress { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin: 8px 0 12px; }
.bulk-progress span { display: block; height: 100%; background: var(--ok); transition: width .2s; }
.bulk-current { padding: 10px 12px; background: var(--panel); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.bulk-current p { margin: 0; }
#gstWarnings .inline-msg { margin: 10px 0 0; }
.bill-done { border-color: var(--ok); }
.bill-done h2 { color: var(--ok); }
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #fff; }
.btn-whatsapp:hover:not(:disabled) { background: #1ebe5a; border-color: #1ebe5a; }
.pill--ok { background: #dcf5e6; color: var(--ok); }
.pill--err { background: #fbe4e4; color: var(--err); }
.admin-table tr.is-muted td { color: var(--text-mut); }

.est-search-row { display: flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.est-search-ico {
  flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
}
.est-search-row input { border: none !important; border-radius: 0 !important; flex: 1; }

.est-balance-card {
  display: flex; flex-wrap: wrap; gap: 18px; padding: 14px 16px; background: var(--panel-2);
  border-radius: var(--radius-sm); margin-bottom: 16px;
}
.est-balance-card div { display: flex; flex-direction: column; gap: 2px; }
.est-balance-card b { font-size: 1.05rem; }
.est-balance-card small { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-mut); }

@media (max-width: 640px) {
  .est-menu-card { padding: 14px; }
  .est-balance-card { gap: 12px; }
}

/* on phones the chip row scrolls edge-to-edge of the card */
@media (max-width: 640px) {
  .filter-bar {
    margin: 0 -22px 14px;
    padding: 0 22px 2px;
  }
}

/* ============================================================
   Mobile pass: toolbars, filters, dialogs/forms, touch targets.
   Same 900px breakpoint as the rest of the admin's "mobile mode".
   ============================================================ */
@media (max-width: 900px) {
  /* search + filter selects + export: one column instead of a cramped
     multi-item wrap row */
  .toolbar { flex-direction: column; align-items: stretch; }
  .tb-search, .tb-select { width: 100%; min-width: 0; flex: none; }
  .tb-spacer { display: none; }
  .export { align-self: flex-end; }

  .notif-filters { flex-direction: column; align-items: stretch; }
  .notif-filters select { width: 100%; }
  .notif-filters .spacer { display: none; }
  .notif-count { align-self: flex-end; }

  /* full-screen dialog: tighter padding, stacked footer so Save/Cancel are
     full-width (easier to tap) instead of squeezed to the right edge */
  .admin-dialog-head { padding: 16px 18px; }
  .admin-dialog-body { padding: 18px; }
  .admin-dialog-foot { flex-direction: column; align-items: stretch; padding: 14px 18px; }
  .admin-dialog-foot .inline-msg { order: -1; text-align: center; }
  .dialog-actions { width: 100%; margin-left: 0; }
  .dialog-actions .btn { flex: 1 1 0; }

  /* comfortably tappable form fields and buttons */
  .stack-form input, .stack-form select, .stack-form textarea { padding: 11px 12px; font-size: 16px; }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 36px; }

  .pn-radio-row, .avatar-row, .rates-actions, .pn-btn-row { gap: 10px; }
  .pn-btn-row .btn { flex: 1 1 auto; }
}
