/* ==================================================================
 * Premium theme layer, loaded after tally.css.
 * The arrangement follows the classic desk: company information on
 * the left, the Home menu on the right with a gold selection bar, the
 * function-key buttons in a column on the right edge, and the status
 * line at the bottom. Colours: deep maroon with gold.
 * ================================================================== */

:root {
    --shell: #5a1422;
    --shell-dark: #3f0d18;
    --maroon: #6d1a2a;
    --maroon-2: #8c2638;
    --gold: #c9a24a;
    --gold-2: #e2c27a;
    --gold-soft: #f7edd4;
    --ink: #221d16;
    --muted: #6f6656;
    --cream: #fffdf8;
    --cream-deep: #f6f1e6;
    --page: #efe8da;
    --line: #e6dcc7;
    --select: #f9e7b3;
    --title: #5a1422;
    --ok: #1f7a4d;
    --danger: #a3141f;
    --shadow: 0 20px 50px rgba(72, 28, 12, .10), 0 2px 6px rgba(72, 28, 12, .05);
}

html, body { font-family: Poppins, "Segoe UI", system-ui, sans-serif; font-size: 14.5px; }
body { background: radial-gradient(1200px 600px at 70% -10%, #f8f0de 0%, transparent 60%), var(--page); }
.num, td.num, th.num, input.amount { font-variant-numeric: tabular-nums; }

/* ---------- shell grid: header / stage + key column / status ---------- */
body:not(.marketing) #app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 176px;
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas: "top top" "stage bar" "calc bar" "status status";
    min-height: 100vh;
}
body:not(.marketing) #top { grid-area: top; }
body:not(.marketing) #stage { grid-area: stage; }
body:not(.marketing) #calc { grid-area: calc; }
body:not(.marketing) #bar { grid-area: bar; }
body:not(.marketing) #status { grid-area: status; }

#top {
    grid-template-columns: 220px 1fr auto;
    background: linear-gradient(100deg, var(--shell-dark), var(--maroon) 55%, var(--maroon-2));
    color: #fff;
    border-bottom: 3px solid var(--gold);
    min-height: 58px;
    box-shadow: 0 2px 12px rgba(63, 13, 24, .25);
}
#top .brand {
    font-family: Poppins, sans-serif;
    font-weight: 700;
    font-size: 19px;
    letter-spacing: .01em;
    display: flex;
    align-items: center;
    gap: 10px;
}
#top .brand::before {
    content: "Ak";
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--gold-2), var(--gold));
    color: var(--shell-dark);
    font-size: 14px;
    font-weight: 800;
}
#top .company-name { font-family: Poppins, sans-serif; font-weight: 600; font-size: 18px; color: #fff; letter-spacing: .01em; }
#top .today { color: #f6e8c8; font-size: 13px; }
.plant-chip { border-color: var(--gold-2); color: #fff; }
.plant-chip:hover { background: rgba(255, 255, 255, .12); }
.gold-chip { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--shell-dark); border-color: transparent; }
.silver-chip { color: #fff; border-color: rgba(255, 255, 255, .6); }
.edu-chip { background: #fff3d6; color: #7a4a00; border-color: var(--gold); }

#stage { padding: 18px 16px 12px; }

/* ---------- windows ---------- */
.window {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.window.full { width: 100%; }
.window.wide { width: min(1180px, 100%); }
.window.voucher-width { width: min(1120px, 100%); }
.titlebar {
    font-family: Poppins, sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    color: #fff;
    background: linear-gradient(100deg, var(--maroon), var(--maroon-2));
    border-bottom: 2px solid var(--gold);
    padding: 10px 16px;
}
.titlebar .badge, .titlebar > span + span {
    font-size: 12px;
    font-weight: 500;
    color: var(--shell-dark);
    background: var(--gold-soft);
    border-radius: 999px;
    padding: 2px 10px;
    border: 0;
}

/* ---------- Home (classic gateway arrangement) ---------- */
.gateway { grid-template-columns: .9fr 1.1fr; min-height: 520px; }
.gateway > .info-pane { order: -1; }
.info-pane {
    background: linear-gradient(180deg, #fbf4e3, #f4ead3);
    border-right: 1px solid var(--line);
    border-left: 0;
    padding: 18px 20px;
}
.info-pane .info-label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; margin-top: 14px; }
.info-pane strong { color: var(--shell-dark); font-weight: 600; }
.gateway .titlebar { justify-content: center; }
.gateway .menu-list { padding: 10px 26px 18px; }
.menu-item, .pick {
    border-radius: 7px;
    padding: 7px 14px;
    font-weight: 500;
}
.gateway .menu-item { text-align: center; font-size: 15px; letter-spacing: .01em; }
.menu-item.active, .pick.active, tr.active {
    background: linear-gradient(90deg, var(--gold-2), var(--select));
    color: var(--shell-dark);
    box-shadow: inset 3px 0 0 var(--maroon);
}
.menu-item:hover:not(.active) { background: #fbf1da; }

/* ---------- right key column ---------- */
#bar {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 10px 8px;
    background: linear-gradient(180deg, #f8f1e1, #efe4cb);
    border-left: 1px solid var(--line);
    border-top: 0;
    overflow-y: auto;
    max-height: calc(100vh - 82px);
    position: sticky;
    top: 0;
}
#bar button {
    width: 100%;
    min-width: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    background: #fffdf7;
    border: 1px solid #e3d4b0;
    border-radius: 7px;
    transition: background .12s, border-color .12s, transform .12s;
}
#bar button:hover { background: var(--gold-soft); border-color: var(--gold); transform: translateX(-1px); }
#bar .fkey { color: var(--maroon); font-weight: 700; font-size: 11px; min-width: 46px; }
#bar .flabel { color: var(--ink); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#status {
    background: var(--shell-dark);
    color: #e9d8ad;
    border-top: 1px solid var(--gold);
    height: 26px;
    grid-template-columns: 160px 1fr auto;
}
#status button { color: #fff; background: transparent; border: 0; cursor: pointer; font-weight: 600; }
#status .status-brand { font-weight: 700; color: var(--gold-2); }

/* ---------- forms ---------- */
input, select, textarea { border-radius: 7px; }
.form-grid input, .form-grid select, .form-grid textarea,
.search-line input, .tally-account input, .narration-row textarea, .pos-scan,
.dispatch-row input, .voucher-no input, .account-row input, .tally-date input, .tally-vch-band input {
    border: 1px solid #ddcfb2;
    background: #fff;
    padding: 6px 9px;
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 3px rgba(201, 162, 74, .25);
    background: #fffef9;
}
.price-buy, button.price-buy {
    background: linear-gradient(135deg, var(--maroon), var(--maroon-2));
    color: #fff;
    border: 0;
    border-radius: 9px;
    padding: 9px 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(109, 26, 42, .22);
}
.price-buy:hover { filter: brightness(1.08); }
.price-ghost, button.price-ghost {
    background: transparent;
    color: var(--maroon);
    border: 1px solid var(--gold);
    border-radius: 9px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
}
.mini {
    border: 1px solid var(--gold);
    background: var(--gold-soft);
    color: var(--shell-dark);
    border-radius: 7px;
    padding: 4px 10px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.mini.ghost { background: transparent; }
.mini:disabled { opacity: .6; cursor: progress; }
.wide-btn { width: 100%; margin-top: 8px; }
.inline-action { display: flex; gap: 6px; align-items: center; }
.inline-action input { flex: 1; min-width: 0; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; margin: 6px 0; cursor: pointer; }
label.check input { width: 16px; height: 16px; accent-color: var(--maroon); }
.hint { color: var(--muted); }
.note { color: var(--ink); }
.side-head { margin: 4px 0 8px; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--maroon); font-weight: 700; grid-column: 1 / -1; }
kbd { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: #fff; border: 1px solid #d9c9a3; border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--shell-dark); }

/* ---------- picker (list of ledgers / items) ---------- */
#picker {
    border: 1px solid var(--gold);
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(63, 13, 24, .22);
    padding: 0 0 4px;
    max-height: 420px;
    background: #fffdf8;
}
#picker .pick-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    background: linear-gradient(100deg, var(--maroon), var(--maroon-2));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    letter-spacing: .03em;
}
#picker .pick-head span { color: var(--gold-2); }
#picker .pick { display: flex; justify-content: space-between; gap: 12px; padding: 5px 12px; border-radius: 0; cursor: pointer; }
#picker .pick em { color: var(--muted); font-style: normal; font-size: 12px; white-space: nowrap; }
#picker .pick.active em { color: var(--shell-dark); }
#picker .pick-create { color: var(--maroon); font-weight: 600; border-bottom: 1px dashed var(--line); }

/* ---------- ledger form ---------- */
.ledger-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.ledger-side { background: #fbf6ea; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ledger-side[hidden] { display: none; }

/* ---------- invoice ---------- */
.tally-vch-band { background: #fbf3df; border-bottom: 1px solid var(--line); }
.tally-vch-band strong { color: var(--maroon); }
.band-hint { margin-left: auto; color: var(--muted); font-size: 12px; }
.inv-head { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; margin-bottom: 10px; }
.inv-party-card {
    background: #fbf6ea;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    min-height: 70px;
}
.inv-party-card strong { color: var(--shell-dark); font-size: 14.5px; }
.inv-party-card .tax-kind { margin-top: 4px; align-self: flex-start; background: var(--gold-soft); color: var(--shell-dark); border-radius: 999px; padding: 1px 10px; font-weight: 600; font-size: 12px; }
table.gst-grid { width: 100%; border-collapse: separate; border-spacing: 0; }
table.gst-grid th { background: #f6ecd2; color: var(--shell-dark); font-size: 12px; font-weight: 600; padding: 7px 6px; border-bottom: 1px solid #e3d1a5; position: sticky; top: 0; }
table.gst-grid td { padding: 3px 4px; border-bottom: 1px solid #f0e7d3; vertical-align: middle; }
table.gst-grid tr:focus-within td { background: #fff8e6; }
table.gst-grid input { width: 100%; border: 1px solid transparent; background: transparent; padding: 5px 6px; }
table.gst-grid input:hover { border-color: #e9dcbd; }
table.gst-grid td.num input { text-align: right; }
table.gst-grid .gst-name { font-weight: 600; min-width: 220px; }
table.gst-grid .gst-hsn { width: 80px; }
table.gst-grid .gst-qty, table.gst-grid .gst-price { width: 90px; }
table.gst-grid .gst-disc, table.gst-grid .gst-rate { width: 64px; }
table.gst-grid .gst-amt { font-weight: 600; min-width: 100px; padding-right: 10px; }
.sl { width: 34px; color: var(--muted); text-align: center; }
.row-x { color: var(--danger); font-size: 18px; line-height: 1; }
.inv-foot { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; margin-top: 12px; align-items: start; }
.inv-totals, .pos-total {
    background: linear-gradient(180deg, #fffaf0, #fbf1da);
    border: 1px solid #e8d6aa;
    border-radius: 12px;
    padding: 10px 14px;
}
.t-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13.5px; }
.t-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.t-row.grand { border-top: 1px solid #e3cf9f; margin-top: 4px; padding-top: 8px; font-size: 18px; color: var(--shell-dark); }
.t-row.grand b { font-weight: 700; }

/* ---------- invoice ready / collect ---------- */
.invoice-ready { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; align-items: start; }
.ready-amount { display: flex; justify-content: space-between; align-items: baseline; background: var(--gold-soft); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.ready-amount span { color: var(--muted); }
.ready-amount strong { font-size: 26px; color: var(--shell-dark); }
.mini-table { width: 100%; font-size: 12.5px; margin-bottom: 10px; }
.mini-table td { padding: 3px 4px; border-bottom: 1px dashed var(--line); }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.act {
    border: 1px solid #e3d4b0;
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.act b { display: block; font-size: 11px; color: var(--maroon); font-weight: 700; }
.act:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(72, 28, 12, .10); border-color: var(--gold); }
.act.wa { border-color: #a7dcbf; background: #f1fbf5; }
.act.upi { border-color: var(--gold); background: var(--gold-soft); }
.act.ghost { background: transparent; }
.ready-side { background: #fbf6ea; border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-height: 200px; }
.qr-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 6px; }
.qr-card img { width: 220px; height: 220px; background: #fff; border-radius: 12px; border: 6px solid #fff; box-shadow: 0 0 0 1px var(--line), 0 10px 24px rgba(72, 28, 12, .1); image-rendering: pixelated; }
.qr-card.small img { width: 170px; height: 170px; }
.qr-card strong { font-size: 20px; color: var(--shell-dark); }
.qr-card span { color: var(--muted); font-size: 12.5px; }
.qr-preview { display: flex; align-items: center; gap: 10px; }
.qr-preview img { width: 120px; height: 120px; image-rendering: pixelated; }
.status-pill { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 11.5px; font-weight: 700; background: #fff1cf; color: #7a4a00; letter-spacing: .03em; }
.status-pill.ok { background: #dff3e8; color: var(--ok); }
.status-pill.off { background: #f6dede; color: var(--danger); }
.form-grid.compact { gap: 6px; margin: 8px 0; }

/* ---------- POS ---------- */
.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.pos-search { display: flex; gap: 8px; margin-bottom: 10px; }
.pos-scan { flex: 1; font-size: 17px; padding: 10px 14px !important; border-radius: 10px !important; border: 2px solid var(--gold) !important; }
.pos-cart-wrap { max-height: calc(100vh - 330px); min-height: 260px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table.pos-cart { width: 100%; border-collapse: collapse; }
table.pos-cart th { background: #f6ecd2; position: sticky; top: 0; font-size: 12px; padding: 7px 6px; }
table.pos-cart td { padding: 4px 6px; border-bottom: 1px solid #f2ead8; }
table.pos-cart input { width: 76px; text-align: right; border: 1px solid #eadfc6; border-radius: 6px; padding: 4px 6px; }
.qty-cell { white-space: nowrap; }
.qty-cell input { width: 54px !important; text-align: center !important; }
.qty-btn { border: 1px solid var(--gold); background: var(--gold-soft); width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-weight: 700; color: var(--shell-dark); }
.pos-amt { font-weight: 600; }
.pos-right { display: flex; flex-direction: column; gap: 8px; }
.pay-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pay-modes button { border: 1px solid #e3d4b0; background: #fff; border-radius: 9px; padding: 8px 4px; cursor: pointer; font-weight: 600; font-size: 13px; }
.pay-modes button b { display: block; font-size: 10.5px; color: var(--maroon); }
.pay-modes button.on { background: linear-gradient(135deg, var(--maroon), var(--maroon-2)); color: #fff; border-color: transparent; }
.pay-modes button.on b { color: var(--gold-2); }
.scan-video { width: 100%; max-height: 240px; border-radius: 12px; margin-bottom: 10px; object-fit: cover; }

/* ---------- settings / tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); background: #fbf6ea; overflow-x: auto; }
.tabs button { border: 1px solid transparent; border-bottom: 0; background: transparent; padding: 8px 14px; border-radius: 9px 9px 0 0; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--cream); border-color: var(--line); color: var(--maroon); box-shadow: inset 0 3px 0 var(--gold); }
.pane-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.sub-grid { display: contents; }
.sub-grid[hidden] { display: none; }
.test-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.test-row input { border: 1px solid #ddcfb2; padding: 7px 10px; width: 200px; }

/* ---------- import / chart / goto / help ---------- */
.steps { padding-left: 18px; line-height: 1.6; }
.steps li { margin-bottom: 8px; }
.drop { display: grid; place-items: center; gap: 6px; border: 2px dashed var(--gold); border-radius: 14px; padding: 26px 14px; background: #fffaf0; cursor: pointer; text-align: center; color: var(--shell-dark); font-weight: 600; margin-bottom: 8px; }
.drop.over { background: var(--gold-soft); }
.drop input { max-width: 100%; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; }
.stat-tiles div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.stat-tiles b { display: block; font-size: 24px; color: var(--maroon); }
.stat-tiles span { color: var(--muted); font-size: 12px; }
.issue-list { font-size: 13px; max-height: 260px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 26px; }
.issue-list.err li { color: var(--danger); }
table.coa tr.ledger-row { cursor: pointer; }
table.coa tr.ledger-row:hover td { background: #fff8e6; }
table.coa tr.group td { font-weight: 700; color: var(--shell-dark); background: #fbf5e7; }
tr.diff-row td { color: var(--danger); font-style: italic; font-weight: 600; }
.goto { width: min(620px, 92vw); }
.goto h3 { margin: 0 0 8px; color: var(--maroon); }
.goto input { width: 100%; font-size: 16px; padding: 10px 12px; border: 2px solid var(--gold); border-radius: 10px; }
.goto-list { max-height: 50vh; overflow: auto; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.goto-item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 12px; cursor: pointer; }
.goto-item em { color: var(--muted); font-style: normal; font-size: 12px; }
.goto-item.active { background: linear-gradient(90deg, var(--gold-2), var(--select)); font-weight: 600; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 24px; }
.help-grid .help-wide { grid-column: 1 / -1; background: #fbf6ea; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.key-table td { padding: 3px 6px; font-size: 13px; }
.licence-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.licence-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.licence-card h4 { margin: 0 0 4px; color: var(--maroon); }
.licence-card p { margin: 0; font-size: 12.5px; color: var(--muted); }
.licence-card.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201, 162, 74, .35); background: #fffaf0; }
.licence-card.gold.on { background: linear-gradient(135deg, #fff6e0, #fbe8b8); }

/* ---------- modal ---------- */
.modal-back { background: rgba(40, 14, 8, .45); backdrop-filter: blur(3px); }
.modal.window { border-radius: 16px; padding: 18px 20px; box-shadow: 0 30px 80px rgba(40, 14, 8, .35); }
#toast { background: var(--shell-dark); color: #fff; border: 1px solid var(--gold); border-radius: 12px; box-shadow: 0 16px 40px rgba(40, 14, 8, .3); }

/* ---------- reports ---------- */
.report-head .co { color: var(--shell-dark); font-weight: 700; }
.report-head h2 { color: var(--maroon); }
.sheet-scroll table th { background: #f6ecd2; color: var(--shell-dark); }
tr.group td { color: var(--shell-dark); }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
    body:not(.marketing) #app { grid-template-columns: 1fr; grid-template-areas: "top" "stage" "calc" "bar" "status"; }
    #bar { flex-direction: row; overflow-x: auto; max-height: none; position: static; border-left: 0; border-top: 1px solid var(--line); }
    #bar button { width: auto; flex: 0 0 auto; }
    .pos-grid, .invoice-ready, .inv-head, .inv-foot, .ledger-grid, .pane-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    #top { grid-template-columns: 1fr auto; }
    #top .company-name { display: none; }
    .gateway { grid-template-columns: 1fr; }
    .gateway > .info-pane { order: 1; }
    .licence-cards { grid-template-columns: 1fr; }
    table.gst-grid .gst-name { min-width: 160px; }
}

/* ---------- print: only the open window ---------- */
@media print {
    body.printing #top, body.printing #bar, body.printing #status, body.printing #calc, body.printing #assistant,
    body.printing .search-line, body.printing .hint { display: none !important; }
    body.printing #app { display: block; }
    body.printing #stage { padding: 0; }
    body.printing .window { box-shadow: none; border: 0; width: 100% !important; }
    body.printing .titlebar { background: none; color: #000; border-bottom: 1px solid #000; }
}

/* ---------- public site ---------- */
body.marketing { background: radial-gradient(900px 500px at 85% -5%, #f6e3b5 0%, transparent 60%), radial-gradient(800px 500px at -10% 30%, #f3dcd9 0%, transparent 55%), #fbf7ee; }
body.marketing .brand { color: var(--maroon); font-family: Poppins, sans-serif; font-weight: 700; }
body.marketing .brand span { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--shell-dark); border: 0; border-radius: 9px; }
body.marketing .m-nav { border-bottom: 1px solid #ecdfc3; backdrop-filter: blur(8px); }
body.marketing .m-nav a { color: #4b4234; }
body.marketing .text-link { color: var(--maroon); font-weight: 600; }
body.marketing .eyebrow, body.marketing .kicker { color: #9a6f1c; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 12.5px; }
body.marketing .hero h1, body.marketing .home-window h2 { font-family: Poppins, sans-serif; font-weight: 700; color: var(--shell-dark); letter-spacing: -.02em; }
body.marketing .hero h1 { font-size: clamp(36px, 4.6vw, 60px); max-width: 17ch; line-height: 1.06; }
body.marketing .home-window h2 { font-size: clamp(28px, 3.4vw, 42px); }
body.marketing .lede { color: #4b4234; font-size: 17px; max-width: 52ch; }
body.marketing .trust { color: var(--muted); font-size: 13px; margin-top: 14px; }
body.marketing .price-buy { background: linear-gradient(135deg, var(--maroon), var(--maroon-2)); color: #fff; border-radius: 10px; box-shadow: 0 10px 24px rgba(109, 26, 42, .25); }
body.marketing .price-ghost { border-color: var(--gold); color: var(--maroon); border-radius: 10px; }
body.marketing .product-frame { border-radius: 18px; overflow: hidden; border: 1px solid #e6d3a6; box-shadow: 0 30px 70px rgba(72, 28, 12, .18); background: #fffdf8; }
body.marketing .pf-top { background: linear-gradient(100deg, var(--shell-dark), var(--maroon)); color: #fff; border-bottom: 3px solid var(--gold); }
body.marketing .pf-top em { color: var(--gold-2); }
body.marketing .pf-side { background: #fbf2dd; }
body.marketing .pf-side p { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 0; }
body.marketing .pf-side span { display: block; font-weight: 600; color: var(--shell-dark); font-size: 13px; }
body.marketing .pf-row { border-radius: 8px; }
body.marketing .pf-row.on { background: linear-gradient(90deg, var(--gold-2), var(--select)); font-weight: 600; }
body.marketing .pf-row b { color: var(--maroon); font-size: 12px; }
body.marketing .stat-row strong { font-family: Poppins, sans-serif; color: var(--maroon); font-weight: 700; }
body.marketing .pillars article { background: #fffdf8; border: 1px solid #ecdfc3; border-radius: 16px; padding: 20px; box-shadow: 0 10px 30px rgba(72, 28, 12, .06); }
body.marketing .pillars h3 { color: var(--shell-dark); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 18px; }
.feature-grid article { background: rgba(255, 253, 248, .85); border: 1px solid #ecdfc3; border-radius: 16px; padding: 18px; backdrop-filter: blur(6px); transition: transform .15s, box-shadow .15s; }
.feature-grid article:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(72, 28, 12, .10); }
.feature-grid span { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--maroon); background: var(--gold-soft); border-radius: 999px; padding: 2px 10px; }
.feature-grid h3 { margin: 10px 0 6px; font-size: 17px; color: var(--shell-dark); }
.feature-grid p { margin: 0; color: #4b4234; font-size: 14px; line-height: 1.55; }
body.marketing .price-card { border-radius: 18px; border: 1px solid #ecdfc3; background: #fffdf8; }
body.marketing .price-card.gold { background: linear-gradient(150deg, var(--shell-dark), var(--maroon) 60%, var(--maroon-2)); border-color: var(--gold); color: #fff; }
body.marketing .price-card.gold .plan-name { color: var(--gold-2); }
body.marketing .price-card.gold .price-buy { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--shell-dark); }
body.marketing .plan-name { color: #9a6f1c; font-weight: 700; }
body.marketing .plan-price { font-family: Poppins, sans-serif; font-weight: 700; font-size: 40px; }
body.marketing .window.gate .gate-card { border-radius: 18px; border: 1px solid #ecdfc3; box-shadow: 0 24px 60px rgba(72, 28, 12, .12); }
body.marketing .m-foot { color: var(--muted); }

/* ---------- fixes: inputs inside coloured bands, line remove buttons ---------- */
.titlebar input, .tally-vch-band input, .tally-date input {
    color: var(--ink) !important;
    background: #fffdf8 !important;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--gold-2) !important;
    border-radius: 7px;
    padding: 4px 8px !important;
}
.tally-date { color: #fff; font-size: 13px; font-weight: 500; display: flex; gap: 8px; align-items: center; }
.tally-date input { width: 130px; }
.tally-vch-band input { width: 90px; }
button.row-x, .text-button.row-x {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--danger);
    font-size: 18px;
    width: 28px;
    height: 28px;
    border-radius: 6px !important;
    cursor: pointer;
}
button.row-x:hover { background: #fbe3e3 !important; }
table.gst-grid, table.gst-grid th, table.gst-grid td { border-left: 0 !important; border-right: 0 !important; }
body.marketing .pf-side { padding: 12px 14px; }

/* ---------- Account Books date filter ---------- */
.book-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 14px;
    padding: 12px 16px;
    background: #fbf3df;
    border-bottom: 1px solid var(--line);
}
.book-filter label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.book-filter input { border: 1px solid #ddcfb2; border-radius: 8px; padding: 7px 10px; font-size: 14px; background: #fff; color: var(--ink); min-width: 150px; }
.book-filter .book-pick input { min-width: 260px; }
.book-filter .price-buy { padding: 8px 18px; }
.book-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.daybook-wait { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 15px; }
tr[data-open] { cursor: pointer; }
tr.mark td { background: linear-gradient(90deg, var(--gold-2), var(--select)) !important; }

/* ---------- Edit Log ---------- */
.integrity { margin: 10px 16px 0; padding: 9px 14px; border-radius: 10px; font-size: 13.5px; }
.integrity.ok { background: #e3f4ea; color: var(--ok); border: 1px solid #b5dfc6; }
.integrity.bad { background: #fbe3e3; color: var(--danger); border: 1px solid #f0b9b9; }
.act-pill { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.act-pill.a-create, .act-pill.a-restore { background: #e3f4ea; color: var(--ok); }
.act-pill.a-alter, .act-pill.a-unlock { background: #fff1cf; color: #7a4a00; }
.act-pill.a-delete, .act-pill.a-lock { background: #fbe3e3; color: var(--danger); }
.act-pill.a-export { background: #e6eefb; color: #24508f; }
.audit-table td { font-size: 13px; }
.modal:has(.audit-detail) { width: min(1000px, 96vw); }
.audit-detail { width: 100%; max-height: 82vh; overflow: auto; }
.audit-detail h3 { overflow-wrap: anywhere; }
.audit-detail h3 { margin: 0 0 4px; color: var(--maroon); }
.audit-meta { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.diff-col { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.diff-col h4 { margin: 0 0 6px; color: var(--maroon); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.diff-col.empty-col { background: #faf6ee; }
.mini-table tr.changed td { background: #fff1cf; font-weight: 600; }
.mini-table.lines { margin-top: 8px; }
.field-diff td:first-child { color: var(--muted); white-space: nowrap; }
.click-row { cursor: pointer; }
.click-row:hover td { background: #fff8e6; }
@media (max-width: 760px) { .diff-grid { grid-template-columns: 1fr; } }

/* Backup & Restore */
.backup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px; }
.backup-card { background: var(--paper, #fffdf7); border: 1px solid rgba(122, 28, 40, .18); border-radius: 10px; padding: 14px 16px; }
.backup-card.wide { grid-column: 1 / -1; }
.backup-card h3 { margin: 0 0 6px; color: var(--maroon, #7a1c28); font-size: 15px; }
.backup-card .field { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; font-size: 12px; }
.backup-card .field input { padding: 6px 8px; }
.backup-list table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.backup-list td, .backup-list th { padding: 4px 6px; border-bottom: 1px solid rgba(0,0,0,.06); text-align: left; }
.restore-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.restore-row .field { min-width: 220px; }
@media (max-width: 760px) { .backup-grid { grid-template-columns: 1fr; } }

/* Bank reconciliation */
.br-tabs { display: flex; gap: 6px; align-items: center; padding: 10px 14px 0; border-bottom: 1px solid rgba(122, 28, 40, .15); }
.br-tabs .grow { flex: 1; }
.br-tab { border: 1px solid rgba(122, 28, 40, .25); border-bottom: none; background: #f6efe2; padding: 7px 14px; border-radius: 8px 8px 0 0; cursor: pointer; font: inherit; color: #5b2a2f; }
.br-tab.on { background: var(--maroon, #7a1c28); color: #fff; }
.br-upload { display: grid; grid-template-columns: minmax(280px, 1fr) 2fr; gap: 14px; padding: 14px; }
.br-drop { display: flex; flex-direction: column; gap: 4px; border: 2px dashed rgba(122, 28, 40, .35); border-radius: 10px; padding: 14px; cursor: pointer; background: #fffaf0; }
.br-drop b { color: var(--maroon, #7a1c28); }
.br-drop span { font-size: 12px; color: #6b5a52; }
.br-drop input { margin-top: 6px; }
.br-stats { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.br-stats div { flex: 1; min-width: 96px; background: #fff; border: 1px solid rgba(0, 0, 0, .07); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.br-stats b { font-size: 20px; }
.br-stats span { font-size: 11px; color: #7b6a60; text-transform: uppercase; letter-spacing: .04em; }
.br-stats .ok b { color: #1f7a3e; }
.br-stats .warn b { color: #b4541c; }
.br-table { width: 100%; border-collapse: collapse; }
.br-table th, .br-table td { padding: 6px 8px; border-bottom: 1px solid rgba(0, 0, 0, .06); vertical-align: top; text-align: left; }
.br-table .num { text-align: right; white-space: nowrap; }
.br-table tr.st-open td { background: #fffaf0; }
.br-table tr.st-ignored td { color: #999; }
.br-table.small { font-size: 12px; }
.br-action { min-width: 360px; }
.br-action select { max-width: 300px; }
.br-post { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.br-post input[list] { width: 200px; padding: 4px 6px; }
.br-remember { font-size: 11px; color: #6b5a52; display: flex; gap: 4px; align-items: center; }
.br-remember input:not([type]) { padding: 2px 4px; font-size: 11px; }
.br-sub { margin: 18px 14px 6px; color: var(--maroon, #7a1c28); }
.link-btn { background: none; border: none; color: var(--maroon, #7a1c28); text-decoration: underline; cursor: pointer; font: inherit; font-size: 12px; padding: 0 4px; }
.brs-sheet { max-width: 820px; margin: 14px auto; background: #fff; border: 1px solid rgba(0, 0, 0, .08); border-radius: 10px; padding: 18px 22px; }
.brs-sheet h3 { margin: 0; color: var(--maroon, #7a1c28); }
.brs-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed rgba(0, 0, 0, .12); }
.brs-line.total { font-size: 15px; border-bottom: 2px solid rgba(122, 28, 40, .35); }
.brs-items { width: 100%; font-size: 12px; margin: 2px 0 6px 18px; }
.brs-items td { padding: 2px 6px; }
.brs-items .num { text-align: right; }
@media (max-width: 760px) { .br-upload { grid-template-columns: 1fr; } .br-action { min-width: 0; } }
@media print {
    body * { visibility: hidden !important; }
    #brs-sheet, #brs-sheet * { visibility: visible !important; }
    #brs-sheet { position: absolute; left: 0; top: 0; width: 100%; border: none; }
}
#br-body .sheet-scroll { max-height: none; overflow: visible; }
.br-table td:first-child { white-space: nowrap; }
.brs-items { width: calc(100% - 18px); }
.brs-items td:first-child { white-space: nowrap; width: 96px; }

/* Orders */
.order-head { display: grid; grid-template-columns: 2fr 1fr 1fr 2fr; gap: 12px; padding: 14px; }
.order-head label, .order-actions label.inline { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.order-head input { padding: 6px 8px; }
.order-lines { width: 100%; border-collapse: collapse; }
.order-lines th, .order-lines td { padding: 5px 8px; border-bottom: 1px solid rgba(0, 0, 0, .06); text-align: left; }
.order-lines .num, .order-lines input.num { text-align: right; }
.order-lines input { padding: 4px 6px; width: 100%; box-sizing: border-box; }
.order-lines input.ol-desc { min-width: 240px; }
.order-actions { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 14px; }
.order-meta { display: grid; grid-template-columns: repeat(4, 1fr) 2fr; gap: 10px; padding: 14px; }
.order-meta div { background: #fff; border: 1px solid rgba(0, 0, 0, .07); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; }
.order-meta span { font-size: 11px; text-transform: uppercase; color: #7b6a60; letter-spacing: .04em; }
.act-pill.st-pending { background: #fff1de; color: #9a5a12; }
.act-pill.st-part { background: #e6f0ff; color: #1d4f9a; }
.act-pill.st-complete { background: #e3f4e8; color: #1f7a3e; }
.act-pill.st-closed { background: #eee; color: #666; }
.badge.st-complete { background: #e3f4e8; color: #1f7a3e; }
.overdue { color: #b42318; font-weight: 600; font-size: 11px; margin-left: 4px; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fbf4e6; }
.mini.danger { color: #b42318; }
@media (max-width: 760px) { .order-head, .order-meta { grid-template-columns: 1fr 1fr; } }
