:root {
    --green: #0F6B4B;
    --green-dark: #0A4D38;
    --green-deep: #063525;
    --green-soft: rgba(15, 107, 75, .09);
    --green-glass: rgba(15, 107, 75, .12);
    --accent: #B7791F;
    --accent-soft: rgba(183, 121, 31, .13);
    --black: #101828;
    --ink: #1D2939;
    --muted: #667085;
    --line: #E4E7EC;
    --line-strong: #D0D5DD;
    --page: #F4F6F5;
    --card: #FFFFFF;
    --white: #FFFFFF;
    --surface-2: #F7F9F8;
    --glass-line: rgba(255, 255, 255, .72);
    --danger: #DC2626;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
    --shadow-lg: 0 1px 3px rgba(16, 24, 40, .06), 0 14px 36px rgba(16, 24, 40, .09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--page); }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1100px 460px at 100% -8%, rgba(15, 107, 75, .045), transparent 60%),
        var(--page);
    color: var(--black);
    font-family: "Plus Jakarta Sans", Inter, Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 650, "GRAD" 0, "opsz" 24;
    line-height: 1;
}

.tb-app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 110px 286px minmax(0, 1fr);
}
.tb-icon-rail {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px 12px;
    background: #FFFFFF;
    border-right: 1px solid var(--line);
    overflow-y: auto;
    scrollbar-width: none;
}
.tb-icon-rail::-webkit-scrollbar { width: 0; height: 0; }
.tb-logo {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--green), var(--green-dark));
    color: #FFFFFF;
    box-shadow: 0 16px 32px rgba(15, 107, 75, .22);
}
.tb-logo .material-symbols-outlined {
    font-size: 31px;
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}
.tb-wordmark {
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
    color: var(--black);
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: -0.025em;
}
.tb-wordmark span { display: block; color: var(--green-dark); }
.tb-rail-nav {
    width: 100%;
    display: grid;
    gap: 8px;
}
.tb-rail-item {
    display: grid;
    justify-items: center;
    gap: 7px;
    color: var(--muted);
}
.tb-rail-item > span {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .68);
    color: #758299;
    border: 1px solid rgba(7, 17, 31, .06);
    transition: .18s ease;
}
.tb-rail-item small {
    max-width: 84px;
    color: inherit;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
}
.tb-app.is-pos {
    grid-template-columns: 88px minmax(0, 1fr);
}
.tb-app.is-pos .tb-workspace {
    display: none;
}
.tb-rail-item:hover > span {
    transform: translateY(-2px);
    background: var(--green-soft);
    color: var(--green-dark);
}
.tb-rail-item.is-active { color: var(--green-dark); }
.tb-rail-item.is-active > span {
    background: var(--black);
    color: #A7C7B7;
    box-shadow: 0 14px 28px rgba(17, 24, 39, .20);
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}
.tb-rail-logout { margin-top: auto; }
.tb-rail-logout button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .66);
    color: var(--muted);
    cursor: pointer;
}

.tb-workspace {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 30px 20px;
    background: #FFFFFF;
    border-right: 1px solid var(--line);
    overflow-y: auto;
    scrollbar-width: none;
}
.tb-workspace::-webkit-scrollbar { width: 0; height: 0; }
.tb-topbar .tb-workspace-trigger,
.tb-workspace .tb-workspace-close,
.tb-workspace-backdrop { display: none; }
.tb-kicker, .eyebrow {
    margin: 0 0 8px;
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.tb-workspace h2 {
    margin: 0;
    color: var(--black);
    font-size: 30px;
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.045em;
}
.tb-muted {
    margin: 8px 0 22px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.tb-menu-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.tb-menu-section > p {
    margin: 0 0 10px;
    color: #98A2B3;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.tb-menu-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    margin-bottom: 6px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: #556174;
    font-weight: 800;
}
.tb-menu-link > .material-symbols-outlined:first-child {
    color: #8793A6;
    font-size: 21px;
}
.tb-menu-link i {
    margin-left: auto;
    color: #B8C0CC;
    font-style: normal;
    font-size: 17px;
}
.tb-menu-link:hover, .tb-menu-link.is-active {
    background: rgba(255, 255, 255, .76);
    border-color: rgba(15, 107, 75, .24);
    color: var(--black);
    box-shadow: 0 12px 26px rgba(7, 17, 31, .08);
}
.tb-menu-link.is-active > .material-symbols-outlined:first-child,
.tb-menu-link.is-active i { color: var(--green-dark); }
.inventory-subnav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: -4px 0 20px;
    padding: 4px 0;
}
.inventory-subnav a {
    display: grid;
    place-items: center;
    min-width: 0;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.8);
    color: var(--black);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}
.inventory-subnav a:hover { border-color: var(--green); color: var(--green-dark); }
.inventory-focused-form { max-width: 820px; }
.rack-row { display: grid; grid-template-columns: 140px minmax(180px,1fr) 100px auto; align-items: center; gap: 10px; }
.rack-row input { min-width: 0; }
.align-end { align-self: end; }
.tb-main {
    min-width: 0;
    min-height: 100vh;
}
.tb-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 15px 28px;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.tb-topbar h1, h1 {
    margin: 0;
    color: var(--black);
    font-size: 22px;
    line-height: 28px;
    font-weight: 900;
    letter-spacing: -0.03em;
}
.tb-outlet-picker {
    width: min(280px, 34vw);
    margin-left: auto;
}
.tb-outlet-picker label {
    position: relative;
    display: block;
}
.tb-outlet-picker label > .material-symbols-outlined {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: var(--green-dark);
    transform: translateY(-50%);
    pointer-events: none;
}
.tb-outlet-picker select {
    min-height: 44px;
    padding-left: 42px;
}
.tb-content {
    container-type: inline-size;
    container-name: workspace-content;
    width: min(100%, 1380px);
    margin: 0 auto;
    padding: 28px 28px 44px;
}
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}
.page-head.compact {
    align-items: center;
    margin-bottom: 16px;
}
.action-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}
.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 28px;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(15, 107, 75, .22), transparent 42%),
        linear-gradient(35deg, transparent 64%, rgba(183, 121, 31, .18)),
        var(--black);
    color: #FFFFFF;
    box-shadow: 0 22px 42px rgba(7, 17, 31, .20);
}
.dashboard-hero h2 {
    margin: 0;
    max-width: 720px;
    color: #FFFFFF;
    font-size: 42px;
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.05em;
}
.dashboard-hero p:not(.tb-kicker) {
    margin: 12px 0 0;
    color: #CBD5E1;
    font-weight: 750;
}
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.quick-action {
    display: grid;
    gap: 12px;
    min-height: 116px;
    align-content: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    color: var(--black);
    font-weight: 900;
}
.quick-action .material-symbols-outlined {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--green-glass);
    color: var(--green-dark);
}
.page-head h2 {
    margin: 0;
    color: var(--black);
    font-size: 34px;
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.045em;
}
.page-head p:not(.tb-kicker) {
    margin: 9px 0 0;
    color: var(--muted);
    font-weight: 750;
}

.tb-action, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #FFFFFF;
    color: var(--black);
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background .15s ease, border-color .15s ease, transform .05s ease, box-shadow .15s ease;
}
.tb-action:hover, .btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.tb-action:active, .btn:active { transform: translateY(1px); }
.btn-primary {
    border-color: transparent;
    background: linear-gradient(180deg, var(--green), var(--green-dark));
    color: #FFFFFF;
    box-shadow: 0 1px 2px rgba(6, 53, 37, .30), 0 6px 16px rgba(15, 107, 75, .22);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--green-dark), var(--green-deep)); border-color: transparent; }
.btn-secondary { background: #FFFFFF; color: var(--black); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger {
    border-color: #FECACA;
    background: #FEF2F2;
    color: var(--danger);
}
.btn-sm {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 11px;
    font-size: 12px;
}
.btn-full { width: 100%; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.kpi-card, .panel, .home-panel, .auth-card, .cart-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
}
.kpi-card {
    container-type: inline-size;
    min-width: 0;
    min-height: 136px;
    padding: 22px;
    box-shadow: inset 0 4px 0 0 var(--green-dark), var(--shadow-md);
}
.kpi-card span {
    display: flex;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.kpi-card strong {
    display: block;
    margin-top: 24px;
    color: var(--black);
    font-size: 36px;
    line-height: 1;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.kpi-card small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}
.panel {
    padding: 24px;
    margin-bottom: 18px;
}
.panel h2 {
    margin: 0 0 10px;
    color: var(--black);
    font-size: 18px;
    font-weight: 900;
}
.panel p {
    color: var(--muted);
    font-weight: 650;
}
.section-head, .home-actions, .chip-row, .storefront-header, .check-row {
    display: flex;
    align-items: center;
}
.section-head {
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; }
.pos-load-more { width: 100%; margin-top: 12px; }
.payment-dialog {
    width: min(620px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--white);
    color: var(--black);
    box-shadow: 0 28px 70px rgba(17, 24, 39, .24);
}
.payment-dialog::backdrop { background: rgba(17, 24, 39, .52); backdrop-filter: blur(3px); }
.payment-sheet { display: grid; gap: 16px; padding: 22px; }
.payment-sheet .section-head { margin: 0; }
.payment-due { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-radius: 10px; background: var(--green-soft); }
.payment-due strong { color: var(--green-dark); font-size: 22px; }
#payment-rows { display: grid; gap: 10px; }
.payment-row { display: grid; grid-template-columns: 130px minmax(100px, .7fr) minmax(140px, 1fr) 42px; gap: 8px; align-items: center; }
.payment-row input, .payment-row select { min-width: 0; }
.payment-balance { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.payment-balance b { text-align: right; }
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
    margin-bottom: 16px;
}
.filter-bar > * {
    flex: 1 1 180px;
    min-width: 0;
}
.filter-bar > .btn,
.filter-bar > button {
    flex: 0 0 auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th, td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}
th {
    position: sticky;
    top: 0;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: rgba(15, 107, 75, .035); }
tbody tr:last-child td { border-bottom: 0; }
.status, .chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: #5C6678;
    font-size: 12px;
    font-weight: 800;
    text-transform: capitalize;
}
.status.green, .chip.selected {
    background: var(--green-soft);
    border-color: rgba(15, 107, 75, .28);
    color: var(--green-dark);
}
.status.danger,
.status.red {
    background: #FEF2F2;
    border-color: #FECACA;
    color: var(--danger);
}
.status.amber {
    background: rgba(183, 121, 31, .13);
    border-color: rgba(183, 121, 31, .34);
    color: var(--accent);
}
.chip-row {
    flex-wrap: wrap;
    gap: 9px;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.module-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 170px;
}
.module-icon {
    display: grid;
    place-items: center;
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--green);
    color: #FFFFFF;
    box-shadow: 0 16px 30px rgba(15, 107, 75, .22);
}
.module-icon .material-symbols-outlined {
    font-size: 36px;
    font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 24;
}
.module-hero h2 {
    margin-bottom: 8px;
    font-size: 34px;
    line-height: 1.05;
}
.empty-state, .cart-empty {
    display: grid;
    place-items: center;
    min-height: 150px;
    border: 1px dashed #CBD5E1;
    border-radius: 18px;
    color: var(--muted);
    text-align: center;
    padding: 18px;
    font-weight: 800;
}
.empty-state.tall { min-height: 360px; }
.module-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.module-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 5px 12px;
    min-height: 112px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .72);
    color: var(--black);
}
.module-card > .material-symbols-outlined {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--green-glass);
    color: var(--green-dark);
}
.module-card strong {
    font-size: 14px;
    font-weight: 900;
}
.module-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.45;
}
.module-card:hover {
    border-color: rgba(15, 107, 75, .26);
    box-shadow: 0 16px 30px rgba(7, 17, 31, .10);
    transform: translateY(-1px);
}
.module-checklist {
    display: grid;
    gap: 12px;
}
.module-checklist span {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .58);
    color: var(--ink);
    font-weight: 850;
}
.module-checklist i {
    color: var(--green-dark);
    font-style: normal;
}
.plan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.plan-card {
    min-height: 320px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 18px 40px rgba(7, 17, 31, .08);
    backdrop-filter: blur(16px);
}
.plan-card.is-featured {
    border-color: rgba(183, 121, 31, .32);
    box-shadow: 0 22px 44px rgba(17, 24, 39, .10);
}
.plan-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}
.plan-top h3 {
    margin: 0;
    color: var(--black);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.03em;
}
.plan-price {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 34px 0 24px;
}
.plan-price strong {
    color: var(--accent);
    font-size: 48px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.04em;
}
.plan-price span {
    margin-bottom: 7px;
    color: var(--muted);
    font-weight: 800;
}
.plan-features {
    display: grid;
    gap: 12px;
}
.plan-features span {
    display: flex;
    gap: 10px;
    color: var(--ink);
    font-weight: 800;
    line-height: 1.45;
}
.plan-features i {
    flex: 0 0 auto;
    color: var(--green-dark);
    font-style: normal;
}

.auth-page, .home-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(145deg, rgba(15, 107, 75, .08), transparent 45%),
        radial-gradient(circle at 92% 6%, rgba(183, 121, 31, .10), transparent 34%),
        #F7F9F5;
}
.auth-card {
    width: min(100%, 430px);
    padding: 30px;
}
.auth-brand, .home-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.auth-brand { margin-bottom: 28px; }
.auth-brand .tb-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
}
.auth-brand strong {
    display: block;
    color: var(--black);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.05em;
}
.auth-brand strong span { color: var(--green-dark); }
.auth-card h1 {
    margin-bottom: 8px;
    font-size: 28px;
}
.form-stack {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}
label span {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
}
input,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #FFFFFF;
    color: var(--black);
    font-weight: 700;
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea {
    resize: vertical;
    line-height: 1.5;
}
input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
    flex: none;
    accent-color: var(--green);
    cursor: pointer;
}
input[type="file"] {
    padding: 12px;
    cursor: pointer;
}
input[type="file"]::file-selector-button {
    margin-right: 14px;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 900;
    cursor: pointer;
}
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(15, 107, 75, .14);
}
.check-row { gap: 8px; }
.check-row input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--green);
}
.alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 800;
}
.alert.danger {
    background: #FEF2F2;
    color: var(--danger);
    border: 1px solid #FECACA;
}
.alert.success {
    background: var(--green-soft);
    color: var(--green-dark);
    border: 1px solid rgba(15, 107, 75, .28);
}
.form-panel {
    display: grid;
    gap: 24px;
    container-type: inline-size;
    container-name: editor-panel;
}
.form-section {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}
.form-section:last-of-type {
    border-bottom: 0;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.span-2 {
    grid-column: span 2;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.field-help {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.upload-note {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px dashed rgba(183, 121, 31, .34);
    border-radius: 16px;
    background: var(--accent-soft);
    color: #7C4A10;
    font-weight: 800;
}
.upload-note strong {
    color: var(--black);
    font-size: 15px;
    font-weight: 900;
}
.table-link {
    color: var(--green-dark);
    font-weight: 900;
}
.inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.inline-actions form {
    margin: 0;
}
.plan-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.plan-choice {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 12px;
    min-height: 92px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .76);
    cursor: pointer;
}
.plan-choice.is-featured {
    border-color: rgba(183, 121, 31, .34);
    background: linear-gradient(145deg, var(--accent-soft), rgba(255, 255, 255, .76));
}
.plan-choice input {
    width: 18px;
    min-height: 18px;
    margin-top: 3px;
    accent-color: var(--green);
}
.plan-choice strong,
.plan-choice small {
    display: block;
}
.plan-choice strong {
    color: var(--black);
    font-size: 15px;
    font-weight: 900;
}
.plan-choice small {
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
}
select {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .82);
    color: var(--black);
    font: inherit;
    font-weight: 800;
}
.tb-native-select {
    position: absolute;
    width: 1px;
    min-height: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.tb-search-select {
    position: relative;
    width: 100%;
}
.tb-search-control {
    position: relative;
}
.tb-search-control input {
    padding-right: 48px;
    cursor: text;
}
.tb-search-control .material-symbols-outlined {
    position: absolute;
    top: 50%;
    right: 14px;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}
.tb-search-select.is-open .tb-search-control input {
    border-color: var(--green);
    outline: 4px solid rgba(15, 107, 75, .16);
}
.tb-search-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
    display: none;
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 38px rgba(17, 24, 39, .16);
    backdrop-filter: blur(18px);
}
.tb-search-select.is-open .tb-search-menu {
    display: grid;
    gap: 5px;
}
.tb-search-option,
.tb-search-empty {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
    font-weight: 850;
    text-align: left;
}
.tb-search-option {
    cursor: pointer;
}
.tb-search-option:hover,
.tb-search-option.is-active {
    background: var(--green-soft);
    color: var(--green-dark);
}
.tb-search-option.is-selected {
    background: var(--accent-soft);
    color: var(--black);
}
.tb-search-empty {
    color: var(--muted);
}
.tb-search-select.is-disabled {
    opacity: .62;
    pointer-events: none;
}
td strong,
td small {
    display: block;
}
td small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.home-shell {
    width: min(100%, 1040px);
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 28px;
    align-items: center;
}
.home-brand {
    margin-bottom: 36px;
}
.home-brand strong {
    color: var(--black);
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -0.06em;
}
.home-brand strong span { color: var(--green-dark); }
.lead {
    max-width: 650px;
    color: #687386;
    font-size: 18px;
    line-height: 1.65;
    font-weight: 650;
}
.home-actions {
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}
.home-panel {
    padding: 26px;
}
.home-panel h2 {
    margin-top: 0;
    font-size: 20px;
    font-weight: 900;
}
.home-panel li {
    margin: 12px 0;
    color: var(--muted);
    font-weight: 800;
}

.pos-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
}
.pos-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
    gap: 18px;
    align-items: start;
}
.pos-workspace,
.sale-cart {
    min-width: 0;
}
.pos-screen.is-counter-gated {
    grid-template-columns: minmax(0, 1fr);
}
.pos-counter-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.pos-counter-gate {
    max-width: 860px;
    margin: 30px auto 0;
    padding: 28px;
    border: 1px solid rgba(15, 107, 75, .18);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(238, 248, 244, .92));
    box-shadow: 0 22px 48px rgba(7, 17, 31, .10);
}
.pos-counter-gate-copy {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.pos-counter-gate-copy > .material-symbols-outlined {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 16px;
    background: var(--green);
    color: #fff;
    font-size: 28px;
}
.pos-counter-gate h2,
.pos-counter-gate h3 { margin: 4px 0 8px; }
.pos-counter-gate p { color: var(--muted); font-weight: 700; line-height: 1.6; }
.pos-counter-form { margin-top: 24px; }
.counter-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 0 0 18px;
    padding: 0;
    border: 0;
}
.counter-choice-grid legend {
    grid-column: 1 / -1;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.counter-choice { position: relative; cursor: pointer; }
.counter-choice input { position: absolute; opacity: 0; pointer-events: none; }
.counter-choice > span,
.counter-choice > strong,
.counter-choice > small { display: block; }
.counter-choice {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .86);
}
.counter-choice:has(input:checked) {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(15, 107, 75, .10);
}
.counter-choice > span { color: var(--green); }
.counter-choice > strong { margin-top: 8px; }
.counter-choice > small { margin-top: 4px; color: var(--green); font-weight: 800; }
.pos-counter-inputs,
.pos-counter-create {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.pos-counter-create { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.pos-counter-empty { margin-top: 22px; padding: 20px; border: 1px dashed var(--line); border-radius: 18px; }
.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.pos-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}
.product-grid {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}
.product-card,
.cart-line {
    display: grid;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .78);
}
.product-card {
    grid-template-columns: 64px minmax(0, 1fr) auto 48px;
    padding: 14px;
}
.product-thumb {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: var(--green-glass);
    color: var(--green-dark);
    font-weight: 900;
}
.product-thumb.small {
    width: 48px;
    height: 48px;
    border-radius: 14px;
}
.product-card h3 {
    margin: 0;
    color: var(--black);
    font-size: 16px;
    font-weight: 900;
}
.product-card p,
.product-card small {
    display: block;
    margin: 4px 0 0;
    color: var(--muted);
    font-weight: 750;
}
.product-card > strong {
    font-size: 17px;
    font-weight: 900;
}
.icon-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: var(--green);
    color: #FFFFFF;
    cursor: pointer;
}
.icon-btn.secondary {
    background: rgba(255, 255, 255, .70);
    color: var(--black);
}
.icon-btn.danger {
    background: #FEF2F2;
    color: var(--danger);
}
.text-right { text-align: right; }
.align-right { justify-content: flex-end; }
.table-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.table-toolbar input {
    flex: 1 1 240px;
    max-width: 460px;
}
.table-toolbar select,
.table-toolbar .native-select,
.table-toolbar .searchable-select {
    flex: 0 1 240px;
    width: auto;
    min-width: 170px;
    max-width: 260px;
}
.table-toolbar .btn { flex: 0 0 auto; }
.compact-kpi {
    min-height: 116px;
}
.detail-list {
    display: grid;
    gap: 12px;
    margin: 16px 0;
}
.detail-list span {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .62);
}
.detail-list b {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.detail-list strong {
    color: var(--black);
    font-weight: 900;
    overflow-wrap: anywhere;
}
.game-preview-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
}
.preview-panel {
    min-height: 620px;
    padding: 0;
    overflow: hidden;
}
.game-preview-frame {
    display: block;
    width: 100%;
    min-height: 620px;
    border: 0;
    background: #FFFFFF;
}
.measurement-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
    border: 1px dashed rgba(15, 107, 75, .28);
    border-radius: 16px;
    background: rgba(15, 107, 75, .06);
}
.sale-cart {
    position: sticky;
    top: 96px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 18px 38px rgba(7, 17, 31, .10);
    backdrop-filter: blur(16px);
}
.mobile-cart-close,
.mobile-cart-backdrop {
    display: none;
}
.cart-line {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    margin-top: 14px;
    padding: 12px;
}
.cart-line strong,
.cart-line small {
    display: block;
}
.cart-line small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}
.qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 9px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(7, 17, 31, .05);
}
.qty-stepper button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, .84);
    color: var(--black);
    font-weight: 900;
}
.summary-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.summary-list span {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-weight: 800;
}
.summary-list b {
    color: var(--black);
}
.cart-actions {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 10px;
}
.pos-cart-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.pos-cart-fields input,
.pos-cart-fields select { min-height: 44px; }
.pos-message {
    position: sticky;
    top: 88px;
    z-index: 12;
}
.receipt-shell {
    width: min(100%, 880px);
    margin: 0 auto;
}
.receipt-card { padding: 30px; }
.receipt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}
.receipt-head h1 {
    margin: 4px 0;
    font-size: 28px;
}
.receipt-head strong,
.receipt-head small { display: block; }
.receipt-head small,
.receipt-customer small {
    margin-top: 5px;
    color: var(--muted);
}
.receipt-customer {
    display: grid;
    gap: 4px;
    padding: 18px 0;
}
.receipt-customer > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.receipt-totals {
    display: grid;
    gap: 10px;
    width: min(100%, 360px);
    margin: 22px 0 0 auto;
}
.receipt-totals span {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-weight: 800;
}
.receipt-totals b { color: var(--black); }
.receipt-grand-total {
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--black) !important;
    font-size: 18px;
}
.receipt-grand-total b { font-size: 24px; }
.receipt-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px dashed var(--line);
    text-align: center;
}
.receipt-footer p { color: var(--muted); }
.mobile-cart-bar {
    display: none;
}
.variants-wrap {
    min-width: 0;
    overflow-x: auto;
}
.variants-table {
    min-width: 920px;
}
.variants-table input {
    min-width: 110px;
}
.variants-table th:last-child,
.variants-table td:last-child {
    width: 48px;
}
.variants-wrap > .btn {
    margin-top: 12px;
}
.matrix {
    margin-bottom: 14px;
    overflow-x: auto;
}
.matrix table {
    width: auto;
    min-width: 420px;
}
.matrix th,
.matrix td {
    text-align: center;
}
.matrix input {
    width: 20px;
    min-height: 20px;
    accent-color: var(--green);
}
.pos-center, .cart-panel { min-width: 0; }
.scan-box {
    display: block;
    margin-bottom: 14px;
}
.cart-panel {
    position: sticky;
    top: 96px;
    align-self: start;
    padding: 18px;
}
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.cart-total strong {
    font-size: 28px;
    font-weight: 900;
}

.storefront-page { background: #FFFFFF; }
.storefront-header {
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid var(--line);
}
.storefront-header strong {
    font-size: 20px;
    font-weight: 900;
}
.storefront-header nav {
    display: flex;
    gap: 20px;
    color: var(--muted);
    font-weight: 800;
}
.storefront-hero {
    width: min(100%, 1040px);
    margin: 0 auto;
    padding: 86px 28px;
}
.storefront-hero h1 {
    font-size: 52px;
    line-height: 56px;
}
.tb-mobile-tabs { display: none; }
.more-backdrop,
.mobile-more-sheet {
    display: none;
}

.page-head-actions { display: flex; flex-wrap: wrap; min-width: 0; max-width: 100%; gap: 8px; align-items: center; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions .btn { padding: 8px 14px; }
.status.red { background: #FEF2F2; border-color: #FECACA; color: var(--danger); }
.status.amber { background: rgba(183, 121, 31, .13); border-color: rgba(183, 121, 31, .34); color: var(--accent); }
.plan-actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.checkbox-row {
    display: flex; flex-direction: row; align-items: center; gap: 10px;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #FFFFFF;
}
.checkbox-row input { width: 18px; height: 18px; margin: 0; }
.checkbox-row span { flex: 1; font-weight: 500; }
.form-grid .span-2 { grid-column: span 2; }

.shop-dashboard {
    display: grid;
    gap: 18px;
    width: min(100%, 1320px);
    margin: 0 auto;
}
.shop-dashboard-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 6px 0 4px;
}
.shop-dashboard-head h2 {
    margin: 5px 0 0;
    color: var(--black);
    font-size: 34px;
    line-height: 1.08;
    font-weight: 900;
}
.shop-dashboard-head p:not(.tb-kicker) {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 650;
}
.dashboard-action-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 10px 26px rgba(17, 24, 39, .05);
    backdrop-filter: blur(14px);
}
.dashboard-action-band > div {
    display: grid;
    gap: 3px;
    min-width: 160px;
}
.dashboard-action-band > div strong { font-size: 14px; font-weight: 900; }
.dashboard-action-band > div span { color: var(--muted); font-size: 11px; font-weight: 700; }
.dashboard-action-band nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.dashboard-action-band nav a,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #FFFFFF;
    color: var(--black);
    font-size: 12px;
    font-weight: 850;
}
.dashboard-action-band nav a:hover,
.text-link:hover {
    border-color: rgba(15, 107, 75, .35);
    color: var(--green-dark);
}
.dashboard-action-band .material-symbols-outlined,
.text-link .material-symbols-outlined { color: var(--green-dark); font-size: 18px; }
.shop-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.shop-metric-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--green-dark);
    border-radius: 16px;
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 12px 28px rgba(17, 24, 39, .06);
}
.shop-metric-card.gold { border-top-color: var(--accent); }
.shop-metric-card.red { border-top-color: var(--danger); }
.shop-metric-card.ink { border-top-color: var(--black); }
.shop-metric-card > div { display: flex; align-items: center; gap: 9px; }
.shop-metric-card > div > span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--green-soft);
    color: var(--green-dark);
}
.shop-metric-card.gold > div > span { background: var(--accent-soft); color: var(--accent); }
.shop-metric-card.red > div > span { background: #FEF2F2; color: var(--danger); }
.shop-metric-card.ink > div > span { background: #EEF0F3; color: var(--black); }
.shop-metric-card small {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.shop-metric-card > strong {
    display: block;
    margin-top: 18px;
    overflow-wrap: anywhere;
    color: var(--black);
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
}
.shop-metric-card > p { margin: 8px 0 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.shop-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
    gap: 18px;
    align-items: start;
}
.shop-dashboard-grid .panel { margin: 0; }
.text-link { min-height: 34px; padding: 0 10px; }
.dashboard-empty {
    display: grid;
    justify-items: center;
    gap: 7px;
    min-height: 150px;
    align-content: center;
    border: 1px dashed #CBD5E1;
    border-radius: 14px;
    text-align: center;
}
.dashboard-empty > span { color: var(--green-dark); font-size: 32px; }
.dashboard-empty strong { font-size: 14px; }
.dashboard-empty p { margin: 0; font-size: 12px; }
.dashboard-sale-list { display: grid; }
.dashboard-sale-list > a {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 2px;
    border-bottom: 1px solid var(--line);
}
.dashboard-sale-list > a:last-child { border-bottom: 0; }
.dashboard-sale-list > a:hover .sale-detail strong { color: var(--green-dark); }
.sale-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--green-soft);
    color: var(--green-dark);
}
.sale-detail,
.sale-total { display: grid; gap: 4px; min-width: 0; }
.sale-detail strong,
.sale-detail small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sale-detail strong,
.sale-total strong { font-size: 13px; font-weight: 900; }
.sale-detail small,
.sale-total small { color: var(--muted); font-size: 10px; font-weight: 700; }
.sale-total { justify-items: end; text-align: right; }
.outlet-overview-list { display: grid; gap: 10px; }
.outlet-overview-list > article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .66);
}
.outlet-overview-head {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}
.outlet-overview-head > .material-symbols-outlined {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
}
.outlet-overview-head > div { display: grid; gap: 3px; min-width: 0; }
.outlet-overview-head strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.outlet-overview-head small { color: var(--muted); font-size: 10px; font-weight: 700; }
.outlet-overview-list dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 0;
}
.outlet-overview-list dl > div { padding: 9px; border-radius: 10px; background: #F7F8F6; }
.outlet-overview-list dt { color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.outlet-overview-list dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 900; }

@media (max-width: 1280px) {
    .tb-app {
        grid-template-columns: 88px minmax(0, 1fr);
    }
    .tb-topbar .tb-workspace-trigger { display: inline-flex; flex: 0 0 auto; }
    .tb-workspace {
        position: fixed;
        left: 88px;
        top: 0;
        z-index: 42;
        display: block;
        width: min(340px, calc(100vw - 112px));
        height: 100dvh;
        background: rgba(247, 249, 245, .98);
        box-shadow: 24px 0 54px rgba(7, 17, 31, .18);
        transform: translateX(calc(-100% - 112px));
        transition: transform .22s ease;
    }
    .tb-workspace .tb-workspace-close {
        position: absolute;
        top: 18px;
        right: 18px;
        display: grid;
    }
    .tb-workspace-backdrop {
        position: fixed;
        inset: 0;
        z-index: 41;
        background: rgba(16, 24, 39, .42);
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease;
    }
    body.workspace-open .tb-workspace { transform: translateX(0); }
    body.workspace-open .tb-workspace-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
}

/* The POS uses the full content width, so its module navigation opens as a drawer. */
@media (min-width: 901px) {
    .tb-app.is-pos .tb-topbar .tb-workspace-trigger { display: inline-flex; flex: 0 0 auto; }
    .tb-app.is-pos .tb-workspace {
        position: fixed;
        left: 88px;
        top: 0;
        z-index: 42;
        display: block;
        visibility: hidden;
        width: min(340px, calc(100vw - 112px));
        height: 100dvh;
        background: rgba(247, 249, 245, .98);
        box-shadow: 24px 0 54px rgba(7, 17, 31, .18);
        transform: translateX(calc(-100% - 112px));
        transition: transform .22s ease;
    }
    .tb-app.is-pos .tb-workspace .tb-workspace-close {
        position: absolute;
        top: 18px;
        right: 18px;
        display: grid;
    }
    .tb-app.is-pos .tb-workspace-backdrop {
        position: fixed;
        inset: 0;
        z-index: 41;
        background: rgba(16, 24, 39, .42);
    }
    body.workspace-open .tb-app.is-pos .tb-workspace { visibility: visible; transform: translateX(0); }
    body.workspace-open .tb-app.is-pos .tb-workspace-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 900px) {
    .inventory-subnav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rack-row { grid-template-columns: minmax(0, 1fr); }
    .rack-row .table-actions { display: flex; flex-wrap: wrap; }
    .pos-counter-gate {
        margin-top: 18px;
        padding: 20px;
    }
    .pos-counter-inputs,
    .pos-counter-create {
        grid-template-columns: minmax(0, 1fr);
    }
    .tb-app {
        display: block;
        padding-bottom: 84px;
    }
    .tb-app.is-pos {
        padding-bottom: 172px;
    }
    .tb-icon-rail { display: none; }
    .tb-topbar .tb-workspace-trigger { display: none; }
    .tb-workspace { display: none; }
    .tb-workspace-backdrop { display: none !important; }
    .tb-topbar {
        min-height: 82px;
        padding: 18px 20px;
        gap: 12px;
    }
    .tb-outlet-picker {
        width: min(250px, 42vw);
    }
    .tb-content { padding: 22px 18px; }
    .dashboard-grid, .home-shell, .pos-preview {
        grid-template-columns: 1fr;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .game-preview-grid,
    .measurement-grid {
        grid-template-columns: 1fr;
    }
    .plan-grid {
        grid-template-columns: 1fr;
    }
    .pos-screen {
        grid-template-columns: 1fr;
    }
    .sale-cart {
        position: fixed;
        inset: auto 0 0;
        top: auto;
        z-index: 41;
        display: block;
        max-height: min(82vh, 720px);
        overflow-y: auto;
        padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
        border-radius: 24px 24px 0 0;
        transform: translateY(104%);
        transition: transform .22s ease;
    }
    .sale-cart.is-open {
        transform: translateY(0);
    }
    .mobile-cart-close {
        display: grid;
    }
    .mobile-cart-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        border: 0;
        background: rgba(17, 24, 39, .48);
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease;
    }
    .mobile-cart-backdrop.is-open {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
    body.cart-drawer-open {
        overflow: hidden;
    }
    .form-section {
        grid-template-columns: 1fr;
    }
    .variants-wrap {
        overflow: visible;
    }
    .variants-table,
    .variants-table tbody,
    .variants-table tr,
    .variants-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }
    .variants-table thead {
        display: none;
    }
    .variants-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: #FFFFFF;
    }
    .variants-table td {
        padding: 0;
        border: 0;
    }
    .variants-table td::before {
        display: block;
        margin-bottom: 6px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .08em;
        text-transform: uppercase;
    }
    .variants-table td:nth-child(1)::before { content: "Variant SKU"; }
    .variants-table td:nth-child(2)::before { content: "Barcode"; }
    .variants-table td:nth-child(3)::before { content: "Size"; }
    .variants-table td:nth-child(4)::before { content: "Color"; }
    .variants-table td:nth-child(5)::before { content: "Design"; }
    .variants-table td:nth-child(6)::before { content: "MRP"; }
    .variants-table td:nth-child(7)::before { content: "Sale"; }
    .variants-table td:nth-child(8)::before { content: "Remove"; }
    .variants-table input {
        min-width: 0;
    }
    .receipt-card { padding: 22px; }
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .pos-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .module-card-grid {
        grid-template-columns: 1fr;
    }
    .shop-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .shop-dashboard-grid {
        grid-template-columns: 1fr;
    }
    .product-card {
        grid-template-columns: 54px minmax(0, 1fr) 44px;
    }
    .product-card > strong {
        grid-column: 2;
    }
    .product-card .icon-btn {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
    .mobile-cart-bar {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(86px + env(safe-area-inset-bottom));
        z-index: 19;
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border: 1px solid rgba(15, 107, 75, .26);
        border-radius: 18px;
        background: rgba(255, 255, 255, .82);
        box-shadow: 0 18px 34px rgba(7, 17, 31, .18);
        backdrop-filter: blur(14px);
        font-weight: 900;
    }
    .cart-panel { position: static; }
    .tb-mobile-tabs {
        position: fixed;
        inset: auto 0 0;
        z-index: 20;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        min-height: 76px;
        padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .88);
        border-top: 1px solid var(--line);
        box-shadow: 0 -12px 26px rgba(7, 17, 31, .10);
    }
    .tb-mobile-tabs a,
    .tb-mobile-tabs button {
        display: grid;
        justify-items: center;
        align-content: center;
        gap: 4px;
        border: 0;
        background: transparent;
        color: var(--muted);
        font-weight: 900;
        cursor: pointer;
    }
    .tb-mobile-tabs .material-symbols-outlined { font-size: 28px; }
    .tb-mobile-tabs small,
    .tb-mobile-tabs button small {
        max-width: 68px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 11px;
    }
    .tb-mobile-tabs a.is-active,
    .tb-mobile-tabs button.is-active {
        color: var(--green-dark);
    }
    .more-backdrop {
        position: fixed;
        inset: 0;
        z-index: 120;
        background: rgba(16, 24, 39, .44);
        opacity: 0;
        pointer-events: none;
        transition: .18s ease;
    }
    .mobile-more-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 121;
        visibility: hidden;
        display: block;
        max-height: min(86vh, 720px);
        overflow-y: auto;
        padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
        border-radius: 24px 24px 0 0;
        background: rgba(255, 255, 255, .92);
        box-shadow: 0 -22px 42px rgba(7, 17, 31, .20);
        backdrop-filter: blur(18px);
        transform: translateY(104%);
        transition: transform .22s ease;
    }
    body.more-open .more-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
    body.more-open .mobile-more-sheet {
        visibility: visible;
        transform: translateY(0);
    }
    .sheet-handle {
        width: 46px;
        height: 4px;
        margin: 0 auto 14px;
        border-radius: 999px;
        background: #CBD5E1;
    }
    .mobile-more-group {
        display: block;
        margin-top: 14px;
    }
    .mobile-more-group > p {
        margin: 0 0 8px;
        color: var(--green-dark);
        font-size: 11px;
        font-weight: 900;
        letter-spacing: .14em;
        text-transform: uppercase;
    }
    .mobile-more-group > div {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
    .mobile-more-group a {
        display: flex;
        align-items: center;
        gap: 9px;
        min-height: 48px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: rgba(255, 255, 255, .72);
        color: var(--black);
        font-size: 12px;
        font-weight: 900;
    }
    .mobile-more-group a.is-active {
        background: var(--green-soft);
        border-color: rgba(15, 107, 75, .28);
        color: var(--green-dark);
    }
}

@media (max-width: 820px) {
    table:not(.keep-mobile-table),
    table:not(.keep-mobile-table) thead,
    table:not(.keep-mobile-table) tbody,
    table:not(.keep-mobile-table) tr,
    table:not(.keep-mobile-table) td {
        display: block;
        width: 100%;
    }
    table:not(.keep-mobile-table) thead {
        display: none;
    }
    table:not(.keep-mobile-table) tr {
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: #FFFFFF;
    }
    table:not(.keep-mobile-table) td {
        padding: 9px 0;
        border-bottom: 1px solid #F1F5F9;
    }
    table:not(.keep-mobile-table) td[data-label]:not([data-label=""]) {
        display: grid;
        grid-template-columns: minmax(96px, .75fr) minmax(0, 1.25fr);
        align-items: start;
        gap: 12px;
    }
    table:not(.keep-mobile-table) td[data-label]:not([data-label=""])::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .08em;
        text-transform: uppercase;
    }
    table:not(.keep-mobile-table) td:last-child {
        border-bottom: 0;
    }
    table:not(.keep-mobile-table) td .row-actions,
    table:not(.keep-mobile-table) td .inline-actions {
        justify-content: flex-start;
    }
}

/* Respond to usable workspace width, not just the viewport: the desktop
   module sidebar and browser zoom also reduce the room available to a page. */
@container workspace-content (max-width: 760px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-head > div { min-width: 0; max-width: 100%; }
    .page-head-actions { justify-content: flex-start; }
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid rgba(15, 107, 75, .28);
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .payment-sheet { padding: 16px; }
    .payment-row { grid-template-columns: 1fr 1fr 42px; }
    .payment-row .payment-reference { grid-column: 1 / -1; grid-row: 2; }
    .auth-page, .home-page { padding: 18px; }
    .tb-topbar {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 12px;
    }
    .tb-topbar > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }
    .tb-topbar h1, h1 {
        font-size: 20px;
        line-height: 25px;
    }
    .tb-action {
        width: 44px;
        padding: 0;
    }
    .tb-action-label { display: none; }
    .tb-outlet-picker {
        order: 3;
        width: 100%;
    }
    .tb-outlet-picker select {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .kpi-card {
        min-height: 118px;
        padding: 16px;
    }
    .kpi-card strong {
        margin-top: 20px;
        font-size: 32px;
    }
    .shop-dashboard-head,
    .dashboard-action-band {
        align-items: stretch;
        flex-direction: column;
    }
    .shop-dashboard-head h2 { font-size: 28px; }
    .shop-dashboard-head .btn { width: 100%; }
    .dashboard-action-band nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-action-band nav a { padding: 8px; }
    .shop-metric-grid { gap: 10px; }
    .shop-metric-card { padding: 14px; }
    .shop-metric-card > strong { margin-top: 14px; font-size: 23px; }
    .shop-metric-card > div > span { width: 32px; height: 32px; }
    .shop-metric-card > p { min-height: 30px; }
    .dashboard-sale-list > a { grid-template-columns: 36px minmax(0, 1fr); }
    .sale-icon { width: 36px; height: 36px; }
    .sale-total { grid-column: 2; justify-items: start; text-align: left; }
    .outlet-overview-list dl { grid-template-columns: 1fr 1fr; }
    .section-head, .storefront-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .dashboard-hero,
    .page-head.compact {
        align-items: stretch;
        flex-direction: column;
    }
    .dashboard-hero {
        padding: 22px;
    }
    .dashboard-hero h2,
    .page-head h2 {
        font-size: 30px;
    }
    .page-head,
    .form-section,
    .form-actions {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-grid .span-2 {
        grid-column: span 1;
    }
    .filter-bar {
        display: grid;
        grid-template-columns: 1fr;
    }
    .filter-bar > * {
        width: 100%;
    }
    .pos-filter-grid,
    .pos-cart-fields {
        grid-template-columns: 1fr;
    }
    .receipt-head {
        display: grid;
    }
    .receipt-head .text-right { text-align: left; }
    .receipt-card { padding: 18px; }
    .variants-table tr {
        grid-template-columns: 1fr;
    }
    .plan-choice-grid {
        grid-template-columns: 1fr;
    }
    .span-2 {
        grid-column: span 1;
    }
    .home-brand strong { font-size: 34px; }
    .auth-card, .home-panel, .panel {
        border-radius: 18px;
        padding: 20px;
    }
}

@media print {
    @page { margin: 8mm; }
    body { background: #fff !important; }
    .tb-icon-rail, .tb-workspace, .tb-topbar, .tb-mobile-tabs, .mobile-cart-bar, .no-print, .more-backdrop, .mobile-more-sheet { display: none !important; }
    .tb-app, .tb-app.is-pos { display: block !important; }
    .tb-main, .tb-content { width: 100% !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; background: #fff !important; }
    .receipt-shell { width: 100%; margin: 0; }
    .receipt-card { width: 100%; max-width: 190mm; margin: 0 auto; border: 0; box-shadow: none; background: #fff; }
}

@media print and (max-width: 100mm) {
    @page { size: 80mm auto; margin: 3mm; }
    .receipt-card { width: 74mm; padding: 0; font-size: 10px; }
    .receipt-head h1 { font-size: 18px; }
    .receipt-table th, .receipt-table td { padding: 5px 2px; }
}

.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-form input, .inline-form select { min-width: 130px; width: auto; }
.actions-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi-card strong {
    font-size: clamp(16px, var(--kpi-value-size, 20cqi), 36px);
    line-height: 1.2;
}
.kpi-card span { overflow-wrap: anywhere; }
.panel, .form-grid > *, .content-grid > * { min-width: 0; }
.form-actions { flex-wrap: wrap; }
@media (max-width: 560px) {
    .panel { padding: 16px; }
    .kpi-card span { min-height: 32px; line-height: 1.35; }
    .page-head-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-head-actions .btn { padding: 10px; }
    .page-head-actions .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
    table:not(.keep-mobile-table) td { overflow-wrap: anywhere; }
    .page-head-actions .btn { white-space: normal; text-align: center; }
}

.kpi-grid.compact { margin: 18px 0; }
.kpi-grid.compact article { min-height: 112px; }
.finance-actions-grid {
    display: grid;
    grid-template-columns: minmax(260px, .75fr) minmax(420px, 1.25fr);
    gap: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.finance-actions-grid .form-stack { align-content: start; }
.operations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.operation-line { display: grid; grid-template-columns: 2fr repeat(5, minmax(105px, 1fr)) 44px; gap: 10px; align-items: end; padding: 14px 0; border-bottom: 1px solid var(--border); }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip-list span { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-weight: 700; }
.text-danger { color: #B42318; }
.text-success { color: var(--green-dark); }

.content-grid { display: grid; gap: 18px; align-items: start; }
.content-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.content-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { min-width: 0; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: inset 0 3px 0 0 var(--green), var(--shadow-sm); }
.stat-card span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.stat-card strong { display: block; margin-top: 10px; color: var(--black); font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.detail-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.detail-tabs .btn { flex: 0 0 auto; }
.report-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
    overflow: visible;
}
.report-tabs .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 12px;
}
.report-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(210px, auto);
    align-items: end;
}
.report-filter-grid > label { min-width: 0; }
#report-columns fieldset {
    margin: 0;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .6);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px 18px;
}
#report-columns legend {
    padding: 0 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}
#report-columns label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: 700;
    color: var(--ink);
}
.report-filter-grid .form-actions {
    align-self: end;
    flex-wrap: nowrap;
}
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; color: var(--black); border-top: 1px solid var(--line); text-decoration: none; }
.list-row span, .list-row strong, .list-row small { display: block; min-width: 0; }
.list-row small { margin-top: 4px; color: var(--muted); }
.garment-item { display: block; grid-template-columns: none; margin: 0 0 16px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.garment-item > .form-grid { width: 100%; }
.garment-item legend { padding: 0 8px; color: var(--green-dark); font-weight: 900; }
.panel pre { max-width: 420px; overflow: auto; white-space: pre-wrap; font-size: 12px; }

/* Tabbed product form */
.form-tabs { flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.form-tabs .material-symbols-outlined { font-size: 18px; }
.form-tab-panel[hidden] { display: none; }
.opt-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }
/* Catalog table thumbnail */
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-thumb { flex: none; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.product-thumb--empty { display: grid; place-items: center; color: #9AA4B2; }
.product-thumb--empty .material-symbols-outlined { font-size: 22px; }
.product-cell-text { min-width: 0; }
/* Product form image preview */
.image-current { display: flex; gap: 16px; align-items: flex-start; margin: 8px 0 12px; }
.image-current img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.image-current-meta { display: grid; gap: 10px; }
.image-remove-toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--danger); font-size: 13px; font-weight: 800; cursor: pointer; }
.image-gallery-current { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 10px; }
.image-gallery-current img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
/* Per-colour image blocks (product form) */
.images-wrap { display: grid; gap: 16px; }
.colour-image-block { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; background: var(--card); }
.colour-image-block--default { border-color: rgba(15, 107, 75, .22); background: linear-gradient(180deg, rgba(15,107,75,.04), transparent); }
.colour-image-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 15px; color: var(--black); }
.colour-image-head .material-symbols-outlined { color: var(--green-dark); font-size: 20px; }
.colour-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-strong); background: conic-gradient(#111,#eee,#111); }
.colour-images-note { margin: 6px 0 2px; }
#colour-images { display: grid; gap: 12px; }
/* Colour images on the product View page */
.colour-view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.colour-view-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--card); }
.colour-view-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-weight: 800; }
.colour-view-card > img { display: block; width: 100%; max-width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.colour-view-empty { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; border: 1px dashed var(--line-strong); color: #9AA4B2; background: var(--surface-2); }
.colour-view-empty .material-symbols-outlined { font-size: 34px; }
.colour-view-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.colour-view-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.grn-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.grn-form .grn-field { display: grid; gap: 4px; margin: 0; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.grn-form .grn-field input { min-height: 40px; width: 92px; }
.grn-form .grn-field .tb-search-select, .grn-form .grn-field select { min-width: 150px; }
.grn-form .btn { align-self: flex-end; }
.pay-now-toggle { display: inline-flex; align-items: center; gap: 10px; margin: 4px 0 14px; font-weight: 800; color: var(--ink); cursor: pointer; }
img.zoomable { cursor: zoom-in; transition: transform .12s ease, box-shadow .12s ease; }
img.zoomable:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.tb-lightbox { position: fixed; inset: 0; z-index: 2000; display: none; place-items: center; padding: 24px; background: rgba(16, 24, 40, .82); backdrop-filter: blur(4px); cursor: zoom-out; }
.tb-lightbox.is-open { display: grid; }
.tb-lightbox img { max-width: min(92vw, 900px); max-height: 88vh; object-fit: contain; border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.5); background: #fff; }
.tb-lightbox-close { position: absolute; top: 18px; right: 20px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.tb-lightbox-close:hover { background: rgba(255,255,255,.26); }
.pricing-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 22px; align-items: start; }
.pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.price-summary {
    position: sticky;
    top: 92px;
    padding: 18px 20px;
    border: 1px solid rgba(15, 107, 75, .22);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(15, 107, 75, .06), rgba(15, 107, 75, .02));
}
.price-summary .tb-kicker { color: var(--green-dark); margin-bottom: 14px; }
.price-summary-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed rgba(15, 107, 75, .18); }
.price-summary-row:last-of-type { border-bottom: 0; }
.price-summary-row span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.price-summary-row strong { color: var(--black); font-size: 18px; font-weight: 900; letter-spacing: -.01em; }
.price-summary-row:last-of-type strong { color: var(--green-dark); font-size: 22px; }
.price-summary-note { margin: 12px 0 0; color: var(--accent); font-size: 12px; font-weight: 800; line-height: 1.4; }
@media (max-width: 820px) {
    .pricing-fields { grid-template-columns: 1fr; }
    .price-summary { position: static; }
}

@media (max-width: 900px) {
    .finance-actions-grid { grid-template-columns: 1fr; }
    .operations-grid { grid-template-columns: 1fr; }
    .operation-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .actions-cell { min-width: 250px; }
    .content-grid.two, .content-grid.three { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1280px) {
    .report-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .report-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-filter-grid .form-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .inline-form, .inline-form input, .inline-form select, .inline-form .btn { width: 100%; }
    .finance-actions-grid .form-grid.two { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 13px; }
    .stat-card strong { font-size: 21px; }
    .report-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-filter-grid { grid-template-columns: 1fr; }
    .report-filter-grid .form-actions {
        grid-column: auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .report-filter-grid .btn { width: 100%; }
}

/* ============================================================
   UI completion pass — classes referenced by shop/outlet/shared
   views that previously had no rule (pages loaded unstyled).
   Additive only; no existing selector is modified.
   ============================================================ */

/* Detail / key-value grids (catalog, outlet, supplier show pages) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.info-grid > div,
.info-grid .info-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #FFFFFF;
}
.info-grid span,
.info-grid small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.info-grid strong { font-size: 15px; color: var(--black); }

/* Two-column detail wrapper (product show: details + gallery) */
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

/* Image thumbnail grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
}
.gallery-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
}

/* Side-by-side panels (roles create+list, finance) */
.split-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    align-items: start;
}

/* Permission checkbox matrix (roles) */
.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

/* POS payment sheet emphasis (grid children already sized by .payment-row) */
.payment-method { font-weight: 700; }
.payment-amount { text-align: right; font-weight: 800; }

/* Dashboard / finance panel rhythm modifiers */
.shop-sales-panel,
.shop-outlet-panel { min-height: 220px; }
.cash-shift-panel { display: grid; gap: 12px; }

/* Muted helper text (tailoring board/forms use bare `.muted`) */
.muted { color: var(--muted); font-weight: 600; }

/* Inline form error text */
.error { color: var(--danger); font-weight: 700; font-size: 12px; }

/* Amber alert variant (complements .status.amber; only danger/success existed) */
.alert.amber {
    background: var(--accent-soft);
    border-color: rgba(183, 121, 31, .34);
    color: var(--accent);
}

/* Active customer detail tab highlight (script toggles .is-active) */
.customer-tab.is-active {
    background: linear-gradient(145deg, var(--green), var(--green-dark));
    color: #FFFFFF;
    border-color: var(--green);
}

@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
}

/* Clickable KPI / metric cards (dashboard drill-downs) */
a.kpi-card.is-linked,
a.shop-metric-card.is-linked { color: inherit; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
a.kpi-card.is-linked:hover,
a.shop-metric-card.is-linked:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(15, 107, 75, .14); }
a.kpi-card.is-linked::after {
    content: 'arrow_outward';
    font-family: 'Material Symbols Outlined';
    position: absolute; top: 12px; right: 12px; font-size: 16px; color: var(--muted); opacity: .5;
}
a.kpi-card.is-linked { position: relative; }
.tb-tour-launch{position:fixed;right:22px;bottom:22px;z-index:80;border:0;border-radius:999px;padding:10px 15px;background:#087f5b;color:#fff;font:700 13px inherit;box-shadow:0 8px 24px rgba(8,127,91,.28);cursor:pointer}.tb-tour-overlay{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:20px;background:rgba(10,27,21,.62);backdrop-filter:blur(4px)}.tb-tour-overlay section{width:min(520px,100%);padding:26px;border-radius:20px;background:#fff;box-shadow:0 24px 80px rgba(0,0,0,.28)}.tb-tour-overlay h2{margin:5px 0 10px}.tb-tour-overlay ol{margin:18px 0;padding-left:20px;color:#42534d}.tb-tour-overlay li+li{margin-top:8px}@media(max-width:720px){.tb-tour-launch{right:14px;bottom:82px}}

/* Tailoring workspace rhythm and responsive density */
.tailoring-measurements-grid {
    grid-template-columns: minmax(560px, 1.2fr) minmax(360px, .8fr);
    gap: 24px;
}
.tailoring-production-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}
.tailoring-measurements-grid .panel,
.tailoring-production-grid .panel {
    padding: 28px;
}
.tailoring-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 24px;
    padding: 2px 0;
    overflow: visible;
}
.tailoring-tabs .btn {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding-inline: 16px;
}
.tailoring-tabs + .content-grid,
.tailoring-tabs ~ .content-grid {
    gap: 24px;
}
.tailoring-tabs + .content-grid.two {
    grid-template-columns: minmax(420px, .92fr) minmax(0, 1.08fr);
}
.tailoring-tabs + .tailoring-measurements-grid {
    grid-template-columns: minmax(560px, 1.2fr) minmax(360px, .8fr);
}
.tailoring-tabs + .content-grid.three {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tailoring-tabs ~ .panel,
.tailoring-tabs ~ .content-grid .panel {
    padding: 28px;
}
.tailoring-tabs ~ .stat-grid {
    gap: 16px;
    margin-bottom: 24px;
}
.tailoring-form-panel,
.tailoring-tabs + .content-grid.two > .form-panel {
    gap: 28px;
}
.tailoring-form-panel .form-grid,
.tailoring-tabs + .content-grid.two > .form-panel .form-grid,
#tailoring-wizard .form-grid {
    column-gap: 20px;
    row-gap: 22px;
}
.tailoring-form-actions {
    margin-top: 2px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}
.tailoring-table-panel > h2 {
    margin-bottom: 18px;
}
.tailoring-stage-card,
.tailoring-tabs + .content-grid.three > .panel {
    min-height: 150px;
}
.tailoring-stage-card .muted {
    margin: 18px 0 0;
}
.tailoring-row-form,
.tailoring-tabs + .panel td form {
    display: grid;
    gap: 10px;
    min-width: 210px;
}
#tailoring-wizard {
    padding: 32px;
}
#tailoring-wizard > .detail-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 28px;
    overflow: visible;
}
#tailoring-wizard > .detail-tabs .btn {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding-inline: 12px;
    white-space: normal;
}
#tailoring-wizard > [data-step] {
    padding: 4px 0 10px;
}
#tailoring-wizard > .form-actions {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

/* A form may live beside the workspace sidebar or in a split panel. Keep
   help copy above the fields before either the inputs or the summary squeeze. */
@container editor-panel (max-width: 1000px) {
    .form-section:not(.garment-item) { grid-template-columns: minmax(0, 1fr); }
    .form-section > div > h2 { margin-top: 0; }
}
@container editor-panel (max-width: 640px) {
    .pricing-fields { grid-template-columns: minmax(0, 1fr); }
    .price-summary { position: static; }
}
@container editor-panel (max-width: 400px) {
    .pricing-grid { grid-template-columns: minmax(0, 1fr); }
    .pricing-grid .span-2 { grid-column: 1; }
}
.form-section > *, .pricing-fields > *, .form-panel label { min-width: 0; }
.form-panel input, .form-panel select, .form-panel textarea { max-width: 100%; }
.form-panel .detail-tabs { gap: 8px; margin-bottom: 8px; }
@media (max-width: 900px) {
    body.more-open { overflow: hidden; }
    body.more-open .mobile-cart-bar,
    body.more-open .tb-tour-launch { visibility: hidden; }
    .mobile-more-sheet .section-head { flex-direction: row; align-items: center; }
    .mobile-more-sheet .section-head > div { min-width: 0; }
    .mobile-more-sheet .section-head > button { flex-shrink: 0; }
}

@media (min-width: 1700px) {
    .tailoring-tabs { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

@media (max-width: 1280px) {
    .tailoring-measurements-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .tailoring-production-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .tailoring-tabs + .content-grid.two,
    .tailoring-tabs + .tailoring-measurements-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .tailoring-tabs + .content-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #tailoring-wizard > .detail-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .tailoring-production-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .tailoring-measurements-grid .panel,
    .tailoring-production-grid .panel {
        padding: 22px;
    }
    .tailoring-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 20px;
    }
    .tailoring-tabs .btn { min-height: 48px; }
    .tailoring-tabs ~ .panel,
    .tailoring-tabs ~ .content-grid .panel {
        padding: 22px;
    }
    .tailoring-tabs + .content-grid.three {
        grid-template-columns: minmax(0, 1fr);
    }
    #tailoring-wizard { padding: 24px; }
    #tailoring-wizard > .detail-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .tailoring-measurements-grid .panel,
    .tailoring-production-grid .panel {
        padding: 18px;
    }
    .tailoring-tabs {
        gap: 8px;
        margin-bottom: 18px;
    }
    .tailoring-tabs .btn {
        min-height: 46px;
        padding-inline: 10px;
        font-size: 12px;
        white-space: normal;
    }
    .tailoring-tabs ~ .panel,
    .tailoring-tabs ~ .content-grid .panel,
    #tailoring-wizard {
        padding: 18px;
    }
    .tailoring-form-panel .form-grid,
    #tailoring-wizard .form-grid {
        row-gap: 18px;
    }
    #tailoring-wizard > .detail-tabs {
        grid-template-columns: minmax(0, 1fr);
        margin-bottom: 22px;
    }
    .tailoring-form-actions,
    #tailoring-wizard > .form-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }
    .tailoring-form-actions .btn,
    #tailoring-wizard > .form-actions .btn {
        width: 100%;
    }
}
