/* ============================================================
   Ez-Invoice · eTIMS Receipt Manager · Stylesheet
   Design system: Artisan Ledger (Stitch) — Material Design 3
   Warm earthy palette · Instrument Serif + Satoshi · No framework
   ============================================================ */

/* ── RESET ── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html{font-size:16px;-webkit-text-size-adjust:100%}
body{font-family:'Satoshi',system-ui,sans-serif;background:var(--bg);color:var(--text);height:100%;overflow:hidden}
img,svg{display:block;max-width:100%}
button{font-family:inherit;cursor:pointer}
input,select,textarea{font-family:inherit}
a{color:var(--accent);text-decoration:none}
.material-symbols-outlined{font-variation-settings:'FILL' 0,'wght' 400,'GRAD' 0,'opsz' 24;vertical-align:middle;line-height:1}

/* ── DESIGN TOKENS (Stitch / Material Design 3 · Earthy) ── */
:root{
  /* Surfaces */
  --bg:              #fff8f3;   /* background / surface-bright */
  --surface:         #ffffff;   /* surface-container-lowest */
  --surface2:        #faf2ec;   /* surface-container-low */
  --surface3:        #f4ede6;   /* surface-container */
  --surface4:        #eee7e1;   /* surface-container-high */
  --surface5:        #e8e1db;   /* surface-container-highest / surface-variant */

  /* Borders */
  --border:          #c1c8c2;   /* outline-variant */
  --border2:         #727973;   /* outline */

  /* Text */
  --text:            #1e1b18;   /* on-surface */
  --text2:           #414844;   /* on-surface-variant */
  --text3:           #727973;   /* outline */

  /* Primary (forest green) */
  --accent:          #325343;   /* primary */
  --accent-lt:       #c6ebd6;   /* primary-fixed */
  --accent-dim:      #abcfba;   /* primary-fixed-dim */
  --accent-dk:       #4a6b5a;   /* primary-container */

  /* Secondary (warm amber/brown) */
  --secondary:       #735a36;   /* secondary */
  --secondary-lt:    #fddaac;   /* secondary-container */
  --on-secondary:    #785e39;   /* on-secondary-container */

  /* Tertiary (deep green) */
  --tertiary:        #265539;
  --tertiary-dk:     #3f6e50;   /* tertiary-container */
  --tertiary-lt:     #bbefc9;   /* tertiary-fixed */

  /* Semantic */
  --danger:          #ba1a1a;   /* error */
  --danger-lt:       #ffdad6;   /* error-container */
  --warn:            #735a36;   /* reuse secondary for warnings */
  --warn-lt:         #fddaac;

  /* Radii */
  --radius:          12px;      /* rounded-xl */
  --radius-lg:       20px;      /* rounded-2xl */
  --radius-xl:       28px;      /* rounded-3xl */

  /* Shadows */
  --shadow:     0 2px 8px rgba(30,27,24,.05), 0 0 0 1px rgba(30,27,24,.03);
  --shadow-lg:  0 8px 32px -4px rgba(30,27,24,.12);
  --shadow-top: 0 -8px 32px -4px rgba(30,27,24,.06);

  /* Typography */
  --serif:  'Instrument Serif', Georgia, serif;
  --mono:   'DM Mono', ui-monospace, monospace;
}

/* ── APP SHELL ── */
#app{
  height:100dvh;
  max-width:430px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  background:var(--bg);
  position:relative;
  overflow:hidden;
}

/* ── SCREENS ── */
.screen{display:none;flex-direction:column;flex:1;overflow:hidden;height:100%}
.screen.active{display:flex}

/* ── SCROLL WRAPPER ── */
.scroll{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch}
.scroll::-webkit-scrollbar{width:3px}
.scroll::-webkit-scrollbar-track{background:transparent}
.scroll::-webkit-scrollbar-thumb{background:var(--surface5);border-radius:10px}

/* ── TOPBAR ── */
.topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 20px 14px;
  background:var(--bg);
  flex-shrink:0;
}
.topbar-title{font-size:17px;font-weight:700;color:var(--text)}
.topbar-back{
  display:flex;align-items:center;gap:6px;
  background:none;border:none;color:var(--accent);
  font-size:14px;font-weight:700;padding:0;letter-spacing:.3px;
}
.topbar-icon{
  background:none;border:none;color:var(--text2);
  padding:8px;border-radius:50%;display:flex;align-items:center;
  transition:.15s background;
}
.topbar-icon:hover{background:var(--surface2)}
.topbar-icon svg,.topbar-icon .material-symbols-outlined{width:22px;height:22px;font-size:22px;stroke:currentColor;fill:none;stroke-width:2}

/* ── APP HEADER (wordmark bar) ── */
.app-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 20px;background:var(--bg);flex-shrink:0;
}
.app-wordmark{
  font-family:var(--serif);font-style:italic;
  font-size:22px;color:var(--accent);line-height:1;
}
.app-avatar{
  width:40px;height:40px;border-radius:50%;
  background:var(--surface5);overflow:hidden;
  border:2px solid var(--accent-lt);
  display:flex;align-items:center;justify-content:center;
  font-size:15px;font-weight:700;color:var(--accent);
}

/* ── SPLASH ── */
#screen-splash{
  background:var(--accent);
  align-items:center;justify-content:center;gap:10px;
}
.splash-wordmark{
  font-family:var(--serif);font-style:italic;
  font-size:56px;color:#fff;letter-spacing:-2px;line-height:1;
}
.splash-wordmark b{font-style:normal;font-family:'Satoshi',sans-serif;font-weight:900;color:var(--accent-lt)}
.splash-tag{font-size:11px;letter-spacing:2px;text-transform:uppercase;color:rgba(255,255,255,.55);font-weight:700}
.splash-version{font-size:10px;color:rgba(255,255,255,.3);position:absolute;bottom:24px;letter-spacing:1px}

/* ── PIN LOCK ── */
.pin-wrap{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 28px}
.pin-logo{
  font-family:var(--serif);font-style:italic;
  font-size:38px;color:var(--accent);letter-spacing:-1px;margin-bottom:4px;
}
.pin-logo b{font-style:normal;font-family:'Satoshi',sans-serif;font-weight:900}
.pin-dots{display:flex;gap:16px;margin:24px 0 16px}
.pin-dot{
  width:14px;height:14px;border-radius:50%;
  border:2px solid var(--border);background:transparent;transition:.12s all;
}
.pin-dot.on{background:var(--accent);border-color:var(--accent);transform:scale(1.12)}
.pin-hint{font-size:13px;color:var(--text3);min-height:18px;margin-bottom:16px;text-align:center;font-weight:500}
.pin-hint.error{color:var(--danger)}
.numpad-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:10px;
  width:100%;max-width:290px;
  background:var(--surface2);padding:14px;border-radius:var(--radius-xl);
}
.nk{
  background:var(--surface);border:none;
  border-radius:var(--radius-lg);padding:18px 8px;
  font-size:24px;font-weight:700;font-family:var(--mono);
  text-align:center;transition:.12s all;color:var(--text);
}
.nk:hover{background:var(--accent-dim)}
.nk:active,.nk.pressed{background:var(--accent);color:#fff;transform:scale(.93)}
.nk.del{font-size:17px;color:var(--text2);background:var(--secondary-lt);color:var(--on-secondary)}
.nk.ghost{visibility:hidden}
.pin-link{margin-top:24px;font-size:13px;color:var(--text3);background:none;border:none;font-weight:500}
.pin-link span{color:var(--accent);font-weight:700}

/* ── ONBOARDING ── */
.ob-wrap{flex:1;overflow-y:auto;padding:24px 20px 110px}
.ob-wrap::-webkit-scrollbar{width:0}
.step-bar{display:flex;gap:5px;margin-bottom:28px}
.step-seg{height:4px;border-radius:2px;flex:1;background:var(--surface5);transition:.3s background}
.step-seg.done{background:var(--accent)}
.ob-h1{
  font-family:var(--serif);font-size:36px;color:var(--accent);
  line-height:1.15;margin-bottom:8px;
}
.ob-sub{font-size:15px;color:var(--text2);line-height:1.6;margin-bottom:28px;font-weight:400}

/* ── FORM ELEMENTS ── */
.field{margin-bottom:18px;position:relative}
.field label{
  display:block;font-size:11px;font-weight:700;
  color:var(--secondary);text-transform:uppercase;letter-spacing:.12em;margin-bottom:8px;
}
.field input,.field select,.field textarea{
  width:100%;background:var(--surface5);
  border:none;border-bottom:2px solid transparent;
  border-radius:var(--radius);
  padding:14px 16px;font-size:15px;color:var(--text);
  outline:none;transition:.15s border-color,.15s background;
  font-family:'Satoshi',sans-serif;
}
.field input:focus,.field select:focus,.field textarea:focus{
  border-bottom-color:var(--secondary);
  background:var(--surface5);
}
.field.has-error input,.field.has-error select{border-bottom-color:var(--danger)}
.field-hint{font-size:12px;color:var(--text3);margin-top:6px;line-height:1.4}
.field-hint.ok{color:var(--accent)}
.field-hint.error{color:var(--danger)}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.input-addon{display:flex;gap:0}
.input-addon input{border-radius:var(--radius) 0 0 var(--radius);flex:1}
.input-addon .addon-btn{
  background:var(--accent);color:#fff;border:none;
  border-radius:0 var(--radius) var(--radius) 0;
  padding:0 16px;font-size:12px;font-weight:700;white-space:nowrap;
  transition:.15s background;
}
.input-addon .addon-btn:hover{background:var(--accent-dk)}
.input-addon .addon-btn:disabled{background:var(--text3)}
select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23727973' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center}

/* ── TOGGLES ── */
.toggle-row{
  display:flex;align-items:center;justify-content:space-between;
  background:var(--surface5);border:none;
  border-radius:var(--radius);padding:14px 16px;cursor:pointer;
  transition:.15s background;margin-bottom:8px;
}
.toggle-row:hover{background:var(--surface4)}
.toggle-label{font-size:14px;font-weight:600;color:var(--text)}
.toggle-sub{font-size:12px;color:var(--text3);margin-top:2px}
.toggle-sw{
  width:44px;height:26px;border-radius:13px;
  background:var(--border);position:relative;transition:.2s background;flex-shrink:0;
}
.toggle-sw.on{background:var(--accent)}
.toggle-sw::after{
  content:'';position:absolute;width:20px;height:20px;border-radius:50%;
  background:#fff;top:3px;left:3px;transition:.2s left;
  box-shadow:0 1px 4px rgba(0,0,0,.25);
}
.toggle-sw.on::after{left:21px}

/* ── BUTTONS ── */
.btn{
  display:flex;align-items:center;justify-content:center;gap:8px;
  width:100%;padding:16px 24px;border:none;border-radius:var(--radius);
  font-size:15px;font-weight:700;font-family:'Satoshi',sans-serif;
  transition:.15s transform,.15s opacity;cursor:pointer;
  text-align:center;text-decoration:none;
}
.btn:active{transform:scale(.96)}
.btn-primary{
  background:var(--accent);color:#fff;
  box-shadow:0 8px 24px -4px rgba(50,83,67,.25);
}
.btn-primary:hover{background:var(--accent-dk)}
.btn-secondary{background:var(--surface4);color:var(--text);border:none}
.btn-secondary:hover{background:var(--surface5)}
.btn-outline{background:transparent;color:var(--accent);border:1.5px solid var(--accent)}
.btn-danger{background:var(--danger);color:#fff}
.btn-ghost{background:none;border:none;color:var(--accent);font-size:14px;padding:8px 0;width:auto;font-weight:700}
.btn-sm{padding:10px 18px;font-size:13px;width:auto;border-radius:10px}
.btn-icon{width:auto;height:40px;padding:0 14px;border-radius:10px}
.btn-row{display:flex;gap:10px}
.btn-row .btn{flex:1}
.btn:disabled,.btn[disabled]{opacity:.45;pointer-events:none}
.spin{display:inline-block;width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin .65s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── BOTTOM NAV (frosted glass · pill active) ── */
.bottom-nav{
  display:none;flex-shrink:0;
  background:rgba(255,248,243,.85);
  backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
  box-shadow:var(--shadow-top);
  border-radius:28px 28px 0 0;
  padding:10px 8px calc(10px + env(safe-area-inset-bottom));
}
.bottom-nav.visible{display:flex}
.nav-inner{display:flex;width:100%;justify-content:space-around;align-items:center}
.nav-btn{
  display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:8px 16px;background:none;border:none;
  color:var(--text3);transition:.2s all;border-radius:var(--radius-lg);
  font-family:'Satoshi',sans-serif;
}
.nav-btn.active{
  background:var(--accent-dk);color:#fff;
  transform:scale(.92);
}
.nav-btn .material-symbols-outlined{font-size:22px}
.nav-btn svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:2}
.nav-btn span.nav-label{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;margin-top:1px}

/* ── HERO BANNER ── */
.hero{
  background:var(--accent);padding:22px 20px 26px;
  position:relative;overflow:hidden;flex-shrink:0;
}
.hero::before{
  content:'';position:absolute;width:240px;height:240px;border-radius:50%;
  background:rgba(255,255,255,.04);top:-90px;right:-60px;pointer-events:none;
}
.hero::after{
  content:'';position:absolute;width:130px;height:130px;border-radius:50%;
  background:rgba(255,255,255,.03);bottom:-35px;left:25px;pointer-events:none;
}
.hero-tag{font-size:11px;color:rgba(255,255,255,.6);letter-spacing:.8px;text-transform:uppercase;font-weight:700;margin-bottom:3px}
.hero-name{
  font-family:var(--serif);font-style:italic;
  font-size:24px;color:#fff;line-height:1.2;
}
.hero-pin{font-size:11px;color:rgba(255,255,255,.5);font-family:var(--mono);margin-top:3px}
.hero-pill{
  display:inline-flex;align-items:center;gap:5px;
  background:rgba(255,255,255,.15);border-radius:100px;
  padding:4px 12px;font-size:11px;color:rgba(255,255,255,.85);margin-top:12px;font-weight:600;
}

/* ── HOME STATS HEADER ── */
.home-header-bar{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 20px 6px;
}
.home-today-label{font-size:10px;font-weight:700;color:var(--text3);text-transform:uppercase;letter-spacing:.15em}
.home-today-value{
  font-family:var(--serif);font-size:20px;color:var(--accent);
}

/* ── STAT CARDS ── */
.stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px 16px}
.stat-card{
  background:var(--surface2);border:none;
  border-radius:var(--radius);padding:16px;
}
.stat-label{font-size:10px;font-weight:700;color:var(--text3);text-transform:uppercase;letter-spacing:.12em;margin-bottom:6px}
.stat-value{
  font-family:var(--serif);font-size:22px;color:var(--text);
  line-height:1;font-variant-numeric:tabular-nums;
}
.stat-meta{font-size:11px;color:var(--text3);margin-top:4px;font-weight:500}

/* ── SECTION ── */
.section{padding:0 16px;margin-bottom:20px}
.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;padding-top:4px}
.section-title{
  font-size:10px;font-weight:700;color:var(--secondary);
  text-transform:uppercase;letter-spacing:.2em;
}
.section-link{font-size:13px;color:var(--accent);font-weight:700}

/* ── QUICK ACTION GRID ── */
.qa-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:0 16px 16px}
.qa-btn{
  background:var(--surface2);border:none;
  border-radius:var(--radius-lg);padding:18px 14px;
  display:flex;flex-direction:column;gap:12px;
  cursor:pointer;transition:.15s transform,.15s background;text-align:left;
}
.qa-btn:active{transform:scale(.95);background:var(--surface4)}
.qa-icon{width:40px;height:40px;border-radius:12px;display:flex;align-items:center;justify-content:center}
.qa-icon.green{background:var(--accent-lt);color:var(--accent)}
.qa-icon.gold{background:var(--secondary-lt);color:var(--secondary)}
.qa-icon.blue{background:#dbeafe;color:#1d4ed8}
.qa-icon.danger{background:var(--danger-lt);color:var(--danger)}
.qa-icon svg,.qa-icon .material-symbols-outlined{width:20px;height:20px;font-size:20px;stroke:currentColor;fill:none;stroke-width:2}
.qa-label{font-size:13px;font-weight:700;color:var(--text)}
.qa-sub{font-size:11px;color:var(--text3);font-weight:500}

/* ── RECEIPT LIST ITEMS ── */
.receipt-item{
  display:flex;align-items:center;gap:14px;
  background:var(--surface2);border:none;
  border-radius:var(--radius);padding:16px;
  margin-bottom:8px;cursor:pointer;
  transition:.15s background;
}
.receipt-item:active{background:var(--surface4)}
.r-icon{
  width:44px;height:44px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:18px;
}
.r-icon.out{background:rgba(50,83,67,.1);color:var(--accent)}
.r-icon.rev{background:rgba(29,78,216,.1);color:#1d4ed8}
.r-icon.pend{background:rgba(115,90,54,.1);color:var(--secondary)}
.r-body{flex:1;min-width:0}
.r-name{font-size:14px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.r-meta{font-size:12px;color:var(--text3);margin-top:3px;font-weight:500}
.r-right{text-align:right;flex-shrink:0}
.r-amount{font-size:15px;font-weight:700;font-variant-numeric:tabular-nums;font-family:var(--mono)}
.r-status{font-size:9px;font-weight:900;margin-top:5px;text-transform:uppercase;letter-spacing:.1em}
.r-status.ok{color:var(--accent)}
.r-status.pend{color:var(--secondary)}
.r-status.fail{color:var(--danger)}

/* ── STATUS BADGES (pill style) ── */
.badge{
  display:inline-flex;align-items:center;gap:4px;
  padding:3px 10px;border-radius:100px;
  font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.1em;
}
.badge-green{background:var(--accent);color:#fff}
.badge-amber{background:var(--secondary-lt);color:var(--on-secondary)}
.badge-red{background:var(--danger);color:#fff}
.badge-blue{background:#dbeafe;color:#1d4ed8}
.badge-gold{background:var(--secondary-lt);color:var(--secondary)}
.badge-outline{background:var(--surface5);color:var(--text2)}

/* ── FILTER CHIPS ── */
.filter-bar{display:flex;gap:6px;overflow-x:auto;padding:10px 16px;scrollbar-width:none;flex-shrink:0}
.filter-bar::-webkit-scrollbar{display:none}
.chip{
  display:inline-block;padding:7px 16px;
  border-radius:100px;font-size:12px;font-weight:700;
  cursor:pointer;white-space:nowrap;
  border:none;background:var(--surface4);color:var(--text3);
  transition:.12s all;
}
.chip.on{background:var(--accent);color:#fff}

/* ── BOTTOM SHEET ── */
.sheet-bg{
  position:fixed;inset:0;background:rgba(0,0,0,0);z-index:200;
  display:none;align-items:flex-end;justify-content:center;
  transition:.25s background;
}
.sheet-bg.open{display:flex;background:rgba(30,27,24,.5)}
.sheet{
  background:var(--bg);border-radius:28px 28px 0 0;
  width:100%;max-width:430px;max-height:92dvh;
  display:flex;flex-direction:column;
  transform:translateY(100%);transition:.3s transform cubic-bezier(.16,1,.3,1);
}
.sheet-bg.open .sheet{transform:translateY(0)}
.sheet-handle{width:40px;height:4px;background:var(--surface5);border-radius:2px;margin:14px auto 0;flex-shrink:0}
.sheet-header{display:flex;align-items:center;justify-content:space-between;padding:16px 22px 6px;flex-shrink:0}
.sheet-title{font-size:18px;font-weight:700;color:var(--text)}
.sheet-close{background:none;border:none;color:var(--text3);font-size:24px;line-height:1;padding:2px 6px;border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center}
.sheet-body{overflow-y:auto;padding:14px 22px 40px;flex:1}
.sheet-body::-webkit-scrollbar{width:0}

/* ── SERVICE / QUICK-SELECT PILLS ── */
.svc-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:16px}
.svc-btn{
  background:var(--surface4);border:none;
  border-radius:var(--radius);padding:14px 10px;
  text-align:center;cursor:pointer;transition:.12s transform;
}
.svc-btn:active{transform:scale(.95)}
.svc-btn.on{background:var(--accent-lt);outline:2px solid var(--accent)}
.svc-btn .svc-em{font-size:22px;display:block;margin-bottom:4px}
.svc-btn .svc-nm{font-size:11px;font-weight:700;color:var(--text);line-height:1.3}
.svc-btn .svc-cd{font-size:9px;color:var(--text3);font-family:var(--mono);margin-top:2px}

/* ── AMOUNT DISPLAY ── */
.amount-box{
  background:var(--surface2);border-radius:var(--radius);
  padding:24px 20px;text-align:center;margin-bottom:16px;
}
.amount-lbl{
  font-size:10px;font-weight:700;color:var(--secondary);
  text-transform:uppercase;letter-spacing:.15em;margin-bottom:8px;
}
.amount-num{
  font-family:var(--serif);font-size:52px;color:var(--accent);
  line-height:1;font-variant-numeric:tabular-nums;
  display:flex;align-items:center;justify-content:center;gap:8px;
}
.amount-num .amount-currency{font-size:26px;opacity:.45;font-style:italic}
.amount-tax{font-size:12px;color:var(--text3);margin-top:8px;font-weight:500}

/* ── NUMPAD ── */
.numpad-wrap{
  display:grid;grid-template-columns:repeat(3,1fr);gap:10px;
  margin-bottom:16px;background:var(--surface2);
  padding:14px;border-radius:var(--radius-xl);
}
.npad{
  background:var(--surface);border:none;
  border-radius:var(--radius-lg);padding:20px 8px;
  font-size:24px;font-weight:700;text-align:center;
  font-variant-numeric:tabular-nums;transition:.12s transform;
  color:var(--text);
}
.npad:hover{background:var(--accent-dim)}
.npad:active{background:var(--accent);color:#fff;transform:scale(.93)}
.npad.npad-del{
  font-size:16px;background:var(--secondary-lt);
  color:var(--on-secondary);
}
.npad.npad-del:active{background:var(--secondary);color:#fff}

/* ── QR RECEIPT ── */
.receipt-view{padding:0 4px 16px}
.status-banner{
  display:flex;align-items:center;justify-content:center;gap:8px;
  padding:10px 16px;font-size:12px;font-weight:700;
  margin-bottom:16px;text-transform:uppercase;letter-spacing:.1em;
}
.status-banner.ok{background:var(--tertiary-lt);color:var(--tertiary)}
.status-banner.pend{background:var(--secondary-lt);color:var(--on-secondary)}
/* USSD *222# fallback — amber tone */
.status-banner.ussd{background:#fff3cd;color:#856404;text-transform:none;font-size:11px;
  font-weight:600;letter-spacing:0;line-height:1.4;border:1px solid #ffc107;border-radius:8px}

/* ── KRA eTIMS Lite consent block ── */
.consent-box{
  display:flex;gap:12px;background:#f0f7f4;border:1.5px solid #c0ddd0;
  border-radius:12px;padding:14px;align-items:flex-start;
}
.consent-icon{font-size:28px;line-height:1;flex-shrink:0}
.consent-body{flex:1}
.consent-title{font-weight:700;font-size:14px;color:var(--accent);margin-bottom:6px}
.consent-text{font-size:12px;color:#555;line-height:1.5;margin-bottom:10px}
.consent-check{display:flex;align-items:flex-start;gap:8px;cursor:pointer;font-size:12px;color:#333}
.consent-check input[type=checkbox]{margin-top:2px;accent-color:var(--accent);width:16px;height:16px;flex-shrink:0}

/* eTIMS registration progress pill */
.etims-reg-status{
  display:flex;align-items:center;gap:8px;
  background:#325343;color:#fff;border-radius:20px;
  padding:10px 16px;font-size:13px;font-weight:500;
}
.etims-reg-status.done {background:#1b7b45}
.etims-reg-status.fail {background:#b5621e}
.etims-reg-spinner{
  display:inline-block;width:14px;height:14px;
  border:2px solid rgba(255,255,255,.3);border-top-color:#fff;
  border-radius:50%;animation:spin .7s linear infinite;flex-shrink:0;
}

/* Offline queue badge on nav */
.offline-badge{
  position:absolute;top:-4px;right:-4px;
  background:#e53935;color:#fff;
  font-size:9px;font-weight:700;
  width:16px;height:16px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  border:2px solid var(--surface);
}
.qr-card{
  background:var(--surface);border:none;
  border-radius:var(--radius-lg);padding:24px;
  margin-bottom:14px;text-align:center;
  box-shadow:var(--shadow-lg);position:relative;overflow:hidden;
}
.qr-box{
  width:160px;height:160px;margin:0 auto 18px;
  background:var(--surface);border:1px solid rgba(193,200,194,.3);
  border-radius:10px;padding:8px;
  display:flex;align-items:center;justify-content:center;
  position:relative;overflow:hidden;
}
.qr-pattern{
  position:absolute;inset:14px;
  background-image:
    repeating-linear-gradient(0deg,rgba(0,0,0,.07) 0,rgba(0,0,0,.07) 2px,transparent 2px,transparent 5px),
    repeating-linear-gradient(90deg,rgba(0,0,0,.07) 0,rgba(0,0,0,.07) 2px,transparent 2px,transparent 5px);
}
.qr-logo-inner{
  width:44px;height:44px;background:var(--accent);border-radius:8px;
  display:flex;align-items:center;justify-content:center;
  color:#fff;font-size:16px;font-weight:900;z-index:1;
  font-family:'Satoshi',sans-serif;
}
/* receipt total amount in serif */
.receipt-total-amount{
  font-family:var(--serif);font-size:26px;color:var(--accent);font-weight:700;
}
.r-meta-table{width:100%;border-collapse:collapse;text-align:left}
.r-meta-table tr td{padding:8px 0;border-bottom:1px solid var(--surface5);font-size:13px}
.r-meta-table tr:last-child td{border-bottom:none}
.r-meta-table .mt-label{color:var(--text3);font-weight:500}
.r-meta-table .mt-val{text-align:right;font-weight:600;font-variant-numeric:tabular-nums;font-family:var(--mono)}
.share-grid{display:grid;grid-template-columns:1fr;gap:10px;margin-top:14px}
.share-btn{
  background:var(--surface4);border:none;
  border-radius:var(--radius);padding:14px 16px;
  display:flex;align-items:center;gap:10px;
  font-size:14px;font-weight:700;color:var(--text);
  transition:.15s transform;
}
.share-btn:active{transform:scale(.97)}

/* ── HS CODE DROPDOWN ── */
.hs-dropdown{
  position:absolute;left:0;right:0;top:calc(100% + 2px);
  background:var(--surface);border:1.5px solid var(--border);
  border-radius:var(--radius);z-index:30;box-shadow:var(--shadow-lg);
  max-height:220px;overflow-y:auto;display:none;
}
.hs-dropdown.open{display:block}
.hs-item{padding:12px 16px;cursor:pointer;border-bottom:1px solid var(--surface5)}
.hs-item:last-child{border-bottom:none}
.hs-item:active{background:var(--surface4)}
.hs-nm{font-size:13px;font-weight:600}
.hs-cd{font-size:10px;color:var(--text3);font-family:var(--mono);margin-top:2px}

/* ── LOOKUP / KRA RESULT ── */
.lookup-card{
  background:var(--surface4);border:none;
  border-radius:var(--radius);padding:12px 14px;
  display:flex;align-items:center;gap:10px;margin-top:8px;
}
.lookup-card.ok{background:var(--accent-lt);outline:1.5px solid var(--accent-dim)}
.lookup-card.err{background:var(--danger-lt);outline:1.5px solid var(--danger)}
.lookup-em{font-size:18px}
.lookup-name{font-size:13px;font-weight:700}
.lookup-pin{font-size:11px;color:var(--text3);font-family:var(--mono)}

/* ── CUSTOMER DROPDOWN ── */
.cust-dropdown{
  background:var(--surface);border:1.5px solid var(--border);
  border-radius:var(--radius);overflow:hidden;
  margin-top:-8px;margin-bottom:10px;
  box-shadow:var(--shadow-lg);display:none;
}
.cust-dropdown.open{display:block}
.cust-item{
  display:flex;justify-content:space-between;align-items:center;
  padding:12px 16px;border-bottom:1px solid var(--surface5);cursor:pointer;
}
.cust-item:last-child{border-bottom:none}
.cust-item:active{background:var(--surface4)}
.cust-name{font-size:13px;font-weight:600}
.cust-pin{font-size:11px;color:var(--text3);font-family:var(--mono)}

/* ── INSIGHTS / CHARTS ── */
.chart-card{
  background:var(--surface2);border:none;
  border-radius:var(--radius-xl);padding:20px;margin-bottom:12px;
}
.chart-title{
  font-size:10px;font-weight:700;color:var(--text3);
  text-transform:uppercase;letter-spacing:.15em;margin-bottom:16px;
}
.bar-row{display:flex;align-items:flex-end;gap:5px;height:80px}
.bar-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px}
.bar-fill{width:100%;border-radius:4px 4px 0 0;background:var(--accent-dk);min-height:3px}
.bar-fill.future{background:var(--surface5)}
.bar-lbl{font-size:9px;color:var(--text3);font-weight:700;letter-spacing:.05em}
.bar-val{font-size:9px;color:var(--text2);font-weight:700}
.donut-wrap{display:flex;align-items:center;gap:16px}
.donut-legend{flex:1}
.leg-item{display:flex;align-items:center;gap:8px;margin-bottom:8px;font-size:12px;font-weight:500}
.leg-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}
.score-row{display:flex;align-items:center;justify-content:space-between}
.score-num{font-family:var(--serif);font-size:40px;color:var(--accent)}
.score-sub{font-size:12px;color:var(--text3);margin-top:2px;font-weight:500}
.meta-rows .mr{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--surface5);font-size:13px}
.meta-rows .mr:last-child{border-bottom:none}
.mr-lbl{color:var(--text3);font-weight:500}
.mr-val{font-weight:700;font-variant-numeric:tabular-nums;font-family:var(--mono)}

/* ── TAX WALLET CARD (Stitch glassmorphism) ── */
.tax-wallet-card{
  background:var(--accent-dk);border-radius:var(--radius-xl);
  padding:28px 24px;color:#fff;position:relative;overflow:hidden;
  box-shadow:0 12px 40px -8px rgba(50,83,67,.35);
}
.tax-wallet-card::after{
  content:'';position:absolute;right:-40px;bottom:-40px;
  width:160px;height:160px;background:rgba(255,255,255,.08);
  border-radius:50%;filter:blur(24px);
}
.tax-wallet-label{
  font-size:10px;font-weight:700;text-transform:uppercase;
  letter-spacing:.15em;opacity:.65;margin-bottom:14px;
}
.tax-wallet-amount{
  font-family:var(--serif);font-size:44px;color:#fff;
  line-height:1;margin-bottom:6px;
}
.tax-wallet-sub{font-size:13px;opacity:.75;margin-bottom:20px;font-weight:500}

/* ── PROFILE ── */
.profile-hero{
  background:var(--accent);padding:32px 20px 28px;
  text-align:center;flex-shrink:0;
}
.avatar{
  width:72px;height:72px;border-radius:50%;
  border:3px solid rgba(255,255,255,.3);
  background:rgba(255,255,255,.2);display:flex;align-items:center;
  justify-content:center;margin:0 auto 14px;
  font-family:var(--serif);font-size:26px;font-weight:400;color:#fff;
}
.prf-name{color:#fff;font-family:var(--serif);font-style:italic;font-size:22px}
.prf-pin{color:rgba(255,255,255,.55);font-size:11px;font-family:var(--mono);margin-top:3px}

/* ── SETTINGS GROUPS ── */
.settings-group{
  background:var(--surface2);border:none;
  border-radius:var(--radius-lg);margin:0 16px 16px;overflow:hidden;
}
.settings-group-title{
  font-size:10px;font-weight:700;color:var(--secondary);
  text-transform:uppercase;letter-spacing:.15em;
  padding:16px 18px 4px;
}
.s-item{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 18px;border-bottom:1px solid var(--surface4);
  cursor:pointer;transition:.15s background;
}
.s-item:last-child{border-bottom:none}
.s-item:active{background:var(--surface4)}
.s-left{display:flex;align-items:center;gap:14px}
.s-icon{
  width:36px;height:36px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;font-size:18px;
}
.s-label{font-size:14px;font-weight:700;color:var(--text)}
.s-sub{font-size:12px;color:var(--text3);font-weight:500;margin-top:1px}
.s-arrow{color:var(--text3)}
.s-arrow svg,.s-arrow .material-symbols-outlined{width:16px;height:16px;font-size:16px;stroke:currentColor;fill:none;stroke-width:2.5}

/* ── BILLING / PLANS ── */
.plan-card{
  background:var(--surface2);border:2px solid transparent;
  border-radius:var(--radius-lg);padding:20px;margin-bottom:10px;
  cursor:pointer;transition:.15s border-color,.15s background;position:relative;
}
.plan-card:active{transform:scale(.98)}
.plan-card.on{border-color:var(--accent);background:var(--surface)}
.plan-badge{
  position:absolute;top:-1px;right:14px;
  background:var(--accent);color:#fff;
  font-size:8px;font-weight:900;padding:3px 12px;
  border-radius:0 0 8px 8px;letter-spacing:.08em;text-transform:uppercase;
}
.plan-name{font-size:18px;font-weight:700;margin-bottom:4px;color:var(--text)}
.plan-price{
  font-family:var(--serif);font-size:30px;color:var(--accent);
  font-variant-numeric:tabular-nums;
}
.plan-price small{font-size:13px;color:var(--text3);font-family:'Satoshi',sans-serif;font-weight:500}
.plan-feats{list-style:none;margin-top:14px}
.plan-feats li{font-size:13px;color:var(--text2);padding:4px 0 4px 20px;position:relative;font-weight:500}
.plan-feats li::before{content:'✓';position:absolute;left:0;color:var(--accent);font-weight:900}

/* ── BILLING CYCLE TOGGLE ── */
.billing-cycle-row{
  display:flex;gap:8px;margin-bottom:14px;
  background:var(--surface2);border-radius:12px;padding:4px;
}
.cycle-btn{
  flex:1;padding:9px 0;border:none;border-radius:9px;font-size:13px;
  font-weight:600;cursor:pointer;background:transparent;color:var(--text2);
  transition:.15s background,.15s color;
}
.cycle-btn.on{background:var(--accent);color:#fff}
.cycle-save{
  display:inline-block;margin-left:5px;
  background:var(--accent);color:#fff;
  padding:1px 7px;border-radius:10px;
  font-size:10px;font-weight:700;letter-spacing:.3px;
}
.cycle-btn.on .cycle-save{background:rgba(255,255,255,.25)}
.plan-price .annual-note{
  display:block;font-size:11px;color:var(--accent);
  font-family:'Satoshi',sans-serif;font-weight:600;margin-top:2px;
}

/* ── AGENT ── */
.client-card{
  display:flex;align-items:center;gap:14px;
  background:var(--surface2);border:none;
  border-radius:var(--radius);padding:14px 16px;
  margin-bottom:8px;cursor:pointer;transition:.15s background;
}
.client-card:active{background:var(--surface4)}
.client-avatar{
  width:42px;height:42px;border-radius:50%;
  background:var(--accent-lt);color:var(--accent);
  display:flex;align-items:center;justify-content:center;
  font-size:15px;font-weight:700;flex-shrink:0;
  font-family:'Satoshi',sans-serif;
}
.client-body{flex:1;min-width:0}
.client-name{font-size:14px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.client-pin{font-size:11px;color:var(--text3);font-family:var(--mono)}
.client-act{font-size:11px;color:var(--text3);margin-top:2px;font-weight:500}
.health{width:10px;height:10px;border-radius:50%;flex-shrink:0}
.health.green{background:var(--accent)}
.health.amber{background:var(--secondary)}
.health.red{background:var(--danger)}

/* ── EMPTY STATE ── */
.empty{text-align:center;padding:52px 24px;color:var(--text3)}
.empty-em{font-size:44px;margin-bottom:14px;opacity:.35}
.empty-h{font-size:18px;font-weight:700;color:var(--text);margin-bottom:6px;font-family:var(--serif)}
.empty-p{font-size:14px;line-height:1.65;font-weight:400}

/* ── TOAST ── */
.toast{
  position:fixed;bottom:92px;left:50%;
  transform:translateX(-50%) translateY(10px);
  background:var(--text);color:#fff;
  padding:11px 20px;border-radius:100px;
  font-size:13px;font-weight:600;z-index:999;
  opacity:0;transition:.25s all;white-space:nowrap;pointer-events:none;
  max-width:90vw;overflow:hidden;text-overflow:ellipsis;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* ── STK PULSE ANIMATION ── */
@keyframes stkPulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.18);opacity:.8}}
.stk-pulse{font-size:48px;display:inline-block;animation:stkPulse 1.4s ease-in-out infinite}

/* ── DIVIDER ── */
.divider{border:none;border-top:1px solid var(--surface5);margin:18px 0}
.divider-text{text-align:center;position:relative;margin:18px 0}
.divider-text::before{content:'';position:absolute;left:0;right:0;top:50%;border-top:1px solid var(--surface5)}
.divider-text span{
  position:relative;background:var(--bg);
  padding:0 12px;font-size:11px;color:var(--text3);font-weight:700;
  text-transform:uppercase;letter-spacing:.1em;
}

/* ── MISC ── */
.pill{
  display:inline-flex;align-items:center;gap:5px;
  background:var(--surface4);border:none;border-radius:100px;
  padding:4px 12px;font-size:12px;font-weight:600;
}
.selected-pill{display:none;margin-bottom:12px}
.selected-pill.show{display:block}
.version-tag{
  text-align:center;font-size:10px;color:var(--text3);
  padding:16px;text-transform:uppercase;letter-spacing:.2em;font-weight:700;
}
.card{
  background:var(--surface2);border:none;
  border-radius:var(--radius-lg);padding:18px;margin-bottom:12px;
}

/* ── LOADING OVERLAY ── */
.loader-overlay{
  position:absolute;inset:0;background:rgba(255,248,243,.88);
  display:none;align-items:center;justify-content:center;
  z-index:50;flex-direction:column;gap:14px;
  backdrop-filter:blur(4px);
}
.loader-overlay.show{display:flex}
.loader-ring{
  width:40px;height:40px;
  border:3px solid var(--surface5);border-top-color:var(--accent);
  border-radius:50%;animation:spin .7s linear infinite;
}
.loader-text{font-size:13px;color:var(--text2);font-weight:600}

/* ── ONE-SCREEN INVOICE FORM ── */
.inv-section-label{
  font-size:10px;font-weight:700;color:var(--secondary);
  text-transform:uppercase;letter-spacing:.15em;
  margin:0 0 8px;
}
.inv-divider{height:1px;background:var(--surface5);margin:18px 0}

/* Progress hint (icon row for low-literacy users) */
.inv-progress-hint{
  display:flex;align-items:center;justify-content:center;
  gap:0;padding:8px 0 16px;
}
.iph{
  text-align:center;font-size:20px;line-height:1.2;
  flex:0 0 52px;padding:6px 4px;border-radius:10px;
  opacity:.4;transition:.2s opacity,.2s background;
  color:var(--text2);
}
.iph small{display:block;font-size:9px;font-weight:600;letter-spacing:.3px;
  text-transform:uppercase;margin-top:2px;font-family:'Satoshi',sans-serif}
.iph.on{opacity:1;background:var(--accent-lt);color:var(--accent)}
.iph-sep{font-size:12px;color:var(--border);padding:0 2px;align-self:center;margin-bottom:8px}

/* Industry chips */
.inv-industries{
  display:flex;gap:6px;overflow-x:auto;
  margin-bottom:14px;padding-bottom:2px;scrollbar-width:none;
}
.inv-industries::-webkit-scrollbar{display:none}
.ind-chip{
  display:inline-flex;align-items:center;gap:4px;
  padding:6px 14px;border-radius:100px;
  font-size:12px;font-weight:700;white-space:nowrap;
  border:none;background:var(--surface4);color:var(--text3);
  cursor:pointer;transition:.12s all;flex-shrink:0;
}
.ind-chip.on{background:var(--accent-dk);color:#fff}

/* Search input override */
.inv-search{
  width:100%;background:var(--surface5)!important;
  border:none;border-radius:var(--radius)!important;
  padding:14px 16px!important;font-size:15px;color:var(--text);
  outline:none;font-family:'Satoshi',sans-serif;
}

/* Amount display */
.inv-amount-display{
  display:flex;align-items:baseline;gap:8px;
  padding:12px 4px 8px;justify-content:center;
}
.inv-amount-currency{
  font-family:var(--serif);font-size:22px;
  color:var(--text3);font-style:italic;
}
.inv-amount-num{
  font-family:var(--serif);font-size:54px;color:var(--accent);
  line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-2px;
}

/* Tax row */
.inv-tax-row{
  display:flex;justify-content:space-between;
  padding:4px 4px 12px;font-size:11px;color:var(--text3);font-weight:500;
  flex-wrap:wrap;gap:4px;
}
.inv-tax-row .tax-total{color:var(--accent);font-weight:700}

/* Compact numpad */
.inv-numpad{
  display:grid;grid-template-columns:repeat(3,1fr);gap:8px;
  background:var(--surface2);padding:12px;
  border-radius:var(--radius-xl);margin-bottom:4px;
}
.inp{
  background:var(--surface);border:none;
  border-radius:var(--radius);padding:15px 8px;
  font-size:22px;font-weight:700;text-align:center;
  color:var(--text);font-family:var(--mono);
  transition:.1s all;
}
.inp:active{background:var(--accent);color:#fff;transform:scale(.93)}
.inp-del{font-size:16px;background:var(--secondary-lt);color:var(--on-secondary)}
.inp-del:active{background:var(--secondary);color:#fff}

/* Customer mode tabs */
.inv-cust-tabs{
  display:flex;gap:4px;background:var(--surface4);
  padding:3px;border-radius:100px;margin-bottom:14px;
}
.cust-tab{
  flex:1;padding:8px;border:none;border-radius:100px;
  font-size:12px;font-weight:700;background:transparent;
  color:var(--text3);transition:.15s all;cursor:pointer;
  font-family:'Satoshi',sans-serif;
}
.cust-tab.on{
  background:var(--surface);color:var(--text);
  box-shadow:0 1px 4px rgba(0,0,0,.1);
}

/* Returning customer list */
.ret-cust-list{
  background:var(--surface2);border-radius:var(--radius);
  overflow:hidden;max-height:200px;overflow-y:auto;
}
.ret-cust-item{
  display:flex;align-items:center;gap:12px;
  padding:12px 14px;border-bottom:1px solid var(--surface4);
  cursor:pointer;transition:.12s background;
}
.ret-cust-item:last-child{border-bottom:none}
.ret-cust-item:active,.ret-cust-item.on{background:var(--accent-lt)}
.ret-cust-av{
  width:34px;height:34px;border-radius:50%;
  background:var(--accent-lt);color:var(--accent);
  display:flex;align-items:center;justify-content:center;
  font-size:12px;font-weight:700;flex-shrink:0;
}

/* Payment pills */
.inv-pay-pills{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:4px}
.pay-pill{
  flex:1;min-width:68px;padding:9px 8px;
  border:1.5px solid var(--border);border-radius:100px;
  font-size:12px;font-weight:700;background:transparent;
  color:var(--text2);cursor:pointer;transition:.12s all;
  white-space:nowrap;text-align:center;font-family:'Satoshi',sans-serif;
}
.pay-pill.on{background:var(--accent);color:#fff;border-color:var(--accent)}

/* ── PROMINENT NEW RECEIPT BUTTON ── */
.btn-new-receipt{
  display:flex;align-items:center;gap:14px;
  width:100%;padding:14px 16px;border-radius:18px;
  background:#fff;
  border:none;cursor:pointer;
  box-shadow:0 4px 24px rgba(0,0,0,.13), 0 1px 4px rgba(0,0,0,.06);
  transition:.15s all;font-family:'Satoshi',sans-serif;
  text-align:left;
}
.btn-new-receipt:active{transform:scale(.98);box-shadow:0 2px 10px rgba(0,0,0,.1)}
.bnr-icon{
  width:46px;height:46px;border-radius:14px;
  background:var(--accent);
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;color:#fff;
}
.bnr-text{flex:1;min-width:0}
.bnr-label{display:block;font-size:15px;font-weight:800;color:var(--text1);line-height:1.2}
.bnr-sub{display:block;font-size:11px;color:var(--text3);margin-top:2px}
.bnr-arrow{color:var(--text3);flex-shrink:0}
/* When out of credits — tint the button */
.btn-new-receipt.no-credits .bnr-icon{background:var(--danger,#e53)}
.btn-new-receipt.no-credits .bnr-label{color:var(--danger,#e53)}

/* ── CREDIT BAR STATES ── */
#credit-bar.warn-low   { background:#fff8e1; }
#credit-bar.warn-critical { background:#fff3e0; }
#credit-bar.warn-empty { background:#fdeaea; }
#credit-bar.warn-low   #credit-num { color:#c47d00; }
#credit-bar.warn-critical #credit-num { color:#d06000; }
#credit-bar.warn-empty #credit-num { color:var(--danger,#e53); }
#credit-bar-fill.warn-low      { background:#f59e0b; }
#credit-bar-fill.warn-critical { background:#ef6c00; }
#credit-bar-fill.warn-empty    { background:var(--danger,#e53); width:100%!important; }

/* ── RESPONSIVE (tablet+) ── */
@media(min-width:430px){
  #app{
    border-left:1px solid var(--surface5);
    border-right:1px solid var(--surface5);
    box-shadow:0 0 60px rgba(30,27,24,.1);
  }
  body{background:var(--surface5)}
}
