/* =====================================================================
   1K WALLET  —  Stylesheet
   Design tokens: indigo brand, teal = prepaid/positive, amber = postpaid
   /outstanding, red = danger. Type: Sora (display) + Inter (body).
   ===================================================================== */

:root {
  --ink:      #0f172a;
  --ink-soft: #475569;
  --muted:    #94a3b8;
  --line:     #e2e8f0;
  --surface:  #f1f5f9;
  --card:     #ffffff;

  --primary:      #4f46e5;
  --primary-dark: #4338ca;
  --accent:       #14b8a6;   /* prepaid / money in */
  --accent-dark:  #0f766e;
  --warn:         #f59e0b;   /* postpaid / outstanding */
  --danger:       #ef4444;
  --ok:           #16a34a;

  --radius: 14px;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px -12px rgba(15,23,42,.18);
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-head: "Sora", var(--font-body);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; margin: 0 0 .4em; letter-spacing: -.01em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
}
.auth-brand {
  background: linear-gradient(150deg, var(--primary) 0%, var(--primary-dark) 55%, #312e81 100%);
  color: #fff;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-brand .logo { font-family: var(--font-head); font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.auth-brand .logo span { color: var(--accent); }
.auth-brand h1 { font-size: 40px; line-height: 1.1; max-width: 12ch; }
.auth-brand p { color: #c7d2fe; max-width: 40ch; }
.auth-brand .pillrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.auth-brand .pill { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; }
.auth-form {
  display: flex; align-items: center; justify-content: center; padding: 40px;
  background: var(--card);
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 26px; }
.auth-card .sub { color: var(--ink-soft); margin-bottom: 26px; }

@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { padding: 36px; }
  .auth-brand h1 { font-size: 30px; }
}

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border: none; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 600; background: var(--primary); color: #fff;
  transition: background .15s, transform .05s; text-decoration: none;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink); color: #cbd5e1; padding: 22px 16px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { font-family: var(--font-head); font-weight: 800; font-size: 20px; color: #fff; padding: 4px 10px 20px; }
.sidebar .brand span { color: var(--accent); }
.sidebar .role-chip { font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 0 10px 14px; }
.nav a {
  display: flex; align-items: center; gap: 10px; color: #cbd5e1;
  padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 500;
  margin-bottom: 2px;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: var(--primary); color: #fff; }
.nav .sep { border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 12px 4px; }
.sidebar .foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 12px 10px 0; }

.main { display: flex; flex-direction: column; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 14px 26px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.topbar .who { font-size: 14px; color: var(--ink-soft); }
.topbar .who b { color: var(--ink); }
.content { padding: 26px; flex: 1; }
.page-title { font-size: 24px; margin-bottom: 4px; }
.page-sub { color: var(--ink-soft); margin-bottom: 22px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; overflow-x: auto; }
  .sidebar .foot, .sidebar .role-chip { display: none; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav .sep { display: none; }
}

/* ---------- Cards / stats ---------- */
.grid { display: grid; gap: 18px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 700px) { .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.card h3 { font-size: 16px; }
.stat { position: relative; overflow: hidden; }
.stat .label { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.stat .value { font-family: var(--font-head); font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.stat.teal .bar  { background: var(--accent); }
.stat.amber .bar { background: var(--warn); }
.stat.indigo .bar{ background: var(--primary); }
.stat.red .bar   { background: var(--danger); }
.stat.teal .value  { color: var(--accent-dark); }
.stat.amber .value { color: #b45309; }
.stat.red .value   { color: var(--danger); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); background: var(--surface); }
table.data tr:hover td { background: #fafbff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.prepaid  { background: #ccfbf1; color: var(--accent-dark); }
.badge.postpaid { background: #fef3c7; color: #b45309; }
.badge.success  { background: #dcfce7; color: var(--ok); }
.badge.failed   { background: #fee2e2; color: var(--danger); }
.badge.pending  { background: #e0e7ff; color: var(--primary-dark); }
.badge.active   { background: #dcfce7; color: var(--ok); }
.badge.blocked, .badge.inactive { background: #fee2e2; color: var(--danger); }

/* ---------- Flash ---------- */
.flash { padding: 13px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 500; }
.flash.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash.info    { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }

/* ---------- Misc ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.help { font-size: 12px; color: var(--muted); margin-top: 6px; }
.row-actions { display: flex; gap: 6px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 800px){ .split { grid-template-columns: 1fr; } }
