:root {
    --color-forest-950: #063d32;
    --color-forest-900: #075241;
    --color-forest-700: #0c705a;
    --color-mint-100: #e5f3ef;
    --color-stone-50: #f8faf9;
    --color-stone-200: #dde4e1;
    --color-ink: #14201d;
    --color-muted: #64716d;
    --radius-sm: 0.45rem;
    --radius-md: 0.75rem;
    --shadow-soft: 0 20px 60px rgb(6 61 50 / 12%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    color: var(--color-ink);
    background: var(--color-stone-50);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
}

.welcome {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    background:
        radial-gradient(circle at 85% 15%, rgb(12 112 90 / 11%), transparent 28rem),
        var(--color-stone-50);
}

.welcome__panel {
    width: min(42rem, 100%);
    padding: clamp(2rem, 6vw, 4rem);
    background: white;
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.welcome__mark {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    margin-bottom: 2rem;
    border-radius: var(--radius-sm);
    color: white;
    background: var(--color-forest-900);
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 0.75rem;
    color: var(--color-forest-700);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    max-width: 13ch;
    margin: 0;
    font-size: clamp(2.25rem, 7vw, 4.5rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.welcome__copy {
    max-width: 56ch;
    margin: 1.75rem 0;
    color: var(--color-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--color-mint-100);
    color: var(--color-forest-950);
    font-weight: 700;
}

.status__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #12a57d;
}

a {
    color: var(--color-forest-700);
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
}

.sidebar {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    color: white;
    background: var(--color-forest-950);
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.4rem 1.5rem;
    color: white;
    font-size: 1.15rem;
    font-weight: 800;
}

.sidebar__mark,
.auth__mark {
    width: 2.35rem;
    height: 2.35rem;
    display: grid;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 35%);
    border-radius: var(--radius-sm);
}

.sidebar__nav {
    display: grid;
    gap: 0.25rem;
}

.sidebar__nav a,
.sidebar__disabled {
    display: block;
    padding: 0.72rem 0.8rem;
    border-radius: var(--radius-sm);
    color: rgb(255 255 255 / 88%);
}

.sidebar__nav a:hover {
    background: rgb(255 255 255 / 10%);
}

.sidebar__disabled {
    color: rgb(255 255 255 / 38%);
}

.sidebar__label {
    margin: 1.25rem 0 0.35rem;
    padding-inline: 0.8rem;
    color: rgb(255 255 255 / 52%);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar__logout {
    margin-top: auto;
}

.sidebar__logout button {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgb(255 255 255 / 20%);
    border-radius: var(--radius-sm);
    color: white;
    background: transparent;
    cursor: pointer;
}

.app-main {
    min-width: 0;
}

.topbar {
    min-height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem clamp(1rem, 3vw, 2rem);
    border-bottom: 1px solid var(--color-stone-200);
    background: white;
}

.topbar form,
.topbar__profile {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.topbar label,
.topbar__profile span {
    color: var(--color-muted);
    font-size: 0.82rem;
}

.topbar select {
    min-width: 15rem;
    padding: 0.65rem 2.2rem 0.65rem 0.8rem;
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius-sm);
    background: white;
}

.topbar__profile {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.content {
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.messages {
    padding: 1rem 2rem 0;
}

.message {
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius-sm);
    background: white;
}

.message--success {
    color: var(--color-forest-950);
    background: var(--color-mint-100);
}

.page-header {
    margin-bottom: 2rem;
}

.page-header--actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.page-header h1 {
    max-width: none;
    font-size: clamp(2rem, 4vw, 3.25rem);
}

.page-header__copy {
    max-width: 62ch;
    margin: 0.8rem 0 0;
    color: var(--color-muted);
    line-height: 1.6;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-block: 1px solid var(--color-stone-200);
}

.metric {
    display: grid;
    gap: 0.55rem;
    padding: 1.5rem;
    border-right: 1px solid var(--color-stone-200);
}

.metric:last-child {
    border-right: 0;
}

.metric span {
    color: var(--color-muted);
    font-size: 0.82rem;
}

.metric strong {
    font-size: 1.25rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    background: white;
    cursor: pointer;
}

.button--primary {
    border-color: var(--color-forest-900);
    color: white;
    background: var(--color-forest-900);
}

.button--danger {
    border-color: #b42318;
    color: #b42318;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.button--wide {
    width: 100%;
}

.data-panel,
.record-form {
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius-md);
    background: white;
}

.table-tools {
    display: flex;
    gap: 0.65rem;
    padding: 1rem;
    border-bottom: 1px solid var(--color-stone-200);
}

.table-tools input {
    width: min(28rem, 100%);
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius-sm);
}

.table-tools--sales {
    display: grid;
    grid-template-columns: minmax(12rem, 1.2fr) minmax(10rem, 0.8fr) repeat(2, minmax(9rem, 0.65fr)) minmax(5rem, 0.35fr) auto auto;
    align-items: end;
}

.table-tools--sales > input,
.table-tools--sales > select,
.table-tools--sales .filter-field input,
.table-tools--sales .filter-field select {
    width: 100%;
    min-height: 2.8rem;
}

.filter-field {
    min-width: 0;
    display: grid;
    gap: 0.3rem;
}

.filter-field > span {
    color: var(--color-muted);
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.table-filter-note {
    margin: 0;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--color-line);
    color: var(--color-muted);
    background: #f8faf9;
    font-size: 0.72rem;
}

.table-row-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-row-actions form {
    display: inline;
    margin: 0;
}

.link-button--danger {
    color: #c83a32;
}

@media (max-width: 1200px) {
    .table-tools--sales {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .table-tools--sales {
        grid-template-columns: 1fr;
    }
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--color-stone-200);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--color-muted);
    background: #fbfcfb;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

tbody tr:hover {
    background: var(--color-stone-50);
}

.badge {
    display: inline-flex;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    color: var(--color-muted);
    background: #edf0ef;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge--active {
    color: var(--color-forest-950);
    background: var(--color-mint-100);
}

.empty {
    padding: 3rem;
    color: var(--color-muted);
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem;
    color: var(--color-muted);
}

.text-warning {
    color: #b54708;
    font-size: 0.78rem;
    font-weight: 700;
}

.inline-form {
    display: inline;
    margin-left: 0.65rem;
}

.link-button {
    padding: 0;
    border: 0;
    color: var(--color-forest-700);
    background: none;
    cursor: pointer;
}

.document-form {
    display: grid;
    gap: 1.25rem;
}

.document-lines {
    display: grid;
}

.document-line {
    display: grid;
    grid-template-columns: minmax(15rem, 2fr) repeat(4, minmax(8rem, 1fr));
    gap: 1rem;
    align-items: end;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-stone-200);
}

.document-detail {
    margin-top: 1.25rem;
}

.pos-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.pos-heading h1 {
    max-width: none;
    font-size: clamp(2rem, 4vw, 3.5rem);
}

.pos-heading > div > p:last-child {
    color: var(--color-muted);
}

.pos-shortcuts {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
    color: var(--color-muted);
    font-size: 0.78rem;
}

kbd {
    padding: 0.2rem 0.35rem;
    border: 1px solid var(--color-stone-200);
    border-bottom-width: 2px;
    border-radius: 0.3rem;
    color: var(--color-ink);
    background: white;
    font: inherit;
}

.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(19rem, 0.7fr);
    gap: 1.25rem;
    align-items: start;
}

.pos-workspace,
.pos-summary {
    min-width: 0;
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius-md);
    background: white;
    box-shadow: var(--shadow-soft);
}

.pos-search {
    position: relative;
    padding: 1.25rem;
    border-bottom: 1px solid var(--color-stone-200);
}

.pos-search label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
    font-weight: 800;
}

.pos-search input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-forest-700);
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
}

.pos-results {
    position: absolute;
    z-index: 5;
    inset: calc(100% - 0.75rem) 1.25rem auto;
    overflow: hidden;
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: var(--shadow-soft);
}

.pos-results button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border: 0;
    border-bottom: 1px solid var(--color-stone-200);
    background: white;
    text-align: left;
    cursor: pointer;
}

.pos-results button:hover {
    background: var(--color-mint-100);
}

.pos-results span {
    color: var(--color-muted);
    font-size: 0.78rem;
}

.pos-cart {
    overflow-x: auto;
}

.pos-cart__head,
.pos-cart__row {
    min-width: 46rem;
    display: grid;
    grid-template-columns: minmax(14rem, 2fr) repeat(3, minmax(6rem, 0.7fr)) minmax(5rem, 0.6fr) 4.5rem;
    gap: 0.65rem;
    align-items: center;
    padding: 0.75rem 1rem;
}

.pos-cart__head {
    color: var(--color-muted);
    background: #fbfcfb;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pos-cart__row {
    border-top: 1px solid var(--color-stone-200);
}

.pos-cart__row .field input,
.pos-cart__row .field select {
    padding: 0.6rem;
}

.line-total {
    text-align: right;
    font-weight: 800;
}

.pos-remove {
    display: flex;
    gap: 0.3rem;
    color: var(--color-muted);
    font-size: 0.7rem;
}

.pos-summary {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
}

.pos-summary__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.15rem;
    font-weight: 800;
}

.pos-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.pos-totals {
    display: grid;
    gap: 0.65rem;
    margin: 0;
    padding-block: 1rem;
    border-block: 1px solid var(--color-stone-200);
}

.pos-totals div,
.receipt__meta div,
.receipt__totals div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.pos-totals dt,
.receipt dt {
    color: var(--color-muted);
}

.pos-totals dd,
.receipt dd {
    margin: 0;
    font-weight: 700;
}

.pos-totals__grand {
    color: var(--color-forest-950);
    font-size: 1.35rem;
}

.pos-actions {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    gap: 0.7rem;
}

.cancellation-panel {
    display: block;
    margin-top: 1.25rem;
}

.cancellation-panel form {
    display: grid;
    gap: 1rem;
}

.cancellation-note {
    margin-top: 1.25rem;
    padding: 1.25rem;
    color: #b42318;
}

.sale-return-line {
    grid-template-columns: minmax(15rem, 2fr) minmax(9rem, 0.7fr) auto;
}

.allocation-line {
    grid-template-columns: minmax(18rem, 2fr) minmax(10rem, 1fr) auto;
}

.voucher-line {
    display: grid;
    grid-template-columns: minmax(12rem, 1.2fr) minmax(14rem, 1.5fr) repeat(2, minmax(8rem, 0.7fr)) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--color-stone-200);
}

.voucher-line--head {
    color: var(--color-muted);
    background: #fbfcfb;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.payment-review {
    margin-top: 1.25rem;
    padding: 1.25rem;
}

.payment-review dl {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 0;
}

.payment-review dl div {
    display: grid;
    gap: 0.35rem;
}

.payment-review dt {
    color: var(--color-muted);
    font-size: 0.78rem;
}

.payment-review dd {
    margin: 0;
    font-weight: 700;
}

.table-total {
    background: var(--color-mint-100);
}

.receipt {
    width: var(--receipt-width, 72mm);
    margin: 0 auto;
    padding: 5mm 3mm;
    color: #111;
    background: white;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11px;
}

.receipt__header {
    padding-bottom: 3mm;
    border-bottom: 1px dashed #777;
    text-align: center;
}

.receipt__header h2,
.receipt__header p {
    margin: 0 0 1mm;
}

.receipt__meta,
.receipt__totals {
    display: grid;
    gap: 1mm;
    margin: 3mm 0;
}

.receipt__items {
    font-size: inherit;
}

.receipt__items th,
.receipt__items td {
    padding: 1.5mm 0;
    border-bottom: 1px dashed #aaa;
    white-space: normal;
}

.receipt__items th:nth-child(2),
.receipt__items td:nth-child(2),
.receipt__items th:last-child,
.receipt__items td:last-child {
    text-align: right;
}

.receipt__items small {
    display: block;
    color: #555;
}

.receipt__grand {
    padding-block: 1.5mm;
    border-block: 1px dashed #777;
    font-size: 13px;
}

.receipt__cancelled {
    padding: 2mm;
    border: 2px solid #b42318;
    color: #b42318;
    text-align: center;
    font-size: 16px;
    font-weight: 900;
}

.receipt footer {
    margin-top: 4mm;
    text-align: center;
}

.receipt__footer-text {
    margin: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

@media (max-width: 1100px) {
    .document-line {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-layout {
        grid-template-columns: 1fr;
    }

    .pos-summary {
        position: static;
    }

    .voucher-line {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.record-form {
    max-width: 50rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
    padding: 1.5rem;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field label,
.auth__form label {
    font-size: 0.85rem;
    font-weight: 700;
}

.field input,
.field select,
.field textarea,
.auth__form input {
    width: 100%;
    padding: 0.75rem 0.8rem;
    border: 1px solid #cbd5d1;
    border-radius: var(--radius-sm);
    background: white;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.auth__form input:focus {
    outline: 3px solid rgb(12 112 90 / 18%);
    border-color: var(--color-forest-700);
}

.field--check {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.field--check input {
    width: 1.15rem;
    height: 1.15rem;
    order: -1;
}

.field small {
    color: var(--color-muted);
}

.field-error,
.form-errors {
    color: #b42318;
    font-size: 0.82rem;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.7rem;
    padding-top: 0.5rem;
}

.user-form {
    display: grid;
    gap: 1.25rem;
}

.membership-panel {
    overflow: hidden;
}

.section-heading {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-stone-200);
}

.section-heading h2 {
    margin: 0.25rem 0 0;
}

.membership-list {
    display: grid;
}

.membership-row {
    display: grid;
    grid-template-columns: minmax(12rem, 1.4fr) minmax(12rem, 1.4fr) repeat(3, auto);
    gap: 1rem;
    align-items: end;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-stone-200);
}

.form-actions--sticky {
    position: sticky;
    bottom: 0;
    padding: 1rem;
    border: 1px solid var(--color-stone-200);
    background: rgb(255 255 255 / 95%);
}

.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(22rem, 0.9fr) minmax(25rem, 1.1fr);
}

.auth__brand,
.auth__form-panel {
    display: grid;
    place-items: center;
    padding: clamp(2rem, 6vw, 6rem);
}

.auth__brand {
    color: white;
    background:
        radial-gradient(circle at 30% 20%, rgb(255 255 255 / 9%), transparent 24rem),
        var(--color-forest-950);
}

.auth__brand-copy {
    max-width: 30rem;
}

.auth__brand h1 {
    max-width: 10ch;
    margin-top: 1rem;
}

.auth__brand p:last-child {
    max-width: 40ch;
    color: rgb(255 255 255 / 70%);
    line-height: 1.7;
}

.eyebrow--light {
    margin-top: 2rem;
    color: #9de2cf;
}

.auth__form {
    width: min(25rem, 100%);
    display: grid;
    gap: 0.8rem;
}

.auth__form h2 {
    margin: 0;
    font-size: 2.2rem;
}

.auth__intro {
    margin: 0 0 1rem;
    color: var(--color-muted);
}

.auth__form .button {
    margin-top: 0.8rem;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-metric {
    display: grid;
    gap: 0.45rem;
    min-height: 9rem;
    padding: 1.25rem;
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
}

.dashboard-metric span,
.dashboard-metric small {
    color: var(--color-muted);
}

.dashboard-metric strong {
    color: var(--color-forest-950);
    font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.dashboard-metric--primary {
    color: white;
    border-color: var(--color-forest-950);
    background: linear-gradient(135deg, var(--color-forest-950), var(--color-forest-700));
}

.dashboard-metric--primary strong,
.dashboard-metric--primary span,
.dashboard-metric--primary small {
    color: white;
}

.dashboard-grid,
.lifecycle-grid,
.manifest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-panel,
.lifecycle-card,
.manifest-grid > article {
    margin: 0;
}

.dashboard-breakdown,
.dashboard-signals,
.manifest-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.dashboard-breakdown > div,
.dashboard-signals > div,
.manifest-list > div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--color-stone-200);
}

.dashboard-breakdown small {
    grid-column: 1 / -1;
    color: var(--color-muted);
}

.dashboard-signals dt,
.manifest-list dt {
    color: var(--color-muted);
}

.dashboard-signals dd,
.manifest-list dd {
    margin: 0;
    font-weight: 700;
}

.dashboard-comparison {
    margin-top: 1rem;
}

.report-tabs,
.report-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.report-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(10rem, 1fr));
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.25rem;
}

.report-filter-actions {
    grid-column: 1 / -1;
}

.lifecycle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lifecycle-form,
.lifecycle-copy {
    display: grid;
    gap: 1rem;
}

.lifecycle-note {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-small);
    background: var(--color-stone-100);
    line-height: 1.6;
}

.purge-blockers {
    border-left: 4px solid var(--color-danger);
}

.purge-blockers li + li {
    margin-top: 0.5rem;
}

.barcode-preview {
    margin: 1rem 0;
}

.barcode-sheet {
    display: grid;
    grid-template-columns: repeat(auto-fill, var(--label-width));
    gap: 0.35rem;
    align-items: start;
}

.barcode-label {
    width: var(--label-width);
    height: var(--label-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1.5mm;
    border: 1px dashed var(--color-stone-300);
    background: white;
    color: black;
    text-align: center;
    line-height: 1.05;
    break-inside: avoid;
}

.barcode-label strong {
    width: 100%;
    overflow: hidden;
    font-size: 9pt;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.barcode-label__graphic {
    width: 94%;
    min-height: 10mm;
}

.barcode-label__graphic svg {
    display: block;
    width: 100%;
    height: 12mm;
}

.barcode-label span,
.barcode-label b {
    font-size: 8pt;
}

.opening-stock-form {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.opening-stock-meta {
    margin: 0;
}

.opening-stock-form table input[type="number"] {
    min-width: 8rem;
}

.opening-confirm {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-top: 1rem;
    font-weight: 700;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 4.5rem minmax(0, 1fr);
    }

    .sidebar__brand span:last-child,
    .sidebar__nav a,
    .sidebar__disabled,
    .sidebar__label,
    .sidebar__logout {
        font-size: 0;
    }

    .sidebar__nav a,
    .sidebar__disabled {
        min-height: 2.7rem;
    }

    .metric-grid,
    .record-form,
    .membership-row,
    .dashboard-metrics,
    .dashboard-grid,
    .manifest-grid,
    .report-filters {
        grid-template-columns: 1fr;
    }

    .metric {
        border-right: 0;
        border-bottom: 1px solid var(--color-stone-200);
    }

    .auth {
        grid-template-columns: 1fr;
    }

    .pos-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .pos-shortcuts {
        justify-content: flex-start;
    }

    .payment-review dl {
        grid-template-columns: 1fr;
    }

    .auth__brand {
        display: none;
    }
}

@media print {
    @page {
        size: 80mm 297mm;
        margin: 0;
    }

    html,
    body,
    .app-shell,
    .app-main,
    .content {
        display: block;
        min-height: 0;
        margin: 0;
        padding: 0;
        background: white;
    }

    html,
    body {
        width: 80mm !important;
    }

    body * {
        visibility: hidden !important;
    }

    .sidebar,
    .topbar,
    .messages,
    .no-print {
        display: none !important;
    }

    .receipt {
        position: absolute;
        top: 0;
        left: 50%;
        margin: 0;
        transform: translateX(-50%);
        box-shadow: none;
        visibility: visible !important;
    }

    .receipt,
    .receipt * {
        visibility: visible !important;
    }

    .barcode-sheet {
        display: flex;
        flex-wrap: wrap;
        gap: 0;
    }

    .barcode-label {
        flex: 0 0 var(--label-width);
        border: 0;
    }
}

@media (max-width: 600px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        min-height: auto;
        flex-direction: row;
        align-items: center;
    }

    .sidebar__nav {
        display: none;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar form {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar select {
        width: 100%;
    }

    .topbar__profile {
        display: none;
    }

    .page-header--actions,
    .table-tools {
        flex-direction: column;
    }
}

/* Compact commerce workspace */
:root {
    --shell-sidebar: 13.75rem;
    --shell-sidebar-collapsed: 4.5rem;
    --color-line: #d8dfdc;
    --color-surface: #ffffff;
    font-size: 14px;
}

body {
    color: #101a17;
    background: #f7f9f8;
}

.app-shell {
    grid-template-columns: var(--shell-sidebar) minmax(0, 1fr);
    transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-is-collapsed {
    grid-template-columns: var(--shell-sidebar-collapsed) minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    background: linear-gradient(180deg, #073f35 0%, #075446 58%, #063d32 100%);
}

.sidebar__brand {
    min-height: 5rem;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgb(255 255 255 / 12%);
    font-size: 1rem;
    white-space: nowrap;
}

.sidebar__mark {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    border-radius: 0.4rem;
    font-size: 0.78rem;
}

.sidebar__brand-copy {
    display: grid;
    gap: 0.15rem;
    line-height: 1.15;
}

.sidebar__brand-copy small {
    color: rgb(255 255 255 / 67%);
    font-size: 0.7rem;
    font-weight: 500;
}

.sidebar__nav {
    min-height: 0;
    flex: 1;
    align-content: start;
    overflow-y: auto;
    padding: 0.7rem 0.45rem 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar__nav::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.sidebar__nav a,
.sidebar__collapse,
.sidebar__logout button {
    width: 100%;
    min-height: 2.55rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem 0.65rem;
    border: 0;
    border-radius: 0.4rem;
    color: rgb(255 255 255 / 86%);
    background: transparent;
    font-size: 0.86rem;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.sidebar__nav a:hover,
.sidebar__nav a.is-active,
.sidebar__collapse:hover,
.sidebar__logout button:hover {
    color: white;
    background: rgb(255 255 255 / 12%);
}

.sidebar__nav a.is-active {
    box-shadow: inset 3px 0 #9de2cf;
}

.nav-code {
    width: 1.65rem;
    flex: 0 0 1.65rem;
    color: #b7e3d7;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-align: center;
}

.nav-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__label {
    margin: 0.85rem 0 0.3rem;
    padding-inline: 0.75rem;
    font-size: 0.62rem;
}

.sidebar__footer {
    padding: 0.6rem 0.45rem;
    border-top: 1px solid rgb(255 255 255 / 15%);
}

.sidebar__logout {
    margin: 0.2rem 0 0;
}

.sidebar-is-collapsed .sidebar__brand-copy,
.sidebar-is-collapsed .nav-text,
.sidebar-is-collapsed .sidebar__label {
    display: none;
}

.sidebar-is-collapsed .sidebar__brand {
    justify-content: center;
    padding-inline: 0.5rem;
}

.sidebar-is-collapsed .sidebar__nav a,
.sidebar-is-collapsed .sidebar__collapse,
.sidebar-is-collapsed .sidebar__logout button {
    justify-content: center;
    padding-inline: 0.35rem;
}

.topbar {
    min-height: 4.5rem;
    padding: 0.65rem 1.75rem;
}

.topbar select {
    min-width: 16rem;
    min-height: 2.75rem;
    padding-block: 0.45rem;
    font-size: 0.86rem;
}

.topbar__profile strong {
    font-size: 0.86rem;
}

.content {
    width: 100%;
    max-width: none;
    padding: 1.5rem 1.75rem 2rem;
}

.page-header {
    margin-bottom: 1.25rem;
}

.page-header h1 {
    font-size: clamp(1.7rem, 2.4vw, 2.25rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.page-header__copy {
    margin-top: 0.45rem;
    font-size: 0.86rem;
}

.eyebrow {
    margin-bottom: 0.45rem;
    font-size: 0.68rem;
}

.button {
    min-height: 2.5rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.84rem;
}

th,
td {
    padding: 0.72rem 0.8rem;
}

@media (max-width: 760px) {
    .app-shell,
    .app-shell.sidebar-is-collapsed {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        min-height: auto;
    }

    .sidebar__brand {
        min-height: 4rem;
    }

    .sidebar__nav {
        display: none;
    }

    .sidebar__footer {
        position: absolute;
        top: 0.45rem;
        right: 0.45rem;
        border: 0;
    }

    .sidebar__collapse {
        display: none;
    }

    .sidebar__logout button {
        width: auto;
    }

    .topbar {
        padding-inline: 1rem;
    }

    .content {
        padding: 1rem;
    }
}

/* Accessible navigation groups, profile menu, and interface scaling */
html.font-size-comfortable {
    font-size: 16px;
}

html.font-size-large {
    font-size: 18px;
}

html.font-size-extra_large {
    font-size: 20px;
}

.nav-group {
    margin-top: 0.35rem;
}

.nav-group summary {
    min-height: 2.55rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem 0.65rem;
    border-radius: 0.4rem;
    color: rgb(255 255 255 / 70%);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
}

.nav-group summary:hover,
.nav-group summary:focus-visible {
    color: white;
    background: rgb(255 255 255 / 10%);
    outline: none;
}

.nav-group summary::marker {
    color: #9de2cf;
}

.nav-group ul {
    display: grid;
    gap: 0.1rem;
    margin: 0;
    padding: 0.2rem 0 0.25rem 0.55rem;
    list-style: none;
}

.nav-group li {
    min-width: 0;
}

.nav-group li a {
    font-size: 0.9rem;
}

.sidebar-is-collapsed .nav-group ul,
.sidebar-is-collapsed .nav-group .nav-text {
    display: none;
}

.sidebar-is-collapsed .nav-group summary {
    justify-content: center;
    padding-inline: 0.35rem;
}

.topbar__profile {
    position: relative;
}

.topbar__profile > summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    list-style: none;
}

.topbar__profile > summary::-webkit-details-marker {
    display: none;
}

.topbar__profile > summary:hover,
.topbar__profile > summary:focus-visible,
.topbar__profile[open] > summary {
    background: #eef7f4;
    outline: none;
}

.profile-avatar {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: var(--color-forest-900);
    font-size: 0.82rem;
    font-weight: 800;
}

.profile-copy {
    display: grid;
    gap: 0.1rem;
    text-align: left;
}

.profile-copy small {
    color: var(--color-muted);
    font-size: 0.75rem;
}

.profile-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.45rem);
    right: 0;
    width: 15rem;
    padding: 0.55rem;
    border: 1px solid var(--color-line);
    border-radius: 0.65rem;
    background: white;
    box-shadow: 0 16px 40px rgb(6 61 50 / 16%);
}

.profile-menu__identity {
    display: grid;
    gap: 0.15rem;
    padding: 0.6rem 0.7rem 0.75rem;
    border-bottom: 1px solid var(--color-line);
}

.profile-menu__identity span {
    color: var(--color-muted);
    font-size: 0.78rem;
}

.topbar .profile-menu form {
    display: block;
}

.profile-menu button {
    width: 100%;
    margin-top: 0.45rem;
    padding: 0.65rem 0.7rem;
    border: 0;
    border-radius: 0.4rem;
    color: #a32620;
    background: transparent;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.profile-menu button:hover,
.profile-menu button:focus-visible {
    background: #fff0ef;
}

.form-section {
    display: grid;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1.25rem;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background: #f8fbfa;
}

.form-section legend {
    padding: 0 0.4rem;
    color: var(--color-forest-950);
    font-size: 1rem;
    font-weight: 800;
}

.form-section__copy {
    margin: -0.35rem 0 0;
    color: var(--color-muted);
    font-size: 0.86rem;
}

@media (max-width: 760px) {
    .sidebar__nav {
        display: grid;
        max-height: 70vh;
    }

    .sidebar__footer {
        display: none;
    }

    .topbar__profile {
        display: block;
    }

    .profile-copy {
        display: none;
    }
}

.pos-screen {
    display: grid;
    gap: 1rem;
}

.pos-resume-notice {
    margin: 0;
    padding: 0.55rem 0.75rem;
    border: 1px solid #b9d8d0;
    border-radius: 0.35rem;
    color: var(--color-forest-950);
    background: #eef7f4;
    font-size: 0.78rem;
    font-weight: 700;
}

.pos-context {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--color-line);
    border-radius: 0.55rem;
    background: white;
}

.pos-context__item {
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem 1.25rem;
    border-right: 1px solid var(--color-line);
}

.pos-context__item:last-child {
    border-right: 0;
}

.pos-context__label,
.pos-quick-cash > span {
    color: var(--color-muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pos-context__control select {
    width: 100%;
    padding: 0;
    border: 0;
    color: var(--color-ink);
    background: white;
    font-size: 0.96rem;
    font-weight: 700;
}

.pos-context__item small {
    color: var(--color-muted);
    font-size: 0.7rem;
}

.pos-layout {
    grid-template-columns: minmax(0, 2fr) minmax(20rem, 0.82fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: 0.55rem;
    background: white;
}

.pos-workspace,
.pos-summary {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.pos-workspace {
    border-right: 1px solid var(--color-line);
}

.pos-search {
    z-index: 3;
    padding: 0.75rem;
}

.pos-search label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.pos-search__input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 0.75rem;
    border: 1.5px solid #2c77d0;
    border-radius: 0.35rem;
}

.pos-search input {
    min-height: 3rem;
    padding: 0.65rem 0.9rem;
    border: 0;
    outline: 0;
    font-size: 0.94rem;
}

.pos-results {
    inset: calc(100% - 0.55rem) 0.75rem auto;
}

.pos-results button {
    min-height: 3rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
}

.pos-cart__head,
.pos-cart__row {
    min-width: 48rem;
    grid-template-columns: 1.7rem minmax(13rem, 2fr) 4.5rem 6.5rem 6rem 7rem 4.5rem;
    gap: 0.55rem;
    padding: 0.6rem 0.75rem;
}

.pos-cart__head {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.7rem;
}

.pos-cart__row {
    min-height: 4.1rem;
    font-size: 0.8rem;
}

.pos-row-number {
    color: var(--color-muted);
    text-align: center;
}

.pos-cart__row .field input,
.pos-cart__row .field select {
    width: 100%;
    min-width: 0;
    padding: 0.48rem;
    border: 1px solid var(--color-line);
    border-radius: 0.35rem;
    background: white;
    font-size: 0.78rem;
}

.pos-cart__row .field select {
    border-color: transparent;
    font-weight: 700;
}

.pos-remove {
    justify-content: center;
}

.pos-remove label {
    font-size: 0;
}

.pos-remove label::after {
    content: "Remove";
    color: #c4342e;
    font-size: 0.68rem;
}

.pos-cart__footer {
    min-height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-top: 1px solid var(--color-line);
    font-size: 0.82rem;
}

.pos-summary {
    position: static;
    align-content: start;
    gap: 0.8rem;
    padding: 1rem;
}

.pos-summary__compact-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.pos-summary .field label {
    margin-bottom: 0.3rem;
    font-size: 0.7rem;
}

.pos-summary input,
.pos-summary select,
.pos-summary textarea {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--color-line);
    border-radius: 0.35rem;
    background: white;
}

.pos-summary textarea {
    min-height: 3.3rem;
    resize: vertical;
}

.pos-totals {
    gap: 0.55rem;
    padding: 0.7rem 0 0;
    border-block: 0;
}

.pos-totals div {
    font-size: 0.82rem;
}

.pos-totals__discount {
    color: var(--color-forest-700);
}

.pos-totals .pos-totals__grand {
    display: grid;
    gap: 0.3rem;
    margin-top: 0.35rem;
    padding: 1rem;
    border: 1px solid #b9d8d0;
    border-radius: 0.35rem;
    background: #eef7f4;
}

.pos-totals__grand dt {
    color: var(--color-forest-950);
    font-size: 0.72rem;
}

.pos-totals__grand dd {
    color: var(--color-forest-950);
    font-size: 1.8rem;
}

.pos-paid input {
    min-height: 3rem;
    font-size: 1.35rem;
}

.pos-change {
    display: grid;
    gap: 0.15rem;
    color: var(--color-forest-700);
}

.pos-change span {
    color: var(--color-ink);
    font-size: 0.76rem;
}

.pos-change strong {
    font-size: 1.5rem;
}

.pos-quick-cash {
    display: grid;
    gap: 0.45rem;
}

.pos-quick-cash div {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
}

.pos-quick-cash button {
    min-height: 2.25rem;
    border: 1px solid #4b8f82;
    border-radius: 0.35rem;
    color: var(--color-forest-950);
    background: white;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.pos-actions {
    grid-template-columns: 1fr;
}

.pos-actions .button {
    min-height: 3rem;
    justify-content: space-between;
}

.pos-actions .button kbd {
    color: inherit;
    background: transparent;
}

.pos-shortcuts {
    justify-content: flex-start;
    gap: 1.2rem;
    padding: 0.4rem 0.75rem;
}

@media (max-width: 1100px) {
    .pos-layout {
        grid-template-columns: 1fr;
    }

    .pos-workspace {
        border-right: 0;
        border-bottom: 1px solid var(--color-line);
    }
}

@media (max-width: 700px) {
    .pos-context {
        grid-template-columns: 1fr;
    }

    .pos-context__item {
        border-right: 0;
        border-bottom: 1px solid var(--color-line);
    }

    .pos-context__item:last-child {
        border-bottom: 0;
    }

    .pos-summary__compact-fields {
        grid-template-columns: 1fr;
    }

    .pos-shortcuts {
        display: none;
    }
}

.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.dashboard-header h1 {
    max-width: none;
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.dashboard-header p {
    margin: 0.35rem 0 0;
    color: var(--color-muted);
    font-size: 0.78rem;
}

.dashboard-header .dashboard-scope {
    margin: 0 0 0.35rem;
    color: var(--color-forest-700);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-period-control {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
}

.dashboard-period-control label {
    color: var(--color-muted);
    font-size: 0.66rem;
    font-weight: 700;
}

.dashboard-period-control select {
    min-width: 12rem;
    height: 2.55rem;
}

.dashboard-custom-period-panel {
    display: flex;
    align-items: end;
    gap: 0.75rem;
    margin: -0.35rem 0 1rem auto;
    padding: 0.8rem 1rem;
    border: 1px solid var(--color-line);
    border-radius: 0.6rem;
    background: white;
}

.dashboard-custom-period-panel[hidden] {
    display: none;
}

.dashboard-custom-period-panel .field {
    min-width: 12rem;
}

.dashboard-metrics--compact {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin: 0 -1.75rem 1rem;
    padding: 0 1.75rem;
    border-block: 1px solid var(--color-line);
    background: white;
}

.dashboard-metrics--compact .dashboard-metric {
    min-height: 7rem;
    align-content: center;
    gap: 0.42rem;
    padding: 1rem 1.25rem;
    border: 0;
    border-right: 1px solid var(--color-line);
    border-radius: 0;
    box-shadow: none;
}

.dashboard-metrics--compact .dashboard-metric:last-child {
    border-right: 0;
}

.dashboard-metrics--compact .dashboard-metric span {
    font-size: 0.72rem;
}

.dashboard-metrics--compact .dashboard-metric strong {
    color: #111a17;
    font-size: clamp(1.05rem, 1.55vw, 1.4rem);
    letter-spacing: -0.02em;
}

.dashboard-metrics--compact .dashboard-metric small {
    font-size: 0.66rem;
}

.dashboard-comparison {
    margin: 0 0 1rem;
}

.dashboard-panel-heading {
    min-height: 3.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--color-line);
}

.dashboard-panel-heading > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
}

.dashboard-panel-heading h2 {
    margin: 0;
    font-size: 0.98rem;
    letter-spacing: -0.01em;
}

.dashboard-panel-heading span,
.dashboard-panel-heading small {
    color: var(--color-muted);
    font-size: 0.7rem;
}

.comparison-table {
    font-size: 0.72rem;
}

.comparison-table th,
.comparison-table td {
    padding: 0.58rem 0.7rem;
}

.comparison-table th {
    color: #3e4945;
    background: #fafbfa;
    font-size: 0.62rem;
    text-transform: none;
}

.comparison-table td > small {
    display: block;
    margin-top: 0.15rem;
    color: var(--color-muted);
    font-size: 0.62rem;
}

.margin-meter {
    width: 3.3rem;
    height: 0.35rem;
    display: inline-block;
    margin-right: 0.4rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e3e7e5;
    vertical-align: middle;
}

.margin-meter i {
    width: min(var(--meter), 100%);
    height: 100%;
    display: block;
    border-radius: inherit;
    background: #2563eb;
}

.dashboard-lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(24rem, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.trend-canvas-wrap {
    height: 17rem;
    padding: 0.7rem 0.8rem 0;
}

.trend-canvas-wrap canvas {
    display: block;
}

.trend-legend {
    display: flex;
    gap: 1rem;
}

.trend-legend span::before {
    width: 1rem;
    height: 0.6rem;
    display: inline-block;
    margin-right: 0.35rem;
    background: #2563eb;
    content: "";
    vertical-align: middle;
    border-radius: 2px;
}

.trend-legend .trend-legend__profit::before {
    background: #0c705a;
}

.trend-summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--color-line);
    color: var(--color-muted);
    font-size: 0.68rem;
}

.trend-summary strong {
    color: var(--color-ink);
}

.attention-list {
    display: grid;
}

.attention-row {
    min-height: 2.6rem;
    display: grid;
    grid-template-columns: 8.2rem minmax(8rem, 1fr) minmax(11rem, 1.3fr);
    gap: 0.7rem;
    align-items: center;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--color-line);
    font-size: 0.7rem;
}

.attention-row strong {
    font-size: 0.72rem;
}

.attention-row > span:last-child {
    color: var(--color-muted);
}

.attention-status {
    color: #b54708;
    font-weight: 700;
}

.attention-row--danger .attention-status {
    color: #b42318;
}

.dashboard-grid--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-grid--compact .dashboard-panel {
    min-height: 0;
    padding: 0;
}

.dashboard-grid--compact .dashboard-breakdown,
.dashboard-grid--compact .dashboard-signals {
    padding: 0 1rem 0.7rem;
}

.dashboard-grid--compact .dashboard-breakdown > div,
.dashboard-grid--compact .dashboard-signals > div {
    padding: 0.62rem 0;
    font-size: 0.74rem;
}

@media (max-width: 1180px) {
    .dashboard-metrics--compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-lower {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-custom-period-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-header .header-actions {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .dashboard-metrics--compact {
        grid-template-columns: 1fr;
        margin-inline: -1rem;
        padding-inline: 1rem;
    }

    .dashboard-metrics--compact .dashboard-metric {
        min-height: 5.5rem;
        border-right: 0;
        border-bottom: 1px solid var(--color-line);
    }

    .dashboard-grid--compact {
        grid-template-columns: 1fr;
    }

    .attention-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

/* Searchable dropdowns */
.searchable-select {
    position: relative;
    width: 100%;
    min-width: 0;
}

.topbar .searchable-select {
    width: auto;
    min-width: 16rem;
}

.searchable-select__native,
.topbar .searchable-select__native {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.searchable-select__trigger {
    width: 100%;
    min-height: 2.75rem;
    position: relative;
    overflow: hidden;
    padding: 0.55rem 2.35rem 0.55rem 0.75rem;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    background: white;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.searchable-select__trigger::after {
    content: "";
    width: 0.48rem;
    height: 0.48rem;
    position: absolute;
    top: 50%;
    right: 0.9rem;
    border-right: 2px solid var(--color-muted);
    border-bottom: 2px solid var(--color-muted);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 140ms ease;
}

.searchable-select.is-open .searchable-select__trigger,
.searchable-select__trigger:focus-visible {
    border-color: var(--color-forest-700);
    outline: 3px solid rgb(12 112 90 / 14%);
}

.searchable-select.is-open .searchable-select__trigger::after {
    transform: translateY(-25%) rotate(225deg);
}

.searchable-select__trigger:disabled {
    color: var(--color-muted);
    background: #f0f3f2;
    cursor: not-allowed;
}

.searchable-select__panel {
    width: max(100%, 18rem);
    max-width: min(30rem, 90vw);
    display: none;
    position: absolute;
    z-index: 50;
    top: calc(100% + 0.35rem);
    left: 0;
    padding: 0.5rem;
    border: 1px solid var(--color-line);
    border-radius: 0.6rem;
    background: white;
    box-shadow: 0 16px 40px rgb(6 61 50 / 18%);
}

body > .searchable-select__panel {
    position: fixed;
    z-index: 1000;
}

.searchable-select.is-open .searchable-select__panel {
    display: block;
}

.searchable-select__search {
    width: 100%;
    min-height: 2.65rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--color-line);
    border-radius: 0.4rem;
    color: var(--color-ink);
    background: #f8fbfa;
}

.searchable-select__search:focus {
    border-color: var(--color-forest-700);
    outline: 3px solid rgb(12 112 90 / 12%);
}

.searchable-select__options {
    max-height: 18rem;
    display: grid;
    gap: 0.15rem;
    overflow-y: auto;
    margin-top: 0.45rem;
}

.searchable-select__option {
    width: 100%;
    min-height: 2.4rem;
    padding: 0.5rem 0.65rem;
    border: 0;
    border-radius: 0.35rem;
    color: var(--color-ink);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.searchable-select__option:hover,
.searchable-select__option:focus-visible,
.searchable-select__option.is-selected {
    color: var(--color-forest-950);
    background: var(--color-mint-100);
    outline: none;
}

.searchable-select__option.is-selected {
    font-weight: 750;
}

.searchable-select__option:disabled {
    color: #9aa5a1;
    cursor: not-allowed;
}

.searchable-select__empty {
    margin: 0;
    padding: 0.8rem 0.65rem;
    color: var(--color-muted);
    font-size: 0.82rem;
}

.field:has(.searchable-select__native:invalid) .searchable-select__trigger {
    border-color: #bd302a;
}

@media (max-width: 760px) {
    .topbar .searchable-select,
    .searchable-select__panel {
        width: 100%;
        min-width: 0;
    }
}

/* User role information */
.role-field-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.75rem;
    gap: 0.5rem;
    align-items: center;
}

.role-info-button {
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-line);
    border-radius: 50%;
    color: var(--color-forest-700);
    background: white;
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
}

.role-info-button:hover,
.role-info-button:focus-visible {
    border-color: var(--color-forest-700);
    background: var(--color-mint-100);
    outline: 3px solid rgb(12 112 90 / 12%);
}

.role-info-dialog {
    width: min(32rem, calc(100vw - 2rem));
    padding: 1.4rem;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    color: var(--color-ink);
    background: white;
    box-shadow: 0 24px 80px rgb(6 61 50 / 28%);
}

.role-info-dialog::backdrop {
    background: rgb(5 25 21 / 52%);
    backdrop-filter: blur(2px);
}

.role-info-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.role-info-dialog h2 {
    margin: 0;
    color: var(--color-forest-950);
    font-size: 1.35rem;
}

.role-info-dialog > p {
    margin: 1rem 0;
    color: var(--color-muted);
    line-height: 1.55;
}

.role-info-dialog ul {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.45;
}

.role-info-dialog__close {
    width: 2.35rem;
    height: 2.35rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--color-muted);
    background: #eef2f0;
    font-size: 1.3rem;
    cursor: pointer;
}

.role-info-dialog__close:hover,
.role-info-dialog__close:focus-visible {
    color: var(--color-ink);
    background: var(--color-stone-200);
    outline: 3px solid rgb(12 112 90 / 12%);
}

/* Guided Commerce POS reference layout */
body:has(.guided-pos) .content {
    padding: 1.6rem 1.25rem 0;
}

body:has(.guided-pos) .topbar::before {
    content: "Nomi Traders";
    color: #17201d;
    font-size: 1.15rem;
    font-weight: 850;
    letter-spacing: -0.02em;
}

.guided-pos {
    grid-template-columns: minmax(0, 2.05fr) minmax(20rem, 0.85fr);
    gap: 0.55rem 0;
    align-items: start;
}

.guided-pos .pos-context {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: 1fr 1fr 1.15fr;
    border: 1px solid #ced8d5;
    border-right: 0;
    border-radius: 0.5rem 0 0 0.5rem;
    background: #fbfcfb;
}

.guided-pos .pos-context__item {
    min-height: 4.6rem;
    display: block;
    padding: 0.6rem 1.3rem;
    border-right: 1px solid var(--color-line);
}

.guided-pos .pos-context__item:first-child {
    padding-left: 0.65rem;
}

.guided-pos .pos-context__item:last-child {
    display: block;
    border-right: 0;
}

.pos-context__icon {
    width: 2.1rem;
    height: 2.1rem;
    display: grid;
    place-items: center;
    border: 1px solid #7faea3;
    border-radius: 0.5rem;
    color: var(--color-forest-700);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.pos-context__copy {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}

.guided-pos .pos-context__label {
    font-size: 0.66rem;
}

.guided-pos .pos-context__item small {
    font-size: 0.7rem;
}

.guided-pos .pos-context__control .searchable-select__trigger {
    min-height: 1.7rem;
    overflow: hidden;
    padding: 0 1.5rem 0 0;
    border: 0;
    color: var(--color-ink);
    background: transparent;
    font-size: 0.94rem;
    font-weight: 800;
}

.guided-pos .pos-context__control .searchable-select__trigger::after {
    right: 0.25rem;
}

.pos-context__action {
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid #5a9187;
    border-radius: 0.35rem;
    color: var(--color-forest-700);
    background: white;
    font-size: 0.72rem;
    font-weight: 750;
    cursor: pointer;
}

.pos-context__action:hover,
.pos-context__action:focus-visible {
    background: var(--color-mint-100);
    outline: 2px solid rgb(12 112 90 / 12%);
}

.pos-price-mode {
    width: min(100%, 17rem);
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    overflow: hidden;
    border: 1px solid #68968c;
    border-radius: 0.38rem;
}

.pos-price-mode button {
    min-height: 2.3rem;
    padding: 0.4rem 0.75rem;
    border: 0;
    color: var(--color-forest-950);
    background: white;
    font-size: 0.76rem;
    font-weight: 750;
    cursor: pointer;
}

.pos-price-mode button + button {
    border-left: 1px solid #68968c;
}

.pos-price-mode button.is-active {
    color: white;
    background: linear-gradient(180deg, #0b6655, #075043);
}

.pos-price-select {
    display: none;
}

.guided-pos .pos-layout {
    display: contents;
}

.guided-pos .pos-workspace {
    position: relative;
    z-index: 2;
    grid-column: 1;
    grid-row: 3;
    min-height: 44rem;
    display: flex;
    flex-direction: column;
    overflow: visible;
    border: 1px solid #ced8d5;
    border-right-color: #d8dfdd;
    border-radius: 0.5rem 0 0 0.5rem;
    box-shadow: 0 5px 18px rgb(9 51 43 / 7%);
}

.guided-pos .pos-search {
    z-index: 20;
    padding: 0.65rem 0.75rem 0.3rem;
    border-bottom: 0;
}

.guided-pos .pos-search__input {
    min-height: 3.2rem;
    border: 1.5px solid #2f7fd4;
    box-shadow: 0 0 0 2px rgb(47 127 212 / 7%);
}

.guided-pos .pos-search__input::before {
    content: "⌕";
    margin-left: 0.75rem;
    color: #71807c;
    font-size: 1.35rem;
    line-height: 1;
}

.guided-pos .pos-search input {
    min-height: 3rem;
    padding-left: 0.15rem;
    font-size: 0.9rem;
}

.guided-pos .pos-results {
    inset: calc(100% - 0.2rem) 0.75rem auto;
    z-index: 100;
    overflow: hidden;
    border-color: #cbd4d1;
    border-radius: 0.35rem;
    box-shadow: 0 14px 32px rgb(9 51 43 / 18%);
}

.pos-results__head,
.guided-pos .pos-results__row {
    display: grid;
    grid-template-columns: 0.75fr 1.1fr minmax(9rem, 1.75fr) 0.95fr 1.05fr 0.55fr;
    align-items: center;
    gap: 0.6rem;
    padding: 0.58rem 0.75rem;
}

.pos-results__head {
    color: var(--color-muted);
    background: #f8faf9;
    border-bottom: 1px solid var(--color-line);
    font-size: 0.67rem;
    font-weight: 750;
}

.guided-pos .pos-results__row {
    min-height: 2.8rem;
    border-bottom: 1px solid var(--color-line);
    font-size: 0.74rem;
}

.guided-pos .pos-results__row > * {
    min-width: 0;
    overflow: hidden;
    color: var(--color-ink);
    font-size: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guided-pos .pos-results__row > :last-child {
    color: var(--color-forest-700);
    font-weight: 800;
    text-align: right;
}

.pos-results__footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.75rem;
    color: var(--color-muted);
    background: white;
    font-size: 0.67rem;
}

.guided-pos .pos-cart {
    min-height: 27rem;
    flex: 1;
    overflow-x: auto;
}

.guided-pos .pos-cart__head,
.guided-pos .pos-cart__row {
    min-width: 50rem;
    grid-template-columns: 1.35rem minmax(10rem, 1.55fr) minmax(7rem, 0.9fr) 5.7rem 6.2rem 5rem 6.8rem 2.5rem;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
}

.guided-pos .pos-cart__head {
    border-block: 1px solid var(--color-line);
    color: #485a56;
    background: #f7f9f8;
    font-size: 0.66rem;
}

.guided-pos .pos-cart__row {
    min-height: 4.25rem;
    border-top: 0;
    border-bottom: 1px solid var(--color-line);
}

.guided-pos .pos-cart__row.is-empty {
    display: none;
}

.guided-pos .pos-product-cell {
    gap: 0.1rem;
}

.guided-pos .pos-product-cell .searchable-select__trigger {
    min-height: 2rem;
    padding: 0.25rem 1.6rem 0.25rem 0;
    border: 0;
    background: transparent;
    font-size: 0.77rem;
    font-weight: 800;
}

.guided-pos .pos-product-cell > small {
    padding-left: 0.1rem;
    color: var(--color-muted);
    font-size: 0.66rem;
}

.pos-product-identifiers {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
    color: var(--color-muted);
    font-size: 0.67rem;
}

.pos-product-identifiers strong {
    overflow: hidden;
    color: #43534f;
    font-weight: 650;
    text-overflow: ellipsis;
}

.pos-product-identifiers small {
    overflow: hidden;
    font-size: inherit;
    text-overflow: ellipsis;
}

.guided-pos .pos-quantity-field {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.3rem;
}

.guided-pos .pos-quantity-field span {
    color: var(--color-muted);
    font-size: 0.66rem;
}

.guided-pos .pos-cart__row .field input {
    min-height: 2.35rem;
    padding: 0.42rem 0.5rem;
    border-color: #cfd8d5;
    font-size: 0.76rem;
}

.guided-pos .line-total {
    color: #16241f;
    font-size: 0.78rem;
}

.guided-pos .pos-remove input {
    position: absolute;
    opacity: 0;
}

.guided-pos .pos-remove label {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 0.3rem;
    cursor: pointer;
}

.guided-pos .pos-remove label::after {
    content: "×";
    color: #e53935;
    font-size: 1.35rem;
    font-weight: 500;
}

.guided-pos .pos-remove label:hover {
    background: #fff0ef;
}

.guided-pos .pos-cart__footer {
    min-height: 4.4rem;
    padding: 0.75rem;
    background: white;
}

.guided-pos .pos-cart__footer strong {
    font-size: 0.74rem;
}

.guided-pos .pos-summary {
    position: relative;
    top: 0;
    z-index: 1;
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: stretch;
    gap: 0.9rem;
    padding: 1.15rem;
    border: 1px solid #ced8d5;
    border-radius: 0 0.5rem 0.5rem 0;
    background: #fbfcfb;
    box-shadow: 0 5px 18px rgb(9 51 43 / 7%);
}

.pos-summary__document {
    display: grid;
    grid-template-columns: minmax(6rem, 0.75fr) minmax(9rem, 1.25fr);
    align-items: end;
    gap: 0.75rem;
}

.pos-document-number {
    min-height: 3.35rem;
    display: grid;
    align-content: center;
    gap: 0.25rem;
}

.pos-document-number span {
    color: var(--color-muted);
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
}

.pos-document-number strong {
    color: var(--color-forest-950);
    font-size: 0.82rem;
}

.pos-summary__date {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3rem;
}

.pos-summary__date label {
    margin: 0;
}

.guided-pos .pos-totals {
    gap: 0.75rem;
    padding: 0.25rem 0 0.85rem;
    border-top: 0;
    border-bottom: 1px solid var(--color-line);
}

.guided-pos .pos-totals div {
    align-items: center;
}

.guided-pos .pos-totals dt,
.guided-pos .pos-totals dd {
    color: var(--color-ink);
    font-size: 0.76rem;
}

.guided-pos .pos-totals__discount dt,
.guided-pos .pos-totals__discount dd {
    color: var(--color-forest-700);
}

.guided-pos .pos-summary__discount {
    grid-template-columns: 1fr 6.5rem;
}

.guided-pos .pos-summary__discount label {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.7rem;
}

.guided-pos .pos-summary__discount input {
    min-height: 2rem;
    padding: 0.3rem 0.45rem;
    text-align: right;
}

.guided-pos .pos-totals__net {
    margin-top: 0.25rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--color-line);
}

.guided-pos .pos-totals__net dt,
.guided-pos .pos-totals__net dd {
    font-size: 0.9rem;
    font-weight: 800;
}

.pos-grand-total {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
    border: 1px solid #a9cbc2;
    border-radius: 0.35rem;
    background: linear-gradient(135deg, #eef8f5, #e8f3f0);
}

.pos-grand-total span {
    color: #31534b;
    font-size: 0.69rem;
}

.pos-grand-total strong {
    color: var(--color-forest-950);
    font-size: 1.8rem;
    line-height: 1;
}

.guided-pos .pos-paid input {
    min-height: 3.1rem;
    font-size: 1.3rem;
}

.guided-pos .pos-change {
    gap: 0.3rem;
}

.guided-pos .pos-change strong {
    font-size: 1.55rem;
}

.guided-pos .pos-quick-cash div {
    gap: 0.35rem;
}

.guided-pos .pos-quick-cash button {
    min-height: 2.4rem;
    font-size: 0.72rem;
}

.guided-pos .pos-actions {
    grid-template-columns: 1fr;
    gap: 0.45rem;
}

.guided-pos .pos-actions .button {
    min-height: 3rem;
    border-color: #56877d;
    border-radius: 0.3rem;
    color: var(--color-forest-950);
    background: white;
}

.guided-pos .pos-actions .button--primary {
    color: white;
    background: linear-gradient(180deg, #0b6655, #075043);
}

.guided-pos .pos-shortcuts {
    margin-inline: -1.25rem;
    padding: 0.7rem 1.25rem;
    border-top: 1px solid var(--color-line);
    background: white;
    font-size: 0.67rem;
}

.guided-pos .pos-shortcuts--top {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 2.8rem;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    flex-wrap: nowrap;
    margin-top: -1.6rem;
    margin-bottom: -0.5rem;
    border-top: 0;
    border-bottom: 1px solid var(--color-line);
    box-shadow: 0 3px 10px rgb(9 51 43 / 5%);
    white-space: nowrap;
    grid-column: 1 / -1;
    grid-row: 1;
}

@media (max-width: 1150px) {
    .guided-pos {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .guided-pos .pos-context,
    .guided-pos .pos-workspace,
    .guided-pos .pos-summary {
        grid-column: 1;
        grid-row: auto;
        border: 1px solid #ced8d5;
        border-radius: 0.5rem;
    }

    .guided-pos .pos-workspace {
        min-height: 38rem;
    }
}

@media (max-width: 780px) {
    .guided-pos .pos-context {
        grid-template-columns: 1fr;
    }

    .guided-pos .pos-context__item,
    .guided-pos .pos-context__item:last-child {
        display: block;
        padding: 0.75rem;
        border-right: 0;
        border-bottom: 1px solid var(--color-line);
    }

    .pos-results__head {
        display: none;
    }

    .guided-pos .pos-results__row {
        grid-template-columns: 1fr auto;
    }

    .guided-pos .pos-results__row > :not(:nth-child(3)):not(:last-child) {
        display: none;
    }

    .pos-results__footer span:last-child {
        display: none;
    }
}

/* Guided purchase and return documents */
body:has(.guided-document) .content {
    padding: 1.6rem 1.25rem 0;
}

.guided-document {
    display: grid;
    grid-template-columns: minmax(0, 2.05fr) minmax(20rem, 0.85fr);
    gap: 0.55rem 0;
    align-items: start;
}

.guided-document__shortcuts {
    position: sticky;
    top: 0;
    z-index: 40;
    grid-column: 1 / -1;
    min-height: 2.8rem;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    flex-wrap: nowrap;
    margin: -1.6rem -1.25rem 0;
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid var(--color-line);
    background: white;
    box-shadow: 0 3px 10px rgb(9 51 43 / 5%);
    font-size: 0.67rem;
    white-space: nowrap;
}

.transaction-context {
    grid-column: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 5.25rem;
    overflow: visible;
    border: 1px solid #ced8d5;
    border-right: 0;
    border-radius: 0.5rem 0 0 0.5rem;
    background: #fbfcfb;
}

.transaction-context__item {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 0.22rem;
    padding: 0.6rem 1rem;
    border-right: 1px solid var(--color-line);
}

.transaction-context__item:last-child {
    border-right: 0;
}

.transaction-context__item > span,
.transaction-document span {
    color: var(--color-muted);
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.transaction-context__item > strong {
    overflow: hidden;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-context__item small {
    color: var(--color-muted);
    font-size: 0.67rem;
}

.transaction-context__item select,
.transaction-context__item input,
.transaction-context__item .searchable-select__trigger {
    width: 100%;
    min-height: 1.8rem;
    padding: 0.15rem 1.4rem 0.15rem 0;
    border: 0;
    background: transparent;
    font-size: 0.86rem;
    font-weight: 750;
}

.transaction-workspace {
    position: relative;
    z-index: 2;
    grid-column: 1;
    min-width: 0;
    min-height: 44rem;
    display: flex;
    flex-direction: column;
    overflow: visible;
    border: 1px solid #ced8d5;
    border-right-color: #d8dfdd;
    border-radius: 0.5rem 0 0 0.5rem;
    background: white;
    box-shadow: 0 5px 18px rgb(9 51 43 / 7%);
}

.transaction-search {
    position: relative;
    z-index: 20;
    padding: 0.65rem 0.75rem 0.3rem;
}

.transaction-search > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.transaction-search > div:first-of-type {
    min-height: 3.2rem;
    display: flex;
    align-items: center;
    border: 1.5px solid #2f7fd4;
    border-radius: 0.35rem;
    background: white;
    box-shadow: 0 0 0 2px rgb(47 127 212 / 7%);
}

.transaction-search > div:first-of-type::before {
    content: "⌕";
    margin-left: 0.75rem;
    color: #71807c;
    font-size: 1.35rem;
}

.transaction-search input {
    min-width: 0;
    min-height: 3rem;
    flex: 1;
    padding: 0 0.5rem;
    border: 0;
    outline: 0;
    background: transparent;
}

.transaction-search kbd {
    margin-right: 0.65rem;
}

.transaction-search .pos-results {
    inset: calc(100% - 0.25rem) 0.75rem auto;
    z-index: 100;
    display: block;
    overflow: hidden;
    border: 1px solid #cbd4d1;
    border-radius: 0.35rem;
    background: white;
    box-shadow: 0 14px 32px rgb(9 51 43 / 18%);
}

.transaction-search .pos-results[hidden] {
    display: none;
}

.transaction-result {
    width: 100%;
    min-height: 2.9rem;
    display: grid;
    grid-template-columns: 0.7fr 0.9fr minmax(9rem, 1.5fr) 0.8fr 0.8fr;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-bottom: 1px solid var(--color-line);
    background: white;
    color: var(--color-ink);
    font-size: 0.72rem;
    text-align: left;
    cursor: pointer;
}

.transaction-result:hover,
.transaction-result:focus-visible {
    background: #edf7f4;
    outline: 0;
}

.transaction-result > * {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-lines {
    min-height: 27rem;
    flex: 1;
    overflow-x: auto;
}

.transaction-line {
    min-width: 50rem;
    min-height: 4.25rem;
    display: grid;
    grid-template-columns: 1.35rem minmax(10rem, 1.55fr) minmax(7rem, 0.9fr) 5.7rem 6.2rem 5rem 6.8rem 2.5rem;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--color-line);
    font-size: 0.72rem;
}

.transaction-line--return {
    grid-template-columns: 1.35rem minmax(11rem, 1.7fr) minmax(8rem, 1fr) 6rem 7rem 7rem 2.5rem;
}

.transaction-line--head {
    min-height: auto;
    color: #485a56;
    background: #f7f9f8;
    font-size: 0.66rem;
    font-weight: 750;
}

.transaction-line.is-empty {
    display: none;
}

.transaction-line .field {
    margin: 0;
}

.transaction-line .field input {
    width: 100%;
    min-height: 2.35rem;
    padding: 0.42rem 0.5rem;
    border: 1px solid #cfd8d5;
    border-radius: 0.3rem;
    font-size: 0.74rem;
}

.transaction-product .searchable-select__trigger {
    min-height: 2rem;
    padding: 0.25rem 1.6rem 0.25rem 0;
    border: 0;
    background: transparent;
    font-size: 0.77rem;
    font-weight: 800;
}

.transaction-product > small,
.transaction-quantity small {
    color: var(--color-muted);
    font-size: 0.65rem;
}

.transaction-identifiers {
    min-width: 0;
    display: grid;
    gap: 0.15rem;
    color: var(--color-muted);
    font-size: 0.65rem;
}

.transaction-identifiers strong,
.transaction-identifiers small {
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-quantity {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.25rem;
}

.transaction-line output {
    font-weight: 800;
    text-align: right;
}

.transaction-remove input {
    position: absolute;
    opacity: 0;
}

.transaction-remove label {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 0.3rem;
    color: #e53935;
    font-size: 1.3rem;
    cursor: pointer;
}

.transaction-remove label:hover {
    background: #fff0ef;
}

.transaction-lines__footer {
    min-height: 4.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: white;
}

.transaction-summary {
    position: relative;
    top: 0;
    z-index: 1;
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: stretch;
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.9rem;
    padding: 1.15rem;
    border: 1px solid #ced8d5;
    border-radius: 0 0.5rem 0.5rem 0;
    background: #fbfcfb;
    box-shadow: 0 5px 18px rgb(9 51 43 / 7%);
}

.transaction-document {
    display: grid;
    grid-template-columns: minmax(6rem, 0.75fr) minmax(9rem, 1.25fr);
    align-items: end;
    gap: 0.75rem;
}

.transaction-document > div:first-child {
    min-height: 3.35rem;
    display: grid;
    align-content: center;
    gap: 0.25rem;
}

.transaction-document strong {
    font-size: 0.82rem;
}

.transaction-summary .field {
    margin: 0;
}

.transaction-summary input,
.transaction-summary select,
.transaction-summary textarea {
    width: 100%;
}

.transaction-summary textarea {
    min-height: 4rem;
}

.transaction-totals {
    display: grid;
    gap: 0.7rem;
    margin: 0;
}

.transaction-totals > div,
.transaction-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.transaction-totals .field {
    display: grid;
    grid-template-columns: 1fr 7rem;
    align-items: center;
}

.transaction-totals .field input {
    min-height: 2rem;
    padding: 0.3rem 0.45rem;
    text-align: right;
}

.transaction-total {
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-line);
    font-size: 0.9rem;
    font-weight: 850;
}

.transaction-grand-total {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid #9ac8be;
    border-radius: 0.35rem;
    background: #eaf5f2;
}

.transaction-grand-total span {
    color: #3f5e57;
    font-size: 0.67rem;
}

.transaction-grand-total strong {
    color: var(--color-forest-950);
    font-size: 1.65rem;
}

.transaction-balance {
    display: grid;
    gap: 0.25rem;
    color: var(--color-forest-800);
}

.transaction-balance span {
    font-size: 0.7rem;
}

.transaction-balance strong {
    font-size: 1.35rem;
}

.transaction-actions {
    display: grid;
    gap: 0.45rem;
}

.transaction-actions .button {
    min-height: 3rem;
    justify-content: space-between;
}

.transaction-actions .button--primary {
    color: white;
    background: linear-gradient(180deg, #0b6655, #075043);
}

.transaction-actions kbd {
    color: inherit;
    background: transparent;
}

@media (max-width: 1150px) {
    .guided-document {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .transaction-context,
    .transaction-workspace,
    .transaction-summary {
        grid-column: 1;
        grid-row: auto;
        border: 1px solid #ced8d5;
        border-radius: 0.5rem;
    }

    .transaction-workspace {
        min-height: 38rem;
    }
}

@media (max-width: 780px) {
    .guided-document__shortcuts {
        display: none;
    }

    .transaction-context {
        grid-template-columns: 1fr;
    }

    .transaction-context__item {
        border-right: 0;
        border-bottom: 1px solid var(--color-line);
    }

    .transaction-context__item:last-child {
        border-bottom: 0;
    }

    .transaction-document {
        grid-template-columns: 1fr;
    }
}

/* Floating, auto-dismissing notifications */
.toast-stack {
    width: min(25rem, calc(100vw - 2rem));
    display: grid;
    gap: 0.65rem;
    position: fixed;
    z-index: 2000;
    top: 5.25rem;
    right: 1rem;
    pointer-events: none;
}

.toast {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.75rem 0.85rem 1rem;
    border: 1px solid #b8cbc6;
    border-left: 4px solid var(--color-forest-700);
    border-radius: 0.5rem;
    color: #17342d;
    background: white;
    box-shadow: 0 14px 38px rgb(6 49 41 / 20%);
    font-size: 0.78rem;
    line-height: 1.4;
    pointer-events: auto;
    animation: toast-enter 180ms ease-out both;
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast--success {
    border-left-color: #16866f;
    background: #f2fbf8;
}

.toast--info {
    border-left-color: #2f7fd4;
    background: #f4f8fd;
}

.toast--error,
.toast--warning {
    border-left-color: #d6453d;
    color: #74231f;
    background: #fff7f6;
}

.toast button {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: currentColor;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
}

.toast button:hover,
.toast button:focus-visible {
    background: rgb(0 0 0 / 6%);
    outline: none;
}

.toast.is-hiding {
    opacity: 0;
    transform: translateX(1rem);
}

@keyframes toast-enter {
    from {
        opacity: 0;
        transform: translateX(1rem);
    }
}

@media (max-width: 600px) {
    .toast-stack {
        top: 0.75rem;
        right: 0.75rem;
    }

    .pos-summary__document {
        grid-template-columns: 1fr;
    }
}
.sidebar__logo {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
}

.settings-logo-preview {
    display: block;
    max-width: 240px;
    max-height: 120px;
    object-fit: contain;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.receipt__logo {
    display: block;
    max-width: 34mm;
    max-height: 16mm;
    margin: 0 auto 2mm;
    object-fit: contain;
}

.report-total-row th,
.report-total-row td {
    border-top: 2px solid var(--green, #075e54);
    background: #eef8f5;
    white-space: nowrap;
}
