/* Kwacha Pay — demo app styles. Palette and proportions follow the design mockups. */
:root {
  --ground: #f6f5f1; --ink: #141413; --muted: #5c5b56; --muted-2: #6b6a64; --faint: #a3a29b;
  --green: #0f6b45; --green-dark: #0a4d31; --green-ink: #0b3b25; --light-green: #e3f1ea; --mint: #4fd38e;
  --orange: #d9641f; --orange-dark: #b4521a; --orange-deep: #9a3b12; --tint: #fbe9dc; --tint-line: #f1cfb8; --tint-bg: #fdf1ec;
  --border: #e3e1d9; --hair: #efede6; --chip: #f1efe8; --chip-ink: #3f3e3a; --dark: #141413; --dark-2: #2a2a28;
  --blue-bg: #e6e9f5; --blue: #2f3d8f; --ash: #c9c7bf;
  --r: 16px; --r-lg: 20px; --r-sm: 12px;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #e9e7df; color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; font-size: 14px; line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* phone frame -------------------------------------------------------------- */
.phone {
  position: relative; width: 100%; min-height: 100dvh; background: var(--ground);
  display: flex; flex-direction: column; overflow: hidden;
}
@media (min-width: 520px) {
  body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
  .phone {
    width: 390px; height: min(844px, calc(100vh - 40px)); min-height: 0; border-radius: 36px;
    box-shadow: 0 30px 80px rgba(20, 20, 19, .28), 0 0 0 10px #141413, 0 0 0 12px #3a3936;
  }
  .phone.wide { width: min(1280px, calc(100vw - 40px)); height: calc(100vh - 40px); border-radius: 18px;
    box-shadow: 0 30px 80px rgba(20, 20, 19, .18), 0 0 0 1px var(--border); }
}
.statusbar {
  flex: 0 0 auto; height: 44px; padding: 10px 16px 0 16px; display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 3;
}
.phone.dark-chrome .statusbar { color: #fff; }
.brand { display: flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 0; font-size: 13px; font-weight: 800; letter-spacing: -.2px; }
.brand-mark { width: 20px; height: 20px; border-radius: 6px; background: var(--green); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.statusbar-right { display: flex; align-items: center; gap: 6px; }
.badge-sandbox { font-size: 10px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--orange-deep); background: var(--tint); border: 1px solid var(--tint-line); border-radius: 999px; padding: 3px 8px; }
.role-pill { font-size: 11px; font-weight: 800; border: 1px solid var(--border); background: #fff; color: var(--ink); border-radius: 999px; padding: 4px 10px; }
.phone.dark-chrome .role-pill { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }

.screen { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; -webkit-overflow-scrolling: touch; }
.page { flex: 1 0 auto; display: flex; flex-direction: column; padding: 12px 20px 24px 20px; gap: 0; min-height: 100%; }
.page > * { flex: 0 0 auto; }
.spacer { flex: 1 1 0 !important; min-height: 12px; }
.page.dark { background: var(--dark); color: #fff; }
.page.green { background: var(--green); color: #fff; }
.page.orange { background: var(--orange-dark); color: #fff; }

/* typography ----------------------------------------------------------------- */
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 600; }
.h1 { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.h2 { font-size: 18px; font-weight: 800; }
.h3 { font-size: 15px; font-weight: 800; }
.small { font-size: 12px; color: var(--muted); }
.strong { font-weight: 700; }
.mono { font-family: var(--mono); font-size: 12px; }
.green-text { color: var(--green); }
.orange-text { color: var(--orange-deep); }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* header rows ------------------------------------------------------------------ */
.topbar { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.topbar .h2 { flex: 1; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); flex: 0 0 auto; }
.dark .iconbtn, .green .iconbtn { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }
.who { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px 6px 6px; font-size: 12px; font-weight: 700; }
.who .av { width: 24px; height: 24px; font-size: 11px; border-radius: 50%; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 6px 10px; border: 0; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.status-pill.ok { color: var(--green); background: var(--light-green); } .status-pill.ok .dot { background: var(--green); }
.status-pill.off { color: var(--orange-deep); background: var(--tint); } .status-pill.off .dot { background: var(--orange); }

/* cards -------------------------------------------------------------------------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.tint { background: var(--tint); border-color: var(--tint-line); }
.card.soft { background: var(--tint-bg); border-color: var(--tint-line); }
.hero { border-radius: var(--r-lg); padding: 22px 22px 18px 22px; color: #fff; display: flex; flex-direction: column; gap: 14px; }
.hero.green { background: var(--green); }
.hero.dark { background: var(--dark); }
.hero .label { font-size: 13px; font-weight: 600; opacity: .85; }
.hero .tag { font-size: 11px; font-weight: 700; background: rgba(255,255,255,.16); border-radius: 999px; padding: 4px 10px; }
.hero .big { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1.05; }
.hero .big small { font-size: 22px; opacity: .8; font-weight: 800; }
.hero .foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,.18); padding-top: 12px; font-size: 13px; font-weight: 600; }
.hero .foot .num { font-size: 14px; font-weight: 800; }
.hero .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ash); border-top: 1px solid rgba(255,255,255,.16); padding-top: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { font-size: 12px; font-weight: 800; background: var(--mint); color: var(--green-ink); border-radius: 8px; padding: 4px 8px; }
.chip.note { background: transparent; color: var(--ash); font-weight: 700; padding: 4px 4px; }

/* actions grid --------------------------------------------------------------------- */
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 14px 6px; color: var(--ink); font-size: 12px; font-weight: 700; }
.action svg { color: var(--green); }
.action:disabled { opacity: .45; cursor: not-allowed; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-align: left; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.stat .s { font-size: 12px; color: var(--green); font-weight: 700; }
.stat.tint .k, .stat.tint .s { color: var(--orange-deep); }
.stat.tint { background: var(--tint); border-color: var(--tint-line); }
.stat.dark { background: var(--dark); color: #fff; border-color: var(--dark); } .stat.dark .k { color: var(--ash); } .stat.dark .s { color: var(--mint); }

/* list rows ------------------------------------------------------------------------- */
.list { background: #fff; border: 1px solid var(--border); border-radius: var(--r); display: flex; flex-direction: column; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--hair); text-align: left; background: transparent; border-left: 0; border-right: 0; border-top: 0; width: 100%; }
.item:last-child { border-bottom: 0; }
.item .title { font-size: 14px; font-weight: 700; }
.item .sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item .amt { font-size: 14px; font-weight: 800; white-space: nowrap; }
.item .amt.in { color: var(--green); }
.item .amt.muted { color: var(--muted); }
.empty { padding: 18px 16px; font-size: 13px; color: var(--muted); text-align: center; }
.av { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: 0 0 auto; }
.av.round { border-radius: 50%; }
.av.c0 { background: var(--tint); color: var(--orange-dark); } .av.c1 { background: var(--light-green); color: var(--green); } .av.c2 { background: var(--blue-bg); color: var(--blue); }
.av.c3 { background: var(--chip); color: var(--chip-ink); }
.tag { font-size: 11px; font-weight: 700; background: var(--chip); color: var(--chip-ink); border-radius: 6px; padding: 1px 6px; }
.tag.ok { background: var(--light-green); color: var(--green); } .tag.warn { background: var(--tint); color: var(--orange-deep); } .tag.dim { background: var(--chip); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.dot.g { background: var(--green); } .dot.o { background: var(--orange); } .dot.n { background: var(--muted-2); }
.section { margin-top: 22px; display: flex; justify-content: space-between; align-items: baseline; }
.section + .list, .section + .card { margin-top: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); font-weight: 600; } .kv .v { font-weight: 700; text-align: right; }
.kv .v.mono { font-size: 12px; }

/* inputs ------------------------------------------------------------------------------ */
.label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; display: block; }
.field { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.field:focus-within, .field.ok { border-color: var(--green); }
.field.warn { border-color: var(--orange); }
.field .av { width: 34px; height: 34px; font-size: 12px; border-radius: 50%; }
.field input, .field select { border: 0; outline: 0; padding: 0; width: 100%; font-size: 15px; font-weight: 700; background: transparent; min-width: 0; }
.field .hint { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 4px; min-height: 16px; }
.hint.ok { color: var(--green); } .hint.warn { color: var(--orange-deep); } .hint.dim { color: var(--muted); font-weight: 600; }
.input { height: 46px; width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0 14px; background: #fff; font-size: 14px; outline: 0; }
.input:focus { border-color: var(--green); }
.help { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* amount + keypad ------------------------------------------------------------------- */
.amount { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 22px; }
.amount .big { font-size: 48px; font-weight: 800; letter-spacing: -1.5px; display: flex; align-items: baseline; gap: 6px; line-height: 1; }
.amount .big .ccy { font-size: 22px; color: var(--muted); letter-spacing: 0; }
.amount .big .dec { color: var(--faint); }
.quick { display: flex; gap: 8px; margin-top: 16px; }
.quick button { flex: 1; height: 36px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 13px; font-weight: 700; }
.quick button.on { border-color: var(--green); background: var(--light-green); color: var(--green); font-weight: 800; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.keypad button { height: 52px; border: 0; background: #fff; border-radius: var(--r-sm); font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.keypad button:active { background: var(--light-green); }

/* buttons -------------------------------------------------------------------------------- */
.btn { height: 56px; border-radius: var(--r); border: 0; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: 800; width: 100%; padding: 0 16px; }
.btn.primary { background: var(--green); color: #fff; }
.btn.white { background: #fff; color: var(--green); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--border); }
.btn.dark { background: var(--dark); color: #fff; }
.btn.orange { background: var(--orange-dark); color: #fff; }
.btn.glass { background: rgba(255,255,255,.14); color: #fff; }
.btn.sm { height: 44px; font-size: 14px; border-radius: 14px; }
.btn.xs { height: 36px; font-size: 13px; border-radius: 10px; padding: 0 12px; width: auto; }
.btn.tall { height: 64px; flex-direction: column; gap: 6px; font-size: 12px; }
.btn:disabled { background: var(--border); color: var(--muted-2); cursor: not-allowed; }
.btn.block { margin-top: 14px; }
.pill-btn { height: 44px; padding: 0 16px; border-radius: 999px; background: rgba(255,255,255,.12); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #fff; border: 0; }

/* bottom nav ------------------------------------------------------------------------------ */
.nav { margin-top: 18px; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border: 0; background: transparent; color: var(--muted-2); font-size: 11px; font-weight: 700; }
.nav button.on { color: var(--green); font-weight: 800; }

/* toasts + sheets -------------------------------------------------------------------------- */
.toasts { position: absolute; left: 16px; right: 16px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--dark); color: #fff; border-radius: 14px; padding: 12px 14px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 2px; animation: up .25s ease; pointer-events: auto; cursor: pointer; }
.toast.err { background: var(--orange-dark); } .toast.ok { background: var(--green); }
.toast .t { font-weight: 800; }
@keyframes up { from { transform: translateY(12px); opacity: 0 } to { transform: none; opacity: 1 } }
.sheet-host { position: absolute; inset: 0; z-index: 40; background: rgba(20,20,19,.45); display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--ground); border-radius: 24px 24px 0 0; padding: 14px 20px 24px 20px; max-height: 92%; overflow-y: auto; animation: up .25s ease; }
.phone.wide .sheet { max-width: 480px; margin: auto; border-radius: 24px; }
.phone.wide .sheet-host { align-items: center; }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 14px auto; }
.pin { display: flex; justify-content: center; gap: 14px; margin: 18px 0; }
.pin span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--green); }
.pin span.on { background: var(--green); }

/* scan ---------------------------------------------------------------------------------------- */
.viewfinder { position: relative; width: 240px; height: 240px; margin: 20px auto 0 auto; }
.viewfinder i { position: absolute; width: 40px; height: 40px; border: 4px solid var(--mint); }
.viewfinder i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.viewfinder i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.viewfinder i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.viewfinder i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.viewfinder .laser { position: absolute; left: 20px; right: 20px; top: 50%; height: 2px; background: var(--mint); opacity: .8; animation: scan 2s ease-in-out infinite; }
@keyframes scan { 0%,100% { transform: translateY(-80px) } 50% { transform: translateY(80px) } }
.viewfinder img { position: absolute; left: 50px; top: 50px; width: 140px; height: 140px; border-radius: 10px; opacity: .9; filter: grayscale(1) contrast(.6) brightness(.9); }
.qrpick { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.qrpick button { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 10px 12px; color: #fff; text-align: left; }
.qrpick button .av { width: 34px; height: 34px; font-size: 12px; }
.qrpick .sub { font-size: 12px; color: var(--ash); }

/* merchant QR -------------------------------------------------------------------------------------- */
.qrbox { width: 190px; height: 190px; background: var(--dark); border-radius: 14px; padding: 10px; display: flex; align-items: center; justify-content: center; }
.qrbox img { width: 100%; height: 100%; border-radius: 6px; display: block; }

/* operator dashboard ------------------------------------------------------------------------------- */
.ops { display: flex; flex-wrap: wrap; min-height: 100%; }
.ops nav { flex: 0 1 220px; min-width: 0; padding: 20px 16px; background: var(--dark); color: #fff; display: flex; flex-direction: column; gap: 6px; }
.ops nav .logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px 10px; }
.ops nav .logo i { width: 28px; height: 28px; border-radius: 8px; background: var(--mint); display: block; }
.ops nav a, .ops nav button.navlink { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ash); font-size: 13px; font-weight: 700; background: transparent; border: 0; text-align: left; width: 100%; }
.ops nav a.on { background: rgba(255,255,255,.12); color: #fff; font-weight: 800; }
.ops nav .reg { margin-top: auto; padding: 12px; border-radius: 10px; background: rgba(255,255,255,.08); font-size: 12px; color: var(--ash); }
.ops nav .reg b { display: block; color: #fff; font-weight: 800; margin-bottom: 4px; }
.ops main { flex: 999 1 560px; min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.ops h1 { font-size: 24px; margin: 0; font-weight: 800; letter-spacing: -.4px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .k { font-size: 12px; font-weight: 700; color: var(--muted); } .kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.5px; } .kpi .s { font-size: 12px; color: var(--muted); }
.kpi .s.ok { color: var(--green); font-weight: 700; } .kpi .s.warn { color: var(--orange-deep); font-weight: 700; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel .ph { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bars i { flex: 1; border-radius: 4px 4px 0 0; background: var(--green); min-height: 2px; display: block; }
.bars i.o { background: var(--orange-dark); } .bars i.dim { background: var(--border); }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.alert { display: flex; gap: 10px; padding: 10px; border-radius: 12px; background: var(--tint-bg); border: 1px solid var(--tint-line); }
.alert .bar { width: 8px; border-radius: 4px; background: var(--orange-dark); flex: 0 0 auto; }
.alert .bar.n { background: var(--muted-2); } .alert .bar.g { background: var(--green); }
.alert.calm { background: var(--ground); border-color: var(--border); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--hair); color: var(--muted); font-weight: 700; font-size: 12px; }
table.t td { padding: 8px 6px; border-bottom: 1px solid var(--hair); }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; }
.scroll-x { overflow-x: auto; }
.ops .btn { height: 44px; font-size: 14px; border-radius: 12px; width: auto; padding: 0 16px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .ops nav { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; gap: 4px; }
  .ops nav .logo { padding: 4px 8px; flex: 1 1 100%; }
  .ops nav .reg { display: none; }
  .ops nav a { padding: 6px 10px; }
  .ops main { padding: 16px; }
}
