/* Zapdigit Admin — single stylesheet. No external deps. */

:root {
  --bg: #0e1117;
  --bg-2: #151a23;
  --panel: #1b212c;
  --panel-2: #212936;
  --border: #2a3341;
  --border-2: #38445580;
  --text: #e6ebf2;
  --muted: #8a97a8;
  --muted-2: #64707f;
  --brand: #5b8cff;
  --brand-2: #3f6fe0;
  --ok: #37c98b;
  --ok-bg: #123626;
  --warn: #f2b13c;
  --warn-bg: #3a2c11;
  --bad: #f2564d;
  --bad-bg: #3a1917;
  --info: #4aa8ff;
  --info-bg: #10293f;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; }

/* ---- App shell ---------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 244px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
}
.brand__mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 800; border-radius: 8px;
  font-size: 16px;
}
.brand__mark--lg { width: 44px; height: 44px; font-size: 22px; border-radius: 12px; }
.brand__name { font-weight: 700; font-size: 15px; letter-spacing: 0.2px; }

.nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 550;
  text-decoration: none; transition: background .12s, color .12s;
}
.nav__item:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav__item.is-active { background: var(--panel-2); color: var(--text); }
.nav__item.is-active .nav__icon { color: var(--brand); }
.nav__icon { width: 18px; text-align: center; color: var(--muted-2); font-size: 14px; }

.sidebar__foot {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.who__name { font-weight: 650; font-size: 13px; }
.who__role { color: var(--muted-2); font-size: 11px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; display: flex; align-items: center;
  padding: 0 28px; border-bottom: 1px solid var(--border);
  background: var(--bg-2); position: sticky; top: 0; z-index: 5;
}
.topbar__title { font-size: 17px; }
.content { padding: 24px 28px 60px; max-width: 1280px; width: 100%; }

/* ---- Flash -------------------------------------------------------------- */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.flash {
  padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-weight: 550;
}
.flash--success { background: var(--ok-bg); border-color: #1e5c40; color: #7ee6b4; }
.flash--error { background: var(--bad-bg); border-color: #6b2a26; color: #ff9a93; }
.flash--info { background: var(--info-bg); border-color: #1d476b; color: #8fccff; }

/* ---- Cards & grid ------------------------------------------------------- */
.grid { display: grid; gap: 16px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .grid--2 { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card__head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card__title { font-size: 14px; font-weight: 650; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat__label { color: var(--muted); font-size: 12px; font-weight: 550; text-transform: uppercase; letter-spacing: .5px; }
.stat__value { font-size: 26px; font-weight: 750; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat__hint { color: var(--muted-2); font-size: 12px; margin-top: 4px; }
.stat--accent { border-color: var(--brand-2); }
.stat--warn .stat__value { color: var(--warn); }

.section-gap { margin-top: 22px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 6px; }

/* ---- Tables ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; padding: 11px 16px; color: var(--muted);
  font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.tbl .muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted-2); }

/* ---- Pills & badges ----------------------------------------------------- */
.pill {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; text-transform: capitalize;
  border: 1px solid transparent;
}
.pill--ok { background: var(--ok-bg); color: #7ee6b4; border-color: #1e5c40; }
.pill--warn { background: var(--warn-bg); color: #ffcf7a; border-color: #6b4f1c; }
.pill--bad { background: var(--bad-bg); color: #ff9a93; border-color: #6b2a26; }
.pill--info { background: var(--info-bg); color: #8fccff; border-color: #1d476b; }
.pill--muted { background: #232b37; color: var(--muted); border-color: var(--border); }

.digits { display: inline-flex; gap: 5px; }
.digit {
  width: 26px; height: 30px; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px; font-family: var(--mono); font-weight: 700; font-size: 15px;
}
.digits--empty { color: var(--muted-2); font-family: var(--mono); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: #232b37; border: 1px solid var(--border);
  font-size: 11.5px; color: var(--muted); font-weight: 600;
}
.amount-pos { color: var(--ok); font-weight: 650; }
.amount-neg { color: var(--bad); font-weight: 650; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 600; font-size: 13px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); transition: filter .12s, background .12s;
  font-family: inherit; text-decoration: none;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }
.btn--ok { background: var(--ok-bg); border-color: #1e5c40; color: #8ff0c1; }
.btn--danger { background: var(--bad-bg); border-color: #6b2a26; color: #ffa79f; }
.btn--ghost { background: transparent; }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn--block { width: 100%; }
.btn-group { display: inline-flex; gap: 6px; }

/* ---- Forms -------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-family: inherit; font-size: 14px;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px #5b8cff28; }
.input--sm { padding: 6px 9px; font-size: 13px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { flex: 1; min-width: 140px; }
.inline-form { display: inline; }
.hint { color: var(--muted-2); font-size: 12px; }
.digit-inputs { display: flex; gap: 8px; }
.digit-inputs .input {
  width: 52px; text-align: center; font-family: var(--mono);
  font-size: 20px; font-weight: 700; padding: 8px 0;
}

/* ---- Toolbar / filters -------------------------------------------------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-tabs { display: inline-flex; gap: 4px; background: var(--panel); padding: 4px; border-radius: 10px; border: 1px solid var(--border); }
.filter-tabs a {
  padding: 6px 12px; border-radius: 7px; color: var(--muted);
  font-weight: 600; font-size: 13px; text-decoration: none;
}
.filter-tabs a:hover { color: var(--text); text-decoration: none; }
.filter-tabs a.is-active { background: var(--panel-2); color: var(--text); }
.search { flex: 1; min-width: 200px; max-width: 320px; }

/* ---- Login -------------------------------------------------------------- */
.login-body {
  display: grid; place-items: center; min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2740, var(--bg));
}
.login-card {
  width: 380px; max-width: calc(100vw - 40px);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.login-card__brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login-card__title { font-size: 18px; font-weight: 750; }
.login-card__sub { color: var(--muted); font-size: 13px; }
.login-card__foot { color: var(--muted-2); font-size: 12px; text-align: center; margin: 18px 0 0; }

/* ---- Misc --------------------------------------------------------------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-weight: 600; }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.upi-row {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border-2);
}
.upi-row:last-child { border-bottom: none; }
.badge-count { background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-size: 12px; color: var(--muted); }
