/* ============================================================
   Prize-Linked Savings Platform — shared styles
   Design intent: this is back-office infrastructure for banks,
   not a consumer lottery surface. Calm, legible, numerate.
   Navy/slate base, a single warm gold accent reserved for prize
   and winner moments only — everything else stays quiet so that
   accent actually means something when it appears.
   ============================================================ */

:root {
  --ink:        #0E1B33;
  --navy:       #122A52;
  --navy-deep:  #0A1830;
  --slate:      #4B5870;
  --slate-light:#8893A8;
  --line:       #E2E6EE;
  --paper:      #F7F8FB;
  --white:      #FFFFFF;
  --gold:       #C8932B;
  --gold-light: #FBF1DC;
  --green:      #1C7C4B;
  --green-light:#E7F5EC;
  --red:        #B23A33;
  --red-light:  #FBEAE8;

  --font-display: 'Iowan Old Style', 'Georgia', 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Roboto Mono', Consolas, monospace;

  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(14,27,51,.06);
  --shadow-md: 0 4px 16px rgba(14,27,51,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--navy-deep); margin: 0 0 .4em; }
h1 { font-size: 1.9rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── Shell layout ─────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--navy-deep);
  color: #C9D3E6;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 8px;
}
.sidebar .brand small { display: block; font-family: var(--font-body); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-top: 3px; }
.sidebar nav { flex: 1; }
.sidebar a {
  display: block;
  padding: 10px 22px;
  color: #B7C2D9;
  text-decoration: none;
  font-size: .9rem;
  border-left: 3px solid transparent;
}
.sidebar a:hover { background: rgba(255,255,255,.04); color: var(--white); }
.sidebar a.active { background: rgba(200,147,43,.12); color: var(--white); border-left-color: var(--gold); font-weight: 600; }
.sidebar .foot { padding: 14px 22px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: .8rem; }
.sidebar .foot a { padding: 8px 0; }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; background: var(--white); border-bottom: 1px solid var(--line);
}
.content { padding: 28px 32px 64px; max-width: 1180px; }

/* ── Auth pages ───────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy-deep); padding: 24px; }
.auth-card { background: var(--white); border-radius: 10px; padding: 40px 36px; width: 100%; max-width: 380px; box-shadow: var(--shadow-md); }
.auth-card .brand { text-align: center; margin-bottom: 28px; }
.auth-card .brand .mark { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: var(--navy-deep); }
.auth-card .brand .mark span { color: var(--gold); }
.auth-card .brand small { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-light); margin-top: 4px; }

/* ── Forms ────────────────────────────────────────────────── */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--slate); margin: 0 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: .92rem; font-family: var(--font-body); background: var(--white); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.help { font-size: .78rem; color: var(--slate-light); margin-top: 4px; }

button, .btn {
  display: inline-block; font-family: var(--font-body); font-weight: 600; font-size: .88rem;
  padding: 10px 18px; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-deep); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: #B07F22; }
.btn-outline { background: var(--white); color: var(--navy); border-color: var(--line); }
.btn-outline:hover { border-color: var(--navy); }
.btn-danger { background: var(--white); color: var(--red); border-color: var(--red-light); }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }

/* ── Cards / stats ────────────────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; }
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; } }

.stat { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.stat .label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--slate-light); font-weight: 600; }
.stat .value { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 600; color: var(--navy-deep); margin-top: 6px; }
.stat .delta { font-size: .78rem; margin-top: 4px; }
.stat .delta.up { color: var(--green); }
.stat .delta.down { color: var(--red); }

/* ── Tables ───────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-light); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--font-mono); }
.table-wrap { overflow-x: auto; }

/* ── Badges ───────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: .72rem; font-weight: 600; }
.badge-gold { background: var(--gold-light); color: #8A641E; }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-slate { background: var(--paper); color: var(--slate); border: 1px solid var(--line); }

/* ── Flash messages ───────────────────────────────────────── */
.flash { padding: 12px 16px; border-radius: var(--radius); font-size: .88rem; margin-bottom: 18px; }
.flash-success { background: var(--green-light); color: var(--green); }
.flash-error { background: var(--red-light); color: var(--red); }

/* ── Misc ─────────────────────────────────────────────────── */
.muted { color: var(--slate-light); }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); font-weight: 700; margin-bottom: 6px; }
hr.div { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--slate-light); }
.winner-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--gold-light); color: #8A641E; padding: 3px 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; }
