:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f5f1;
    color: #17221c;
    --ink: #17221c;
    --muted: #6d7871;
    --line: #dde2dc;
    --green: #194d33;
    --green-soft: #e7f0e9;
    --paper: #ffffff;
    --sidebar: #f7f8f5;
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
body { min-width: 320px; background: #f3f5f1; }
button { font: inherit; }
button:focus-visible { outline: 3px solid rgba(47, 111, 75, 0.28); outline-offset: 2px; }
h1:focus { outline: none; }

.workspace-shell {
    min-height: 100dvh;
    padding-bottom: 2.5rem;
    background:
        radial-gradient(circle at 82% 10%, var(--theme-glow, rgba(190, 220, 163, .28)), transparent 28rem),
        linear-gradient(145deg, var(--theme-wash, #f3f5f1) 0%, #f7f8f5 54%, var(--theme-soft, #e7f0e9) 145%);
    transition: background .25s ease;
}

.login-shell {
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}
.login-card {
    width: min(26rem, 100%);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(23, 34, 28, .08);
}
.session-chip {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: var(--muted);
    font-size: .82rem;
}
.session-chip .ghost-action { padding: .25rem .55rem; font-size: .78rem; }

.theme-home {
    --green: #194d33;
    --green-soft: #e7f0e9;
    --theme-wash: #f3f5f1;
    --theme-soft: #dfece2;
    --theme-glow: rgba(89, 151, 104, .2);
}

.theme-items {
    --green: #124b47;
    --green-soft: #dfeeea;
    --theme-wash: #f1f6f4;
    --theme-soft: #cae3dc;
    --theme-glow: rgba(48, 143, 132, .24);
}

.theme-sales {
    --green: #31346f;
    --green-soft: #e7e8f6;
    --theme-wash: #f4f4fa;
    --theme-soft: #d8daf0;
    --theme-glow: rgba(92, 98, 184, .22);
}

.theme-purchases {
    --green: #682d52;
    --green-soft: #f3e4ed;
    --theme-wash: #faf4f7;
    --theme-soft: #ead1df;
    --theme-glow: rgba(165, 77, 126, .2);
}

.theme-bank {
    --green: #1d4f78;
    --green-soft: #e0ecf5;
    --theme-wash: #f2f7fa;
    --theme-soft: #cfe1ef;
    --theme-glow: rgba(57, 126, 177, .22);
}

.theme-inventory {
    --green: #124b47;
    --green-soft: #dfeeea;
    --theme-wash: #f1f6f4;
    --theme-soft: #cae3dc;
    --theme-glow: rgba(48, 143, 132, .24);
}

.theme-accounting {
    --green: #3d4a6d;
    --green-soft: #e6e9f3;
    --theme-wash: #f4f5fa;
    --theme-soft: #d5dae8;
    --theme-glow: rgba(88, 102, 150, .22);
}

.theme-more {
    --green: #4a3d6d;
    --green-soft: #ebe7f4;
    --theme-wash: #f6f4fa;
    --theme-soft: #ddd4ec;
    --theme-glow: rgba(110, 88, 160, .2);
}
.workspace-header {
    height: 6rem;
    padding: 0 1.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(1rem);
    position: sticky;
    top: 0;
    z-index: 10;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
}
.product-sign {
    flex: 0 0 auto;
    width: 2.9rem; height: 2.9rem; border: 0; border-radius: .8rem;
    background: var(--green); color: white; cursor: pointer;
    font-family: Georgia, serif; font-size: 1.5rem;
    box-shadow: 0 .5rem 1.2rem rgba(25,77,51,.16);
}
.organisation-card {
    display: grid;
    grid-template-columns: minmax(0, auto) auto;
    grid-template-rows: auto auto auto;
    column-gap: .55rem;
    align-items: center;
    min-width: 0;
    padding: .2rem 0 .2rem .95rem;
    border: 0;
    border-left: 1px solid var(--line);
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: var(--ink);
}
.organisation-card .organisation-meta,
.organisation-card strong,
.organisation-card > span:not(.organisation-chevron) {
    grid-column: 1;
    justify-self: start;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.organisation-card strong { font-size: .95rem; line-height: 1.25; }
.organisation-card > span:not(.organisation-chevron):not(.organisation-meta) {
    color: var(--muted);
    font-size: .7rem;
    letter-spacing: .04em;
}
.organisation-meta {
    color: #8a938d;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.organisation-chevron {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: center;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--muted);
}

.page-trail {
    min-height: 2.55rem;
    padding: .35rem 1.6rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem .5rem;
    border-bottom: 1px solid var(--line);
    background: rgba(250, 251, 249, .9);
    color: #8a948d;
    position: sticky;
    top: 6rem;
    z-index: 9;
    backdrop-filter: blur(.8rem);
}

.page-trail button {
    padding: .25rem .38rem;
    border: 0;
    border-radius: .35rem;
    background: transparent;
    color: #6f7972;
    cursor: pointer;
    font-size: .76rem;
    font-weight: 650;
}

.page-trail button:hover,
.page-trail button:focus-visible {
    background: var(--green-soft);
    color: var(--green);
}

.page-trail button.current {
    color: var(--green);
    font-size: .95rem;
    font-weight: 800;
    cursor: default;
}

.page-trail .trail-arrow {
    color: #aeb6b0;
    font-size: .85rem;
    line-height: 1;
    user-select: none;
}

.workspace-body { min-height: calc(100dvh - 8.5rem); display: grid; grid-template-columns: 17rem minmax(0, 1fr); }
.sidebar {
    padding: 1.5rem 1rem; border-right: 1px solid var(--line); background: var(--sidebar);
    position: sticky; top: 6rem; height: calc(100dvh - 8.5rem); overflow-y: auto;
}
.primary-nav { display: grid; gap: .35rem; }
.nav-button {
    width: 100%; min-height: 3rem; padding: .65rem .75rem; display: grid;
    grid-template-columns: 1.8rem 1fr auto; align-items: center; gap: .55rem;
    border: 1px solid transparent; border-radius: .7rem; background: transparent;
    color: #35433b; text-align: left; cursor: pointer; font-weight: 650;
}
.nav-button:hover { background: white; border-color: var(--line); }
.nav-button.active { background: var(--green); color: white; box-shadow: 0 .5rem 1.25rem rgba(25,77,51,.12); }
.nav-icon { font-size: 1.12rem; text-align: center; }
kbd {
    min-width: 1.45rem; padding: .16rem .36rem; border: 1px solid #d6dcd6; border-bottom-width: 2px;
    border-radius: .35rem; background: white; color: #647068; font: 700 .66rem/1.1 Inter, sans-serif; text-align: center;
}
.nav-button.active kbd { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.12); color: white; }
.content-area { padding: clamp(2rem, 5vw, 4.5rem); overflow: hidden; }
.content-area section { max-width: 76rem; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2.3rem; }
.breadcrumb { margin: 0 0 .55rem; color: #64806e; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.page-heading h1, .gateway h1 { margin: 0; color: var(--green); font-family: Georgia, serif; font-size: clamp(2.8rem, 5vw, 4.7rem); font-weight: 400; letter-spacing: -.045em; line-height: .98; }
.page-heading > div > p:last-child, .gateway > p:nth-child(3) { margin: .75rem 0 0; color: var(--muted); }
.primary-action { padding: .7rem 1rem; border: 0; border-radius: .6rem; background: var(--green); color: white; cursor: pointer; font-weight: 700; white-space: nowrap; }
.primary-action span { margin-right: .35rem; }
.primary-action:disabled { opacity: .45; cursor: not-allowed; }
.form-error { margin: 0; color: #a12828; font-size: .82rem; font-weight: 600; }
.list-search { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .78rem; }
.list-search input {
    min-height: 2rem; min-width: 12rem; padding: .25rem .45rem;
    border: 1px solid var(--line); border-radius: .4rem; background: #fff; color: var(--ink);
    font: 500 .8rem "Segoe UI", Tahoma, sans-serif;
}

.list-card { overflow: hidden; border: 1px solid var(--line); border-radius: .9rem; background: var(--paper); box-shadow: 0 1rem 3rem rgba(31,46,37,.04); }
.list-toolbar { min-height: 3.7rem; padding: 0 1.25rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.list-toolbar span { color: var(--muted); font-size: .78rem; }
.report-toolbar label,
.recon-account {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--muted);
    font-size: .78rem;
}
.report-toolbar input,
.recon-account select {
    min-height: 2rem;
    padding: .25rem .45rem;
    border: 1px solid var(--line);
    border-radius: .4rem;
    background: #fff;
    color: var(--ink);
    font: 500 .8rem "Segoe UI", Tahoma, sans-serif;
}
.report-empty { padding: 1.25rem; }
.report-empty > p { margin: 0 0 1rem; color: var(--muted); font-size: .88rem; }
.recon-table .table-row {
    grid-template-columns: 4.5rem 7rem minmax(10rem, 2fr) 7rem 7rem 7rem;
    min-height: 3.2rem;
}
.recon-cleared { background: #f3f8f4; opacity: .85; }
.recon-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .84rem;
}
.recon-foot strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.gstr2b-json {
    width: 100%;
    margin-top: .35rem;
    font-family: ui-monospace, Consolas, monospace;
    font-size: .78rem;
    line-height: 1.4;
    padding: .65rem .75rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fafbfa;
    color: var(--ink);
    resize: vertical;
    min-height: 10rem;
    box-sizing: border-box;
}
.recon-statement {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}
.recon-statement input {
    width: 7.5rem;
    min-height: 2rem;
    padding: .25rem .45rem;
    border: 1px solid var(--line);
    border-radius: .4rem;
}
.tally-grid-stock .tally-grid-row {
    grid-template-columns: minmax(10rem, 2fr) 6rem 5rem 6rem 7rem;
}
.tally-grid-transfer .tally-grid-row {
    grid-template-columns: minmax(10rem, 2fr) 5rem 5rem 4.5rem 6rem 7rem;
}
.tally-grid-allocate .tally-grid-row {
    grid-template-columns: 7rem 7rem 7rem 7rem 7rem;
}
.tally-grid-adjust .tally-grid-row {
    grid-template-columns: minmax(10rem, 2fr) 6rem 6rem 6rem 6rem;
}
.tally-check {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.tally-check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}
.data-table { min-width: 42rem; }
.table-row { width: 100%; min-height: 4.5rem; padding: .8rem 1.25rem; display: grid; grid-template-columns: minmax(14rem, 2fr) 1fr 1fr 1fr; align-items: center; gap: 1rem; border: 0; border-bottom: 1px solid #edf0ec; background: white; color: #37433c; text-align: left; }
button.table-row { cursor: pointer; }
button.table-row:hover { background: #fafbf9; }
button.report-row-drill:hover { background: #f0f6f1; }
button.report-row-drill:focus-visible { outline: 2px solid var(--green, #2d6a4f); outline-offset: -2px; }
.table-row:last-child { border-bottom: 0; }
.table-header { min-height: 2.7rem; background: #f8f9f7; color: #89928c; font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.item-name { display: flex; align-items: center; gap: .85rem; }
.item-name i { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; flex: none; border-radius: .55rem; background: var(--green-soft); color: var(--green); font-style: normal; font-size: .7rem; font-weight: 800; }
.item-name span { display: grid; gap: .18rem; }
.item-name strong { color: var(--ink); font-size: .88rem; }
.item-name small { color: #929b95; font-size: .68rem; }
.stock { padding: .28rem .48rem; border-radius: 999px; background: #eaf4eb; color: #377347; font-style: normal; font-size: .7rem; font-weight: 700; }
.stock.muted { background: #f0f1ef; color: #8b928d; }

.gateway { min-height: 60vh; position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.gateway-mark { position: absolute; right: 3%; color: rgba(25,77,51,.045); font-family: Georgia,serif; font-size: min(34vw, 28rem); line-height: 1; pointer-events: none; }
.empty-workspace { min-height: 24rem; display: grid; place-items: center; align-content: center; padding: 3rem; border: 1px dashed #cdd5ce; border-radius: 1rem; background: rgba(255,255,255,.48); text-align: center; }
.empty-icon { width: 3.5rem; height: 3.5rem; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 1.4rem; }
.empty-workspace h2 { margin: 1rem 0 .35rem; font-family: Georgia,serif; font-weight: 400; }
.empty-workspace p { max-width: 31rem; margin: 0; color: var(--muted); }

.shortcut-bar {
    padding: 0 1rem 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .42rem;
    color: #667169;
    font-size: .7rem;
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: 12;
    pointer-events: none;
}

.shortcut-chip {
    min-height: 2.15rem;
    padding: .3rem .55rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid rgba(116, 128, 119, .22);
    border-radius: .55rem;
    background: rgba(255, 255, 255, .86);
    color: #68736c;
    box-shadow: 0 .4rem 1.2rem rgba(31, 46, 37, .08);
    backdrop-filter: blur(.7rem);
    pointer-events: auto;
}

button.shortcut-chip { cursor: pointer; }
button.shortcut-chip:hover { border-color: var(--green); color: var(--green); }
.shortcut-chip kbd { min-width: 2rem; }

@media (max-width: 760px) {
    .workspace-header { height: 5rem; padding: 0 1rem; }
    .header-brand { gap: .55rem; }
    .page-trail { padding-inline: 1rem; top: 5rem; }
    .organisation-meta { display: none; }
    .organisation-card { padding-left: .65rem; }
    .session-chip span { display: none; }
    .workspace-body { display: block; }
    .sidebar { position: static; height: auto; padding: .75rem; border-right: 0; border-bottom: 1px solid var(--line); }
    .primary-nav { grid-template-columns: repeat(4, 1fr); }
    .nav-button { display: flex; justify-content: center; padding: .6rem .25rem; font-size: .72rem; }
    .nav-button .nav-icon, .nav-button kbd { display: none; }
    .content-area { padding: 2rem 1rem 4rem; overflow-x: auto; }
    .page-heading { align-items: flex-start; }
    .shortcut-bar { padding: 0 .65rem .65rem 0; }
}

.centre-stage {
    min-height: calc(100dvh - 11.05rem);
    display: grid;
    place-items: center;
    padding: clamp(1rem, 2.5vw, 2rem);
}

.centre-stage:has(.item-form-page),
.centre-stage:has(.records-page) {
    place-items: start center;
}

.centre-stage > section {
    width: min(100%, 42rem);
}

.gateway-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .8rem;
    align-items: center;
    padding: 0;
}

.gateway-heading {
    padding-left: .2rem;
    text-align: left;
}

.gateway-heading h1 {
    margin: 0;
    color: var(--green);
    font-family: Georgia, serif;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 400;
    letter-spacing: -.055em;
    line-height: .92;
}

.gateway-actions {
    display: grid;
    gap: .32rem;
    padding: .55rem;
    border: 1px solid var(--line);
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, .74);
    box-shadow: 0 1.5rem 5rem rgba(31, 46, 37, .06);
}

.primary-gateway-actions {
    grid-template-columns: minmax(0, 1fr);
}

.module-actions {
    grid-template-columns: minmax(0, 1fr);
}

.gateway-button {
    min-height: 3.25rem;
    padding: .45rem .75rem;
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    align-items: center;
    gap: .8rem;
    border: 1px solid transparent;
    border-radius: .75rem;
    background: transparent;
    color: #2f3d35;
    text-align: left;
    cursor: pointer;
    font-weight: 700;
}

.gateway-button kbd {
    width: 1.8rem;
    height: 1.8rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: .48rem;
    background: var(--green-soft);
    color: var(--green);
    font-size: .75rem;
}

.primary-gateway-actions .module-items { --module-dark: #124b47; --module-soft: #dfeeea; }
.primary-gateway-actions .module-sales { --module-dark: #31346f; --module-soft: #e7e8f6; }
.primary-gateway-actions .module-purchases { --module-dark: #682d52; --module-soft: #f3e4ed; }
.primary-gateway-actions .module-bank { --module-dark: #1d4f78; --module-soft: #e0ecf5; }
.primary-gateway-actions .module-inventory { --module-dark: #0f5c4c; --module-soft: #d7efe8; }
.primary-gateway-actions .module-accounting { --module-dark: #3d4a6d; --module-soft: #e6e9f3; }
.primary-gateway-actions .module-more { --module-dark: #4a3d6d; --module-soft: #ebe7f4; }

.primary-gateway-actions .gateway-button {
    border-color: color-mix(in srgb, var(--module-dark) 12%, transparent);
    background: linear-gradient(135deg, white 20%, var(--module-soft) 145%);
    color: var(--module-dark);
}

.primary-gateway-actions .gateway-button kbd {
    background: var(--module-soft);
    color: var(--module-dark);
}

/* One selection style everywhere: outer ring only. */
.gateway-actions .gateway-button:hover,
.gateway-actions .gateway-button:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--green) 52%, white);
    outline-offset: 2px;
    box-shadow: none;
}

.gateway-actions .gateway-button:hover i,
.gateway-actions .gateway-button:focus-visible i {
    transform: translateX(.2rem);
}

.primary-gateway-actions .gateway-button:hover,
.primary-gateway-actions .gateway-button:focus-visible {
    outline-color: color-mix(in srgb, var(--module-dark) 58%, white);
    border-color: color-mix(in srgb, var(--module-dark) 12%, transparent);
    background: linear-gradient(135deg, white 20%, var(--module-soft) 145%);
    color: var(--module-dark);
}

/* While arrow-key navigating, ignore hover so only focus is highlighted. */
html.keyboard-nav .gateway-button:hover:not(:focus-visible),
html.keyboard-nav button.table-row:hover:not(:focus-visible) {
    outline: none;
}

html.keyboard-nav .gateway-button:hover:not(:focus-visible) i {
    transform: none;
}

html.keyboard-nav button.table-row:hover:not(:focus-visible) {
    background: white;
}

.gateway-button i {
    color: #9aa49d;
    font-style: normal;
    transition: transform .15s ease;
}

.records-page {
    align-self: start;
    margin: 0 auto;
}

.records-page .page-heading {
    margin-bottom: 1.1rem;
}

.records-page .page-heading h1 {
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 750;
    letter-spacing: -.035em;
}

.centre-stage > .item-form-page,
.centre-stage > .tally-page,
.centre-stage > .reports-hub {
    width: min(100%, 64rem);
}

.reports-hub {
    align-self: start;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem 1.6rem;
    padding: 1.2rem 1.3rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 1.2rem 3rem rgba(31, 46, 37, .05);
}

.reports-column h2 {
    margin: 0 0 .7rem;
    color: var(--green);
    font-size: .92rem;
    font-weight: 800;
}

.reports-column ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: .28rem;
}

.reports-column button {
    width: 100%;
    padding: .42rem .2rem;
    border: 0;
    background: transparent;
    color: #5b6660;
    text-align: left;
    cursor: pointer;
    font-size: .84rem;
    font-weight: 550;
    display: grid;
    grid-template-columns: 1.6rem 1fr;
    gap: .45rem;
    align-items: center;
}

.reports-column button kbd {
    min-width: 1.35rem;
    padding: .12rem .2rem;
    border: 1px solid #d0d7d1;
    border-bottom-width: 2px;
    border-radius: .3rem;
    background: white;
    color: #647068;
    font: 700 .62rem/1.1 Inter, sans-serif;
    text-align: center;
}

.reports-column button:hover,
.reports-column button:focus-visible {
    color: var(--green);
}

.reports-column button:hover kbd,
.reports-column button:focus-visible kbd {
    border-color: color-mix(in srgb, var(--green) 35%, white);
    color: var(--green);
}

.tally-voucher {
    border: 1px solid #9aab9e;
    background: #fbfcf8;
    box-shadow: 0 .8rem 2rem rgba(31, 46, 37, .06);
    font-family: "Segoe UI", Tahoma, sans-serif;
}

.tally-voucher-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem .85rem;
    border-bottom: 1px solid #9aab9e;
    background: linear-gradient(180deg, #e8eee8, #d7e0d8);
}

.tally-voucher-head strong {
    color: var(--green);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.tally-voucher-meta {
    display: flex;
    align-items: center;
    gap: .85rem;
    color: #3d4a41;
    font-size: .82rem;
    font-weight: 650;
}

.tally-voucher-meta label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.tally-voucher-meta input,
.tally-no {
    width: 7.5rem;
    height: 1.85rem;
    padding: 0 .4rem;
    border: 1px solid #8f9e93;
    background: #fffef8;
    color: var(--ink);
    font: 600 .82rem "Segoe UI", Tahoma, sans-serif;
}

.tally-no { width: 4.5rem; text-align: right; }

.tally-voucher-party,
.tally-master-body {
    display: grid;
    gap: .45rem;
    padding: .75rem .85rem;
    border-bottom: 1px solid #c5d0c7;
}

.tally-field {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr);
    gap: .65rem;
    align-items: center;
}

.tally-field > span {
    color: #2f3d35;
    font-size: .82rem;
    font-weight: 650;
    text-align: right;
}

.tally-field > span::after { content: " :"; }

.tally-field input,
.tally-field select,
.tally-field textarea,
.tally-grid input,
.tally-narration input {
    width: 100%;
    min-height: 1.85rem;
    padding: .2rem .45rem;
    border: 1px solid #8f9e93;
    background: #fffef8;
    color: var(--ink);
    font: 500 .84rem "Segoe UI", Tahoma, sans-serif;
}

.tally-field textarea { min-height: 4.2rem; resize: vertical; }
.tally-field-wide { align-items: start; }
.tally-field-wide > span { padding-top: .35rem; }

.tally-amount { text-align: right; font-variant-numeric: tabular-nums; }

.tally-grid {
    display: grid;
    border-bottom: 1px solid #9aab9e;
}

.tally-grid-row {
    display: grid;
    grid-template-columns: minmax(12rem, 2.4fr) 5.5rem 6rem 4.5rem 7rem;
    border-bottom: 1px solid #d5ddd6;
}

.tally-grid-gst-intra .tally-grid-row {
    grid-template-columns: minmax(9rem, 1.8fr) 4.2rem 5rem 3.4rem 4.5rem 3.6rem 5rem 5rem 6rem;
}

.tally-grid-gst-inter .tally-grid-row {
    grid-template-columns: minmax(9rem, 1.8fr) 4.2rem 5rem 3.4rem 4.5rem 3.6rem 5.5rem 6rem;
}

.tally-grid-expense .tally-grid-row {
    grid-template-columns: minmax(12rem, 1fr) 8rem;
}

.tally-grid-journal .tally-grid-row {
    grid-template-columns: minmax(10rem, 2fr) minmax(8rem, 1.2fr) 7rem 7rem minmax(8rem, 1.5fr);
}

.tally-grid-voucher-nos .tally-grid-row {
    grid-template-columns: minmax(8rem, 1.5fr) 7rem 6rem 5rem;
}

.tally-grid-taxes .tally-grid-row {
    grid-template-columns: minmax(8rem, 1.5fr) 6rem 6rem 5rem 5rem;
}

.tally-grid-row:last-child { border-bottom: 0; }

.tally-grid-head {
    background: #e7eee8;
    color: #3f4d44;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tally-grid-head span {
    padding: .4rem .5rem;
    border-right: 1px solid #c5d0c7;
}

.tally-grid-head span:last-child { border-right: 0; }

.tally-grid-row input {
    border: 0;
    border-right: 1px solid #d5ddd6;
    border-radius: 0;
    background: #fffef8;
    min-height: 2rem;
}

.tally-grid-row input[readonly] {
    background: #f4f7f4;
    color: #4a5a50;
}
.tally-grid-row input:focus {
    outline: 2px solid color-mix(in srgb, var(--green) 35%, white);
    outline-offset: -2px;
    background: #fff;
}

.tally-voucher-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
    padding: .7rem .85rem;
    border-bottom: 1px solid #9aab9e;
}

.tally-voucher-bottom-gst { align-items: start; }

.tally-totals {
    display: grid;
    gap: .25rem;
    min-width: 11rem;
    justify-items: stretch;
}

.tally-total-line,
.tally-total {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    font-variant-numeric: tabular-nums;
}

.tally-total-line {
    color: #4a5a50;
    font-size: .82rem;
}

.tally-total strong { font-size: 1.05rem; }

.tally-narration {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    gap: .55rem;
    align-items: center;
}

.tally-narration > span {
    color: #2f3d35;
    font-size: .82rem;
    font-weight: 650;
    text-align: right;
}

.tally-narration > span::after { content: " :"; }

.tally-total {
    display: grid;
    justify-items: end;
    gap: .2rem;
    min-width: 8rem;
    color: #2f3d35;
    font-size: .78rem;
    font-weight: 700;
}

.tally-total strong {
    color: var(--green);
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}

.tally-voucher-foot {
    display: flex;
    gap: .65rem;
    padding: .75rem .85rem;
    background: #f3f6f2;
}

.tally-master .tally-master-body {
    grid-template-columns: 1fr;
}

.item-form {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 1.2rem 3rem rgba(31, 46, 37, .05);
    overflow: hidden;
}

.item-form-section {
    padding: 1.35rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--line);
}

.item-form-section:last-of-type {
    border-bottom: 0;
}

.item-form-section h2 {
    margin: 0 0 1rem;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 750;
}

.item-basics {
    display: block;
}

.item-basics-fields {
    display: grid;
    gap: 1rem;
}

.item-form .field {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr);
    gap: .85rem;
    align-items: start;
}

.item-form .field > span,
.item-form .field-label {
    padding-top: .7rem;
    color: #5f6a63;
    font-size: .78rem;
    font-weight: 700;
}

.item-form .field.required > span {
    color: #b42318;
}

.item-form .field.required > span::after {
    content: " *";
}

.field-label.with-hint,
.hinted-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.field-label.with-hint i {
    width: 1rem;
    height: 1rem;
    display: grid;
    place-items: center;
    border: 1px solid #c5cdc6;
    border-radius: 50%;
    color: #7a857e;
    font-style: normal;
    font-size: .62rem;
    font-weight: 800;
    cursor: help;
}

.hinted-label {
    border-bottom: 1px dashed #b7c0b9;
    width: fit-content;
    cursor: help;
}

.item-form input[type="text"],
.item-form input:not([type]),
.item-form input[inputmode],
.item-form select,
.item-form textarea {
    width: 100%;
    min-height: 2.6rem;
    padding: .55rem .75rem;
    border: 1px solid #d5ddd6;
    border-radius: .45rem;
    background: white;
    color: var(--ink);
    font: 500 .9rem Inter, sans-serif;
}

.item-form textarea {
    min-height: 6.5rem;
    resize: vertical;
}

.item-form input:focus,
.item-form select:focus,
.item-form textarea:focus {
    border-color: var(--green);
    outline: 3px solid color-mix(in srgb, var(--green) 14%, transparent);
}

.type-toggle {
    display: inline-flex;
    gap: .15rem;
    padding: .2rem;
    border: 1px solid #d5ddd6;
    border-radius: .55rem;
    background: #f7f8f6;
    width: fit-content;
}

.type-toggle label {
    min-width: 5.5rem;
    padding: .45rem .8rem;
    border-radius: .4rem;
    color: #526057;
    text-align: center;
    cursor: pointer;
    font-size: .86rem;
    font-weight: 650;
}

.type-toggle label.active {
    background: white;
    color: var(--green);
    box-shadow: 0 .2rem .6rem rgba(31, 46, 37, .08);
}

.type-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.search-field {
    position: relative;
}

.search-field input {
    padding-right: 2.2rem;
}

.search-field span {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8a938d;
    font-size: 1rem;
}

.tax-rates-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.tax-rates-section .field {
    grid-template-columns: 1fr;
    gap: .45rem;
}

.tax-rates-section .field > span {
    padding-top: 0;
}

.section-toggle {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 1rem;
    color: var(--ink);
    cursor: pointer;
    font-size: .95rem;
    font-weight: 750;
}

.section-toggle input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--green);
}

.item-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.item-column {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.affix-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
}

.affix-field > span {
    display: grid;
    place-items: center;
    padding: 0 .75rem;
    border: 1px solid #d5ddd6;
    border-right: 0;
    border-radius: .45rem 0 0 .45rem;
    background: #f5f7f4;
    color: #667169;
    font-size: .78rem;
    font-weight: 750;
}

.affix-field input {
    border-radius: 0 .45rem .45rem 0 !important;
}

.item-form-actions {
    display: flex;
    gap: .7rem;
    padding: 1rem 1.5rem 1.35rem;
    border-top: 1px solid var(--line);
    background: #fafbf9;
}

.ghost-action {
    padding: .7rem 1rem;
    border: 1px solid var(--line);
    border-radius: .6rem;
    background: white;
    color: #465149;
    cursor: pointer;
    font-weight: 650;
}

.ghost-action:hover {
    border-color: #b7c2ba;
    color: var(--ink);
}

.main-gateway {
    width: min(100%, 34rem) !important;
}

.compact-empty {
    min-height: 18rem;
}

.entity-gateway {
    width: min(100%, 34rem) !important;
}

.entry-card {
    display: grid;
    gap: .9rem;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .8);
    box-shadow: 0 1.2rem 3rem rgba(31, 46, 37, .05);
}

.entry-card label {
    display: grid;
    gap: .38rem;
    color: #657069;
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .04em;
}

.entry-card input {
    width: 100%;
    height: 2.8rem;
    padding: 0 .8rem;
    border: 1px solid #d5ddd6;
    border-radius: .55rem;
    background: white;
    color: var(--ink);
    font: 500 .9rem Inter, sans-serif;
}

.entry-card input:focus {
    border-color: var(--green);
    outline: 3px solid color-mix(in srgb, var(--green) 14%, transparent);
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}

.save-action {
    justify-self: end;
}

@media (max-width: 760px) {
    .centre-stage {
        min-height: calc(100dvh - 7.55rem);
        display: grid;
        place-items: center;
        padding: 1rem 1rem 3rem;
    }

    .gateway-panel {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .module-actions {
        grid-template-columns: 1fr;
    }

    .gateway-button {
        min-height: 3.05rem;
    }

    .entry-grid {
        grid-template-columns: 1fr;
    }

    .item-basics,
    .item-two-column,
    .tax-rates-grid,
    .tally-field,
    .tally-voucher-bottom,
    .tally-narration {
        grid-template-columns: 1fr;
    }

    .tally-field > span,
    .tally-narration > span {
        text-align: left;
        padding-top: 0;
    }

    .tally-grid-row {
        grid-template-columns: 1fr 1fr;
    }

    .tally-grid-head { display: none; }

    .tally-voucher-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }

    .item-form .field {
        grid-template-columns: 1fr;
        gap: .4rem;
    }

    .item-form .field > span,
    .item-form .field-label {
        padding-top: 0;
    }
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #173f2a;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Item name / HSN typeahead (browser catalog) */
.tally-field.suggest-wrap {
    position: relative;
}

.suggest-list {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    max-height: 14rem;
    overflow: auto;
    background: #fffef8;
    border: 1px solid #c5b896;
    box-shadow: 0 6px 16px rgba(40, 30, 10, 0.12);
}

.suggest-list button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.4rem 0.65rem;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.suggest-list button:hover,
.suggest-list button:focus {
    background: #f0e6c8;
    outline: none;
}

.suggest-list .suggest-main {
    display: block;
    font-weight: 600;
}

.suggest-list .suggest-meta {
    display: block;
    font-size: 0.82rem;
    opacity: 0.75;
}

