/* =====================================================================
   Damal Cash Book — modern, phone-first. Brand blue + orange (from the logo), soft cards, big
   touch targets. Loaded after Bootstrap 5 (grid, forms, utilities).
   ===================================================================== */
:root {
  --brand: #0a6ad8;          /* Damal blue */
  --brand-ink: #0757b4;
  --brand-soft: #e8f1fd;
  --indigo: #4f46e5;
  --indigo-soft: #eef0ff;
  --accent: #f7931e;          /* Damal orange */
  --accent-soft: #fff6e5;
  --in: #0f9d72;
  --out: #e0475b;
  --out-soft: #fdecee;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6eaf0;
  --paper: #f4f6fa;
  --card: #ffffff;
  --grad: linear-gradient(135deg, #0a7cf0 0%, #0757b4 100%);
  --grad-soft: linear-gradient(135deg, #e8f1fd 0%, #fff3e6 100%);
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .35);
  --font: "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-link-color-rgb: 11, 107, 79;
  --bs-border-radius: var(--r-sm);
}
body { font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); }
h1, h2, h3, h4 { letter-spacing: -.02em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small-caps { font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.ico { width: 1.25em; height: 1.25em; flex: 0 0 auto; vertical-align: -.22em; }
.skip-link { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: #fff; padding: .5rem 1rem; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--accent) !important; outline-offset: 2px; box-shadow: none !important; }

/* ---------- buttons ---------- */
.btn { border-radius: var(--r-sm); font-weight: 650; padding: .62rem 1.05rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.btn-lg { padding: .85rem 1.3rem; border-radius: 14px; font-size: 1.05rem; }
.btn-sm { padding: .38rem .75rem; border-radius: 10px; }
.btn-brand, .btn-primary { background: var(--brand); color: #fff; border: 0; }
.btn-brand:hover, .btn-brand:focus, .btn-primary:hover { background: var(--brand-ink); color: #fff; }
.btn-grad { background: var(--grad); color: #fff; border: 0; box-shadow: 0 10px 24px -10px rgba(10, 106, 216, .8); }
.btn-grad:hover { color: #fff; filter: brightness(1.05); }
.btn-outline-brand { border: 1.5px solid var(--line); color: var(--ink); background: #fff; }
.btn-outline-brand:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.btn-in { background: var(--in); color: #fff; border: 0; }
.btn-in:hover { background: var(--brand-ink); color: #fff; }
.btn-out { background: var(--out); color: #fff; border: 0; }
.btn-out:hover { background: #c23246; color: #fff; }
.btn-wa { background: #25d366; color: #073d1f; border: 0; }
.btn-wa:hover { background: #1fbd5a; color: #062e18; }
.btn-ghost { background: transparent; border: 0; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: rgba(15, 23, 42, .05); }
.btn-white { background: #fff; color: var(--ink); border: 0; }
.btn-white:hover { background: #f1f5f9; }
.btn-glass { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.link-void { color: var(--muted); text-decoration: underline; font-size: .85rem; background: none; border: 0; padding: 0; }
.link-void:hover { color: var(--out); }

/* ---------- forms ---------- */
.form-label { font-weight: 650; font-size: .92rem; color: var(--ink-2); margin-bottom: .35rem; }
.form-control, .form-select { border-radius: var(--r-sm); border: 1.5px solid var(--line); padding: .68rem .9rem; background-color: #fff; }
.form-control-lg, .form-select-lg { padding: .8rem 1rem; border-radius: 14px; }
.form-control-sm, .form-select-sm { padding: .4rem .65rem; border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(10, 106, 216, .14); }
.amount-input { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; padding: .7rem 1rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon .form-control { padding-left: 2.5rem; }

/* ---------- cards & bits ---------- */
.card-box { background: var(--card); border-radius: var(--r-lg); padding: 1.15rem 1.25rem; box-shadow: var(--shadow); border: 1px solid rgba(15, 23, 42, .03); }
.card-box.p-0 { overflow: hidden; }
.card-label { font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: .25rem; }
.card-big { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; }
.card-current { outline: 2px solid var(--brand); }
.page-title { font-size: 1.55rem; font-weight: 800; margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.section-h { font-size: 1.05rem; font-weight: 750; margin: 1.6rem 0 .8rem; }
.notice { border-radius: var(--r-md); padding: .85rem 1.05rem; margin-bottom: 1rem; border: 1px solid; }
.notice-wait { background: var(--accent-soft); border-color: #fbd38d; color: #7a4d00; }
.notice-warn { background: var(--out-soft); border-color: #f7c2ca; color: #8a1c2c; }
.notice-ok { background: var(--brand-soft); border-color: #b5e7d5; color: var(--brand-ink); }
.flash { border-radius: var(--r-md); border: 0; box-shadow: var(--shadow); }
.alert { border-radius: var(--r-md); }
.badge-status { display: inline-flex; align-items: center; gap: .25rem; font-size: .74rem; font-weight: 700; padding: .18rem .6rem; border-radius: 999px; white-space: nowrap; }
.badge-ok { background: var(--brand-soft); color: var(--brand-ink); }
.badge-wait { background: var(--accent-soft); color: #8a5500; }
.badge-bad { background: var(--out-soft); color: #b42339; }
.badge-neutral { background: #eef2f6; color: var(--muted); }
.amt { font-weight: 750; font-variant-numeric: tabular-nums; }
.amt.in { color: var(--in); }
.amt.out { color: var(--out); }
.text-in { color: var(--in) !important; }
.text-out { color: var(--out) !important; }
.acct-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.acct-row:first-of-type { border-top: 0; }
.is-void { opacity: .5; }
.is-void .amt { text-decoration: line-through; }
.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty .ico { width: 2.4rem; height: 2.4rem; color: #c3cad6; margin-bottom: .5rem; }

.avatar { width: 2.6rem; height: 2.6rem; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: .95rem; flex: 0 0 auto; }
.avatar-lg { width: 3.6rem; height: 3.6rem; border-radius: 18px; font-size: 1.25rem; }
.tone-0 { background: #e7f7f1; color: #0b6b4f; } .tone-1 { background: #eef0ff; color: #3730a3; } .tone-2 { background: #fff6e5; color: #9a5b00; }
.tone-3 { background: #fdecee; color: #a51d34; } .tone-4 { background: #e8f4fd; color: #075985; } .tone-5 { background: #f3e8ff; color: #6b21a8; }

/* list rows (customers, sales, products, cash book) */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; }
.row-link { display: flex; align-items: center; gap: .85rem; padding: .85rem 1.15rem; color: inherit; text-decoration: none; }
a.row-link:hover { background: #f8fafc; }
.row-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-title { font-weight: 700; }
.row-sub { font-size: .85rem; color: var(--muted); }
.row-end { text-align: right; white-space: nowrap; }
.row-end .row-sub { font-size: .78rem; }

/* old list classes kept for cash book / admin screens */
.entry-list, .book-list, .history { list-style: none; padding: 0; margin: 0; }
.entry-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--line); }
.entry-list li:first-child { border-top: 0; }
.entry-main, .book-main { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.book-list li { display: flex; align-items: center; gap: .9rem; padding: .8rem 1.15rem; border-top: 1px solid var(--line); }
.book-list li:first-child { border-top: 0; }
.book-date { flex: 0 0 4.6rem; font-size: .84rem; color: var(--muted); }
.book-amt { text-align: right; white-space: nowrap; }
.book-act { flex: 0 0 auto; text-align: right; min-width: 3.5rem; }
@media (max-width: 575px) { .book-list li { flex-wrap: wrap; gap: .3rem .75rem; } .book-date { flex-basis: 100%; } .book-act { min-width: 0; } }
.history-row { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 1.2rem; border-top: 1px solid var(--line); }
.history-row:first-child { border-top: 0; }
.history-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; white-space: nowrap; }

/* segmented filters */
.seg { display: inline-flex; flex-wrap: wrap; background: #e9edf3; border-radius: 14px; padding: 4px; gap: 2px; }
.seg a, .seg button { padding: .42rem .85rem; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 650; font-size: .92rem; border: 0; background: none; }
.seg a.on, .seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.seg-count { font-size: .75rem; background: rgba(0, 0, 0, .06); border-radius: 999px; padding: 0 .45rem; margin-left: .2rem; }

/* ---------- app shell ---------- */
.app-body { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 1020; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: .75rem; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.2rem; color: var(--ink) !important; text-decoration: none; letter-spacing: -.02em; }
.brand img { border-radius: 10px; }
.ws-pill { display: inline-flex; align-items: center; gap: .4rem; max-width: 52vw; padding: .38rem .8rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: .9rem; border: 0; }
.ws-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-btn { width: 2.4rem; height: 2.4rem; border-radius: 12px; border: 0; background: var(--grad); color: #fff; font-weight: 800; font-size: .85rem; }

.shell { display: flex; }
.sidebar { display: none; }
.app-main { flex: 1; min-width: 0; padding: 1.25rem 0 6.5rem; }
@media (min-width: 992px) {
  .sidebar { display: flex; flex-direction: column; gap: .15rem; position: sticky; top: 62px; height: calc(100vh - 62px); width: 248px; padding: 1.1rem .8rem; border-right: 1px solid var(--line); background: #fff; overflow-y: auto; flex: 0 0 248px; }
  .app-main { padding: 1.75rem 0 3rem; }
  .bottom-bar { display: none !important; }
}
.side-link { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.side-link .ico { color: var(--muted); }
.side-link:hover { background: #f1f5f9; color: var(--ink); }
.side-link.active { background: var(--brand-soft); color: var(--brand-ink); }
.side-link.active .ico { color: var(--brand); }
.side-sep { height: 1px; background: var(--line); margin: .6rem .4rem; }
.side-cta { margin: .3rem .2rem .8rem; }

.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); }
.bottom-bar a, .bottom-bar button { display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .7rem; font-weight: 650; color: var(--muted); text-decoration: none; background: none; border: 0; padding: .2rem 0; }
.bottom-bar .ico { width: 1.45rem; height: 1.45rem; }
.bottom-bar a.on { color: var(--brand-ink); }
.fab { width: 3.4rem; height: 3.4rem; border-radius: 18px; background: var(--grad) !important; color: #fff !important; display: grid !important; place-items: center; margin: -1.4rem auto 0; box-shadow: 0 12px 26px -10px rgba(10, 106, 216, .9); }
.fab .ico { width: 1.7rem; height: 1.7rem; }

/* quick action sheet */
.sheet.offcanvas-bottom { height: auto; border-radius: 26px 26px 0 0; border: 0; padding-bottom: env(safe-area-inset-bottom); }
.sheet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
@media (min-width: 576px) { .sheet-grid { grid-template-columns: repeat(3, 1fr); } }
.sheet-item { display: flex; flex-direction: column; gap: .55rem; padding: 1rem; border-radius: 18px; text-decoration: none; color: var(--ink); background: #f6f8fb; font-weight: 700; }
.sheet-item small { color: var(--muted); font-weight: 500; }
.sheet-item .qa-ico { width: 2.6rem; height: 2.6rem; border-radius: 14px; display: grid; place-items: center; color: #fff; }

.app-footer { padding: 1.2rem 0 6.5rem; color: var(--muted); font-size: .84rem; }
@media (min-width: 992px) { .app-footer { padding-bottom: 1.5rem; } }
.app-footer a { color: var(--muted); }

/* ---------- dashboard ---------- */
.hero-card { background: var(--grad); color: #fff; border-radius: 26px; padding: 1.35rem 1.4rem; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%); }
.hero-card .lbl { opacity: .85; font-size: .85rem; font-weight: 600; }
.hero-card .big { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1rem; }
.hero-stats > div { background: rgba(255, 255, 255, .13); border-radius: 14px; padding: .6rem .7rem; }
.hero-stats b { display: block; font-size: 1.02rem; }
.hero-stats span { font-size: .74rem; opacity: .85; }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; margin: 1rem 0; }
.qa { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .85rem .3rem; border-radius: 18px; background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); font-size: .8rem; font-weight: 700; text-align: center; }
.qa-ico { width: 2.6rem; height: 2.6rem; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.qa-ico .ico { width: 1.35rem; height: 1.35rem; }
.bg-g1 { background: linear-gradient(135deg, #0f9d72, #12b886); } .bg-g2 { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.bg-g3 { background: linear-gradient(135deg, #f59e0b, #f97316); } .bg-g4 { background: linear-gradient(135deg, #e0475b, #f43f5e); }
.bg-g5 { background: linear-gradient(135deg, #0ea5e9, #2563eb); } .bg-g6 { background: linear-gradient(135deg, #64748b, #334155); }
.stat-tile { background: #fff; border-radius: var(--r-lg); padding: 1rem 1.1rem; box-shadow: var(--shadow); height: 100%; }
.stat-tile .v { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.stat-tile .l { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-sm { padding: .8rem 1rem; }

/* ---------- contact page ---------- */
.balance-card { border-radius: 24px; padding: 1.25rem; color: #fff; }
.balance-pos { background: linear-gradient(135deg, #0f9d72, #0b6b4f); }
.balance-neg { background: linear-gradient(135deg, #e0475b, #9f1239); }
.balance-zero { background: linear-gradient(135deg, #64748b, #334155); }
.balance-card .big { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.contact-tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.entry-tabs .nav-link { border-radius: 12px; font-weight: 700; color: var(--muted); }
.entry-tabs .nav-link.active { background: var(--ink); color: #fff; }

/* ---------- sale form (POS) ---------- */
.pos-lines .pos-line { display: grid; grid-template-columns: 1fr 5.2rem 6.5rem 2.2rem; gap: .45rem; align-items: center; padding: .5rem 0; border-top: 1px dashed var(--line); }
.pos-lines .pos-line:first-child { border-top: 0; }
@media (max-width: 575px) { .pos-lines .pos-line { grid-template-columns: 1fr 4.3rem 5.6rem 2rem; } }
.pos-total { position: sticky; bottom: 4.6rem; z-index: 5; }
@media (min-width: 992px) { .pos-total { bottom: 1rem; } }
.total-box { background: var(--ink); color: #fff; border-radius: 20px; padding: 1rem 1.15rem; }
.total-box .big { font-size: 1.9rem; font-weight: 800; }
.product-pick { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .35rem; scrollbar-width: thin; }
.chip { flex: 0 0 auto; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .38rem .8rem; font-weight: 650; font-size: .88rem; color: var(--ink); white-space: nowrap; }
.chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.chip small { color: var(--muted); font-weight: 600; margin-left: .25rem; }

/* ---------- debt / old types ---------- */
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.type-pick { position: relative; display: block; border: 2px solid var(--line); border-radius: 14px; padding: .7rem .75rem .7rem 2.2rem; cursor: pointer; background: #fff; }
.type-pick input { position: absolute; left: .75rem; top: .9rem; accent-color: var(--brand); }
.type-pick:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.type-title { display: block; font-weight: 700; }
.type-help { display: block; font-size: .8rem; color: var(--muted); line-height: 1.35; }

/* ---------- reports ---------- */
.period-nav { display: flex; align-items: center; gap: 1rem; }
.period-nav a { width: 2.3rem; height: 2.3rem; border-radius: 12px; display: grid; place-items: center; background: #fff; box-shadow: var(--shadow); text-decoration: none; font-size: 1.3rem; color: var(--ink); }
.chart-wrap { position: relative; height: 280px; }
.cat-row { padding: .45rem 0; }
.cat-bar { height: .45rem; border-radius: 999px; background: #eef2f6; overflow: hidden; margin-top: .3rem; }
.cat-bar span { display: block; height: 100%; border-radius: 999px; }
.bg-in { background: var(--in); } .bg-out { background: var(--out); } .bg-brand { background: var(--grad); }
.month-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; padding: .4rem 0; }

/* ---------- admin / billing (older screens) ---------- */
.admin-tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; }
.admin-tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); font-weight: 650; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.admin-tabs a.on { color: var(--ink); border-color: var(--brand); }
.pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (min-width: 992px) { .pay-grid { grid-template-columns: 1.3fr 1fr .9fr 1.2fr; } }
.review-actions { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; display: grid; gap: .75rem; }
.approve-form .form-control { max-width: 320px; flex: 1 1 200px; }
.reject-box summary { color: var(--out); font-weight: 650; cursor: pointer; width: fit-content; }
.settings-box, .form-narrow { max-width: 680px; }
.form-wide { max-width: 980px; }
.stat .card-big { font-size: 1.7rem; }
.plan-strip { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.pay-steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.pay-steps > li { counter-increment: s; position: relative; padding: 0 0 1.6rem 3rem; }
.pay-steps > li:last-child { padding-bottom: 0; }
.pay-steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 800; display: grid; place-items: center; }
.step-title { font-weight: 750; font-size: 1.05rem; margin: .2rem 0 .7rem; }
.merchant-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; background: var(--brand-soft); border-radius: 16px; padding: .9rem 1.1rem; }
.merchant-number { white-space: nowrap; font-size: clamp(1.3rem, 6.5vw, 1.6rem); font-weight: 800; color: var(--brand-ink); letter-spacing: .03em; }
.total-line { border-top: 1px solid var(--line); padding-top: .6rem; font-size: 1.1rem; }
.staff-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.staff-who { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.audit-details { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--muted); overflow-wrap: anywhere; }
.plan-features { list-style: none; padding: 0; margin: 1.1rem 0; font-size: .95rem; }
.plan-features li { padding: .3rem 0 .3rem 1.7rem; position: relative; }
.plan-features li::before { content: ""; position: absolute; left: 0; top: .48rem; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--brand-soft) no-repeat center / 11px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230757b4' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }

/* ---------- auth / installer (bare layout) ---------- */
.bare { min-height: 100vh; background: var(--paper); display: flex; flex-direction: column; }
.bare-top { padding: 1rem 0; }
.auth-wrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 1rem 1rem 3rem; }
@media (min-width: 768px) { .auth-wrap { align-items: center; } }
.auth-card { width: 100%; max-width: 460px; background: #fff; border-radius: 28px; padding: 1.8rem 1.4rem; box-shadow: var(--shadow-lg); }
@media (min-width: 576px) { .auth-card { padding: 2.2rem 2.2rem; } }
.auth-card.wide { max-width: 720px; }
.auth-title { font-size: 1.6rem; font-weight: 800; margin-bottom: .3rem; }
.auth-sub { color: var(--muted); margin-bottom: 1.4rem; }
.auth-alt { text-align: center; margin: 1.4rem 0 0; color: var(--muted); }
.mail-icon { width: 3.6rem; height: 3.6rem; border-radius: 18px; margin: 0 auto 1rem; background: var(--grad); display: grid; place-items: center; color: #fff; }
.install-step { display: flex; gap: .9rem; align-items: flex-start; margin: 1.4rem 0 .9rem; }
.install-step .n { width: 2rem; height: 2rem; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 800; display: grid; place-items: center; flex: 0 0 auto; }
.install-step h2 { font-size: 1.05rem; font-weight: 750; margin: .25rem 0 0; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; font-size: .9rem; }
.check-list li { display: flex; gap: .5rem; align-items: center; }

/* ---------- public site ---------- */
.site-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 30; padding: 1rem 0; }
.site-nav .brand { color: #fff !important; }
.site-nav .nav-link { color: rgba(255, 255, 255, .86); font-weight: 600; padding: .4rem .8rem !important; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: #fff; }
.site-nav .navbar-toggler { border-color: rgba(255, 255, 255, .4); }
.site-nav .navbar-toggler-icon { filter: invert(1); }
@media (max-width: 767px) { .site-nav .navbar-collapse { background: rgba(10, 30, 40, .92); border-radius: 18px; padding: .6rem 1rem 1rem; margin-top: .6rem; backdrop-filter: blur(12px); } }
.site-nav.solid { position: sticky; background: #fff; border-bottom: 1px solid var(--line); }
.site-nav.solid .brand { color: var(--ink) !important; }
.site-nav.solid .nav-link { color: var(--ink-2); }
.site-nav.solid .navbar-toggler-icon { filter: none; }
.site-nav.solid .navbar-toggler { border-color: var(--line); }
@media (max-width: 767px) { .site-nav.solid .navbar-collapse { background: #fff; box-shadow: var(--shadow); } }
.lang-switch { display: inline-flex; border-radius: 999px; padding: 3px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); }
.lang-switch a { padding: .25rem .7rem; border-radius: 999px; text-decoration: none; color: rgba(255, 255, 255, .85); font-size: .82rem; font-weight: 700; }
.lang-switch a.on { background: #fff; color: var(--ink); }
.light .lang-switch, .site-nav.solid .lang-switch, .bare .lang-switch, .topbar .lang-switch { background: #eef2f6; border-color: transparent; }
.light .lang-switch a, .site-nav.solid .lang-switch a, .bare .lang-switch a, .topbar .lang-switch a { color: var(--muted); }
.light .lang-switch a.on, .site-nav.solid .lang-switch a.on, .bare .lang-switch a.on, .topbar .lang-switch a.on { background: var(--ink); color: #fff; }

.hero { position: relative; background: var(--grad); color: #fff; padding: 7.5rem 0 7rem; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 85% 10%, rgba(255, 255, 255, .18), transparent 70%), radial-gradient(500px 400px at 10% 100%, rgba(245, 158, 11, .25), transparent 70%); }
.hero::after { content: ""; position: absolute; left: -5%; right: -5%; bottom: -60px; height: 120px; background: var(--paper); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.hero .container { position: relative; z-index: 1; }
.hero-badge { display: inline-flex; align-items: center; gap: .45rem; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: .32rem .85rem; font-size: .85rem; font-weight: 650; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -.035em; margin: 1rem 0; }
.hero .lead { font-size: 1.12rem; opacity: .92; max-width: 34rem; }
.hero-trust { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: 1.6rem; font-size: .9rem; opacity: .92; }
.hero-trust span { display: inline-flex; align-items: center; gap: .4rem; }
.phone-mock { width: 100%; max-width: 330px; margin: 0 auto; background: #0b1220; border-radius: 42px; padding: 12px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); transform: rotate(-2deg); }
.phone-screen { background: var(--paper); border-radius: 32px; overflow: hidden; color: var(--ink); }
.phone-screen .ps-head { background: var(--grad); color: #fff; padding: 1.1rem 1rem 1.3rem; }
.phone-screen .ps-body { padding: .8rem; display: grid; gap: .55rem; }
.ps-row { display: flex; align-items: center; gap: .6rem; background: #fff; border-radius: 14px; padding: .55rem .65rem; font-size: .82rem; box-shadow: var(--shadow); }
.ps-row b { font-size: .86rem; }
.section { padding: 4.5rem 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.6rem; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: .3rem .8rem; margin-bottom: .8rem; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.feature { background: #fff; border-radius: var(--r-lg); padding: 1.5rem; height: 100%; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature .qa-ico { margin-bottom: 1rem; }
.feature h3 { font-size: 1.12rem; font-weight: 750; }
.feature p { color: var(--muted); margin: 0; }
.steps-row { display: grid; gap: 1rem; }
@media (min-width: 768px) { .steps-row { grid-template-columns: repeat(3, 1fr); } }
.step { background: #fff; border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--shadow); }
.step .n { width: 2.6rem; height: 2.6rem; border-radius: 14px; background: var(--grad); color: #fff; font-weight: 800; display: grid; place-items: center; margin-bottom: .9rem; }
.stats-band { background: var(--ink); color: #fff; border-radius: 28px; padding: 2rem 1.5rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; text-align: center; }
@media (min-width: 768px) { .stats-band { grid-template-columns: repeat(4, 1fr); } }
.stats-band b { display: block; font-size: 1.9rem; font-weight: 800; background: linear-gradient(90deg, #5aa9ff, #ffb15c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats-band span { color: #cbd5e1; font-size: .92rem; }
.plan { background: #fff; border-radius: 24px; padding: 1.6rem; height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow); border: 2px solid transparent; }
.plan.featured { border-color: var(--brand); box-shadow: var(--shadow-lg); position: relative; }
.plan-tag { position: absolute; top: -.8rem; left: 1.4rem; background: var(--grad); color: #fff; font-size: .75rem; font-weight: 800; border-radius: 999px; padding: .25rem .75rem; }
.plan-name { font-size: 1.15rem; font-weight: 800; margin: 0; }
.plan-summary { color: var(--muted); font-size: .92rem; min-height: 2.8em; margin: .35rem 0 1rem; }
.plan-amount { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; }
.plan-per { color: var(--muted); margin-left: .15rem; }
.plan-sub { color: var(--muted); font-size: .88rem; }
.renewal-note { color: var(--muted); text-align: center; max-width: 640px; margin: 2.2rem auto 0; font-size: .93rem; }
.cta-band { background: var(--grad); color: #fff; border-radius: 28px; padding: 2.4rem 1.6rem; text-align: center; position: relative; overflow: hidden; }
.cta-band h2 { font-weight: 800; }
.site-footer { padding: 2.4rem 0; color: var(--muted); }
.site-footer a { color: var(--muted); }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.legal { max-width: 760px; }
.legal h2 { font-size: 1.15rem; font-weight: 750; margin-top: 1.7rem; }
.error-box { max-width: 520px; padding: 6rem 1rem; }
.error-code { font-size: 4.5rem; font-weight: 800; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead-muted { color: var(--muted); font-size: 1.08rem; }

/* ---------- print sheets ---------- */
.print-body { background: #eef2f6; }
.print-sheet { max-width: 780px; padding: 2rem 1rem; }
.receipt { background: #fff; border-radius: 20px; padding: 2rem; box-shadow: var(--shadow); }
.receipt-title { font-size: 1.4rem; font-weight: 800; }
.receipt-paid { display: inline-block; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; border-radius: 999px; padding: .25rem .9rem; margin-bottom: 1.2rem; }
.receipt-table th { width: 38%; color: var(--muted); font-weight: 600; }
.receipt-total th, .receipt-total td { font-size: 1.15rem; font-weight: 800; border-bottom: 0; }
.statement-table th { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.report-sheet { max-width: 900px; margin: 0 auto; }
@media (max-width: 575px) { .receipt { padding: 1.2rem; } }
@media print {
  .no-print { display: none !important; }
  .print-body { background: #fff; }
  .receipt { box-shadow: none; padding: 0; border-radius: 0; }
  .print-sheet { max-width: none; padding: 0; }
}
/* thermal receipt (58/80 mm) */
.thermal-body { background: #eef2f6; }
.thermal { width: 80mm; max-width: 100%; margin: 1rem auto; background: #fff; padding: 4mm; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: #000; line-height: 1.35; }
.thermal h1 { font-size: 16px; font-weight: 800; text-align: center; margin: 0; font-family: var(--font); }
.thermal .c { text-align: center; }
.thermal hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; opacity: 1; }
.thermal table { width: 100%; border-collapse: collapse; }
.thermal td { padding: 1px 0; vertical-align: top; }
.thermal .r { text-align: right; white-space: nowrap; }
.thermal .tot td { font-weight: 800; font-size: 14px; }
@media print {
  @page { size: 80mm auto; margin: 0; }
  .thermal-body { background: #fff; }
  .thermal { margin: 0; width: 80mm; }
}

/* bar widths without inline styles (security policy) */
.bar-0{width:0}.bar-1{width:1%}.bar-2{width:2%}.bar-3{width:3%}.bar-4{width:4%}.bar-5{width:5%}.bar-6{width:6%}.bar-7{width:7%}.bar-8{width:8%}.bar-9{width:9%}.bar-10{width:10%}.bar-11{width:11%}.bar-12{width:12%}.bar-13{width:13%}.bar-14{width:14%}.bar-15{width:15%}.bar-16{width:16%}.bar-17{width:17%}.bar-18{width:18%}.bar-19{width:19%}.bar-20{width:20%}.bar-21{width:21%}.bar-22{width:22%}.bar-23{width:23%}.bar-24{width:24%}.bar-25{width:25%}.bar-26{width:26%}.bar-27{width:27%}.bar-28{width:28%}.bar-29{width:29%}.bar-30{width:30%}.bar-31{width:31%}.bar-32{width:32%}.bar-33{width:33%}.bar-34{width:34%}.bar-35{width:35%}.bar-36{width:36%}.bar-37{width:37%}.bar-38{width:38%}.bar-39{width:39%}.bar-40{width:40%}.bar-41{width:41%}.bar-42{width:42%}.bar-43{width:43%}.bar-44{width:44%}.bar-45{width:45%}.bar-46{width:46%}.bar-47{width:47%}.bar-48{width:48%}.bar-49{width:49%}.bar-50{width:50%}.bar-51{width:51%}.bar-52{width:52%}.bar-53{width:53%}.bar-54{width:54%}.bar-55{width:55%}.bar-56{width:56%}.bar-57{width:57%}.bar-58{width:58%}.bar-59{width:59%}.bar-60{width:60%}.bar-61{width:61%}.bar-62{width:62%}.bar-63{width:63%}.bar-64{width:64%}.bar-65{width:65%}.bar-66{width:66%}.bar-67{width:67%}.bar-68{width:68%}.bar-69{width:69%}.bar-70{width:70%}.bar-71{width:71%}.bar-72{width:72%}.bar-73{width:73%}.bar-74{width:74%}.bar-75{width:75%}.bar-76{width:76%}.bar-77{width:77%}.bar-78{width:78%}.bar-79{width:79%}.bar-80{width:80%}.bar-81{width:81%}.bar-82{width:82%}.bar-83{width:83%}.bar-84{width:84%}.bar-85{width:85%}.bar-86{width:86%}.bar-87{width:87%}.bar-88{width:88%}.bar-89{width:89%}.bar-90{width:90%}.bar-91{width:91%}.bar-92{width:92%}.bar-93{width:93%}.bar-94{width:94%}.bar-95{width:95%}.bar-96{width:96%}.bar-97{width:97%}.bar-98{width:98%}.bar-99{width:99%}.bar-100{width:100%}
.bare-flash { max-width: 720px; }

/* v2 additions: installer, POS header, misc */
.install-card { max-width: 560px; }
.inst-block { border: 1px solid var(--line); border-radius: 18px; padding: 1rem 1rem 1.1rem; margin-bottom: 1rem; }
.inst-block .step-title { display: flex; align-items: center; gap: .6rem; }
.inst-num { width: 1.9rem; height: 1.9rem; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 800; display: inline-grid; place-items: center; flex: 0 0 auto; }
.qa-ico.mx-auto { display: grid; }
.pos-head { grid-template-columns: 1fr 5.2rem 6.5rem 2.2rem; gap: .45rem; padding-bottom: .25rem; }
.rotate-180 { transform: rotate(180deg); }
.entry-type-label { color: var(--muted); }
input:checked + .entry-type-label { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.chip[hidden] { display: none; }
[hidden] { display: none !important; }

/* v3: three sections */
.section-hero { border-radius: 26px; padding: 1.3rem 1.4rem; color: #fff; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.section-hero .page-title { color: #fff; }
.bg-store { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.bg-debts { background: linear-gradient(135deg, #f7931e, #e65c1e); }
.bg-money { background: linear-gradient(135deg, #0f9d72, #0a6ad8); }
.qa-lg { width: 3.2rem; height: 3.2rem; border-radius: 16px; }
.bg-white-20 { background: rgba(255, 255, 255, .2); color: #fff; }
.action-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 768px) { .action-tiles { grid-template-columns: repeat(3, 1fr); } }
.action-tile { background: #fff; border-radius: 20px; padding: 1rem; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .35rem; transition: transform .15s ease; }
.action-tile:hover { transform: translateY(-2px); color: var(--ink); }
.action-tile b { font-size: 1rem; }
.action-tile small { color: var(--muted); line-height: 1.3; }
.buy-line { display: grid; grid-template-columns: 1fr 1fr 1fr 2.2rem; gap: .5rem; padding: .7rem 0; border-top: 1px dashed var(--line); align-items: end; }
.buy-line:first-child { border-top: 0; }
.buy-line .buy-name { grid-column: 1 / 4; }
.buy-line .buy-x { grid-column: 4; align-self: end; }
.buy-line > div:nth-of-type(n+2) { grid-row: 2; }
.big-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.big-choice a { border-radius: 20px; padding: 1rem; text-decoration: none; color: var(--ink); background: #fff; box-shadow: var(--shadow); display: flex; gap: .7rem; align-items: center; font-weight: 700; line-height: 1.25; }
.big-choice a small { display: block; color: var(--muted); font-weight: 500; }
.debt-total { border-radius: 22px; padding: 1rem 1.1rem; color: #fff; text-decoration: none; display: block; }
.debt-total .v { font-size: 1.6rem; font-weight: 800; }
.debt-total.owes-me { background: linear-gradient(135deg, #0f9d72, #12b886); }
.debt-total.i-owe { background: linear-gradient(135deg, #e0475b, #f97316); }
.debt-total.dim { opacity: .55; }
.debt-total:hover { color: #fff; }
.side-group { font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: .9rem .8rem .3rem; }
.sheet-group { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: .9rem 0 .5rem; }
.sheet-group:first-child { margin-top: 0; }
.cat-split { display: grid; gap: .75rem; }
@media (min-width: 768px) { .cat-split { grid-template-columns: 1fr 1fr; } }
.period-nav-light a { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.period-nav-light span { width: 2.3rem; }
.me-btn-light { background: #eef2f6; color: var(--ink); display: inline-grid; place-items: center; }
.section-cards { display: grid; gap: 1rem; }
@media (min-width: 992px) { .section-cards { grid-template-columns: repeat(3, 1fr); } }
.section-card { border-radius: 24px; padding: 1.1rem 1.2rem 1.2rem; color: #fff; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.section-card .sc-head { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.section-card .sc-head b { display: block; font-size: 1.15rem; }
.section-card .sc-head small { display: block; opacity: .8; font-size: .8rem; line-height: 1.25; }
.section-card .sc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 1rem 0 .8rem; }
.section-card .sc-stats > * { background: rgba(255, 255, 255, .14); border-radius: 14px; padding: .6rem .7rem; color: #fff; text-decoration: none; }
.section-card .sc-stats b { display: block; font-size: 1.1rem; }
.section-card .sc-stats span { font-size: .75rem; opacity: .85; }
.section-card .sc-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; }
.section-card .sc-actions a { background: #fff; color: var(--ink); border-radius: 12px; padding: .45rem .75rem; font-weight: 700; font-size: .85rem; text-decoration: none; display: inline-flex; gap: .35rem; align-items: center; }
@media (max-width: 575px) {
  .big-choice { grid-template-columns: 1fr; gap: .55rem; }
  .big-choice a { padding: .8rem .9rem; }
}
.col-lg-5 .big-choice { grid-template-columns: 1fr; gap: .55rem; }
.buy-line .form-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* brand name: two-tone like the logo */
.brand-name .b1 { color: #0a6ad8; }
.brand-name .b2 { color: #f7931e; }
.site-nav:not(.solid) .brand-name .b1, .site-nav:not(.solid) .brand-name .b2 { color: #fff; }
.brand img { border-radius: 10px; background: #fff; }
.install-logo { width: 180px; height: auto; }
.footer-logo { width: 150px; height: auto; }
