/* ==========================================================================
   DoPay Africa - design system
   Pay everyone, at once, across Africa.

   FLAT COLOURS ONLY. There is no linear-gradient, no radial-gradient, no
   gradient text, no glassmorphism blur panel and no shimmer skeleton anywhere
   in this file. Depth comes from the soft shadow tokens alone.

   Every colour used below resolves to a custom property declared in :root (or
   its dark-mode override). No raw hex values appear outside the token blocks.
   ========================================================================== */

:root{
  /* Brand - sampled from the DoPay Africa logo */
  --brand-blue:        #044294;   /* primary - the "D" */
  --brand-blue-dark:   #03337A;   /* hover / active / sidebar */
  --brand-blue-50:     #E8EDF7;   /* tint backgrounds, selected rows */
  --brand-green:       #0F903A;   /* success, paid, positive delta */
  --brand-green-light: #28A83E;   /* success hover */
  --brand-green-50:    #E7F4EB;
  --brand-red:         #D41419;   /* danger, failed, destructive */
  --brand-red-dark:    #B50B0F;
  --brand-red-50:      #FCEAEA;

  --primary: var(--brand-blue);
  --primary-hover: var(--brand-blue-dark);
  --primary-light: var(--brand-blue-50);
  --success: var(--brand-green);
  --danger:  var(--brand-red);
  --warning: #B26A00;              /* pending/processing - amber, flat */
  --warning-50: #FDF3E3;
  --info:    #044294;

  /* Neutrals */
  --bg:        #F5F7FA;
  --surface:   #FFFFFF;
  --surface-2: #FAFBFD;
  --border:    #E1E6EF;
  --text:      #0E1726;
  --text-light:#5B6779;

  /* Elevation - soft shadows only, never gradients */
  --shadow-sm: 0 1px 2px rgba(4,66,148,.06), 0 1px 3px rgba(14,23,38,.05);
  --shadow-md: 0 4px 14px rgba(14,23,38,.08);
  --shadow-lg: 0 18px 38px rgba(14,23,38,.12);
  --radius-sm: 6px; --radius: 10px; --radius-lg: 16px;
  --transition: all .2s ease;
  --sidebar-width: 264px;

  /* Supporting tokens derived from the palette above */
  --on-primary:  #FFFFFF;          /* text on a filled brand surface */
  --on-dark:     #FFFFFF;
  --sidebar-bg:  var(--brand-blue-dark);
  --sidebar-text: #DCE6F5;
  --sidebar-muted: #9DB2D4;
  --sidebar-active-bg: #0A4FA8;
  --sidebar-hover-bg:  #063C8C;

  --overlay:      rgba(14,23,38,.52);
  --focus-ring:   rgba(4,66,148,.35);
  --row-hover:    #F3F6FB;
  --skeleton:     #E7ECF4;
  --track:        #E9EEF6;

  --mtn:       #FFCB05;
  --mtn-text:  #4A3B00;
  --airtel:    #E8112D;
  --airtel-text: #FFFFFF;

  --sidebar-collapsed-width: 68px;
  --topbar-height: 62px;
  /* Height of the fixed sandbox bar. 0 when it is not shown, so every sticky
     offset below can simply add it without caring whether it exists. */
  --sandbox-h: 0px;
  --font-head: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"]{
  --bg:#0B1220; --surface:#131C2C; --surface-2:#0F1826; --border:#25324A;
  --text:#EEF2F8; --text-light:#94A3B8; --primary-light:#0D2A55;
  --brand-blue-50:#0D2A55; --brand-green-50:#0F2A19; --brand-red-50:#2C1214;

  --warning:#E0A64A; --warning-50:#2E2210;
  --success:#3CB55C; --danger:#F0575C;
  --primary:#3E7BD0; --primary-hover:#5590DE;

  --sidebar-bg:#0F1826; --sidebar-text:#C6D3E6; --sidebar-muted:#7A8CA8;
  --sidebar-active-bg:#1B2C48; --sidebar-hover-bg:#16233A;

  --on-primary:#FFFFFF;
  --overlay: rgba(2,6,14,.66);
  --focus-ring: rgba(62,123,208,.45);
  --row-hover:#18243A;
  --skeleton:#1D2A40;
  --track:#1D2A40;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.30), 0 1px 3px rgba(0,0,0,.24);
  --shadow-md: 0 4px 14px rgba(0,0,0,.36);
  --shadow-lg: 0 18px 38px rgba(0,0,0,.46);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

*,*::before,*::after{ box-sizing:border-box; }

html{ -webkit-text-size-adjust:100%; }

body{
  margin:0;
  font-family:var(--font-body);
  font-size:15px;
  line-height:1.6;
  color:var(--text);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3,h4{ font-family:var(--font-head); margin:0 0 .4em; color:var(--text); }
h1{ font-size:34px; font-weight:700; line-height:1.2; letter-spacing:-.02em; }
h2{ font-size:26px; font-weight:600; line-height:1.25; }
h3{ font-size:20px; font-weight:600; }
h4{ font-size:16px; font-weight:600; }
p{ margin:0 0 1em; }
p:last-child{ margin-bottom:0; }

a{ color:var(--primary); text-decoration:none; }
a:hover{ text-decoration:underline; }

small{ font-size:13px; }
code,kbd,pre{ font-family:'SFMono-Regular',Consolas,'Liberation Mono',monospace; font-size:13px; }

img{ max-width:100%; height:auto; }
hr{ border:0; border-top:1px solid var(--border); margin:20px 0; }

:focus-visible{
  outline:2px solid var(--primary);
  outline-offset:2px;
  border-radius:var(--radius-sm);
}

::selection{ background:var(--primary-light); color:var(--text); }

.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}

.skip-link{
  position:absolute; left:-9999px; top:0; z-index:200;
  background:var(--primary); color:var(--on-primary);
  padding:10px 16px; border-radius:0 0 var(--radius) 0; font-weight:600;
}
.skip-link:focus{ left:0; }

/* Money and every numeric column line up */
.num,.money,td.num,th.num,.kpi-value,.stat-value{ font-variant-numeric:tabular-nums; }

.icon{ width:18px; height:18px; flex:0 0 auto; display:inline-block; vertical-align:-3px; }
.icon-sm{ width:14px; height:14px; }
.icon-lg{ width:22px; height:22px; }
.icon-xl{ width:52px; height:52px; }

/* ==========================================================================
   Sandbox bar
   ========================================================================== */

/* Fixed rather than sticky. A sticky bar sitting in the body flow fights the
   sticky sidebar and top bar below it, so instead it is taken out of flow and
   everything else is offset by --sandbox-h. */
body.has-sandbox{ --sandbox-h:36px; padding-top:36px; }

.sandbox-bar{
  position:fixed; top:0; left:0; right:0; z-index:140;
  height:36px;
  display:flex; align-items:center; gap:8px;
  padding:0 18px;
  background:var(--warning);
  color:var(--on-primary);
  font-size:13.5px; font-weight:600;
  letter-spacing:.02em;
  white-space:nowrap; overflow-x:auto; overflow-y:hidden;
}
.sandbox-bar a{ color:var(--on-primary); text-decoration:underline; margin-left:auto; }
.sandbox-bar .icon{ width:16px; height:16px; flex:0 0 16px; }

/* ==========================================================================
   App shell
   ========================================================================== */

.app-shell{ display:flex; min-height:100vh; }

.sidebar{
  width:var(--sidebar-width);
  flex:0 0 var(--sidebar-width);
  background:var(--sidebar-bg);
  color:var(--sidebar-text);
  display:flex; flex-direction:column;
  position:sticky; top:var(--sandbox-h); height:calc(100vh - var(--sandbox-h));
  transition:width .18s ease, flex-basis .18s ease;
  z-index:60;
}

.sidebar-brand{
  display:flex; align-items:center; gap:10px;
  padding:16px 14px 14px 18px;
  min-height:var(--topbar-height);
}
.brand-link{
  display:flex; align-items:center; gap:10px; color:inherit; text-decoration:none; min-width:0;
}
.brand-link:hover{ text-decoration:none; }
.brand-mark{
  width:38px; height:38px; object-fit:contain; flex:0 0 38px;
  background:var(--surface); border-radius:9px; padding:4px;
}
.brand-text{ display:flex; flex-direction:column; min-width:0; }
.brand-text strong{
  font-family:var(--font-head); font-size:15px; font-weight:600; color:var(--on-dark);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.brand-text small{ font-size:11.5px; color:var(--sidebar-muted); letter-spacing:.04em; text-transform:uppercase; }

.sidebar-toggle{
  margin-left:auto; background:transparent; border:0; cursor:pointer;
  color:var(--sidebar-muted); padding:6px; border-radius:var(--radius-sm);
  display:flex; transition:var(--transition);
}
.sidebar-toggle:hover{ background:var(--sidebar-hover-bg); color:var(--on-dark); }

.sidebar-nav{ flex:1; overflow-y:auto; padding:6px 10px 12px; }
.sidebar-nav::-webkit-scrollbar{ width:6px; }
.sidebar-nav::-webkit-scrollbar-thumb{ background:var(--sidebar-hover-bg); border-radius:3px; }

.nav-group{ margin-bottom:14px; }
.nav-group-title{
  font-size:10.5px; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  color:var(--sidebar-muted); margin:6px 0 6px 10px;
}
.sidebar-nav ul{ list-style:none; margin:0; padding:0; }

.nav-link{
  display:flex; align-items:center; gap:11px;
  padding:9px 11px; border-radius:var(--radius);
  color:var(--sidebar-text); font-size:14.5px; font-weight:500;
  transition:var(--transition); position:relative;
}
.nav-link:hover{ background:var(--sidebar-hover-bg); color:var(--on-dark); text-decoration:none; }
.nav-link.is-active{ background:var(--sidebar-active-bg); color:var(--on-dark); font-weight:600; }
.nav-link.is-active::before{
  content:''; position:absolute; left:-10px; top:50%; transform:translateY(-50%);
  width:3px; height:22px; border-radius:0 3px 3px 0; background:var(--on-dark);
}
.nav-icon{ display:flex; flex:0 0 18px; }
.nav-label{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nav-badge{
  margin-left:auto; background:var(--warning); color:var(--on-primary);
  font-size:11px; font-weight:700; min-width:20px; height:20px; padding:0 6px;
  border-radius:10px; display:inline-flex; align-items:center; justify-content:center;
}

.sidebar-foot{ padding:12px 14px 16px; border-top:1px solid var(--sidebar-hover-bg); }
.sidebar-version{ margin:10px 0 0; font-size:11px; color:var(--sidebar-muted); text-align:center; }

/* Collapsed rail */
html.sidebar-collapsed .sidebar{ width:var(--sidebar-collapsed-width); flex-basis:var(--sidebar-collapsed-width); }
html.sidebar-collapsed .brand-text,
html.sidebar-collapsed .nav-label,
html.sidebar-collapsed .nav-group-title,
html.sidebar-collapsed .nav-badge,
html.sidebar-collapsed .sidebar-version{ display:none; }
html.sidebar-collapsed .sidebar-brand{ padding-left:14px; justify-content:center; }
html.sidebar-collapsed .sidebar-toggle{ transform:rotate(180deg); }
html.sidebar-collapsed .nav-link{ justify-content:center; padding:11px 0; }
html.sidebar-collapsed .btn-block{ padding-left:0; padding-right:0; }

.sidebar-scrim{
  position:fixed; inset:0; background:var(--overlay); z-index:55; border:0;
}
/* The bar is screen decoration; it must never reach the paper. */
@media print{ body.has-sandbox{ padding-top:0; } }

.app-main{ flex:1; min-width:0; display:flex; flex-direction:column; }

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar{
  position:sticky; top:var(--sandbox-h); z-index:50;
  display:flex; align-items:center; gap:12px;
  min-height:var(--topbar-height);
  padding:10px 20px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
}
.topbar-burger{ display:none; }

.global-search{
  position:relative; flex:1; max-width:460px;
}
.global-search .search-icon{
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  color:var(--text-light); pointer-events:none;
}
.global-search input{
  width:100%; padding:9px 42px 9px 38px;
  border:1px solid var(--border); border-radius:var(--radius);
  background:var(--surface-2); color:var(--text); font:inherit; font-size:14px;
  transition:var(--transition);
}
.global-search input:focus{
  outline:none; border-color:var(--primary); background:var(--surface);
  box-shadow:0 0 0 3px var(--focus-ring);
}
.search-kbd{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  border:1px solid var(--border); border-radius:5px; padding:1px 6px;
  font-size:11px; color:var(--text-light); background:var(--surface);
}

.topbar-actions{ display:flex; align-items:center; gap:8px; margin-left:auto; }

.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border:1px solid var(--border); border-radius:var(--radius);
  background:var(--surface); color:var(--text-light); cursor:pointer;
  transition:var(--transition); position:relative;
}
.icon-btn:hover{ background:var(--surface-2); color:var(--text); border-color:var(--primary); }

.notif-badge{
  position:absolute; top:-5px; right:-5px;
  background:var(--danger); color:var(--on-primary);
  font-size:10.5px; font-weight:700; line-height:1;
  min-width:18px; height:18px; padding:0 5px; border-radius:9px;
  display:flex; align-items:center; justify-content:center;
  border:2px solid var(--surface);
}

.ccy-switch select{
  border:1px solid var(--border); border-radius:var(--radius);
  background:var(--surface); color:var(--text);
  /* Extra right padding so the native dropdown arrow never sits on the text. */
  padding:9px 26px 9px 10px; font:inherit; font-size:13.5px; font-weight:600; cursor:pointer;
}

.theme-dark{ display:none; }
[data-theme="dark"] .theme-light{ display:none; }
[data-theme="dark"] .theme-dark{ display:inline-flex; }

.user-wrap,.notif-wrap{ position:relative; }
.user-btn{
  display:flex; align-items:center; gap:9px;
  padding:5px 9px 5px 5px; border:1px solid var(--border); border-radius:var(--radius);
  background:var(--surface); cursor:pointer; color:var(--text); transition:var(--transition);
}
.user-btn:hover{ background:var(--surface-2); border-color:var(--primary); }
.avatar{
  width:30px; height:30px; border-radius:8px; flex:0 0 30px;
  background:var(--primary); color:var(--on-primary);
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:13px;
}
.user-meta{ display:flex; flex-direction:column; align-items:flex-start; line-height:1.25; }
.user-meta strong{ font-size:13.5px; font-weight:600; }
.user-meta small{ font-size:11.5px; color:var(--text-light); }

/* Dropdowns */
.dropdown{
  position:absolute; right:0; top:calc(100% + 8px);
  min-width:250px; background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow-lg); z-index:70; overflow:hidden;
}
.dropdown[hidden]{ display:none; }
.dropdown a{
  display:flex; align-items:center; gap:10px;
  padding:11px 14px; color:var(--text); font-size:14px; transition:var(--transition);
}
.dropdown a:hover{ background:var(--surface-2); text-decoration:none; }
.dropdown a.is-danger{ color:var(--danger); }
.dropdown-sep{ height:1px; background:var(--border); }
.dropdown-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px; border-bottom:1px solid var(--border); font-size:14px;
}
.dropdown-body{ max-height:340px; overflow-y:auto; }
.dropdown-empty{ padding:24px 14px; text-align:center; color:var(--text-light); font-size:13.5px; }
.dropdown-foot{
  display:block; text-align:center; padding:11px; border-top:1px solid var(--border);
  font-size:13.5px; font-weight:600; color:var(--primary);
}
.notif-dropdown{ min-width:340px; }
.notif-item{ align-items:flex-start !important; gap:10px; }
.notif-item.is-unread{ background:var(--primary-light); }
.notif-item > span{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.notif-item strong{ font-size:13.5px; font-weight:600; }
.notif-item small{ font-size:12.5px; color:var(--text-light); }
.notif-item time{ font-size:11.5px; color:var(--text-light); }
.notif-dot{ width:8px; height:8px; border-radius:50%; margin-top:6px; flex:0 0 8px; background:var(--primary); }
.notif-success{ background:var(--success); }
.notif-warning{ background:var(--warning); }
.notif-danger{ background:var(--danger); }
.notif-info{ background:var(--primary); }

.link-btn{
  background:none; border:0; padding:0; cursor:pointer;
  color:var(--primary); font:inherit; font-size:13px; font-weight:600; text-decoration:underline;
}

/* ==========================================================================
   Content area
   ========================================================================== */

.content{
  flex:1; padding:24px 28px 40px;
  max-width:1560px; width:100%; margin:0 auto;
  display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:20px;
  align-content:start;
}
.content > *{ grid-column:1 / -1; }
.content-wide{ max-width:none; }

.page-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:16px; flex-wrap:wrap;
}
.page-sub{ color:var(--text-light); font-size:14.5px; margin:2px 0 0; max-width:78ch; }
.page-actions{ display:flex; gap:9px; flex-wrap:wrap; align-items:center; }

.app-foot{
  display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap;
  padding:16px 28px; border-top:1px solid var(--border);
  color:var(--text-light); font-size:12.5px; background:var(--surface);
}
.foot-tag{ font-style:italic; }

/* Column span helpers on the 12-column grid */
.col-3{ grid-column:span 3; } .col-4{ grid-column:span 4; }
.col-5{ grid-column:span 5; } .col-6{ grid-column:span 6; }
.col-7{ grid-column:span 7; } .col-8{ grid-column:span 8; }
.col-9{ grid-column:span 9; } .col-12{ grid-column:1 / -1; }

/* ==========================================================================
   Cards & panels
   ========================================================================== */

.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
  padding:20px;
}
.card-tight{ padding:0; overflow:hidden; }
.card-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap; margin-bottom:14px;
}
.card-head h2,.card-head h3{ margin:0; }
.card-head-sub{ font-size:13px; color:var(--text-light); margin:2px 0 0; }
.card-tight .card-head{ padding:18px 20px 0; margin-bottom:12px; }
.card-foot{
  padding:12px 20px; border-top:1px solid var(--border);
  background:var(--surface-2); display:flex; justify-content:space-between;
  align-items:center; gap:12px; flex-wrap:wrap;
}

.panel-title{ font-family:var(--font-head); font-size:16px; font-weight:600; margin:0; }

/* Banners */
.banner{
  display:flex; align-items:flex-start; gap:11px;
  padding:13px 16px; border-radius:var(--radius);
  border:1px solid var(--border); background:var(--surface-2);
  font-size:14px; line-height:1.55;
}
.banner .icon{ flex:0 0 18px; margin-top:2px; }
.banner-success{ background:var(--brand-green-50); border-color:var(--success); color:var(--text); }
.banner-success .icon{ color:var(--success); }
.banner-danger{ background:var(--brand-red-50); border-color:var(--danger); color:var(--text); }
.banner-danger .icon{ color:var(--danger); }
.banner-warning{ background:var(--warning-50); border-color:var(--warning); color:var(--text); }
.banner-warning .icon{ color:var(--warning); }
.banner-info{ background:var(--primary-light); border-color:var(--primary); color:var(--text); }
.banner-info .icon{ color:var(--primary); }
.banner-sticky{ margin:14px 28px 0; align-items:center; }
.banner > div{ flex:1; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding:10px 16px; border-radius:var(--radius);
  border:1px solid transparent; cursor:pointer;
  font-family:var(--font-body); font-size:14px; font-weight:600; line-height:1.2;
  transition:var(--transition); text-decoration:none; white-space:nowrap;
}
.btn:hover{ text-decoration:none; }
.btn:disabled,.btn.is-disabled{ opacity:.55; cursor:not-allowed; pointer-events:none; }
.btn:active{ transform:translateY(1px); }

.btn-primary{ background:var(--primary); color:var(--on-primary); }
.btn-primary:hover{ background:var(--primary-hover); }

.btn-success{ background:var(--success); color:var(--on-primary); }
.btn-success:hover{ background:var(--brand-green-light); }

.btn-danger{ background:var(--danger); color:var(--on-primary); }
.btn-danger:hover{ background:var(--brand-red-dark); }

.btn-outline{ background:var(--surface); color:var(--text); border-color:var(--border); }
.btn-outline:hover{ border-color:var(--primary); color:var(--primary); background:var(--surface-2); }

.btn-ghost{ background:transparent; color:var(--text-light); }
.btn-ghost:hover{ background:var(--surface-2); color:var(--text); }

.btn-sm{ padding:6px 11px; font-size:13px; border-radius:var(--radius-sm); }
.btn-lg{ padding:13px 22px; font-size:15.5px; }
.btn-block{ width:100%; }
.btn .icon{ width:16px; height:16px; }

.btn-group{ display:inline-flex; gap:0; }
.btn-group .btn{ border-radius:0; border-left-width:0; }
.btn-group .btn:first-child{ border-radius:var(--radius) 0 0 var(--radius); border-left-width:1px; }
.btn-group .btn:last-child{ border-radius:0 var(--radius) var(--radius) 0; }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.form-grid-3{ grid-template-columns:repeat(3,minmax(0,1fr)); }
.field{ display:flex; flex-direction:column; gap:6px; min-width:0; }
.field-full{ grid-column:1 / -1; }

label,.field-label{ font-size:13.5px; font-weight:600; color:var(--text); }
.field-hint{ font-size:12.5px; color:var(--text-light); }
.field-error{ font-size:12.5px; color:var(--danger); font-weight:500; }

input[type=text],input[type=email],input[type=password],input[type=number],
input[type=search],input[type=tel],input[type=date],input[type=url],
select,textarea{
  width:100%; padding:10px 12px;
  border:1px solid var(--border); border-radius:var(--radius);
  background:var(--surface); color:var(--text);
  font-family:var(--font-body); font-size:14.5px; line-height:1.4;
  transition:var(--transition);
}
textarea{ min-height:92px; resize:vertical; }
select{ cursor:pointer; }

input:focus,select:focus,textarea:focus{
  outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--focus-ring);
}
input:disabled,select:disabled,textarea:disabled{
  background:var(--surface-2); color:var(--text-light); cursor:not-allowed;
}
input.has-error,select.has-error,textarea.has-error{ border-color:var(--danger); }
input::placeholder,textarea::placeholder{ color:var(--text-light); opacity:.75; }

input[readonly]{ background:var(--surface-2); color:var(--text-light); }

.input-money{ text-align:right; font-variant-numeric:tabular-nums; font-weight:600; }

.input-group{ display:flex; align-items:stretch; }
.input-group input{ border-radius:var(--radius) 0 0 var(--radius); }
.input-group .input-addon{
  display:flex; align-items:center; padding:0 12px;
  border:1px solid var(--border); border-left:0; border-radius:0 var(--radius) var(--radius) 0;
  background:var(--surface-2); color:var(--text-light); font-size:13.5px; font-weight:600;
}
.input-group .btn{ border-radius:0 var(--radius) var(--radius) 0; }

.password-wrap{ position:relative; }
.password-wrap input{ padding-right:44px; }
.password-toggle{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  background:none; border:0; cursor:pointer; color:var(--text-light);
  padding:7px; border-radius:var(--radius-sm); display:flex;
}
.password-toggle:hover{ color:var(--text); background:var(--surface-2); }

.strength{ height:5px; border-radius:3px; background:var(--track); overflow:hidden; }
.strength-bar{ height:100%; width:0; background:var(--danger); transition:width .25s ease, background .25s ease; }
.strength-bar.is-fair{ background:var(--warning); }
.strength-bar.is-good{ background:var(--brand-green-light); }
.strength-bar.is-strong{ background:var(--success); }

.checkbox,.radio{
  display:flex; align-items:flex-start; gap:9px;
  font-size:14px; font-weight:500; cursor:pointer; color:var(--text);
}
.checkbox input,.radio input{
  width:17px; height:17px; margin:2px 0 0; accent-color:var(--primary); cursor:pointer; flex:0 0 17px;
}

.switch{ display:inline-flex; align-items:center; gap:10px; cursor:pointer; font-size:14px; font-weight:500; }
.switch input{ position:absolute; opacity:0; width:0; height:0; }
.switch-track{
  width:42px; height:24px; border-radius:12px; background:var(--track);
  position:relative; transition:var(--transition); flex:0 0 42px;
}
.switch-track::after{
  content:''; position:absolute; top:3px; left:3px; width:18px; height:18px;
  border-radius:50%; background:var(--surface); box-shadow:var(--shadow-sm); transition:var(--transition);
}
.switch input:checked + .switch-track{ background:var(--primary); }
.switch input:checked + .switch-track::after{ transform:translateX(18px); }
.switch input:focus-visible + .switch-track{ box-shadow:0 0 0 3px var(--focus-ring); }

fieldset{ border:1px solid var(--border); border-radius:var(--radius); padding:16px; margin:0 0 16px; }
legend{ padding:0 8px; font-size:13.5px; font-weight:600; color:var(--text-light); }

.form-actions{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
  padding-top:16px; margin-top:4px; border-top:1px solid var(--border);
}
.form-actions .spacer{ margin-left:auto; }

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrap{ overflow-x:auto; border-radius:var(--radius); }

table.data{
  width:100%; border-collapse:collapse; font-size:14px; background:var(--surface);
}
table.data th,table.data td{
  padding:11px 14px; text-align:left; border-bottom:1px solid var(--border);
  vertical-align:middle;
}
table.data thead th{
  background:var(--surface-2); color:var(--text-light);
  font-size:11.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  white-space:nowrap; position:sticky; top:0; z-index:2;
}
table.data tbody tr{ transition:background .12s ease; }
table.data tbody tr:hover{ background:var(--row-hover); }
table.data tbody tr.is-selected{ background:var(--primary-light); }
table.data tbody tr:last-child td{ border-bottom:0; }
table.data td.num,table.data th.num{ text-align:right; }
table.data .cell-strong{ font-weight:600; }
table.data .cell-muted{ color:var(--text-light); font-size:13px; }
table.data .cell-mono{ font-family:'SFMono-Regular',Consolas,monospace; font-size:12.5px; }
table.data td.tight{ width:1%; white-space:nowrap; }

.table-sticky thead th{ box-shadow:0 1px 0 var(--border); }

.row-actions{ display:flex; gap:6px; justify-content:flex-end; }

/* Chips */
.chip{
  display:inline-flex; align-items:center; gap:5px;
  padding:3px 9px; border-radius:20px;
  font-size:12px; font-weight:600; line-height:1.5; white-space:nowrap;
}
.chip-muted{ background:var(--surface-2); color:var(--text-light); border:1px solid var(--border); }
.chip-success{ background:var(--brand-green-50); color:var(--success); }
.chip-danger{ background:var(--brand-red-50); color:var(--danger); }
.chip-warning{ background:var(--warning-50); color:var(--warning); }
.chip-info{ background:var(--primary-light); color:var(--primary); }
.chip-mtn{ background:var(--mtn); color:var(--mtn-text); }
.chip-airtel{ background:var(--airtel); color:var(--airtel-text); }

/* Pagination */
.pager{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap; padding:14px 4px 0;
}
.pager-info{ font-size:13px; color:var(--text-light); }
.pager-links{ display:flex; gap:4px; flex-wrap:wrap; }
.pager-btn{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:36px; height:36px; padding:0 10px;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--surface); color:var(--text); font-size:13.5px; font-weight:600;
  transition:var(--transition);
}
.pager-btn:hover{ border-color:var(--primary); color:var(--primary); text-decoration:none; }
.pager-btn.is-current{ background:var(--primary); border-color:var(--primary); color:var(--on-primary); }
.pager-btn.is-disabled{ opacity:.45; pointer-events:none; }

/* Filters */
.filter-bar{
  display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end;
  padding:14px 16px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-sm);
}
.filter-bar .field{ min-width:150px; }
.filter-bar .field-grow{ flex:1; min-width:220px; }

/* Empty states */
.empty-state{ text-align:center; padding:48px 20px; }
.empty-illus{
  width:88px; height:88px; margin:0 auto 16px;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%; background:var(--primary-light); color:var(--primary);
}
.empty-state h3{ margin:0 0 6px; }
.empty-state p{ color:var(--text-light); max-width:44ch; margin:0 auto 18px; }

/* ==========================================================================
   KPI tiles & stats
   ========================================================================== */

.kpi-row{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }

.kpi{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-sm);
  padding:18px; display:flex; flex-direction:column; gap:10px;
}
.kpi-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.kpi-chip{
  width:40px; height:40px; border-radius:11px;
  display:flex; align-items:center; justify-content:center;
  background:var(--primary-light); color:var(--primary);
}
.kpi-chip.is-success{ background:var(--brand-green-50); color:var(--success); }
.kpi-chip.is-danger{ background:var(--brand-red-50); color:var(--danger); }
.kpi-chip.is-warning{ background:var(--warning-50); color:var(--warning); }
.kpi-value{ font-family:var(--font-head); font-size:27px; font-weight:700; line-height:1.1; letter-spacing:-.02em; }
.kpi-label{ font-size:13px; color:var(--text-light); font-weight:500; }
.kpi-delta{ display:inline-flex; align-items:center; gap:4px; font-size:12.5px; font-weight:600; }
.kpi-delta.is-up{ color:var(--success); }
.kpi-delta.is-down{ color:var(--danger); }
.kpi-delta.is-flat{ color:var(--text-light); }
.kpi-delta .icon{ width:13px; height:13px; }

/* Wallet strip */
.wallet-strip{ display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; }
.wallet-card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); padding:18px;
}
.wallet-card.is-low{ border-color:var(--warning); background:var(--warning-50); }
.wallet-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.wallet-ccy{
  display:inline-flex; align-items:center; gap:7px;
  font-family:var(--font-head); font-size:14px; font-weight:600;
}
.wallet-flag{
  width:30px; height:30px; border-radius:8px; background:var(--primary-light); color:var(--primary);
  display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700;
}
.wallet-balance{ font-family:var(--font-head); font-size:26px; font-weight:700; letter-spacing:-.02em; }
.wallet-meta{ display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; margin-top:8px;
  font-size:12.5px; color:var(--text-light); }
.wallet-acct{ font-family:'SFMono-Regular',Consolas,monospace; }

/* Stat list */
.stat-list{ display:grid; gap:10px; }
.stat-row{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.stat-label{ font-size:13.5px; color:var(--text-light); }
.stat-value{ font-size:15px; font-weight:600; }
.stat-value-lg{ font-family:var(--font-head); font-size:22px; font-weight:700; }

/* ==========================================================================
   Progress bars (segmented, flat)
   ========================================================================== */

.progress{
  height:10px; border-radius:6px; background:var(--track);
  overflow:hidden; display:flex;
}
.progress-lg{ height:18px; border-radius:9px; }
.progress span{ display:block; height:100%; transition:width .4s ease; }
.seg-success{ background:var(--success); }
.seg-pending{ background:var(--warning); }
.seg-failed{ background:var(--danger); }
.seg-queued{ background:var(--track); }
.seg-primary{ background:var(--primary); }

.progress-legend{
  display:flex; gap:14px; flex-wrap:wrap; margin-top:10px; font-size:12.5px; color:var(--text-light);
}
.progress-legend span{ display:inline-flex; align-items:center; gap:6px; }
.legend-dot{ width:9px; height:9px; border-radius:3px; }

/* Coverage bar (step 5) */
.coverage{ margin-top:14px; }
.coverage-bar{ height:16px; border-radius:8px; background:var(--track); overflow:hidden; }
.coverage-fill{ height:100%; background:var(--success); transition:width .5s ease; }
.coverage-fill.is-tight{ background:var(--warning); }
.coverage-fill.is-short{ background:var(--danger); }
.coverage-scale{ display:flex; justify-content:space-between; font-size:12px; color:var(--text-light); margin-top:6px; }

/* ==========================================================================
   Wizard
   ========================================================================== */

.stepper{
  display:flex; align-items:center; gap:0;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-sm);
  padding:16px 18px; overflow-x:auto;
}
.step{ display:flex; align-items:center; gap:10px; flex:1; min-width:0; }
.step-dot{
  width:32px; height:32px; flex:0 0 32px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:700;
  border:2px solid var(--border); background:var(--surface); color:var(--text-light);
  transition:var(--transition);
}
.step.is-done .step-dot{ background:var(--primary); border-color:var(--primary); color:var(--on-primary); }
.step.is-current .step-dot{ border-color:var(--primary); color:var(--primary); background:var(--surface); }
.step-label{ display:flex; flex-direction:column; min-width:0; }
.step-label strong{ font-size:13px; font-weight:600; white-space:nowrap; }
.step-label small{ font-size:11.5px; color:var(--text-light); white-space:nowrap; }
.step.is-current .step-label strong{ color:var(--primary); }
.step-line{ flex:1; height:2px; background:var(--border); margin:0 10px; min-width:14px; }
.step.is-done + .step .step-line,
.step.is-done .step-line{ background:var(--primary); }

.step-pill{
  display:none; align-items:center; justify-content:space-between; gap:10px;
  padding:12px 16px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); font-weight:600; font-size:14px;
}
.step-pill .progress{ flex:1; max-width:160px; }

.wizard-body{ display:grid; gap:20px; }

.cycle-cards{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.cycle-card{
  border:2px solid var(--border); border-radius:var(--radius);
  padding:16px; background:var(--surface); cursor:pointer;
  transition:var(--transition); text-align:left; display:flex; flex-direction:column; gap:5px;
}
.cycle-card:hover{ border-color:var(--primary); }
.cycle-card.is-selected{ border-color:var(--primary); background:var(--primary-light); }
.cycle-card strong{ font-family:var(--font-head); font-size:15px; }
.cycle-card small{ font-size:12.5px; color:var(--text-light); }
.cycle-card input{ position:absolute; opacity:0; }

.selection-bar{
  position:sticky; bottom:0; z-index:30;
  display:flex; align-items:center; justify-content:space-between;
  gap:14px; flex-wrap:wrap;
  padding:13px 18px; margin-top:4px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-lg);
}
.selection-summary{ font-size:14px; font-weight:600; }
.selection-summary em{ font-style:normal; color:var(--text-light); font-weight:500; }

.totals-panel{
  position:sticky; top:calc(var(--sandbox-h) + var(--topbar-height) + 20px);
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); padding:18px;
}
.totals-panel h3{ margin:0 0 14px; font-size:16px; }
.totals-row{
  display:flex; justify-content:space-between; gap:10px;
  padding:8px 0; font-size:14px; border-bottom:1px solid var(--border);
}
.totals-row:last-of-type{ border-bottom:0; }
.totals-row.is-grand{
  margin-top:8px; padding-top:12px; border-top:2px solid var(--border); border-bottom:0;
  font-family:var(--font-head); font-size:17px; font-weight:700;
}
.totals-row span:last-child{ font-variant-numeric:tabular-nums; font-weight:600; }

/* Step 3: table on the left, sticky totals on the right */
.assign-layout{ display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:20px; align-items:start; }
.assign-layout > *{ min-width:0; }

.assign-modes{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.mode-btn{
  padding:11px 12px; border:2px solid var(--border); border-radius:var(--radius);
  background:var(--surface); cursor:pointer; font-size:13.5px; font-weight:600;
  color:var(--text); transition:var(--transition); text-align:center;
}
.mode-btn:hover{ border-color:var(--primary); }
.mode-btn.is-active{ border-color:var(--primary); background:var(--primary-light); color:var(--primary); }

.warn-list{ list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.warn-item{
  display:flex; align-items:flex-start; gap:9px;
  padding:10px 12px; border-radius:var(--radius);
  background:var(--warning-50); border:1px solid var(--warning); font-size:13.5px;
}
.warn-item .icon{ color:var(--warning); flex:0 0 16px; margin-top:2px; }

.confirm-box{
  border:2px solid var(--danger); border-radius:var(--radius);
  background:var(--brand-red-50); padding:18px; margin-top:16px;
}
.confirm-box h3{ margin:0 0 8px; color:var(--danger); }

.otp-input{
  display:flex; gap:8px; justify-content:center;
}
.otp-input input{
  width:48px; height:56px; text-align:center;
  font-family:var(--font-head); font-size:22px; font-weight:700;
  border:2px solid var(--border); border-radius:var(--radius);
  background:var(--surface); color:var(--text); padding:0;
}
.otp-input input:focus{ border-color:var(--primary); box-shadow:0 0 0 3px var(--focus-ring); outline:none; }

/* Live monitor */
.monitor-counters{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.counter-tile{
  border:1px solid var(--border); border-radius:var(--radius);
  padding:14px; text-align:center; background:var(--surface-2);
}
.counter-tile strong{ display:block; font-family:var(--font-head); font-size:26px; font-weight:700; line-height:1.1; }
.counter-tile small{ font-size:12.5px; color:var(--text-light); font-weight:500; }
.counter-success strong{ color:var(--success); }
.counter-failed strong{ color:var(--danger); }
.counter-pending strong{ color:var(--warning); }

.event-feed{ max-height:280px; overflow-y:auto; display:grid; gap:1px; background:var(--border); border-radius:var(--radius); }
.event-row{
  display:flex; gap:10px; align-items:baseline;
  padding:9px 12px; background:var(--surface); font-size:13px;
}
.event-row time{ color:var(--text-light); font-size:11.5px; flex:0 0 62px; font-variant-numeric:tabular-nums; }

/* Timeline drawer */
.drawer{
  position:fixed; inset:0; z-index:110; display:flex; justify-content:flex-end;
}
.drawer[hidden]{ display:none; }
.drawer-scrim{ position:absolute; inset:0; background:var(--overlay); }
.drawer-panel{
  position:relative; width:min(520px,100%); background:var(--surface);
  border-left:1px solid var(--border); box-shadow:var(--shadow-lg);
  display:flex; flex-direction:column; overflow-y:auto;
}
.drawer-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:18px 20px; border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--surface);
}
.drawer-body{ padding:20px; }

.timeline{ list-style:none; margin:0; padding:0 0 0 22px; position:relative; }
.timeline::before{
  content:''; position:absolute; left:6px; top:6px; bottom:6px; width:2px; background:var(--border);
}
.timeline li{ position:relative; padding:0 0 18px; }
.timeline li::before{
  content:''; position:absolute; left:-22px; top:5px; width:12px; height:12px;
  border-radius:50%; background:var(--primary); border:2px solid var(--surface);
}
.timeline li.is-success::before{ background:var(--success); }
.timeline li.is-failed::before{ background:var(--danger); }
.timeline li.is-pending::before{ background:var(--warning); }
.timeline-head{ display:flex; gap:9px; align-items:baseline; flex-wrap:wrap; }
.timeline-head strong{ font-size:14px; }
.timeline-head time{ font-size:12px; color:var(--text-light); }
.timeline p{ margin:3px 0 0; font-size:13.5px; color:var(--text-light); }
.timeline pre{
  margin:8px 0 0; padding:10px; background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--radius-sm); font-size:11.5px; overflow-x:auto; max-height:180px; color:var(--text-light);
}

/* ==========================================================================
   Modals & toasts
   ========================================================================== */

.modal{
  position:fixed; inset:0; z-index:130;
  display:flex; align-items:center; justify-content:center; padding:20px;
  background:var(--overlay);
}
.modal[hidden]{ display:none; }
.modal-card{
  background:var(--surface); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg); padding:26px;
  width:min(520px,100%); max-height:88vh; overflow-y:auto;
}
.modal-card.is-wide{ width:min(760px,100%); }
.modal-card h2{ margin:0 0 10px; font-size:21px; }
.modal-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:22px; flex-wrap:wrap; }

.toast-stack{
  position:fixed; right:20px; bottom:20px; z-index:200;
  display:flex; flex-direction:column; gap:10px; max-width:min(380px,calc(100vw - 40px));
}
.toast{
  display:flex; align-items:flex-start; gap:10px;
  padding:13px 15px; border-radius:var(--radius);
  background:var(--surface); border:1px solid var(--border);
  border-left:4px solid var(--primary);
  box-shadow:var(--shadow-lg); font-size:14px;
  animation:toast-in .22s ease;
}
.toast-success{ border-left-color:var(--success); }
.toast-success .icon{ color:var(--success); }
.toast-danger{ border-left-color:var(--danger); }
.toast-danger .icon{ color:var(--danger); }
.toast-warning{ border-left-color:var(--warning); }
.toast-warning .icon{ color:var(--warning); }
.toast-info .icon{ color:var(--primary); }
.toast-close{ background:none; border:0; cursor:pointer; color:var(--text-light); padding:0 0 0 6px; margin-left:auto; }

@keyframes toast-in{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:none; } }

/* ==========================================================================
   Loading - flat opacity pulse. No shimmer, no gradient.
   ========================================================================== */

.skeleton{
  background:var(--skeleton); border-radius:var(--radius-sm);
  animation:pulse 1.4s ease-in-out infinite;
}
.skeleton-text{ height:12px; margin:8px 0; }
.skeleton-title{ height:22px; width:45%; margin-bottom:14px; }
.skeleton-tile{ height:104px; }
.skeleton-row{ height:44px; margin-bottom:2px; }

@keyframes pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.45; } }

.spinner{
  width:16px; height:16px; border-radius:50%;
  border:2px solid var(--track); border-top-color:var(--primary);
  animation:spin .7s linear infinite; display:inline-block;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

/* Scroll-in reveal */
.reveal{ opacity:0; transform:translateY(12px); transition:opacity .45s ease, transform .45s ease; }
.reveal.is-visible{ opacity:1; transform:none; }

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
  .reveal{ opacity:1; transform:none; }
}

/* ==========================================================================
   Auth screens (bare layout)
   ========================================================================== */

.body-bare{ background:var(--bg); }
.bare-main{ min-height:100vh; display:flex; }

.auth-split{ display:flex; width:100%; min-height:100vh; }
.auth-brand{
  flex:0 0 44%;
  background:var(--brand-blue);
  color:var(--on-dark);
  padding:48px 52px;
  display:flex; flex-direction:column; justify-content:space-between;
}
.auth-brand-logo{
  background:var(--surface); border-radius:var(--radius-lg);
  padding:14px 18px; display:inline-flex; align-self:flex-start;
}
.auth-brand-logo img{ height:46px; width:auto; display:block; }
.auth-brand h1{ color:var(--on-dark); font-size:36px; line-height:1.18; margin:0 0 12px; max-width:14ch; }
.auth-brand .tagline{ font-size:17px; opacity:.92; margin:0 0 34px; max-width:32ch; }
.auth-points{ list-style:none; margin:0; padding:0; display:grid; gap:16px; }
.auth-points li{ display:flex; gap:12px; align-items:flex-start; font-size:14.5px; }
.auth-points .icon{ flex:0 0 20px; margin-top:2px; }
.auth-points strong{ display:block; font-size:15px; margin-bottom:2px; }
.auth-points span{ opacity:.88; }
.auth-brand-foot{ font-size:12.5px; opacity:.7; }

.auth-panel{
  flex:1; display:flex; align-items:center; justify-content:center; padding:40px 24px;
}
.auth-card{
  width:min(432px,100%);
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-md); padding:34px;
}
.auth-card h2{ margin:0 0 6px; font-size:25px; }
.auth-card .auth-sub{ color:var(--text-light); font-size:14.5px; margin:0 0 24px; }
.auth-card .field{ margin-bottom:16px; }
.auth-mobile-logo{ display:none; text-align:center; margin-bottom:22px; }
.auth-mobile-logo img{ height:52px; }
.auth-links{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  flex-wrap:wrap; margin-bottom:20px; font-size:13.5px;
}
.auth-foot{ text-align:center; margin-top:22px; font-size:12.5px; color:var(--text-light); }
.auth-demo{
  margin-top:20px; padding:14px; border:1px dashed var(--border);
  border-radius:var(--radius); background:var(--surface-2); font-size:12.5px; color:var(--text-light);
}
.auth-demo code{ color:var(--text); font-weight:600; }

.error-card{
  margin:auto; text-align:center; padding:40px 28px;
  width:min(520px,100%);
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-md);
}
.error-logo{ height:52px; margin-bottom:18px; }
.error-code{
  font-family:var(--font-head); font-size:56px; font-weight:700;
  color:var(--primary); margin:0; line-height:1;
}
.error-msg{ color:var(--text-light); white-space:pre-wrap; text-align:left;
  background:var(--surface-2); border-radius:var(--radius); padding:12px; font-size:13px; }
.error-hint{ color:var(--text-light); font-size:14px; }
.error-actions{ display:flex; gap:10px; justify-content:center; margin-top:22px; flex-wrap:wrap; }

/* Install wizard */
.install-wrap{
  margin:auto; width:min(720px,100%); padding:40px 24px;
}
.install-card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-md); padding:32px;
}
.install-head{ text-align:center; margin-bottom:28px; }
.install-head img{ height:62px; margin-bottom:14px; }

/* QR enrolment */
.qr-box{
  display:flex; gap:22px; align-items:flex-start; flex-wrap:wrap;
  padding:18px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface-2);
}
.qr-canvas{
  width:196px; height:196px; background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius); padding:8px; flex:0 0 auto;
}
.qr-canvas canvas{ width:100%; height:100%; image-rendering:pixelated; display:block; }
.secret-code{
  font-family:'SFMono-Regular',Consolas,monospace; font-size:15px; font-weight:600;
  letter-spacing:.08em; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:9px 12px; display:inline-block; word-break:break-all;
}
.backup-codes{
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px;
  font-family:'SFMono-Regular',Consolas,monospace; font-size:14px; font-weight:600;
}
.backup-codes li{
  list-style:none; padding:8px 10px; background:var(--surface-2);
  border:1px solid var(--border); border-radius:var(--radius-sm); text-align:center;
}

/* Receipt */
.receipt{
  width:min(680px,100%); margin:0 auto;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:32px;
}
.receipt-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:18px; flex-wrap:wrap; margin-bottom:24px; }
.receipt-logo{ height:48px; }
.receipt-stamp{
  border:2px solid var(--success); color:var(--success);
  border-radius:var(--radius); padding:6px 14px; font-weight:700;
  font-family:var(--font-head); letter-spacing:.06em; text-transform:uppercase; font-size:13px;
}
.receipt dl{ display:grid; grid-template-columns:auto 1fr; gap:10px 20px; margin:0; }
.receipt dt{ color:var(--text-light); font-size:13.5px; }
.receipt dd{ margin:0; font-weight:600; font-size:14px; text-align:right; font-variant-numeric:tabular-nums; }
.receipt-amount{
  margin:22px 0; padding:18px; border-radius:var(--radius);
  background:var(--brand-green-50); text-align:center;
}
.receipt-amount strong{ display:block; font-family:var(--font-head); font-size:30px; font-weight:700; color:var(--success); }
.receipt-foot{ margin-top:24px; padding-top:16px; border-top:1px solid var(--border);
  font-size:12px; color:var(--text-light); text-align:center; }

/* Tabs */
.tabs{
  display:flex; gap:2px; border-bottom:1px solid var(--border);
  overflow-x:auto; margin-bottom:20px;
}
.tab{
  padding:11px 16px; border:0; border-bottom:2px solid transparent;
  background:none; cursor:pointer; color:var(--text-light);
  font:inherit; font-size:14px; font-weight:600; white-space:nowrap; transition:var(--transition);
}
.tab:hover{ color:var(--text); }
.tab.is-active{ color:var(--primary); border-bottom-color:var(--primary); }

/* Definition rows used across detail screens */
.dl-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:16px; }
.dl-item{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.dl-item dt{ font-size:12px; color:var(--text-light); text-transform:uppercase; letter-spacing:.05em; font-weight:600; }
.dl-item dd{ margin:0; font-size:15px; font-weight:600; word-break:break-word; }

.code-copy{
  display:inline-flex; align-items:center; gap:8px;
  background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius);
  padding:8px 10px; font-family:'SFMono-Regular',Consolas,monospace; font-size:12.5px;
  max-width:100%; overflow-x:auto;
}
.code-copy button{ background:none; border:0; cursor:pointer; color:var(--primary); padding:2px; display:flex; }

/* Bar list (provider split) */
.bar-list{ display:grid; gap:14px; }
.bar-row-head{ display:flex; justify-content:space-between; gap:10px; font-size:13.5px; margin-bottom:5px; }
.bar-row-head strong{ font-weight:600; }
.bar-track{ height:9px; border-radius:5px; background:var(--track); overflow:hidden; }
.bar-fill{ height:100%; background:var(--primary); }
.bar-fill.is-mtn{ background:var(--mtn); }
.bar-fill.is-airtel{ background:var(--airtel); }

/* Attention list */
.attention-item{
  display:flex; align-items:center; gap:12px; padding:12px 0;
  border-bottom:1px solid var(--border);
}
.attention-item:last-child{ border-bottom:0; }
.attention-icon{
  width:34px; height:34px; flex:0 0 34px; border-radius:9px;
  display:flex; align-items:center; justify-content:center;
  background:var(--warning-50); color:var(--warning);
}
.attention-icon.is-danger{ background:var(--brand-red-50); color:var(--danger); }
.attention-icon.is-info{ background:var(--primary-light); color:var(--primary); }
.attention-body{ flex:1; min-width:0; }
.attention-body strong{ display:block; font-size:14px; }
.attention-body small{ color:var(--text-light); font-size:12.5px; }

.quick-actions{ display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; }
.quick-action{
  display:flex; flex-direction:column; align-items:center; gap:8px;
  padding:16px 10px; border:1px solid var(--border); border-radius:var(--radius);
  background:var(--surface); color:var(--text); font-size:13px; font-weight:600;
  text-align:center; transition:var(--transition);
}
.quick-action:hover{ border-color:var(--primary); color:var(--primary); text-decoration:none; background:var(--surface-2); }
.quick-action .icon{ width:20px; height:20px; color:var(--primary); }

.chart-box{ position:relative; height:280px; }
.chart-box-sm{ height:220px; }

.mono{ font-family:'SFMono-Regular',Consolas,monospace; font-size:12.5px; }
.text-muted{ color:var(--text-light); }
.text-success{ color:var(--success); }
.text-danger{ color:var(--danger); }
.text-warning{ color:var(--warning); }
.text-right{ text-align:right; }
.text-center{ text-align:center; }
.nowrap{ white-space:nowrap; }
.flex{ display:flex; }
.flex-between{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.flex-gap{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.mt-0{ margin-top:0; } .mt-1{ margin-top:8px; } .mt-2{ margin-top:16px; } .mt-3{ margin-top:24px; }
.mb-0{ margin-bottom:0; } .mb-1{ margin-bottom:8px; } .mb-2{ margin-bottom:16px; } .mb-3{ margin-bottom:24px; }

/* ==========================================================================
   Responsive - 320px and up
   ========================================================================== */

@media (max-width:1280px){
  .content{ padding:20px 20px 36px; }
  .kpi-row{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9{ grid-column:1 / -1; }
}

@media (max-width:1024px){
  .sidebar{
    position:fixed; left:0; top:var(--sandbox-h); height:calc(100vh - var(--sandbox-h));
    transform:translateX(-100%); transition:transform .22s ease;
    box-shadow:var(--shadow-lg);
  }
  .sidebar.is-open{ transform:none; }
  html.sidebar-collapsed .sidebar{ width:var(--sidebar-width); flex-basis:var(--sidebar-width); }
  html.sidebar-collapsed .brand-text,
  html.sidebar-collapsed .nav-label,
  html.sidebar-collapsed .nav-group-title,
  html.sidebar-collapsed .sidebar-version{ display:revert; }
  html.sidebar-collapsed .nav-link{ justify-content:flex-start; padding:9px 11px; }
  .sidebar-toggle{ display:none; }
  .topbar-burger{ display:inline-flex; }
  .cycle-cards{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .assign-modes{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .monitor-counters{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .assign-layout{ grid-template-columns:1fr; }
  .totals-panel{ position:static; }
  .auth-brand{ display:none; }
  .auth-mobile-logo{ display:block; }
}

@media (max-width:768px){
  h1{ font-size:26px; }
  h2{ font-size:21px; }
  .content{ padding:16px 14px 32px; gap:16px; }
  .banner-sticky{ margin:12px 14px 0; }
  .topbar{ padding:9px 14px; gap:8px; }
  .global-search{ max-width:none; }
  .search-kbd{ display:none; }
  .user-meta{ display:none; }
  .form-grid,.form-grid-3{ grid-template-columns:1fr; }
  .stepper{ display:none; }
  .step-pill{ display:flex; }
  .kpi-row{ grid-template-columns:1fr; }
  .backup-codes{ grid-template-columns:1fr; }
  .receipt{ padding:20px; }
  .notif-dropdown{ min-width:min(320px,calc(100vw - 28px)); }
  .dropdown{ right:-4px; }

  /* Item tables become stacked cards */
  table.stackable thead{ display:none; }
  table.stackable,table.stackable tbody,table.stackable tr,table.stackable td{ display:block; width:100%; }
  table.stackable tr{
    border:1px solid var(--border); border-radius:var(--radius);
    margin-bottom:10px; padding:6px 0; background:var(--surface);
  }
  table.stackable td{
    display:flex; justify-content:space-between; gap:14px;
    border-bottom:0; padding:7px 14px; text-align:right;
    /* Long references and Relworx ids must wrap, not spill out of the card. */
    min-width:0; overflow-wrap:anywhere; word-break:break-word;
  }
  table.stackable td::before{
    content:attr(data-label);
    font-size:11.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase;
    color:var(--text-light); text-align:left; flex:0 0 auto;
    white-space:nowrap;
  }
  table.stackable td.cell-mono{ font-size:11.5px; }
  table.stackable td.num{ text-align:right; }
  .row-actions{ justify-content:flex-end; }
}

@media (max-width:480px){
  /* Keep the sandbox warning readable rather than clipped on a small phone. */
  .sandbox-bar{ font-size:11.5px; padding:0 12px; gap:6px; }
  .sandbox-bar a{ font-size:11.5px; }

  .content{ padding:14px 12px 28px; }
  .card{ padding:16px; border-radius:var(--radius); }
  .cycle-cards,.assign-modes,.monitor-counters{ grid-template-columns:1fr; }
  .otp-input input{ width:40px; height:50px; font-size:19px; }
  .page-actions{ width:100%; }
  .page-actions .btn{ flex:1; }
  .toast-stack{ right:12px; left:12px; bottom:12px; max-width:none; }
  .auth-card{ padding:24px 20px; border:0; box-shadow:none; background:transparent; }
}

/* ==========================================================================
   Print - A4 batch reports and receipts
   ========================================================================== */

@media print{
  @page{ size:A4; margin:14mm; }

  .sidebar,.topbar,.app-foot,.sandbox-bar,.toast-stack,.page-actions,
  .filter-bar,.pager,.selection-bar,.stepper,.step-pill,.modal,.drawer,
  .skip-link,.banner-sticky,.row-actions,.quick-actions{ display:none !important; }

  body{ background:var(--surface); color:var(--text); font-size:11pt; }
  .app-shell{ display:block; }
  .content{ display:block; padding:0; max-width:none; }
  .card,.receipt{
    border:1px solid var(--border); box-shadow:none; break-inside:avoid; page-break-inside:avoid;
    border-radius:0; margin-bottom:10mm; padding:6mm;
  }
  table.data{ font-size:9.5pt; }
  table.data thead{ display:table-header-group; }
  table.data tr{ break-inside:avoid; page-break-inside:avoid; }
  table.data thead th{ position:static; }
  a{ color:var(--text); text-decoration:none; }
  h1{ font-size:18pt; }
  h2{ font-size:14pt; }
  .print-only{ display:block !important; }
  .chart-box{ display:none; }
}

.print-only{ display:none; }
