:root {
    --canvas: #f5efe4;
    --canvas-warm: #eee4d3;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-solid: #fffaf2;
    --surface-muted: #f6efe3;
    --surface-inset: #f8f1e6;
    --surface-dark: #16202a;
    --surface-dark-soft: #214252;
    --ink-strong: #17222b;
    --ink: #314250;
    --ink-soft: #61707d;
    --ink-muted: #8b98a3;
    --line-soft: rgba(23, 34, 43, 0.08);
    --line: rgba(23, 34, 43, 0.14);
    --line-strong: rgba(23, 34, 43, 0.22);
    --accent: #1c5c72;
    --accent-strong: #173f52;
    --money: #16795c;
    --money-strong: #0f6249;
    --money-soft: #e8f4ed;
    --receipt: #b97a23;
    --receipt-strong: #8d5d19;
    --receipt-soft: #f7eddc;
    --danger: #b44d54;
    --danger-strong: #8f3740;
    --danger-soft: #faecec;
    --focus: rgba(28, 92, 114, 0.16);
    --shadow: 0 26px 54px -42px rgba(23, 34, 43, 0.62);
    --shadow-strong: 0 34px 64px -46px rgba(12, 18, 24, 0.8);
    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 30px;
    --font-body: "Manrope", "Segoe UI", sans-serif;
    --font-display: "Space Grotesk", "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", "Courier New", monospace;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
}

* {
    box-sizing: border-box;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.product-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.product-combobox {
    position: relative;
    width: 100%;
}

.product-combobox__control {
    display: flex;
    align-items: stretch;
    min-height: 48px;
    overflow: visible;
    border: 1px solid rgba(148, 163, 184, 0.85);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px -20px rgba(15, 23, 42, 0.45);
}

.product-combobox__control:focus-within {
    border-color: rgba(14, 116, 144, 0.9);
    box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.12);
}

.product-combobox__input {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 0;
    background: transparent;
    color: #0f172a;
}

.product-combobox__input::placeholder {
    color: #64748b;
}

.product-combobox__input:focus {
    outline: none;
}

.product-combobox__toggle {
    flex: 0 0 44px;
    border: 0;
    border-left: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(248, 250, 252, 0.96);
    color: #334155;
}

.product-combobox__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 40;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 36px -26px rgba(15, 23, 42, 0.65);
}

.product-combobox__options {
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.product-combobox__empty {
    padding: 14px;
    color: #64748b;
    font-size: 0.92rem;
}

.product-combobox__option {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    background: transparent;
    color: #0f172a;
    text-align: left;
}

.product-combobox__option:last-child {
    border-bottom: 0;
}

.product-combobox__option:hover,
.product-combobox__option.is-highlighted {
    background: rgba(240, 249, 255, 0.95);
}

.product-combobox__option.is-selected {
    background: rgba(236, 253, 245, 0.98);
}

.product-combobox__option.is-out-of-stock {
    background: rgba(254, 242, 242, 0.92);
}

.product-combobox__option.is-out-of-stock:hover,
.product-combobox__option.is-out-of-stock.is-highlighted {
    background: rgba(254, 226, 226, 0.98);
}

.product-combobox__media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(28, 92, 114, 0.18), transparent 55%),
        linear-gradient(135deg, rgba(245, 239, 228, 0.95), rgba(255, 255, 255, 0.92));
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.product-combobox__thumb {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    background: transparent;
}

.product-combobox__thumb--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #0f766e;
    font-weight: 800;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, rgba(204, 251, 241, 0.96), rgba(224, 242, 254, 0.96));
}

.product-combobox__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 3px;
}

.product-combobox__code {
    color: #8b5e24;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.product-combobox__title {
    font-weight: 700;
    font-size: 0.95rem;
}

.product-combobox__description {
    color: #475569;
    font-size: 0.86rem;
    white-space: normal;
    word-break: break-word;
}

.product-combobox__meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    white-space: nowrap;
}

.product-combobox__stock,
.product-combobox__price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.77rem;
    font-weight: 800;
}

.product-combobox__stock {
    color: #475569;
    background: rgba(241, 245, 249, 0.92);
}

.product-combobox__stock--empty {
    color: #b91c1c;
    background: rgba(254, 226, 226, 0.95);
}

.product-combobox__price {
    color: #0f766e;
    background: rgba(220, 252, 231, 0.95);
}

.product-combobox__sheet-head {
    display: none;
}

.product-combobox__sheet-search-wrap {
    display: none;
}

.product-combobox__sheet-search {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(203, 213, 225, 0.96);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    color: #17222b;
    font-size: 0.94rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.product-combobox__sheet-search::placeholder {
    color: #7b8a98;
}

.product-combobox__sheet-search:focus {
    outline: none;
    border-color: rgba(28, 92, 114, 0.42);
    box-shadow:
        0 0 0 4px rgba(28, 92, 114, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.sale-product-combobox.has-selection .product-combobox__control {
    border-color: rgba(21, 128, 61, 0.34);
    box-shadow: 0 12px 28px -24px rgba(21, 128, 61, 0.42);
}

.sale-items-shell {
    width: 100%;
}

@media (max-width: 640px) {
    .sale-form-pagehead {
        margin-bottom: 1rem;
    }

    .sale-form-pagehead h1 {
        font-size: 1.7rem;
        line-height: 1.15;
    }

    .sale-form-shell {
        padding: 1rem;
        border-radius: 24px;
        box-shadow: 0 24px 44px -36px rgba(15, 23, 42, 0.45);
    }

    .sale-form-grid {
        gap: 1rem;
    }

    .sale-form-shell label {
        margin-bottom: 0.45rem;
        color: #1e293b;
    }

    .sale-form-shell input:not([type="checkbox"]):not([type="radio"]),
    .sale-form-shell select,
    .sale-form-shell textarea {
        min-height: 48px;
        border-radius: 16px;
    }

    .sale-form-shell input[type="date"] {
        -webkit-appearance: none;
        appearance: none;
    }

    .sale-quick-client-panel {
        padding: 0.9rem;
        border-radius: 20px;
    }

    .sale-products-section {
        margin-top: 1.75rem;
    }

    #toggleSaleCatalogBtn {
        min-height: 52px;
        padding: 0 1rem;
        border-radius: 22px;
        font-size: 0.82rem;
        letter-spacing: 0.16em;
    }

    #saleCatalogPanel {
        padding: 0.9rem;
        border-radius: 24px;
        background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.96));
        box-shadow: 0 18px 36px -34px rgba(15, 23, 42, 0.48);
    }

    #productSearchMobile,
    #startBarcodeScannerBtnMobile,
    #stopBarcodeScannerBtnMobile,
    #saveSaleBtn {
        min-height: 48px;
        border-radius: 18px;
    }

    #saleCatalogList {
        max-height: 15rem;
        gap: 0.75rem;
    }

    #saleCatalogList > button {
        border-radius: 24px;
        padding: 0.8rem;
    }

    .sale-items-shell {
        margin-top: 6px;
    }

    #itemsTable {
        display: block;
        min-width: 0;
    }

    #itemsTable thead {
        display: none;
    }

    #itemsTable tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    #itemsTable tbody tr {
        display: block;
        border: 1px solid rgba(226, 232, 240, 0.95);
        border-radius: 22px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
        box-shadow: 0 18px 30px -28px rgba(15, 23, 42, 0.52);
        overflow: visible;
    }

    #itemsTable tbody td {
        display: grid;
        grid-template-columns: minmax(92px, 108px) minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        width: 100%;
        padding: 12px 14px;
        border-top: 1px solid rgba(226, 232, 240, 0.8);
    }

    #itemsTable tbody td:first-child {
        display: block;
        padding: 14px;
        border-top: 0;
        background:
            radial-gradient(circle at top left, rgba(28, 92, 114, 0.08), transparent 42%),
            linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.82));
    }

    #itemsTable tbody td:nth-child(2)::before {
        content: "Cantidad";
        color: #475569;
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    #itemsTable tbody td:nth-child(3)::before {
        content: "Precio";
        color: #475569;
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    #itemsTable tbody td:nth-child(4)::before {
        content: "Total";
        color: #475569;
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    #itemsTable tbody td:nth-child(5) {
        display: flex;
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid rgba(226, 232, 240, 0.8);
        background: rgba(255, 255, 255, 0.74);
    }

    #itemsTable tbody td:nth-child(5)::before {
        content: none;
    }

    #itemsTable input[name="quantities"],
    #itemsTable .unit-price {
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 14px;
    }

    #itemsTable .line-total {
        color: #0f172a;
        font-size: 1rem;
        font-weight: 800;
        text-align: right;
    }

    #itemsTable .remove-row {
        min-height: 40px;
        padding: 0 14px;
        border: 1px solid rgba(248, 113, 113, 0.28);
        border-radius: 999px;
        background: rgba(254, 242, 242, 0.96);
        color: #b91c1c;
        font-size: 0.85rem;
        font-weight: 700;
    }

    .sale-items-summary {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .sale-items-summary > button {
        width: 100%;
        min-height: 46px;
        border-radius: 16px;
    }

    .sale-items-summary__totals {
        display: grid;
        gap: 8px;
        padding: 14px 16px;
        border: 1px solid rgba(226, 232, 240, 0.95);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.88);
        box-shadow: 0 16px 28px -30px rgba(15, 23, 42, 0.56);
    }

    .sale-items-summary__totals span {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-right: 0;
        gap: 12px;
    }

    .sale-form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .sale-form-actions > a {
        order: 2;
        text-align: center;
        font-size: 0.92rem;
    }

    .sale-form-actions__buttons {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .sale-form-actions__buttons > a,
    .sale-form-actions__buttons > button {
        width: 100%;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 18px;
    }

    .product-combobox__control {
        min-height: 58px;
        border: 1px solid rgba(148, 163, 184, 0.5);
        border-radius: 22px;
        background:
            radial-gradient(circle at top left, rgba(185, 122, 35, 0.1), transparent 42%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.98));
        box-shadow: 0 22px 36px -28px rgba(15, 23, 42, 0.5);
    }

    .product-combobox__input {
        padding: 16px 18px;
        font-size: 0.98rem;
    }

    .product-combobox__input--trigger {
        cursor: pointer;
        caret-color: transparent;
    }

    .product-combobox__toggle {
        flex-basis: 54px;
        border-left-color: rgba(148, 163, 184, 0.18);
        background: linear-gradient(180deg, rgba(28, 92, 114, 0.94), rgba(23, 63, 82, 0.96));
        color: #f8fafc;
        font-size: 0.92rem;
    }

    .product-combobox__panel {
        position: fixed;
        left: 10px;
        right: 10px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        z-index: 60;
        max-height: min(66vh, 560px);
        padding: 12px;
        border: 1px solid rgba(203, 213, 225, 0.84);
        border-radius: 30px;
        background:
            radial-gradient(circle at top left, rgba(185, 122, 35, 0.1), transparent 38%),
            radial-gradient(circle at top right, rgba(22, 121, 92, 0.08), transparent 34%),
            linear-gradient(180deg, rgba(255, 250, 242, 0.995), rgba(248, 250, 252, 0.99));
        box-shadow:
            0 32px 54px -24px rgba(15, 23, 42, 0.52),
            0 0 0 999px rgba(15, 23, 42, 0.16);
    }

    .product-combobox__sheet-head {
        display: block;
        position: sticky;
        top: 0;
        z-index: 1;
        margin: -2px -2px 8px;
        padding: 4px 6px 12px;
        background: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(255, 250, 242, 0.82));
    }

    .product-combobox__sheet-kicker {
        margin: 0;
        color: #8b5e24;
        font-family: var(--font-mono);
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.16em;
        text-transform: uppercase;
    }

    .product-combobox__sheet-title {
        margin: 6px 0 0;
        color: #17222b;
        font-family: var(--font-display);
        font-size: 1.18rem;
        font-weight: 700;
        letter-spacing: -0.03em;
    }

    .product-combobox__sheet-copy {
        margin: 4px 0 0;
        color: #61707d;
        font-size: 0.86rem;
        line-height: 1.4;
    }

    .product-combobox__sheet-search-wrap {
        display: block;
        margin-top: 12px;
    }

    .product-combobox--keyboard-open .product-combobox__panel {
        padding: 10px;
        border-radius: 28px;
    }

    .product-combobox--keyboard-open .product-combobox__sheet-head {
        margin: -2px -2px 6px;
        padding: 0 2px 8px;
        background: transparent;
    }

    .product-combobox--keyboard-open .product-combobox__sheet-kicker,
    .product-combobox--keyboard-open .product-combobox__sheet-title,
    .product-combobox--keyboard-open .product-combobox__sheet-copy {
        display: none;
    }

    .product-combobox--keyboard-open .product-combobox__sheet-search-wrap {
        margin-top: 0;
    }

    .product-combobox--keyboard-open .product-combobox__options {
        gap: 10px;
    }

    .product-combobox--keyboard-open .product-combobox__option {
        padding: 12px;
        border-radius: 22px;
    }

    .product-combobox__options {
        display: flex;
        flex-direction: column;
        gap: 12px;
        max-height: min(56vh, 470px);
        padding: 2px 2px 4px;
        padding-right: 4px;
    }

    .product-combobox__option {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 10px 14px;
        align-items: start;
        padding: 14px;
        border: 1px solid rgba(214, 223, 230, 0.96);
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 18px 30px -28px rgba(15, 23, 42, 0.48);
    }

    .product-combobox__meta {
        grid-column: 2;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 8px;
        white-space: normal;
    }

    .product-combobox__media {
        width: 76px;
        height: 76px;
        border-radius: 22px;
    }

    .product-combobox__thumb {
        object-fit: contain;
        padding: 6px;
    }

    .product-combobox__title {
        font-size: 1rem;
        line-height: 1.25;
    }

    .product-combobox__description {
        font-size: 0.82rem;
        line-height: 1.3;
    }

    .product-combobox__code {
        font-size: 0.69rem;
        letter-spacing: 0.14em;
    }

    .product-combobox__empty {
        padding: 18px 16px;
        text-align: center;
        font-size: 0.9rem;
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.8);
        border: 1px dashed rgba(148, 163, 184, 0.35);
    }

    .product-combobox__option.is-selected {
        border-color: rgba(21, 128, 61, 0.34);
        background: linear-gradient(180deg, rgba(236, 253, 245, 0.98), rgba(255, 255, 255, 0.98));
    }

    .product-combobox__option.is-highlighted {
        border-color: rgba(28, 92, 114, 0.28);
    }

    .product-combobox__option.is-out-of-stock {
        border-color: rgba(254, 202, 202, 0.9);
    }
}

@media (max-width: 480px) {
    .sale-form-shell {
        padding: 0.85rem;
        border-radius: 22px;
    }

    #itemsTable tbody td:first-child {
        padding: 12px;
    }

    .product-combobox__control {
        min-height: 54px;
        border-radius: 18px;
    }

    .product-combobox__input {
        padding: 15px 14px;
        font-size: 0.95rem;
    }

    .product-combobox__toggle {
        flex: 0 0 48px;
    }

    .product-combobox__panel {
        left: 8px;
        right: 8px;
        top: 50%;
        padding: 10px;
        border-radius: 24px;
        transform: translateY(-50%);
    }

    .product-combobox__option {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 8px 12px;
        padding: 12px;
    }

    .product-combobox__media {
        width: 64px;
        height: 64px;
        border-radius: 18px;
    }

    .product-combobox__title {
        font-size: 0.92rem;
    }

    .product-combobox__description {
        font-size: 0.79rem;
    }

    .product-combobox__sheet-title {
        font-size: 1.06rem;
    }

    .product-combobox__sheet-copy {
        font-size: 0.8rem;
    }

    .product-combobox__sheet-search {
        min-height: 46px;
        padding: 0 14px;
        border-radius: 16px;
        font-size: 0.9rem;
    }

    .product-combobox--keyboard-open .product-combobox__panel {
        left: 6px;
        right: 6px;
        border-radius: 24px;
    }

    .product-combobox--keyboard-open .product-combobox__sheet-search {
        min-height: 44px;
        border-radius: 15px;
    }

    .product-combobox--keyboard-open .product-combobox__option {
        grid-template-columns: 60px minmax(0, 1fr);
        gap: 8px 10px;
        padding: 11px;
        border-radius: 20px;
    }

    .product-combobox--keyboard-open .product-combobox__media {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }

    #toggleSaleCatalogBtn {
        font-size: 0.78rem;
        letter-spacing: 0.14em;
    }

    #saleCatalogList {
        max-height: 14.25rem;
    }
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

::selection {
    background: rgba(28, 92, 114, 0.18);
    color: var(--ink-strong);
}

@keyframes surface-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.app-body,
body.auth-shell {
    position: relative;
    color: var(--ink-strong);
    font-family: var(--font-body);
    background:
        radial-gradient(circle at top left, rgba(185, 122, 35, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(22, 121, 92, 0.09), transparent 24%),
        linear-gradient(180deg, #faf6ef 0%, var(--canvas) 100%);
}

body.app-body::before,
body.auth-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(49, 66, 80, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(49, 66, 80, 0.03) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent 96%);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 74px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(250, 246, 239, 0.82);
    backdrop-filter: blur(18px);
}

.app-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1720px;
    margin: 0 auto;
}

.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.header-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, #183141 0%, #1c5c72 58%, #19785c 100%);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    box-shadow: 0 20px 30px -22px rgba(22, 92, 114, 0.88);
}

.header-brand__copy {
    min-width: 0;
}

.header-brand__name {
    display: block;
    font-family: var(--font-display);
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: var(--ink-strong);
}

.header-brand__page {
    display: block;
    margin-top: 2px;
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    white-space: nowrap;
}

.header-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line-soft);
    border-radius: 15px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.42);
}

.header-toggle:hover {
    color: var(--ink-strong);
    background: rgba(255, 255, 255, 0.72);
    border-color: var(--line);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.58);
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 700;
}

.stock-pill:hover {
    border-color: rgba(180, 77, 84, 0.28);
    color: var(--ink-strong);
    background: rgba(255, 255, 255, 0.8);
}

.stock-pill__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger-soft);
    color: var(--danger-strong);
    font-size: 0.73rem;
    font-weight: 800;
    line-height: 1;
}

.user-menu {
    position: relative;
}

.user-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 5px 7px 5px 6px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--ink);
}

.user-button:hover {
    background: rgba(255, 255, 255, 0.88);
    border-color: var(--line);
    color: var(--ink-strong);
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(23, 63, 82, 0.95), rgba(22, 121, 92, 0.88));
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.user-email {
    display: flex;
    flex-direction: column;
    min-width: 0;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.15;
}

.user-email small {
    color: var(--ink-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    padding: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(16px);
}

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 700;
    text-align: left;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--surface-muted);
    color: var(--ink-strong);
}

.user-dropdown button {
    color: var(--danger);
    cursor: pointer;
}

.app-sidebar {
    color: var(--ink-strong);
}

.app-sidebar__frame {
    height: calc(100vh - 74px);
    padding: 16px 12px 18px 0;
}

.app-sidebar__panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100%;
    padding: 8px 16px 18px 6px;
    border-right: 1px solid var(--line-soft);
}

.app-sidebar__mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 12px 12px;
}

.app-sidebar__eyebrow {
    color: var(--ink-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.app-sidebar__title {
    margin-top: 5px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink-strong);
}

.nav-section {
    display: grid;
    gap: 8px;
}

.nav-section__label {
    padding: 0 12px;
    color: var(--ink-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 20px;
    color: var(--ink-soft);
}

.nav-link:hover {
    border-color: var(--line-soft);
    background: rgba(255, 255, 255, 0.56);
    color: var(--ink-strong);
}

.nav-link--active {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink-strong);
    box-shadow: var(--shadow);
}

.nav-link__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: rgba(23, 34, 43, 0.06);
    color: inherit;
    flex-shrink: 0;
}

.nav-link--active .nav-link__icon {
    background: linear-gradient(135deg, rgba(28, 92, 114, 0.12), rgba(22, 121, 92, 0.12));
}

.nav-link__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.nav-link__label {
    color: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.1;
}

.nav-link__hint {
    color: var(--ink-muted);
    font-size: 0.74rem;
    line-height: 1.2;
}

.nav-link--active .nav-link__hint {
    color: var(--ink-soft);
}

.nav-note {
    margin-top: auto;
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.6);
}

.nav-note__label {
    color: var(--ink-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.nav-note__title {
    margin-top: 7px;
    color: var(--ink-strong);
    font-size: 0.98rem;
    font-weight: 800;
}

.nav-note__copy {
    margin-top: 6px;
    color: var(--ink-soft);
    font-size: 0.84rem;
    line-height: 1.5;
}

.app-main {
    padding: 18px 16px 26px;
    min-width: 0;
}

.app-canvas {
    max-width: 1540px;
    margin: 0 auto;
}

.app-main section {
    display: grid;
    gap: 24px;
}

.app-main section > * {
    min-width: 0;
    animation: surface-enter 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-main h1,
.app-main h2,
.app-main h3,
.auth-card h1,
.auth-card h2,
.collections-hero h1,
.collections-stage-header h2 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--ink-strong);
    letter-spacing: -0.05em;
}

.app-main h1 {
    font-size: clamp(1.95rem, 2.7vw, 2.7rem);
}

.app-main h2 {
    font-size: clamp(1.3rem, 1.4vw, 1.8rem);
}

.app-main h3 {
    font-size: clamp(1.08rem, 1vw, 1.35rem);
}

.app-main p {
    margin: 0;
    line-height: 1.6;
}

.app-main label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-main section > .flex.justify-between.items-center.mb-6,
.app-main section > .flex.justify-between.items-center.mb-4 {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 0;
}

.app-main section > form.mb-4,
.app-main section > form.mb-6 {
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(14px);
}

.app-main .text-gray-500,
.app-main .text-slate-500,
.app-main .text-slate-400 {
    color: var(--ink-muted) !important;
}

.app-main .text-gray-700,
.app-main .text-slate-700 {
    color: var(--ink) !important;
}

.app-main .text-blue-600,
.app-main .text-sky-700,
.app-main .text-indigo-700,
.app-main .text-indigo-600 {
    color: var(--accent) !important;
}

.app-main .text-red-600 {
    color: var(--danger) !important;
}

.app-main .text-green-600,
.app-main .text-emerald-700 {
    color: var(--money) !important;
}

.app-main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.app-main select,
.app-main textarea,
.auth-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.auth-card select,
.auth-card textarea {
    width: 100%;
    min-height: 52px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-inset);
    color: var(--ink-strong);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.app-main input[type="date"],
.auth-card input[type="date"] {
    min-height: 52px;
}

.app-main input::placeholder,
.app-main textarea::placeholder,
.auth-card input::placeholder,
.auth-card textarea::placeholder {
    color: var(--ink-muted);
}

.app-main input:focus,
.app-main select:focus,
.app-main textarea:focus,
.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
    outline: none;
    border-color: rgba(28, 92, 114, 0.42);
    background: #fff;
    box-shadow: 0 0 0 4px var(--focus);
}

.app-main select,
.auth-card select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
        linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 2px),
        calc(100% - 14px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 44px;
}

.app-main textarea,
.auth-card textarea {
    min-height: 132px;
    resize: vertical;
}

.app-main input[type="file"] {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--ink-soft);
}

.app-main form.bg-white,
.app-main .bg-white.rounded.shadow,
.app-main .bg-white.rounded-lg.shadow,
.app-main .bg-white.p-8.rounded-lg.shadow.max-w-3xl,
.app-main .bg-white.p-8.rounded-lg.shadow.max-w-4xl,
.app-main .bg-white.p-8.rounded-lg.shadow.max-w-4xl.mt-6,
.app-main .max-w-xl.mx-auto.bg-white.rounded-lg.shadow.p-6.text-center {
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.app-main .overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line-soft);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow);
}

.app-main .overflow-x-auto table {
    width: 100%;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.app-main .overflow-x-auto thead {
    background: rgba(23, 34, 43, 0.04);
}

.app-main .overflow-x-auto thead th {
    padding: 15px 18px;
    color: var(--ink-soft);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-main .overflow-x-auto tbody td {
    padding: 16px 18px;
    color: var(--ink-strong);
    border-top: 1px solid var(--line-soft);
    vertical-align: top;
}

.app-main .overflow-x-auto tbody tr:hover {
    background: rgba(255, 250, 242, 0.72);
}

.app-main :is(a, button).bg-blue-600,
.app-main :is(a, button).bg-gray-800,
.app-main :is(a, button).bg-slate-700,
.app-main :is(a, button).bg-slate-800,
.app-main :is(a, button).bg-emerald-700,
.app-main :is(a, button).bg-sky-700,
.auth-card :is(a, button).bg-blue-600,
.auth-card :is(a, button).bg-sky-700 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 18px;
    color: #fff;
    font-weight: 800;
    box-shadow: 0 20px 34px -26px rgba(23, 63, 82, 0.82);
}

.app-main :is(a, button).bg-blue-600,
.app-main :is(a, button).bg-sky-700,
.auth-card :is(a, button).bg-blue-600,
.auth-card :is(a, button).bg-sky-700 {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.app-main :is(a, button).bg-gray-800,
.app-main :is(a, button).bg-slate-700,
.app-main :is(a, button).bg-slate-800 {
    background: linear-gradient(135deg, var(--surface-dark) 0%, var(--surface-dark-soft) 100%);
}

.app-main :is(a, button).bg-emerald-700 {
    background: linear-gradient(135deg, var(--money) 0%, var(--money-strong) 100%);
}

.app-main :is(a, button).bg-blue-600:hover,
.app-main :is(a, button).bg-sky-700:hover,
.auth-card :is(a, button).bg-blue-600:hover,
.auth-card :is(a, button).bg-sky-700:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 36px -24px rgba(28, 92, 114, 0.7);
}

.app-main :is(a, button).bg-gray-800:hover,
.app-main :is(a, button).bg-slate-700:hover,
.app-main :is(a, button).bg-slate-800:hover,
.app-main :is(a, button).bg-emerald-700:hover {
    transform: translateY(-1px);
}

.app-main :is(a, button).border.border-gray-300,
.app-main :is(a, button).border.border-slate-200,
.app-main :is(a, button).border.border-slate-300 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 18px;
    border-color: var(--line) !important;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink) !important;
    font-weight: 800;
}

.app-main :is(a, button).border.border-gray-300:hover,
.app-main :is(a, button).border.border-slate-200:hover,
.app-main :is(a, button).border.border-slate-300:hover {
    border-color: var(--line-strong) !important;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink-strong) !important;
}

.app-main :is(a, button):focus-visible,
.auth-card :is(a, button):focus-visible,
.header-toggle:focus-visible,
.user-button:focus-visible,
.stock-pill:focus-visible,
.nav-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--focus);
}

.app-main .bg-green-50.border-green-200,
.auth-card .bg-green-50.border-green-200 {
    border-color: rgba(22, 121, 92, 0.18) !important;
    background: var(--money-soft) !important;
    color: var(--money-strong) !important;
    border-radius: 18px;
}

.app-main .bg-red-50.border-red-200,
.auth-card .bg-red-50.border-red-200 {
    border-color: rgba(180, 77, 84, 0.18) !important;
    background: var(--danger-soft) !important;
    color: var(--danger-strong) !important;
    border-radius: 18px;
}

.app-main .bg-blue-50.border-blue-200 {
    border-color: rgba(28, 92, 114, 0.18) !important;
    background: rgba(28, 92, 114, 0.08) !important;
    color: var(--accent-strong) !important;
    border-radius: 18px;
}

.app-main .bg-amber-50.border-amber-200 {
    border-color: rgba(185, 122, 35, 0.18) !important;
    background: var(--receipt-soft) !important;
    color: var(--receipt-strong) !important;
    border-radius: 18px;
}

.app-footer {
    padding: 8px 18px 22px;
}

.app-footer__copy {
    max-width: 1720px;
    margin: 0 auto;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
    color: var(--ink-muted);
    font-size: 0.8rem;
    text-align: center;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
}

.auth-shell--login {
    padding: 28px;
}

.auth-login-grid {
    display: grid;
    grid-template-columns: minmax(380px, 1.2fr) minmax(360px, 0.86fr);
    gap: 24px;
    width: min(100%, 1180px);
    align-items: stretch;
}

.auth-login-story {
    position: relative;
    overflow: hidden;
    display: grid;
    align-content: start;
    min-height: 720px;
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 34px;
    background: linear-gradient(145deg, #16202a 0%, #1c4d62 52%, #16795c 100%);
    color: #f8fafc;
    box-shadow: var(--shadow-strong);
}

.auth-login-story::before {
    content: "";
    position: absolute;
    inset: auto -72px -92px auto;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 64%);
    pointer-events: none;
}

.auth-login-story::after {
    content: "";
    position: absolute;
    inset: 24px 24px auto auto;
    width: 160px;
    height: 160px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        repeating-linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.06) 0,
            rgba(255, 255, 255, 0.06) 1px,
            transparent 1px,
            transparent 18px
        );
    opacity: 0.7;
    pointer-events: none;
}

.auth-login-story__brand {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    max-width: 30rem;
}

.auth-login-story__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.auth-login-story .auth-kicker,
.auth-login-story .auth-heading,
.auth-login-story .auth-copy {
    color: #f8fafc;
}

.auth-login-story .auth-kicker {
    color: rgba(248, 250, 252, 0.72);
}

.auth-login-story .auth-heading {
    margin-top: 10px;
    max-width: 13ch;
    font-size: clamp(2.2rem, 3vw, 3.15rem);
    line-height: 0.95;
}

.auth-login-story .auth-copy {
    max-width: 58ch;
    margin-top: 24px;
    color: rgba(248, 250, 252, 0.8);
}

.auth-login-story__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.auth-login-story__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.auth-login-metric {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.auth-login-metric span {
    display: block;
    color: rgba(248, 250, 252, 0.62);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.auth-login-metric strong {
    display: block;
    margin-top: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.auth-login-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-login-story__list {
    display: grid;
    gap: 14px;
    margin-top: 28px;
    max-width: 34rem;
}

.auth-login-story__item {
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    background: rgba(9, 17, 23, 0.18);
    backdrop-filter: blur(12px);
}

.auth-login-story__item span {
    display: block;
    color: rgba(248, 250, 252, 0.62);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.auth-login-story__item p {
    margin-top: 8px;
    color: #f8fafc;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.55;
}

.auth-card {
    position: relative;
    width: min(100%, 560px);
    padding: 32px;
    border: 1px solid var(--line-soft);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(18px);
}

.auth-card--login {
    width: 100%;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 460px;
    margin-left: auto;
    padding: 36px;
}

.auth-login-mobile-strip {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.auth-login-mobile-strip span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-card__header {
    display: grid;
    gap: 8px;
}

.auth-label {
    display: block;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-alert {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 18px;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.5;
}

.auth-alert--success {
    border-color: rgba(22, 121, 92, 0.18);
    background: var(--money-soft);
    color: var(--money-strong);
}

.auth-alert--error {
    border-color: rgba(180, 77, 84, 0.18);
    background: var(--danger-soft);
    color: var(--danger-strong);
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 20px 34px -26px rgba(23, 63, 82, 0.82);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 36px -24px rgba(28, 92, 114, 0.7);
    filter: saturate(1.02);
}

.auth-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--focus);
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 6px;
    border-radius: 34px 34px 0 0;
    background: linear-gradient(90deg, var(--receipt) 0%, var(--accent) 58%, var(--money) 100%);
}

.auth-kicker {
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.auth-heading {
    margin-top: 14px;
    font-size: clamp(2rem, 3vw, 2.55rem);
}

.auth-heading--compact {
    font-size: clamp(1.95rem, 2.4vw, 2.5rem);
}

.auth-copy {
    margin-top: 10px;
    color: var(--ink-soft);
    line-height: 1.65;
}

.auth-stack {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-footer {
    margin-top: 22px;
    color: var(--ink-soft);
    font-size: 0.92rem;
    text-align: center;
}

.auth-footer--login {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}

.auth-link {
    color: var(--accent);
    font-weight: 800;
}

.auth-link--small {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

.auth-link:hover {
    color: var(--accent-strong);
}

@media (min-width: 769px) {
    .auth-login-story__metrics {
        margin-top: auto;
    }
}

.collections-page {
    display: grid;
    gap: 24px;
}

.collections-hero {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 34px;
    background: linear-gradient(135deg, #16202a 0%, #1d566d 56%, #17795c 100%);
    color: #f8fafc;
    box-shadow: 0 32px 58px -42px rgba(12, 18, 24, 0.95);
}

.collections-hero::after {
    content: "";
    position: absolute;
    right: -48px;
    bottom: -64px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 62%);
    pointer-events: none;
}

.collections-kicker {
    color: rgba(248, 250, 252, 0.72);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.collections-hero h1 {
    margin-top: 16px;
    color: #fff;
    font-size: clamp(2rem, 3vw, 2.9rem);
}

.collections-hero p {
    margin-top: 12px;
    max-width: 760px;
    color: rgba(248, 250, 252, 0.84);
}

.collections-hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.collections-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 700;
}

.collections-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
    gap: 24px;
    align-items: start;
}

.collections-stage,
.collections-side {
    padding: 22px;
    border: 1px solid var(--line-soft);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.collections-stage-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.collections-stage-header p {
    margin-top: 6px;
    color: var(--ink-soft);
}

.collections-counter {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#contenedor {
    display: grid;
    gap: 16px;
}

.collections-page .agregar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    margin-top: 18px;
    padding: 0 18px;
    border: 1px solid rgba(185, 122, 35, 0.2);
    border-radius: 20px;
    background: linear-gradient(135deg, var(--receipt) 0%, var(--receipt-strong) 100%);
    color: #fff;
    font-size: 0.96rem;
    font-weight: 800;
    box-shadow: 0 22px 36px -28px rgba(185, 122, 35, 0.92);
    cursor: pointer;
}

.collections-page .agregar:hover {
    transform: translateY(-1px);
}

.collections-page .tarjeta {
    position: relative;
    padding: 22px;
    border: 1px solid var(--line-soft);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 42px -34px rgba(23, 34, 43, 0.6);
}

.collections-page .tarjeta::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    border-radius: 28px 28px 0 0;
    background: linear-gradient(90deg, var(--accent) 0%, var(--money) 100%);
}

.collections-page .tarjeta-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.collections-page .tarjeta-kicker,
.collections-page .campo-input label,
.collections-page .campo-amount label {
    color: var(--ink-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.collections-page .tarjeta-title {
    margin-top: 7px;
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--ink-strong);
    letter-spacing: -0.04em;
}

.collections-page .tarjeta-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--ink);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.collections-page .tarjeta-badge.is-alert {
    background: var(--danger-soft);
    color: var(--danger-strong);
}

.collections-page .tarjeta-badge.is-ok {
    background: var(--money-soft);
    color: var(--money-strong);
}

.collections-page .tarjeta-badge.is-paid {
    background: rgba(22, 121, 92, 0.14);
    color: var(--money-strong);
}

.collections-page .campo-input,
.collections-page .campo-amount {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.collections-page .campo-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.collections-page .tarjeta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.collections-page .campo-data {
    display: flex;
    align-items: center;
    min-height: 74px;
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--surface-inset);
    color: var(--ink-strong);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
}

.collections-page .campo-data:empty::before {
    content: attr(data-empty);
    color: var(--ink-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.collections-page input {
    width: 100%;
    min-height: 50px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-inset);
    color: var(--ink-strong);
}

.collections-page input:focus {
    outline: none;
    border-color: rgba(28, 92, 114, 0.42);
    background: #fff;
    box-shadow: 0 0 0 4px var(--focus);
}

.collections-page .botones {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.collections-page button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.collections-page button:hover {
    transform: translateY(-1px);
}

.collections-page button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.collections-page .buscar {
    min-width: 168px;
    background: linear-gradient(135deg, var(--surface-dark) 0%, var(--surface-dark-soft) 100%);
    color: #fff;
}

.collections-page .aplicar {
    width: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
}

.collections-page .efectivo {
    background: linear-gradient(135deg, var(--money) 0%, var(--money-strong) 100%);
    color: #fff;
}

.collections-page .debito {
    background: linear-gradient(135deg, #294d60 0%, #193543 100%);
    color: #fff;
}

.collections-page .estadoA,
.collections-page .estadoD {
    font-weight: 800;
}

.collections-page .estadoA {
    color: var(--danger);
}

.collections-page .estadoD {
    color: var(--money);
}

.collections-page .cobrado,
.collections-page .processing,
.collections-page .error {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 18px;
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.45;
}

.collections-page .cobrado:empty,
.collections-page .processing:empty,
.collections-page .error:empty {
    display: none;
}

.collections-page .cobrado {
    border-color: rgba(22, 121, 92, 0.16);
    background: var(--money-soft);
    color: var(--money-strong);
}

.collections-page .processing {
    border-color: rgba(28, 92, 114, 0.16);
    background: rgba(28, 92, 114, 0.08);
    color: var(--accent);
}

.collections-page .error {
    border-color: rgba(180, 77, 84, 0.18);
    background: var(--danger-soft);
    color: var(--danger-strong);
}

.collections-page .detalle {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--line-soft);
}

.collections-page .detalle:empty {
    display: none;
}

.collections-page .detalle-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--accent);
    font-size: 0.92rem;
    font-weight: 800;
}

.collections-page .detalle-link:hover {
    color: var(--accent-strong);
}

.collections-page .totales {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.collections-total {
    padding: 18px;
    border: 1px solid var(--line-soft);
    border-radius: 22px;
    background: var(--surface-solid);
}

.collections-total__label {
    display: block;
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.collections-total__value {
    display: block;
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: 1.72rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
}

.collections-total--cash .collections-total__value {
    color: var(--money);
}

.collections-total--bank .collections-total__value {
    color: var(--accent);
}

.collections-total--all {
    background: linear-gradient(135deg, rgba(22, 32, 42, 0.96), rgba(33, 66, 82, 0.96));
    border-color: rgba(255, 255, 255, 0.08);
}

.collections-total--all .collections-total__label {
    color: rgba(255, 255, 255, 0.68);
}

.collections-total--all .collections-total__value {
    color: #fff;
}

.collections-side__copy {
    color: var(--ink-soft);
    line-height: 1.6;
}

.collections-side__copy strong {
    color: var(--ink-strong);
}

.collections-side__list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.collections-side__item {
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.58);
}

.collections-side__item span {
    display: block;
    color: var(--ink-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.collections-side__item p {
    margin-top: 8px;
    color: var(--ink);
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.5;
}

.app-page-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.app-page-toolbar__copy {
    min-width: 0;
}

.app-page-toolbar__copy p {
    margin-top: 6px;
    color: var(--ink-muted);
    font-size: 0.94rem;
}

.app-page-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.app-simple-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.app-simple-table thead {
    background: rgba(23, 34, 43, 0.04);
}

.app-simple-table th,
.app-simple-table td {
    padding: 15px 18px;
}

.app-simple-table th {
    color: var(--ink-soft);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-simple-table tbody td {
    color: var(--ink-strong);
    border-top: 1px solid var(--line-soft);
    vertical-align: top;
}

.app-simple-table tbody tr:hover {
    background: rgba(255, 250, 242, 0.72);
}

.app-inline-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

@media (max-width: 1024px) {
    .collections-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding-inline: 14px;
    }

    .app-header__inner {
        gap: 12px;
        align-items: center;
    }

    .header-brand__page,
    .user-email small {
        display: none;
    }

    .header-brand__mark {
        width: 40px;
        height: 40px;
        border-radius: 14px;
        font-size: 1rem;
    }

    .header-brand__name {
        font-size: 1rem;
    }

    .header-actions {
        gap: 8px;
    }

    .stock-pill,
    .user-button {
        min-width: 0;
    }

    .user-dropdown {
        width: min(220px, calc(100vw - 24px));
    }

    .app-sidebar__frame {
        height: 100%;
        min-height: 100%;
        padding: 0;
        background: #fffaf2;
    }

    .app-sidebar__panel {
        border-right: 0;
        min-height: 100%;
        border-radius: 26px;
        background: #fffaf2;
        box-shadow: none;
        padding: 14px 12px 18px;
    }

    .app-main {
        padding: 14px 12px 24px;
    }

    .app-main section > form.mb-4,
    .app-main section > form.mb-6,
    .collections-stage,
    .collections-side {
        padding: 18px;
    }

    .collections-hero {
        padding: 22px;
    }

    .collections-page .campo-inline,
    .collections-page .botones,
    .collections-page .tarjeta-grid {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .collections-page .buscar {
        width: 100%;
    }

    .stock-pill__label,
    .user-email {
        display: none;
    }

    .nav-section {
        padding: 10px;
        border-radius: 24px;
        background: #fffaf2;
    }

    .nav-link {
        background: #fffaf2;
    }

    .nav-link--active {
        background: #ffffff;
        box-shadow: 0 20px 32px -28px rgba(23, 34, 43, 0.35);
    }

    .auth-shell--login {
        padding: 16px;
    }

    .auth-login-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .auth-login-story {
        order: 2;
        padding: 22px;
        border-radius: 28px;
    }

    .auth-login-story {
        min-height: auto;
    }

    .auth-login-story .auth-heading {
        max-width: none;
        font-size: clamp(1.85rem, 7vw, 2.45rem);
    }

    .auth-login-story__brand {
        gap: 12px;
    }

    .auth-login-story__mark {
        width: 48px;
        height: 48px;
        border-radius: 16px;
        font-size: 1.2rem;
    }

    .auth-login-story__chips {
        margin-top: 20px;
    }

    .auth-login-story__metrics {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 18px;
    }

    .auth-login-story__list {
        gap: 10px;
        margin-top: 18px;
    }

    .auth-login-story__item {
        padding: 14px 16px;
        border-radius: 20px;
    }

    .auth-card--login {
        order: 1;
        padding: 24px;
        border-radius: 28px;
        max-width: none;
        margin-left: 0;
    }

    .auth-heading--compact {
        font-size: clamp(1.8rem, 7vw, 2.2rem);
    }

    .auth-copy {
        line-height: 1.55;
    }

    .auth-stack {
        margin-top: 20px;
        gap: 14px;
    }

    .auth-login-mobile-strip {
        display: flex;
    }

    .auth-footer--login {
        margin-top: 18px;
        padding-top: 16px;
    }

    .app-page-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .app-page-toolbar__actions {
        justify-content: stretch;
    }

    .app-page-toolbar__actions > * {
        flex: 1 1 100%;
    }

    .app-main .overflow-x-auto table,
    .app-simple-table,
    .users-table {
        min-width: 680px;
    }
}

@media (max-width: 560px) {
    .auth-shell {
        padding: 14px;
    }

    .auth-shell--login {
        padding: 14px;
    }

    .auth-login-grid {
        gap: 14px;
    }

    .auth-card {
        padding: 22px;
        border-radius: 26px;
    }

    .auth-card::before {
        border-radius: 26px 26px 0 0;
    }

    .auth-card--login {
        padding: 22px;
    }

    .auth-login-story {
        padding: 18px;
        border-radius: 24px;
    }

    .auth-login-story__chips {
        display: none;
    }

    .auth-login-story__metrics {
        margin-top: 16px;
    }

    .auth-login-story__list {
        display: none;
    }

    .auth-field__label-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .app-header__inner {
        flex-wrap: nowrap;
    }

    .app-header__inner > * {
        min-width: 0;
    }

    .header-actions {
        flex: 0 0 auto;
        width: auto;
        justify-content: flex-end;
    }

    .stock-pill,
    .user-button {
        flex: 0 1 auto;
        justify-content: center;
    }

    .header-brand {
        gap: 10px;
    }

    .header-brand__name {
        font-size: 0.95rem;
    }

    .app-sidebar__panel {
        border-radius: 0 0 28px 0;
        padding-right: 10px;
    }
}
