/* ============================================================
   ANGEL GST MOBILE — Ultra Premium Light Design System
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Manrope:wght@600;700;800&display=swap');

:root {
  color-scheme: light;
  --bg: #f5f3fb;
  --bg-2: #fbfaff;
  --bg-3: #eef2fb;
  --card: rgba(255, 255, 255, .90);
  --card-2: #ffffff;
  --stroke: #4a5470;
  --stroke-2: #2f3957;
  --text: #151b31;
  --muted: #5f6885;
  --muted-2: #8b93ac;
  --brand: #5b4bdb;
  --brand-2: #8b5cf6;
  --brand-3: #0ea5e9;
  --gold: #c08a16;
  --gold-2: #9a6d0c;
  --green: #12924f;
  --green-2: #0d7a41;
  --red: #dc2626;
  --red-2: #b91c1c;
  --shadow: 0 18px 45px rgba(37, 44, 88, .10);
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 74px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button, .nav-item, .more-tile, .pick-item, .btn-primary, .btn-secondary, .bill-card, .list-card, .quick-tile { touch-action: manipulation; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100%;
  overscroll-behavior-y: none;
}

body {
  background:
    radial-gradient(900px 520px at 88% -12%, rgba(109, 94, 252, .14), transparent 62%),
    radial-gradient(720px 460px at -12% 12%, rgba(168, 85, 247, .10), transparent 62%),
    radial-gradient(760px 520px at 52% 112%, rgba(14, 165, 233, .09), transparent 62%),
    linear-gradient(180deg, #f8f6fd 0%, #f3f6fc 55%, #f7f5fc 100%);
  background-attachment: fixed;
}

button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; border: none; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 0; height: 0; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  transition: background-color 9999s ease-in-out 0s;
}

.hidden { display: none !important; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: flex-start; align-items: center;
  padding: 26px 20px calc(26px + var(--safe-b));
  position: relative; overflow-x: hidden; overflow-y: auto;
}
.login-wrap > .login-badge { margin-top: auto; }
.login-wrap > .login-foot { margin-bottom: auto; }
.aurora {
  position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0;
  animation: floaty 12s ease-in-out infinite;
}
.aurora.a { width: 340px; height: 340px; background: rgba(109, 94, 252, .22); top: -90px; left: -80px; }
.aurora.b { width: 300px; height: 300px; background: rgba(168, 85, 247, .18); bottom: -90px; right: -70px; animation-delay: -4s; }
.aurora.c { width: 220px; height: 220px; background: rgba(56, 189, 248, .14); top: 45%; right: -110px; animation-delay: -8s; }
@keyframes floaty {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -22px, 0) scale(1.08); }
}

.login-badge {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 30px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid #4a3fb0;
  color: var(--brand); font-size: 9.5px; font-weight: 900;
  letter-spacing: 1.4px; text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(37, 44, 88, .06);
  margin-bottom: 16px;
  animation: fadeUp .6s both;
}
.login-badge i { font-size: 10px; color: var(--gold); }

.brand-mark {
  width: 86px; height: 86px; border-radius: 27px; position: relative; z-index: 1;
  background: linear-gradient(145deg, #6d5efc, #8b5cf6 55%, #b8860b 135%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 20px 45px rgba(91, 75, 219, .32), inset 0 1px 0 rgba(255,255,255,.45);
  margin-bottom: 18px;
  animation: popIn .6s cubic-bezier(.2, .9, .3, 1.2) both;
}
.brand-mark i { font-size: 38px; color: #fff; filter: drop-shadow(0 3px 8px rgba(40, 30, 90, .28)); }
.brand-mark::after {
  content: ''; position: absolute; inset: -1px; border-radius: 28px;
  background: linear-gradient(160deg, rgba(255,255,255,.6), transparent 42%);
  mask: linear-gradient(#000, transparent 60%);
  -webkit-mask: linear-gradient(#000, transparent 60%);
}
@keyframes popIn { from { opacity: 0; transform: scale(.7) translateY(10px); } to { opacity: 1; transform: none; } }

.login-title {
  position: relative; z-index: 1; text-align: center; margin-bottom: 16px;
  animation: fadeUp .6s .08s both;
}
.login-title h1 {
  margin: 0; font-family: 'Manrope', 'Inter', sans-serif; font-size: 29px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(100deg, #1a1f3d 10%, #5b4bdb 55%, #b8860b 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-title p { margin: 7px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .3px; }
.login-title .gold-line { width: 54px; height: 3px; border-radius: 4px; margin: 12px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

.login-pills {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 0 0 20px;
}
.login-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: 30px;
  background: rgba(255, 255, 255, .66);
  border: 1px solid var(--stroke);
  color: var(--muted); font-size: 10.5px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(37, 44, 88, .04);
}
.login-pill i { color: var(--brand); font-size: 10px; }

.glass-card {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid #4a5470;
  border-radius: 26px;
  padding: 24px 22px;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 24px 60px rgba(37, 44, 88, .13), 0 2px 6px rgba(37, 44, 88, .05), 0 0 0 1px rgba(24, 32, 63, .045);
  animation: fadeUp .6s .14s both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.login-card-head { text-align: center; margin: 0 0 18px; }
.login-card-head h2 { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: -0.3px; color: var(--text); }
.login-card-head p { margin: 4px 0 0; font-size: 11.5px; font-weight: 600; color: var(--muted); }

.field { margin-bottom: 15px; }
.field label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.field label i { color: var(--gold); font-size: 11px; }
.input-shell {
  display: flex; align-items: center; gap: 11px;
  background: #f7f8fd;
  border: 1.5px solid #4a5470;
  border-radius: 15px; padding: 0 14px; height: 54px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-shell:focus-within {
  border-color: #4a3fb0;
  box-shadow: 0 0 0 4px rgba(91, 75, 219, .12), 0 8px 24px rgba(37, 44, 88, .08);
  background: #ffffff;
}
.input-shell > i { color: var(--muted-2); font-size: 15px; width: 18px; text-align: center; }
.input-shell input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 15px; font-weight: 600; height: 100%; min-width: 0;
}
.input-shell input::placeholder { color: var(--muted-2); font-weight: 500; }
.eye-btn { background: transparent; color: var(--muted); font-size: 15px; padding: 6px; }

.btn-primary {
  width: 100%; height: 54px; border-radius: 15px;
  background: linear-gradient(120deg, #5b4bdb 0%, #7c3aed 45%, #a855f7 100%);
  color: #fff; font-size: 15px; font-weight: 800; letter-spacing: .4px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 14px 30px #4a3fb0, inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .12s, box-shadow .2s, filter .2s;
  position: relative; overflow: hidden;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.40), transparent);
  transform: skewX(-20deg); animation: shine 3.4s infinite;
}
@keyframes shine { 0% { left: -60%; } 55%, 100% { left: 130%; } }

.login-foot { position: relative; z-index: 1; margin-top: 22px; text-align: center; color: var(--muted-2); font-size: 11px; font-weight: 600; letter-spacing: .4px; }
.login-foot b { color: var(--muted); }
.login-error {
  display: none; align-items: center; gap: 8px;
  background: #fff1f2; border: 1px solid #b91c1c;
  color: #b91c1c; font-size: 12.5px; font-weight: 700;
  padding: 10px 13px; border-radius: 12px; margin-bottom: 14px;
}
.login-error.show { display: flex; animation: shake .35s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Compact login for shorter phones — keeps the whole card visible */
@media (max-height: 760px) {
  .login-wrap { padding-top: 18px; padding-bottom: calc(18px + var(--safe-b)); }
  .login-badge { margin-bottom: 12px; padding: 6px 11px; }
  .brand-mark { width: 72px; height: 72px; border-radius: 23px; margin-bottom: 12px; }
  .brand-mark i { font-size: 32px; }
  .login-title { margin-bottom: 12px; }
  .login-title h1 { font-size: 25px; }
  .login-title p { font-size: 12px; margin-top: 5px; }
  .login-title .gold-line { margin-top: 9px; }
  .login-pills { margin-bottom: 14px; gap: 6px; }
  .login-pill { padding: 6px 9px; font-size: 9.5px; }
  .glass-card { padding: 20px 18px; border-radius: 22px; }
  .login-card-head { margin-bottom: 14px; }
  .field { margin-bottom: 12px; }
  .input-shell { height: 50px; }
  .btn-primary { height: 50px; }
  .login-foot { margin-top: 16px; }
}
@media (max-height: 640px) {
  .login-pills { display: none; }
  .brand-mark { width: 62px; height: 62px; border-radius: 20px; }
  .brand-mark i { font-size: 27px; }
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, rgba(248, 246, 253, .96), rgba(248, 246, 253, .82) 70%, rgba(248, 246, 253, 0));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.topbar .hello { flex: 1; min-width: 0; }
.topbar .hello small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted-2); }
.topbar .hello h2 { margin: 2px 0 0; font-size: 17px; font-weight: 800; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(236,253,245,.95));
  border: 1.5px solid #047857;
  color: #064e3b; font-size: 12.5px; font-weight: 900; letter-spacing: .2px;
  padding: 7px 12px; border-radius: 30px; margin-top: 5px; max-width: 100%;
  box-shadow: 0 4px 12px rgba(4,120,87,.10);
}
.company-chip i { font-size: 11px; color: #047857; }
.company-chip span { color:#064e3b; font-weight:900; }
.session-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(239,246,255,.95));
  border: 1.5px solid #1d4ed8;
  color: #0f172a; font-size: 12.5px; font-weight: 900; letter-spacing: .2px;
  padding: 7px 12px; border-radius: 30px; margin-top: 5px; max-width: 100%;
  cursor: pointer; box-shadow: 0 4px 12px rgba(37,99,235,.12);
}
.session-chip i { font-size: 12px; color: #b45309; }
.session-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; color:#0f172a; font-weight:900; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; flex-shrink: 0;
  background: rgba(255, 255, 255, .78); border: 1px solid var(--stroke);
  color: var(--text); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(37, 44, 88, .06);
  transition: background .2s, transform .12s;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.gold { color: var(--gold); border-color: #8a6408; background: rgba(192, 138, 22, .09); }

.view { flex: 1; padding: 4px 16px calc(var(--nav-h) + 34px + var(--safe-b)); max-width: 760px; width: 100%; margin: 0 auto; }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 16px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -0.5px; }
.page-head p { margin: 4px 0 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.page-head .head-icon {
  width: 46px; height: 46px; border-radius: 16px; flex-shrink: 0;
  background: linear-gradient(140deg, #4a3fb0, rgba(168, 85, 247, .08));
  border: 1px solid #4a3fb0; color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  box-shadow: 0 10px 24px rgba(91, 75, 219, .12);
}

/* Cards */
.card {
  background: linear-gradient(165deg, #ffffff, #fbfbff);
  border: 1px solid var(--stroke); border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(37, 44, 88, .07), 0 1px 2px rgba(37, 44, 88, .04);
}
.card-pad { padding: 16px; }
.section-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 900; letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted);
  margin: 22px 2px 11px;
}
.section-label i { color: var(--gold); }
.section-label .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--stroke), transparent); }
.section-label .link { color: var(--brand); font-size: 11px; letter-spacing: .4px; text-transform: none; font-weight: 800; }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.stat {
  position: relative; overflow: hidden;
  padding: 15px 14px; border-radius: 18px;
  background: linear-gradient(165deg, #ffffff, #fbfbff);
  border: 1px solid var(--stroke);
  box-shadow: 0 10px 26px rgba(37, 44, 88, .07);
}
.stat::after {
  content: ''; position: absolute; width: 90px; height: 90px; border-radius: 50%;
  right: -35px; top: -35px; background: var(--glow, #4a3fb0); filter: blur(10px);
}
.stat .s-icon {
  width: 36px; height: 36px; border-radius: 12px; font-size: 15px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
  background: var(--chip, rgba(91, 75, 219, .10)); color: var(--chip-fg, var(--brand));
  border: 1px solid var(--chip-bd, #4a3fb0);
}
.stat .s-label { font-size: 10.5px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; color: var(--muted); }
.stat .s-value { font-size: 18px; font-weight: 900; margin-top: 4px; letter-spacing: -0.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s-sub { font-size: 10.5px; font-weight: 700; color: var(--muted-2); margin-top: 3px; }
.stat.green { --glow: rgba(18, 146, 79, .16); --chip: rgba(18, 146, 79, .10); --chip-fg: #0d7a41; --chip-bd: #0d7a41; }
.stat.gold { --glow: rgba(192, 138, 22, .16); --chip: rgba(192, 138, 22, .10); --chip-fg: #8a6408; --chip-bd: #8a6408; }
.stat.blue { --glow: rgba(14, 165, 233, .14); --chip: rgba(14, 165, 233, .10); --chip-fg: #0369a1; --chip-bd: #0369a1; }
.stat.red { --glow: rgba(220, 38, 38, .12); --chip: rgba(220, 38, 38, .09); --chip-fg: #b91c1c; --chip-bd: #b91c1c; }

/* Quick actions */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px 11px; border-radius: 17px;
  background: linear-gradient(165deg, #ffffff, #fbfbff);
  border: 1px solid var(--stroke); color: var(--text);
  box-shadow: 0 8px 20px rgba(37, 44, 88, .06);
  transition: transform .12s, border-color .2s, background .2s;
}
.quick:active { transform: scale(.95); border-color: var(--stroke-2); }
.quick .q-icon {
  width: 42px; height: 42px; border-radius: 14px; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--q1, #5b4bdb), var(--q2, #8b5cf6));
  box-shadow: 0 8px 18px var(--qsh, rgba(91, 75, 219, .28));
  color: #fff;
}
.quick span { font-size: 10.5px; font-weight: 800; letter-spacing: .2px; color: #3b4360; text-align: center; line-height: 1.15; }
.quick.green { --q1: #0d7a41; --q2: #16a34a; --qsh: #0d7a41; }
.quick.gold { --q1: #9a6d0c; --q2: #d9a51f; --qsh: #8a6408; }
.quick.blue { --q1: #0369a1; --q2: #0ea5e9; --qsh: rgba(14, 165, 233, .24); }
.quick.red { --q1: #b91c1c; --q2: #ef4444; --qsh: rgba(220, 38, 38, .22); }
.quick.cyan { --q1: #0e7490; --q2: #06b6d4; --qsh: rgba(14, 116, 144, .22); }
.quick.violet { --q1: #5b21b6; --q2: #8b5cf6; --qsh: rgba(109, 40, 217, .22); }
.quick.orange { --q1: #c2410c; --q2: #fb923c; --qsh: rgba(194, 65, 12, .22); }
.quick.pink { --q1: #be185d; --q2: #f472b6; --qsh: rgba(190, 24, 93, .22); }

/* Sales / list cards */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: #ffffff; border: 1px solid var(--stroke);
  border-radius: 14px; padding: 0 14px; height: 48px; margin-bottom: 13px;
  box-shadow: 0 4px 14px rgba(37, 44, 88, .04);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.search-bar:focus-within {
  border-color: #4a3fb0;
  box-shadow: 0 0 0 3px rgba(91, 75, 219, .10);
  background: #ffffff;
}
.search-bar i { color: var(--muted-2); }
.search-bar input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text); font-size: 14px; font-weight: 600; }
.search-bar input::placeholder { color: var(--muted-2); font-weight: 500; }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.chip {
  flex-shrink: 0; padding: 8px 14px; border-radius: 30px;
  background: #ffffff; border: 1px solid var(--stroke);
  color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: .3px;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 3px 10px rgba(37, 44, 88, .03);
}
.chip.active {
  background: linear-gradient(120deg, #5b4bdb, #8b5cf6);
  border-color: transparent; color: #fff; box-shadow: 0 8px 18px rgba(91, 75, 219, .22);
}

.bill-card {
  display: flex; align-items: center; gap: 13px;
  padding: 14px; margin-bottom: 10px; border-radius: 18px;
  background: linear-gradient(165deg, #ffffff, #fcfcff);
  border: 1px solid var(--stroke);
  box-shadow: 0 8px 22px rgba(37, 44, 88, .06);
  transition: transform .12s, border-color .2s;
}
.bill-card:active { transform: scale(.99); border-color: var(--stroke-2); }
.bill-avatar {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: linear-gradient(145deg, rgba(91, 75, 219, .12), rgba(168, 85, 247, .06));
  border: 1px solid #4a3fb0; color: var(--brand);
}
.bill-main { flex: 1; min-width: 0; }
.bill-main .b-no { font-size: 13px; font-weight: 900; letter-spacing: .3px; display: flex; align-items: center; gap: 7px; }
.bill-main .b-party { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bill-main .b-date { font-size: 10.5px; font-weight: 700; color: var(--muted-2); margin-top: 3px; }
.bill-amt { text-align: right; flex-shrink: 0; }
.bill-amt .amt { font-size: 14.5px; font-weight: 900; letter-spacing: -0.2px; }
.bill-amt .badge { margin-top: 5px; }

/* Master cards (Items / Parties) — content row + symmetric action footer */
.master-card { display: block; padding: 14px; }
.master-top { display: flex; align-items: center; gap: 13px; }
.master-top .bill-main { min-width: 0; }
.master-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid #4a5470;
}
.act-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; border-radius: 11px;
  border: 1px solid #4a5470; background: #f7f8fd;
  color: #37405c; font-size: 12px; font-weight: 800; letter-spacing: .2px;
  transition: background .16s, transform .12s, border-color .16s;
}
.act-btn:active { transform: scale(.98); background: #eef1f9; }
.act-btn i { font-size: 11px; }
.act-btn.danger {
  color: var(--red); border-color: #b91c1c;
  background: rgba(220, 38, 38, .06);
}
.act-btn.danger:active { background: rgba(220, 38, 38, .11); }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9px; font-weight: 900; letter-spacing: .7px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px;
  background: rgba(18, 146, 79, .10); border: 1px solid #0d7a41; color: var(--green-2);
}
.badge.gold { background: rgba(192, 138, 22, .10); border-color: #8a6408; color: #8a6408; }
.badge.blue { background: rgba(14, 165, 233, .10); border-color: #0369a1; color: #0369a1; }

/* Empty / skeleton */
.empty { text-align: center; padding: 46px 20px; color: var(--muted-2); }
.empty .e-icon {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 24px;
  background: #f4f6fb; border: 1px solid var(--stroke);
  display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--muted-2);
}
.empty h3 { margin: 0 0 5px; font-size: 15px; color: var(--muted); font-weight: 800; }
.empty p { margin: 0; font-size: 12px; font-weight: 600; }
.skeleton { border-radius: 16px; height: 74px; margin-bottom: 10px; background: linear-gradient(100deg, #f1f3f9 30%, #fbfbfe 50%, #f1f3f9 70%); background-size: 220% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -120% 0; } }

/* FAB */
.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + var(--safe-b)); z-index: 45;
  width: 58px; height: 58px; border-radius: 20px;
  background: linear-gradient(140deg, #5b4bdb, #8b5cf6);
  color: #fff; font-size: 21px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 34px rgba(91, 75, 219, .32), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .14s;
}
.fab:active { transform: scale(.92) rotate(90deg); }

/* Bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--nav-h) + var(--safe-b)); padding: 8px 10px var(--safe-b);
  display: flex; align-items: stretch; justify-content: space-around; gap: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .98));
  border-top: 1px solid var(--stroke);
  box-shadow: 0 -8px 30px rgba(37, 44, 88, .06);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}
.nav-item {
  flex: 1; max-width: 92px; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: transparent; color: var(--muted-2); font-size: 9.5px; font-weight: 800; letter-spacing: .3px;
  position: relative; transition: color .2s;
}
.nav-item i { font-size: 17px; transition: transform .2s; }
.nav-item.active { color: var(--brand); }
.nav-item.active i { transform: translateY(-1px); }
.nav-item.active::before {
  content: ''; position: absolute; inset: 2px 6px;
  border-radius: 14px; z-index: -1;
  background: linear-gradient(140deg, rgba(91, 75, 219, .12), rgba(168, 85, 247, .05));
  border: 1px solid #4a3fb0;
  box-shadow: 0 6px 16px rgba(91, 75, 219, .08);
}
.nav-item.active i { color: var(--brand); }

/* Immersive pages (e.g. new sale) hide the bottom nav */
.app-shell.no-nav .bottom-nav { display: none; }
.app-shell.no-nav .view { padding-bottom: calc(104px + var(--safe-b)); }
.app-shell.no-nav .topbar { padding-bottom: 6px; }

/* Details / accordion polish */
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary i.fa-chevron-down { transition: transform .22s; }
details.card[open] > summary i.fa-chevron-down { transform: rotate(180deg); }

/* ============================================================
   SALE FORM
   ============================================================ */
.form-card { padding: 15px; margin-bottom: 12px; }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; min-width: 0; }
.field-sm { margin-bottom: 12px; }
.field-sm label {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 6px;
}
.field-sm label i { color: var(--gold); font-size: 9.5px; }
.inp {
  width: 100%; height: 46px; border-radius: 13px; padding: 0 12px;
  background: #ffffff; border: 1.5px solid #4a5470;
  color: var(--text); font-size: 14px; font-weight: 700; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.inp:focus { border-color: #4a3fb0; box-shadow: 0 0 0 3px rgba(91, 75, 219, .10); }
.inp::placeholder { color: var(--muted-2); font-weight: 500; }
.inp[readonly] { color: var(--muted); background: #f7f8fd; }
select.inp { appearance: none; }
.picker-btn {
  width: 100%; min-height: 46px; border-radius: 13px; padding: 8px 12px;
  background: #ffffff; border: 1.5px solid #4a5470;
  color: var(--text); text-align: left; display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 700;
}
.picker-btn .ph { color: var(--muted-2); font-weight: 500; }
.picker-btn i.lead { color: var(--gold); font-size: 13px; }
.picker-btn .chev { margin-left: auto; color: var(--muted-2); font-size: 12px; }

.item-card {
  border-radius: 17px; padding: 13px; margin-bottom: 10px;
  background: linear-gradient(165deg, #ffffff, #fcfcff);
  border: 1px solid var(--stroke);
  box-shadow: 0 6px 18px rgba(37, 44, 88, .05);
  animation: fadeUp .25s both;
}
.item-card .ic-top { display: flex; align-items: flex-start; gap: 10px; }
.item-card .ic-idx {
  width: 26px; height: 26px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(145deg, #4a3fb0, rgba(168, 85, 247, .07));
  border: 1px solid #4a3fb0; color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900;
}
.item-card .ic-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 900; letter-spacing: .1px; }
.item-card .ic-name small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-card .ic-rm {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: rgba(220, 38, 38, .07); border: 1px solid #b91c1c; color: var(--red); font-size: 12px;
}
.item-card .ic-grid { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 8px; margin-top: 11px; }
.item-card .ic-grid .lbl { font-size: 9px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase; color: var(--muted-2); margin-bottom: 4px; }
.item-card .mini {
  width: 100%; height: 40px; border-radius: 11px; padding: 0 10px;
  background: #ffffff; border: 1.5px solid #4a5470;
  color: var(--text); font-size: 13px; font-weight: 800; outline: none; text-align: right;
}
.item-card .mini:focus { border-color: #4a3fb0; }
.item-card .amt-box {
  height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: flex-end;
  padding: 0 10px; font-size: 13px; font-weight: 900;
  background: rgba(18, 146, 79, .08);
  border: 1px solid #0d7a41; color: var(--green-2);
  white-space: nowrap; overflow: hidden;
}
.orig-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.orig-row .o-lbl { font-size: 10px; font-weight: 800; color: var(--muted-2); letter-spacing: .5px; text-transform: uppercase; }
.orig-row .o-inp {
  flex: 1; height: 36px; border-radius: 10px; padding: 0 10px; text-align: right;
  background: #fffdf7; border: 1.5px dashed #8a6408;
  color: #8a6408; font-size: 12.5px; font-weight: 800; outline: none;
}
.add-item-btn {
  width: 100%; height: 46px; border-radius: 14px;
  background: rgba(91, 75, 219, .07); border: 1.5px dashed #4a3fb0;
  color: var(--brand); font-size: 12.5px; font-weight: 900; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 4px;
}
.add-item-btn:active { background: rgba(91, 75, 219, .12); }

.totals-card { padding: 15px; }
.tot-line { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 5px 0; }
.tot-line b { color: var(--text); font-weight: 800; }
.tot-line.green b { color: var(--green-2); }
.tot-line.red b { color: var(--red); }
.tot-divider { height: 1px; background: linear-gradient(90deg, var(--stroke), transparent); margin: 8px 0; }
.grand-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding: 13px 15px; border-radius: 16px;
  background: linear-gradient(120deg, rgba(91, 75, 219, .12), rgba(168, 85, 247, .06));
  border: 1px solid #4a3fb0;
  box-shadow: 0 10px 26px rgba(91, 75, 219, .08);
}
.grand-bar .g-lbl { font-size: 10.5px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; color: var(--brand); }
.grand-bar .g-val { font-size: 21px; font-weight: 900; letter-spacing: -0.6px; }

.sticky-save {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 11px 16px calc(11px + var(--safe-b));
  background: linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .98) 45%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--stroke);
  box-shadow: 0 -8px 30px rgba(37, 44, 88, .06);
  display: flex; align-items: center; gap: 12px;
}
.sticky-save .ss-total { flex: 1; min-width: 0; }
.sticky-save .ss-total small { display: block; font-size: 9.5px; font-weight: 900; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted-2); }
.sticky-save .ss-total div { font-size: 19px; font-weight: 900; letter-spacing: -0.4px; white-space: nowrap; }
.sticky-save .btn-primary { width: auto; padding: 0 22px; height: 50px; flex-shrink: 0; }

/* ============================================================
   BOTTOM SHEET / MODALS
   ============================================================ */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(23, 28, 50, .34); backdrop-filter: blur(5px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 720px; max-height: 86vh; max-height: 86dvh;
  background: linear-gradient(180deg, #ffffff, #fbfbff);
  border: 1px solid var(--stroke-2); border-bottom: none;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 60px rgba(37, 44, 88, .18);
  display: flex; flex-direction: column;
  animation: sheetUp .28s cubic-bezier(.2,.9,.3,1.05) both;
  padding-bottom: var(--safe-b);
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 44px; height: 4px; border-radius: 4px; background: #dfe3ef; margin: 10px auto 4px; }
.sheet-head { display: flex; align-items: center; gap: 11px; padding: 8px 18px 12px; border-bottom: 1px solid var(--stroke); }
.sheet-head h3 { margin: 0; font-size: 16px; font-weight: 900; flex: 1; letter-spacing: -0.2px; }
.sheet-head .sh-icon {
  width: 36px; height: 36px; border-radius: 12px; font-size: 14px;
  background: linear-gradient(145deg, #4a3fb0, rgba(168, 85, 247, .07));
  border: 1px solid #4a3fb0; color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.sheet-body { padding: 14px 18px 20px; overflow-y: auto; }
.sheet-close { width: 34px; height: 34px; border-radius: 11px; background: #f4f6fb; border: 1px solid var(--stroke); color: var(--muted); font-size: 13px; }

.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-item {
  display: flex; align-items: center; gap: 14px; padding: 16px 14px; min-height: 72px; border-radius: 16px;
  background: #ffffff; border: 1px solid var(--stroke);
  color: var(--text); text-align: left; width: 100%;
  box-shadow: 0 4px 14px rgba(37, 44, 88, .04);
  transition: background .18s, border-color .18s;
}
.pick-item:active { background: #f8f9fe; border-color: var(--stroke-2); }
.pick-item .pi-icon {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: rgba(91, 75, 219, .09); border: 1px solid #4a3fb0; color: var(--brand);
}
.pick-item .pi-main { flex: 1; min-width: 0; }
.pick-item .pi-main b { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-item .pi-main small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-item .pi-right { font-size: 12px; font-weight: 900; color: var(--green-2); flex-shrink: 0; }
.pick-step {
  display: flex; align-items: center; gap: 8px; margin-bottom: 11px;
  font-size: 10.5px; font-weight: 800; color: var(--muted-2); letter-spacing: .5px; text-transform: uppercase;
}
.pick-step .ps-chip {
  padding: 4px 10px; border-radius: 20px; background: rgba(91, 75, 219, .08);
  border: 1px solid #4a3fb0; color: var(--brand);
}
.pick-step .ps-chip.done { background: rgba(18, 146, 79, .08); border-color: #0d7a41; color: var(--green-2); }

/* Toast */
.toast-wrap { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 26px + var(--safe-b)); transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; width: calc(100% - 32px); max-width: 420px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 15px;
  background: #ffffff; border: 1px solid #0d7a41;
  color: #173a2a; font-size: 12.5px; font-weight: 700;
  box-shadow: 0 16px 36px rgba(37, 44, 88, .16);
  animation: toastIn .28s cubic-bezier(.2,.9,.3,1.1) both;
}
.toast i { color: var(--green); font-size: 15px; }
.toast.error { background: #ffffff; border-color: #b91c1c; color: #5b1520; }
.toast.error i { color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

/* Confirm dialog */
.dialog-backdrop { position: fixed; inset: 0; z-index: 130; background: rgba(23, 28, 50, .38); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 22px; animation: fadeIn .18s both; }
.dialog {
  width: 100%; max-width: 360px; border-radius: 24px; padding: 22px;
  background: linear-gradient(170deg, #ffffff, #fbfbff);
  border: 1px solid var(--stroke-2); box-shadow: 0 24px 60px rgba(37, 44, 88, .22);
  text-align: center; animation: popIn .25s both;
}
.dialog .d-icon { width: 54px; height: 54px; border-radius: 18px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 21px; background: rgba(91, 75, 219, .09); border: 1px solid #4a3fb0; color: var(--brand); }
.dialog h3 { margin: 0 0 7px; font-size: 16px; font-weight: 900; }
.dialog p { margin: 0 0 18px; font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.45; }
.dialog .d-actions { display: flex; gap: 10px; }
.dialog .d-actions button { flex: 1; height: 46px; border-radius: 13px; font-size: 12.5px; font-weight: 900; letter-spacing: .3px; }
.dialog .d-cancel { background: #f4f6fb; border: 1px solid var(--stroke); color: var(--muted); }
.dialog .d-ok { background: linear-gradient(120deg, #5b4bdb, #8b5cf6); color: #fff; box-shadow: 0 10px 22px rgba(91, 75, 219, .22); }

/* Print modal */
.print-backdrop { position: fixed; inset: 0; z-index: 140; background: rgba(23, 28, 50, .55); display: flex; flex-direction: column; animation: fadeIn .2s both; }
.print-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--stroke); background: rgba(255, 255, 255, .96); }
.print-top h3 { margin: 0; flex: 1; font-size: 14px; font-weight: 900; }
.print-top .icon-btn { width: 38px; height: 38px; border-radius: 12px; }
.print-frame-wrap { flex: 1; background: #e9edf5; overflow: hidden; }
.print-frame-wrap iframe { width: 100%; height: 100%; border: none; background: #fff; }
.print-copies { display: flex; gap: 6px; padding: 9px 14px calc(9px + var(--safe-b)); overflow-x: auto; background: rgba(255, 255, 255, .98); border-top: 1px solid var(--stroke); }
.print-copies .chip { font-size: 10.5px; padding: 7px 11px; }

/* More page tiles */
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-tile {
  padding: 15px 8px 12px; border-radius: 17px; text-align: center;
  background: linear-gradient(165deg, #ffffff, #fcfcff);
  border: 1px solid var(--stroke); color: var(--text);
  box-shadow: 0 6px 18px rgba(37, 44, 88, .05);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.more-tile:active { transform: scale(.96); }
.more-tile .mt-icon {
  width: 42px; height: 42px; border-radius: 14px; font-size: 16px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--q1, #5b4bdb), var(--q2, #8b5cf6));
  box-shadow: 0 8px 18px var(--qsh, rgba(91, 75, 219, .24));
}
.more-tile span { font-size: 10.5px; font-weight: 800; color: #3b4360; line-height: 1.2; }
.more-foot {
  display: flex; align-items: center; gap: 12px;
  margin-top: 18px; padding: 14px 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--stroke);
  box-shadow: 0 6px 18px rgba(37, 44, 88, .04);
}
.more-foot .mf-icon {
  width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: rgba(18, 146, 79, .08);
  border: 1px solid #0d7a41;
  color: var(--green-2);
}
.more-foot b { display: block; font-size: 12.5px; font-weight: 900; }
.more-foot small { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.4; }

/* Utility */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; } .mt-14 { margin-top: 14px; } .mt-20 { margin-top: 20px; }
.muted { color: var(--muted); } .tiny { font-size: 11px; font-weight: 600; }
.center { text-align: center; }
.loading-inline { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 620px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-grid { grid-template-columns: repeat(8, 1fr); }
}


/* Premium form system */
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 420px) { .form-grid { grid-template-columns: 1fr; } .form-grid .full { grid-column: auto; } }
label.field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
label.field > span.lbl, label.field { font-size: 11px; font-weight: 800; color: #4a5470; letter-spacing: .2px; }
label.field { font-size: 11px; font-weight: 800; color: #4a5470; }
label.field input, label.field select, label.field textarea,
.field-input {
  width: 100%; padding: 12px 13px; border-radius: 14px;
  border: 1px solid #4a5470;
  background: #ffffff;
  color: var(--text); font-size: 14px; font-weight: 600;
  outline: none; transition: border-color .18s, box-shadow .18s, background .18s;
}
label.field input::placeholder, label.field textarea::placeholder { color: var(--muted-2); font-weight: 500; }
label.field input:focus, label.field select:focus, label.field textarea:focus {
  border-color: #4a3fb0;
  box-shadow: 0 0 0 3px rgba(91, 75, 219, .10);
  background: #ffffff;
}
label.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8b93ac 50%), linear-gradient(135deg, #8b93ac 50%, transparent 50%); background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px); background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
.form-section { margin: 14px 0 8px; padding: 10px 12px; border-radius: 14px; background: #f7f8fd; border: 1px solid #4a5470; display:flex; align-items:center; gap:8px; font-size:11px; font-weight:900; letter-spacing:.5px; text-transform:uppercase; color:#4a5470; }
.form-section i { color: var(--gold); }
.sheet-body .btn-primary { width: 100%; justify-content: center; padding: 14px 16px; font-size: 15px; border-radius: 16px; }
.form-hint { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* Buttons */
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: 14px; border: 1px solid #4a5470;
  background: #ffffff; color: var(--text); font-weight: 800; font-size: 13px;
}
.btn-secondary:active { transform: scale(.98); background: #f4f6fb; }
.btn-secondary.sm { padding: 8px 12px; border-radius: 12px; font-size: 12px; gap: 6px; }
.btn-add-premium {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: 14px; border: none; color: #fff;
  font-weight: 900; font-size: 13px; letter-spacing: .1px;
  background: linear-gradient(135deg, #5b4bdb 0%, #8b5cf6 55%, #c08a16 140%);
  box-shadow: 0 10px 22px rgba(91, 75, 219, .24), inset 0 1px 0 rgba(255,255,255,.30);
}
.btn-add-premium:active { transform: scale(.97); }
.btn-add-premium i { font-size: 12px; }
.page-head-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ============================================================
   LIST TOOLBAR (search + primary action) — used by every module list
   ============================================================ */
.list-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
}
.search-shell {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--stroke);
  box-shadow: 0 4px 14px rgba(37, 44, 88, .04);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.search-shell:focus-within {
  border-color: #4a3fb0;
  box-shadow: 0 0 0 3px rgba(91, 75, 219, .10);
  background: #ffffff;
}
.search-shell > i { color: var(--muted-2); font-size: 14px; flex-shrink: 0; }
.search-shell input {
  flex: 1; min-width: 0; height: 100%;
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 14px; font-weight: 600;
}
.search-shell input::placeholder { color: var(--muted-2); font-weight: 500; }

.btn-add {
  flex: 0 0 auto; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 48px; padding: 0 16px; border-radius: 14px; border: none;
  color: #fff; font-size: 13px; font-weight: 900; letter-spacing: .2px;
  background: linear-gradient(135deg, #5b4bdb 0%, #8b5cf6 100%);
  box-shadow: 0 8px 20px rgba(91, 75, 219, .26), inset 0 1px 0 rgba(255, 255, 255, .30);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn-add:active { transform: scale(.97); box-shadow: 0 4px 12px rgba(91, 75, 219, .24); }
.btn-add i { font-size: 12px; }

/* Voucher list rows (genericList) */
.row-actions {
  display: flex; gap: 8px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid #4a5470;
}
.row-actions .act-btn { flex: 1; min-width: 0; }
.row-actions .act-btn:only-child { flex: 0 0 auto; padding: 0 20px; margin-left: auto; }
.item-act-btn {
  width: 32px; height: 32px; padding: 0 !important;
  border-radius: 10px; font-size: 11.5px; flex-shrink: 0;
}

/* Danger confirm */
.dialog .d-ok.danger { background: linear-gradient(120deg, #ef4444, #dc2626); color: #fff; box-shadow: 0 10px 22px rgba(220, 38, 38, .26); }

/* Prevent iOS/Android from auto-zooming focused fields (below 16px mobile
   browsers zoom, which makes the caret and layout jump while typing). Target
   touch devices specifically so desktop styling stays unchanged. */
@media (hover: none) and (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
}

/* Hide buttons when printing */
@media print { button, .btn-primary, .btn-secondary, .icon-btn { display: none !important; } }

/* Ledger tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ledger-table th, .ledger-table td { padding: 8px 6px; border-bottom: 1px solid #4a5470; white-space: nowrap; }
.ledger-table thead th { font-size: 10px; font-weight: 800; color: #4a5470; text-transform: uppercase; letter-spacing: .3px; background: #f3f4f6; }
.ledger-table tbody tr:last-child td { border-bottom: none; }

/* === Father Dedication Ribbon (mobile top) === */
.tribute-ribbon{display:flex;align-items:center;justify-content:center;gap:8px;width:fit-content;max-width:calc(100% - 12px);margin:calc(5px + env(safe-area-inset-top, 0px)) auto 5px;padding:5px 14px;background:linear-gradient(90deg,#fde68a 0%,#fbcfe8 22%,#bfdbfe 45%,#bbf7d0 68%,#fed7aa 100%);border:1.5px solid #1f2937;border-radius:999px;box-shadow:0 6px 18px rgba(31,41,55,.12),inset 0 1px 0 rgba(255,255,255,.7);white-space:nowrap;overflow:hidden;position:relative;z-index:1000}
.tribute-ribbon::before{content:"";position:absolute;inset:0;border-radius:999px;background:linear-gradient(120deg,transparent 0%,rgba(255,255,255,.35) 45%,rgba(255,255,255,.55) 50%,rgba(255,255,255,.35) 55%,transparent 100%);background-size:220% 100%;animation:tributeSheen 7s linear infinite;pointer-events:none}
.tribute-text{font-family:'Manrope','Inter',Georgia,serif;font-weight:800;font-size:clamp(9.5px,2.55vw,12.5px);letter-spacing:.3px;line-height:1.2;color:#111827;background:none;-webkit-background-clip:border-box;background-clip:border-box;-webkit-text-fill-color:#111827;text-shadow:none;animation:none;position:relative;z-index:1}
.tribute-ribbon .feather{color:#111827;font-size:clamp(11px,2.8vw,14px);display:inline-flex;align-items:center;justify-content:center;filter:drop-shadow(0 1px 1px rgba(255,255,255,.35));position:relative;z-index:1}
.tribute-ribbon .feather-l{animation:featherFloatL 3.4s ease-in-out infinite}
.tribute-ribbon .feather-r{animation:featherFloatR 3.4s ease-in-out infinite}
@keyframes featherFloatL{0%,100%{transform:translateY(0) rotate(-18deg)}50%{transform:translateY(-2px) rotate(-8deg) scale(1.06)}}
@keyframes featherFloatR{0%,100%{transform:translateY(0) rotate(18deg) scaleX(-1)}50%{transform:translateY(-2px) rotate(8deg) scaleX(-1) scale(1.06)}}
@keyframes tributeSheen{0%{background-position:220% 0}100%{background-position:-220% 0}}
/* ===== Financial Year / Session - Ultra Premium ===== */
.fy-active-card,.fy-form-card,.fy-list-card,.fy-suggest-card{
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,255,.94));
  border: 1px solid rgba(74,84,112,.18);
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(37,44,88,.08);
  padding: 16px;
  margin-bottom: 14px;
  overflow: hidden;
}
.fy-active-card{ background: linear-gradient(135deg, rgba(91,75,219,.10), rgba(14,165,233,.06) 45%, rgba(255,255,255,.96)); border-color: rgba(91,75,219,.20); }
.fy-active-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.fy-active-label{ font-size:12px; font-weight:800; letter-spacing:.4px; text-transform:uppercase; color:var(--brand); display:flex; align-items:center; gap:8px; }
.fy-active-name{ font-size:22px; line-height:1.2; font-weight:800; color:var(--text); letter-spacing:-.3px; margin-bottom:6px; word-break:break-word; }
.fy-active-meta{ font-size:12.5px; color:var(--muted); font-weight:600; }
.fy-active-meta i{ color:var(--brand); margin-right:4px; }
.fy-pill{ display:inline-flex; align-items:center; justify-content:center; padding:5px 10px; border-radius:999px; font-size:10px; font-weight:900; letter-spacing:.6px; white-space:nowrap; border:1px solid transparent; }
.fy-pill.ok{ background:rgba(18,146,79,.10); color:var(--green); border-color:rgba(18,146,79,.22); }
.fy-pill.warn{ background:rgba(220,38,38,.08); color:var(--red); border-color:rgba(220,38,38,.18); }
.fy-pill.idle{ background:rgba(95,104,133,.08); color:var(--muted); border-color:rgba(95,104,133,.18); }

.fy-section-head{ display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.fy-section-icon{ width:42px; height:42px; border-radius:14px; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg, var(--brand), var(--brand-2)); color:#fff; font-size:16px; box-shadow:0 8px 20px rgba(91,75,219,.28); flex-shrink:0; }
.fy-section-icon.alt{ background:linear-gradient(135deg,#0ea5e9,#2563eb); box-shadow:0 8px 20px rgba(14,165,233,.24); }
.fy-section-title{ font-size:16px; font-weight:800; color:var(--text); line-height:1.2; }
.fy-section-sub{ font-size:12px; color:var(--muted); font-weight:600; margin-top:2px; }

.fy-form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.fy-field{ display:flex; flex-direction:column; gap:6px; min-width:0; }
.fy-field.fy-full{ grid-column:1 / -1; }
.fy-field > span{ font-size:12px; font-weight:800; color:#334155; letter-spacing:.2px; }
.fy-form-card .f-input{ width:100%; min-width:0; border:1px solid rgba(74,84,112,.24); background:#fff; border-radius:14px; padding:13px 14px; font-size:14px; font-weight:600; color:var(--text); outline:none; transition:border-color .2s, box-shadow .2s; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.fy-form-card .f-input:focus{ border-color:rgba(91,75,219,.55); box-shadow:0 0 0 4px rgba(91,75,219,.10); }
.fy-form-card input[type=date].f-input{ min-height:48px; }

.fy-check{ display:flex; align-items:flex-start; gap:10px; margin:14px 0; padding:12px 13px; border-radius:14px; background:rgba(91,75,219,.04); border:1px solid rgba(91,75,219,.10); }
.fy-check input{ width:20px; height:20px; margin-top:1px; accent-color:var(--brand); flex-shrink:0; }
.fy-check span{ display:flex; flex-direction:column; gap:2px; font-size:13px; color:var(--text); line-height:1.35; }
.fy-check small{ font-size:11.5px; color:var(--muted); font-weight:600; }
.fy-submit{ width:100%; min-height:50px; border-radius:14px; font-size:14px; font-weight:800; display:flex; align-items:center; justify-content:center; gap:10px; box-shadow:0 12px 24px rgba(91,75,219,.22); }

.fy-session-list{ display:flex; flex-direction:column; gap:10px; }
.fy-session-item{ background:#fff; border:1px solid rgba(74,84,112,.14); border-radius:16px; padding:14px; box-shadow:0 4px 14px rgba(37,44,88,.04); }
.fy-session-item.active{ border-color:rgba(18,146,79,.28); background:linear-gradient(180deg, rgba(18,146,79,.04), #fff 40%); }
.fy-session-main{ display:flex; align-items:center; gap:12px; }
.fy-session-icon{ width:42px; height:42px; border-radius:13px; background:rgba(91,75,219,.08); color:var(--brand); display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.fy-session-item.active .fy-session-icon{ background:rgba(18,146,79,.10); color:var(--green); }
.fy-session-info{ flex:1; min-width:0; }
.fy-session-name{ font-size:15px; font-weight:800; color:var(--text); line-height:1.25; word-break:break-word; }
.fy-session-date{ font-size:12px; color:var(--muted); font-weight:600; margin-top:4px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.fy-session-date .sep{ color:var(--muted-2); }
.fy-session-status{ flex-shrink:0; }
.fy-session-actions{ margin-top:12px; padding-top:12px; border-top:1px dashed rgba(74,84,112,.16); display:flex; align-items:center; justify-content:space-between; gap:10px; }
.fy-current-note{ font-size:12px; font-weight:700; color:var(--green); display:flex; align-items:center; gap:6px; }
.fy-activate-btn{ margin-left:auto; border:none; background:linear-gradient(135deg,#ffffff,#f8fafc); color:var(--brand); border:1px solid rgba(91,75,219,.20); padding:10px 14px; border-radius:12px; font-size:12.5px; font-weight:800; display:inline-flex; align-items:center; gap:8px; cursor:pointer; box-shadow:0 4px 12px rgba(91,75,219,.08); }
.fy-activate-btn:active{ transform:translateY(1px); }

.fy-suggest-card{ border-color:rgba(192,138,22,.28); background:linear-gradient(135deg, rgba(192,138,22,.10), rgba(255,255,255,.96)); }
.fy-suggest-head{ display:flex; gap:12px; align-items:flex-start; margin-bottom:10px; }
.fy-suggest-icon{ width:40px;height:40px;border-radius:12px;background:rgba(192,138,22,.14);color:var(--gold);display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.fy-suggest-title{ font-size:14px; font-weight:800; color:var(--text); }
.fy-suggest-sub{ font-size:12px; color:var(--muted); font-weight:600; margin-top:2px; }
.fy-suggest-body{ font-size:14px; color:#334155; font-weight:600; margin-bottom:12px; }
.fy-suggest-body b{ color:var(--text); }
.fy-suggest-actions{ display:flex; gap:10px; }
.fy-btn{ flex:1; min-height:44px; border-radius:12px; font-size:13px; font-weight:800; display:flex; align-items:center; justify-content:center; gap:8px; }
.fy-btn-ghost{ flex:0 0 auto; border:1px solid rgba(74,84,112,.20); background:#fff; color:var(--text); padding:0 14px; border-radius:12px; font-size:13px; font-weight:800; display:flex; align-items:center; gap:8px; }

@media (max-width: 420px){
  .fy-form-grid{ grid-template-columns:1fr 1fr; gap:10px; }
  .fy-field > span{ font-size:11.5px; }
  .fy-form-card .f-input{ padding:12px; font-size:13px; }
  .fy-active-name{ font-size:20px; }
  .fy-session-main{ align-items:flex-start; }
  .fy-session-status{ margin-left:auto; }
}
@media (max-width: 360px){
  .fy-form-grid{ grid-template-columns:1fr; }
  .fy-field.fy-full{ grid-column:auto; }
  .fy-suggest-actions{ flex-direction:column; }
  .fy-btn-ghost{ min-height:44px; justify-content:center; }
}
