:root {
    color-scheme: light;
    font-family: Arial, sans-serif;
    --ink: #1f2937;
    --line: #d7dee8;
    --brand: #0f766e;
    --bg: #f6f7f9;
    --panel: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
}

.shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px;
}

.has-app-sidebar .app-frame {
    display: flex;
    min-height: 100vh;
}

.has-app-sidebar .app-main-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.has-app-sidebar .shell {
    max-width: none;
    width: 100%;
    flex: 1;
    padding: 20px 24px 32px;
}

.app-sidebar {
    width: 248px;
    flex-shrink: 0;
    background: var(--panel);
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    overflow: auto;
    z-index: 40;
    transition: width 0.2s ease, margin 0.2s ease, opacity 0.2s ease;
}

.app-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 16px 10px;
    border-bottom: 1px solid #eef2f7;
}

.app-sidebar-brand {
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
}

.app-sidebar-close {
    display: none;
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0 4px;
}

.app-sidebar-nav {
    padding: 8px 10px 20px;
}

.app-sidebar-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0 0 12px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
}

.app-sidebar-tab {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 6px;
    cursor: pointer;
}

.app-sidebar-tab:hover {
    color: #334155;
}

.app-sidebar-tab.is-active {
    background: #fff;
    color: #0f766e;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.app-sidebar-tab-panel[hidden] {
    display: none !important;
}

.app-sidebar-hint {
    margin: 10px 8px 0;
    font-size: 11px;
    line-height: 1.35;
    color: #94a3b8;
}

.app-sidebar-group {
    margin-bottom: 8px;
}

.app-sidebar-group-title {
    margin: 0 0 6px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.app-sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: left;
}

.app-sidebar-group-toggle:hover {
    background: #f8fafc;
    color: #334155;
}

.app-sidebar-group-label {
    flex: 1;
    min-width: 0;
}

.app-sidebar-group-chevron {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    transition: transform 0.15s ease;
    transform: rotate(-90deg);
}

.app-sidebar-group.is-open .app-sidebar-group-chevron {
    transform: rotate(0deg);
}

.app-sidebar-group.is-open > .app-sidebar-group-toggle {
    color: #0f766e;
}

.app-sidebar-links {
    display: grid;
    gap: 2px;
    padding: 0 0 4px;
}

.app-sidebar-group:not(.is-open) > .app-sidebar-links,
.app-sidebar-links[hidden] {
    display: none !important;
}

.app-sidebar-link-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
    gap: 2px;
}

.app-sidebar-link {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.25;
    border: 1px solid transparent;
}

.app-sidebar-fav-btn {
    width: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.app-sidebar-fav-btn:hover,
.app-sidebar-fav-btn.is-fav {
    color: #0f766e;
    background: #f0fdfa;
}

.app-sidebar-group--favorites .app-sidebar-group-title {
    color: #0f766e;
}

.app-sidebar-link:hover {
    background: #f1f5f9;
    color: var(--ink);
}

.app-sidebar-link.is-active {
    background: #ecfdf5;
    border-color: #99f6e4;
    color: #0f766e;
    font-weight: 700;
}

.app-sidebar-link--emphasis {
    background: #0f766e;
    color: #fff;
    font-weight: 700;
}

.app-sidebar-link--emphasis:hover {
    background: #0d645d;
    color: #fff;
}

.app-sidebar-link--emphasis.is-active {
    background: #0d645d;
    border-color: #0d645d;
    color: #fff;
}

.app-sidebar-backdrop {
    display: none;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: var(--panel);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 30;
}

.app-topbar-start {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 0;
}

.app-topbar-title-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
}

.app-topbar-page-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.shell .sectionbar > div > h1,
.shell .topbar > div > h1,
.sale-pos-title h1 {
    display: none;
}

.app-topbar-brand {
    display: none;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
}

.app-sidebar-toggle {
    white-space: nowrap;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.app-topbar-actions form {
    margin: 0;
}

body.sidebar-collapsed .app-sidebar {
    width: 0;
    margin-left: -1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.dashboard-nav-hint {
    margin: 0 0 8px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 14px;
}

@media (max-width: 980px) {
    .has-app-sidebar .app-frame {
        display: block;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        max-height: none;
        width: min(288px, 88vw);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
    }

    body.sidebar-mobile-open .app-sidebar {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .app-sidebar-close {
        display: block;
    }

    .app-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 35;
    }

    body.sidebar-mobile-open .app-sidebar-backdrop {
        display: block;
    }

    .app-sidebar-backdrop[hidden] {
        display: none !important;
    }

    .app-topbar-brand {
        display: inline;
    }

    body.sidebar-collapsed .app-sidebar {
        width: min(288px, 88vw);
        margin-left: 0;
    }
}

@media (min-width: 981px) {
    .app-sidebar-head .app-sidebar-brand {
        display: block;
    }

    .app-topbar-brand {
        display: none !important;
    }
}

@media (max-width: 760px) {
    .app-topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .app-topbar-title-wrap {
        justify-content: flex-start;
        padding: 0;
    }

    .app-topbar-page-title {
        font-size: 16px;
        white-space: normal;
    }

    .app-topbar-actions {
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
    }
}

.login {
    max-width: 360px;
    margin: 10vh auto 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

label {
    display: grid;
    gap: 6px;
    margin: 0 0 14px;
}

input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
}

button {
    min-height: 40px;
    border: 0;
    border-radius: 6px;
    padding: 0 14px;
    background: var(--brand);
    color: white;
    cursor: pointer;
}

.alert {
    margin-bottom: 14px;
    padding: 10px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #991b1b;
    border-radius: 6px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
}

.sectionbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.sectionbar h1,
.topbar h1 {
    margin: 0 0 6px;
}

.sectionbar p,
.topbar p {
    margin: 0;
    color: #5b6778;
}

.button,
.link {
    color: var(--brand);
    text-decoration: none;
    font-weight: 700;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    text-align: center;
    white-space: normal;
}

.secondary {
    background: #e7eef4;
    color: var(--ink);
}

.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
    vertical-align: middle;
}

th {
    color: #5b6778;
    font-weight: 700;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.actions form {
    margin: 0;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status.on {
    background: #dcfce7;
    color: #166534;
}

.status.off {
    background: #fee2e2;
    color: #991b1b;
}

.status.warning {
    background: #fef3c7;
    color: #92400e;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
}

.form-actions {
    display: flex;
    align-items: end;
}

.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.mini-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.mini-panel h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

@media (max-width: 760px) {
    .sectionbar,
    .topbar,
    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .grid-form,
    .split {
        grid-template-columns: 1fr;
    }
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 10px;
    margin: 18px 0;
    max-width: 100%;
}

.span-2 {
    grid-column: 1 / -1;
}

.form-money-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 220px));
    gap: 8px 20px;
    grid-column: 1 / -1;
    justify-content: start;
    align-items: start;
}

.form-money-pair label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    min-width: 0;
}

.form-money-pair input {
    width: 100%;
    max-width: 220px;
}

.field-note.is-compact {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.35;
    color: #64748b;
    cursor: help;
}

.field-hint-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-size: 9px;
    font-weight: 700;
    font-style: normal;
    flex-shrink: 0;
}


.swatch {
    display: inline-block;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    vertical-align: middle;
}

.subsection {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.compact {
    margin-bottom: 12px;
}

.variant-form {
    margin-bottom: 18px;
}

.money {
    min-width: 90px;
}

.app-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 24px 0;
    background: var(--panel);
    border-bottom: 1px solid #e2e8f0;
}

.nav-user {
    color: var(--ink);
    font-weight: 700;
    font-size: 14px;
    margin-right: 4px;
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 4px;
    max-width: min(360px, 42vw);
}

.nav-workspace {
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-profile {
    font-size: 13px;
}

.nav-brand {
    color: var(--ink);
    font-size: 20px;
    font-weight: 800;
    text-decoration: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-actions form {
    margin: 0;
}

@media (max-width: 760px) {
    .app-nav {
        align-items: stretch;
        flex-direction: column;
    }

    .nav-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

.toolbar {
    display: flex;
    align-items: end;
    gap: 12px;
    margin: 0 0 18px;
}

.actions-row {
    display: flex;
    gap: 8px;
}

.danger-text {
    color: #b91c1c;
}

@media (max-width: 760px) {
    .toolbar,
    .actions-row {
        align-items: stretch;
        flex-direction: column;
    }
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.summary-grid div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.summary-grid strong,
.summary-grid span {
    display: block;
}

.summary-grid strong {
    color: #5b6778;
    font-size: 12px;
    margin-bottom: 4px;
}

.top-space {
    margin-top: 18px;
}

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

.notice {
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a8a;
}

.field {
    position: relative;
}

.grow {
    flex: 1;
}

.field-help {
    margin: -8px 0 0;
    color: #5b6778;
    font-size: 13px;
}

.search-results {
    position: absolute;
    z-index: 20;
    top: 68px;
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, .12);
}

.search-result {
    display: grid;
    width: 100%;
    min-height: auto;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    text-align: left;
}

.search-result:hover:not(.is-highlighted),
.search-result:focus:not(.is-highlighted) {
    background: #f1f5f9;
}

.search-result.is-highlighted {
    background: #99f6e4;
    box-shadow: inset 6px 0 0 #0f766e;
    outline: 2px solid #0f766e;
    outline-offset: -2px;
    position: relative;
    z-index: 1;
}

.search-result.is-highlighted strong {
    color: #134e4a;
    font-weight: 800;
}

.search-result.is-highlighted span,
.search-result.is-highlighted small {
    color: #115e59;
    font-weight: 600;
}

.sale-pos-sku .search-results {
    top: calc(100% - 4px);
    max-height: min(34vh, 240px);
    overflow-y: auto;
}

.search-result strong,
.search-result span,
.search-result small {
    display: block;
}

.search-result .line-desc,
.purchase-lines-table .line-desc {
    color: var(--muted, #64748b);
    font-size: 12px;
    font-weight: normal;
}

.search-result.catalog-search-result,
.search-result.purchase-search-result {
    display: grid;
    gap: 2px;
    text-align: left;
}

.search-result.catalog-search-result strong,
.search-result.purchase-search-result strong {
    font-size: 13px;
}

.search-result.catalog-search-result span,
.search-result.purchase-search-result span {
    color: #64748b;
    font-size: 12px;
    font-weight: normal;
}

.search-result small {
    color: #5b6778;
}

.search-empty {
    padding: 10px 12px;
    color: #5b6778;
}

.field-note {
    color: #5b6778;
    font-size: 12px;
}

.warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.quick-actions .button {
    width: 100%;
    line-height: 1.15;
}
.dashboard .quick-actions {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

.dashboard .quick-actions .button {
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

.sale-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.sale-totals div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.sale-totals strong,
.sale-totals span {
    display: block;
}

.sale-totals span {
    font-size: 22px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .sale-totals {
        grid-template-columns: 1fr;
    }
}

.inline-resolution {
    display: grid;
    grid-template-columns: 150px minmax(180px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

@media (max-width: 760px) {
    .inline-resolution {
        grid-template-columns: 1fr;
    }
}

.was-validated input:invalid,
.was-validated select:invalid,
input.is-missing,
select.is-missing {
    border-color: #dc2626 !important;
    background: #fff1f2 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}
.sale-screen {
    padding: 14px;
}

.sale-screen .sectionbar {
    margin-bottom: 10px;
}

.sale-screen .sectionbar h1 {
    margin-bottom: 2px;
}

.sale-screen .sectionbar p,
.sale-screen .compact p {
    font-size: 12px;
}

.sale-screen label {
    margin-bottom: 8px;
}

.sale-screen input,
.sale-screen select {
    min-height: 34px;
    padding: 6px 8px;
}

.sale-screen button,
.sale-screen .button {
    min-height: 34px;
}

.sale-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr);
    gap: 12px;
    align-items: start;
}

.sale-block {
    min-width: 0;
}

.sale-screen .subsection {
    margin-top: 10px;
}

.sale-screen .grid-form {
    gap: 8px 10px;
}

.sale-screen .add-line-row {
    grid-template-columns: minmax(220px, 2fr) minmax(120px, 1fr) 84px 96px auto;
    align-items: end;
}

.sale-screen .add-line-row .span-2 {
    grid-column: auto;
}

.sale-screen .add-payment-row {
    grid-template-columns: minmax(130px, 1fr) minmax(110px, 1fr);
    align-items: end;
}

.sale-screen .add-payment-row label:nth-child(3),
.sale-screen .add-payment-row .span-2 {
    grid-column: 1 / -1;
}

.sale-screen table {
    font-size: 12px;
}

.sale-screen th,
.sale-screen td {
    padding: 6px;
}

.compact-sale-totals {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 10px;
    padding-top: 8px;
    background: var(--panel);
}

.compact-sale-totals div {
    padding: 8px 10px;
}

.compact-sale-totals span {
    font-size: 18px;
}

@media (max-width: 980px) {
    .sale-workspace,
    .sale-screen .add-line-row,
    .sale-screen .add-payment-row {
        grid-template-columns: 1fr;
    }

    .sale-screen .add-line-row .span-2 {
        grid-column: 1 / -1;
    }
}
/* POS sale layout */
body.sale-pos-layout {
    overflow: hidden;
}

body.sale-pos-layout .app-frame {
    height: 100vh;
    overflow: hidden;
}

body.sale-pos-layout .app-main-column {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.has-app-sidebar .shell:has(.sale-pos-screen) {
    max-width: none;
    padding: 4px 8px 6px;
    flex: 1;
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.shell:has(.sale-pos-screen) {
    max-width: none;
    padding: 6px 10px 8px;
}

.sale-pos-screen.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 6px 8px;
    overflow: hidden;
}

.sale-pos-screen form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.sale-pos-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.sale-pos-shortcuts {
    margin: 0;
    font-size: 10px;
    color: #94a3b8;
    white-space: nowrap;
}

.sale-pos-meta-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px 10px;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.sale-pos-messages {
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
    min-height: 48px;
    max-height: 132px;
    overflow: auto;
}

.sale-pos-messages[data-coach-state="warn"] {
    border-color: #fcd34d;
    background: #fffbeb;
}

.sale-pos-messages[data-coach-state="error"] {
    border-color: #fca5a5;
    background: #fef2f2;
}

.sale-pos-messages[data-coach-state="ok"] {
    border-color: #86efac;
    background: #f0fdf4;
}

.sale-pos-messages-title {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.sale-pos-messages .sale-pos-coach-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sale-pos-messages .sale-pos-coach-item {
    font-size: 12px;
    line-height: 1.35;
    padding-left: 14px;
    position: relative;
}

.sale-pos-messages .sale-pos-coach-item::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
}

.sale-pos-meta-warning,
.sale-pos-payment-warning {
    display: none !important;
}

.sale-pos-meta-field {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
}

.sale-pos-meta-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.sale-pos-meta-field input,
.sale-pos-meta-field select {
    margin-top: 0;
    min-height: 32px;
    font-size: 13px;
}

.sale-pos-meta-inline select,
.sale-pos-meta-inline input:not([type="hidden"]) {
    width: min(148px, 22vw);
    min-width: 108px;
}

.sale-pos-cash-summary {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 4px 8px;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 11px;
    line-height: 1.2;
    color: #475569;
}

.sale-pos-cash-label {
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 10px;
}

.sale-pos-cash-stat {
    white-space: nowrap;
}

.sale-pos-cash-highlight {
    font-weight: 700;
    color: #0f766e;
}

.sale-pos-cash-link {
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.sale-pos-cash-link:hover {
    text-decoration: underline;
}

.sale-pos-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 310px);
    gap: 10px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.sale-pos-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sale-pos-stage {
    display: grid;
    grid-template-columns: minmax(170px, 230px) minmax(0, 1fr);
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.sale-pos-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.sale-pos-preview-frame {
    flex: 1;
    min-height: 180px;
    max-height: min(52vh, 420px);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
}

.sale-pos-preview-frame img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sale-pos-preview-caption {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    line-height: 1.25;
    word-break: break-word;
}

.sale-pos-preview-hint {
    margin: 0;
    font-size: 10px;
    color: #94a3b8;
    line-height: 1.3;
}

.sale-pos-preview-hint code {
    font-size: 10px;
}

.sale-pos-stage-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sale-pos-scan-card {
    border: 2px solid #99f6e4;
    border-radius: 8px;
    background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
    padding: 8px 10px;
    flex-shrink: 0;
}

.sale-pos-scan-grid {
    display: grid;
    grid-template-columns: minmax(200px, 1.5fr) minmax(130px, .7fr) 64px 88px 96px;
    gap: 8px;
    align-items: end;
}

.sale-pos-sku {
    margin: 0;
    position: relative;
}

.sale-pos-sku .search-results {
    top: calc(100% - 4px);
    max-height: min(34vh, 240px);
}

.sale-pos-sku .field-help {
    margin: 2px 0 0;
    font-size: 10px;
    line-height: 1.2;
    min-height: 0;
}

.sale-pos-sku label,
.sale-pos-option label,
.sale-pos-qty label,
.sale-pos-price label {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #64748b;
}

.sale-sku-field input[data-variant-query] {
    font-size: 17px;
    font-weight: 800;
    min-height: 38px;
    border-color: #5eead4;
    background: #fff;
}

.sale-pos-qty input,
.sale-pos-price input {
    min-height: 38px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.sale-pos-price input {
    text-align: right;
}

.returns-exchange-pickers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
    max-width: 520px;
}

.returns-exchange-pickers[hidden] {
    display: none !important;
}

.returns-exchange-dim {
    font-weight: bold;
    display: block;
}

.returns-exchange-dim select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 5px;
}

.sale-pos-legacy-pickers {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.sale-pos-legacy-pickers select {
    width: 100%;
    min-height: 38px;
}

.sale-pos-dim-caption {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #64748b;
}

.sale-pos-dim-caption {
    margin-top: 2px;
}

.sale-pos-add-wrap {
    display: flex;
    align-items: end;
}

.sale-pos-add-btn {
    width: 100%;
    min-height: 38px;
    font-size: 14px;
    font-weight: 800;
}

.sale-pos-cart {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sale-pos-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.sale-pos-cart-head h2 {
    margin: 0;
    font-size: 14px;
}

.sale-pos-cart-count {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 4px 10px;
}

.sale-pos-cart-hint {
    margin: 2px 0 0;
    font-size: 10px;
    color: #64748b;
    line-height: 1.3;
}

.sale-pos-cart-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    font-size: 10px;
    font-family: inherit;
}

.sale-lines-wrap tr.sale-line-selected td {
    background: #eff6ff;
}

.sale-discount-cell {
    min-width: 0;
}

.sale-clear-manual {
    min-width: 18px;
    padding: 0 3px;
    line-height: 1;
    font-size: 12px;
}

.sale-manual-discount-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.45);
}

.sale-manual-discount-modal[hidden] {
    display: none;
}

.sale-manual-discount-dialog {
    width: min(100%, 360px);
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    display: grid;
    gap: 10px;
}

.sale-manual-discount-dialog h3 {
    margin: 0;
    font-size: 16px;
}

.sale-manual-line-label {
    margin: 0;
    font-size: 13px;
    color: #334155;
}

.sale-manual-discount-dialog label {
    display: grid;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
}

.sale-manual-mode-switch {
    display: flex;
    gap: 0;
    padding: 4px;
    border-radius: 10px;
    background: #e2e8f0;
}

.sale-manual-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sale-manual-mode-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.12);
    font-size: 12px;
    font-weight: 800;
}

.sale-manual-mode-btn.is-active {
    background: #fff;
    color: #0f766e;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.sale-manual-mode-btn.is-active .sale-manual-mode-icon {
    background: #ccfbf1;
    color: #0f766e;
}

.sale-manual-mode-caption {
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    line-height: 1.35;
    color: #475569;
    font-weight: 600;
}

.sale-manual-input-panel {
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

.sale-manual-input-panel.is-active {
    border-color: #14b8a6;
    background: #f0fdfa;
    box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.15);
}

.sale-manual-input-panel label {
    display: grid;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #0f766e;
}

.sale-manual-discount-dialog input {
    font-weight: 600;
    font-size: 18px;
    min-height: 42px;
}

.sale-manual-actions {
    display: flex;
    gap: 8px;
}

.sale-manual-error {
    margin: 0;
    min-height: 1.2em;
    font-size: 12px;
}

.sale-lines-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.sale-cart-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

.sale-cart-table col.col-product {
    width: 40%;
}

.sale-cart-table col.col-qty {
    width: 56px;
}

.sale-cart-table col.col-price {
    width: 76px;
}

.sale-cart-table col.col-discount {
    width: 108px;
}

.sale-cart-table col.col-subtotal {
    width: 84px;
}

.sale-cart-table col.col-action {
    width: 56px;
}

.sale-cart-table thead th {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.sale-cart-table th,
.sale-cart-table td {
    vertical-align: middle;
    padding: 5px 8px;
    overflow: hidden;
    box-sizing: border-box;
}

.sale-cart-table .sale-col-product {
    text-align: left;
}

.sale-cart-table .sale-col-qty {
    text-align: center;
    padding-left: 4px;
    padding-right: 4px;
}

.sale-cart-table .sale-col-price,
.sale-cart-table .sale-col-subtotal {
    text-align: right;
    padding-left: 4px;
    padding-right: 8px;
}

.sale-cart-table .sale-col-discount {
    text-align: center;
    padding-left: 4px;
    padding-right: 4px;
}

.sale-cart-table .sale-col-action {
    text-align: center;
    padding-left: 2px;
    padding-right: 2px;
}

.sale-cart-table .sale-col-input {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 3px 4px;
    font-size: 12px;
    font-weight: 700;
}

.sale-cart-table .sale-col-qty .sale-col-input {
    text-align: center;
}

.sale-cart-table .sale-col-price .sale-col-input {
    text-align: right;
}

.sale-cart-table .sale-subtotal-cell {
    font-weight: 700;
    white-space: nowrap;
    font-size: 12px;
}

.sale-cart-table .discount-select {
    width: 100%;
    max-width: 100px;
    margin: 0 auto;
    display: block;
    font-size: 10px;
    padding: 2px 4px;
}

.sale-cart-table .discount-select[hidden] {
    display: none !important;
}

.sale-cart-table .manual-discount-badge {
    justify-content: center;
    max-width: 100%;
}

.manual-discount-badge[hidden] {
    display: none !important;
}

.sale-cart-table .discount-msg {
    display: none;
}

.sale-line-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
}

.sale-manual-discount-btn {
    min-width: 26px;
    width: 26px;
    height: 26px;
    padding: 0;
    font-weight: 800;
    font-size: 12px;
    line-height: 1;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    cursor: pointer;
}

.sale-remove-btn {
    min-width: 26px;
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

.sale-pos-ticket-campaign {
    color: #0f766e;
    font-weight: 600;
}

.sale-pos-checkout {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sale-pos-totals-card {
    border: 1px solid #99f6e4;
    border-radius: 8px;
    background: linear-gradient(180deg, #ecfeff 0%, #fff 100%);
    padding: 8px;
    display: grid;
    gap: 5px;
    flex-shrink: 0;
}

.sale-pos-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
}

.sale-pos-total-row strong {
    font-size: 15px;
    font-weight: 800;
}

.sale-pos-total-sub {
    border-color: #e2e8f0;
    background: #f8fafc;
    font-size: 12px;
}

.sale-pos-total-sub strong {
    font-size: 15px;
    font-weight: 700;
    color: #334155;
}

.sale-pos-total-discount strong {
    color: #b45309;
}

.sale-pos-total-main {
    border-color: #5eead4;
    background: #f0fdfa;
}

.sale-pos-total-main strong {
    font-size: 22px;
    color: #0f766e;
}

.sale-pos-total-change strong {
    color: #64748b;
}

.sale-pos-change-due strong {
    color: #b45309;
}

.sale-pos-change-back strong {
    color: #15803d;
}

.sale-pos-coach {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    padding: 6px 8px;
    flex-shrink: 0;
}

.sale-pos-coach[data-coach-state="warn"] {
    border-color: #fcd34d;
    background: #fffbeb;
}

.sale-pos-coach[data-coach-state="error"] {
    border-color: #fca5a5;
    background: #fef2f2;
}

.sale-pos-coach[data-coach-state="ok"] {
    border-color: #86efac;
    background: #f0fdf4;
}

.sale-pos-coach-title {
    margin: 0 0 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
}

.sale-pos-coach-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 2px;
}

.sale-pos-coach-item {
    font-size: 11px;
    line-height: 1.3;
    padding-left: 12px;
    position: relative;
}

.sale-pos-coach-item::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
}

.sale-pos-coach-error {
    color: #b91c1c;
    font-weight: 700;
}

.sale-pos-coach-warn {
    color: #b45309;
    font-weight: 700;
}

.sale-pos-coach-ok {
    color: #15803d;
    font-weight: 700;
}

.sale-pos-coach-info {
    color: #475569;
}

.sale-pos-payments-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    flex-shrink: 0;
}

.sale-pos-payments-card h2 {
    margin: 0 0 6px;
    font-size: 13px;
}

.sale-pos-payment-grid {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 8px 10px;
    align-items: end;
}

.sale-pos-payment-grid label {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
}

.sale-pos-payment-ref,
.sale-pos-payment-actions,
.sale-pos-payment-warning {
    grid-column: 1 / -1;
}

.sale-pos-payment-actions button {
    width: 100%;
    min-height: 38px;
}

.sale-pos-payment-warning {
    margin: 0;
    font-size: 12px;
    min-height: 0;
}

.sale-payments-wrap {
    margin-top: 4px;
    max-height: 72px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.sale-pos-submit {
    flex-shrink: 0;
}

.sale-pos-submit button {
    width: 100%;
    min-height: 40px;
    font-size: 15px;
    font-weight: 800;
    border-radius: 8px;
}

/* Apartados: acento azul (distinto de venta verde/teal) */
.sale-pos-screen--layaway {
    --brand: #1d4ed8;
}

.sale-pos-screen--layaway .sale-pos-topbar {
    border-bottom-color: #bfdbfe;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.sale-pos-screen--layaway .sale-pos-shortcuts {
    color: #1e40af;
}

.sale-pos-screen--layaway .sale-pos-total-main {
    border-color: #93c5fd;
    background: #eff6ff;
}

.sale-pos-screen--layaway .sale-pos-total-main strong {
    color: #1d4ed8;
}

.sale-pos-screen--layaway .sale-pos-coach[data-coach-state="ok"] {
    border-color: #93c5fd;
    background: #eff6ff;
}

.sale-pos-screen--layaway .sale-pos-coach-ok {
    color: #1e40af;
}

.sale-pos-screen--layaway .sale-pos-add-btn,
.sale-pos-screen--layaway .sale-pos-submit button,
.sale-pos-screen--layaway .button:not(.secondary) {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.sale-pos-screen--layaway .sale-pos-add-btn:hover,
.sale-pos-screen--layaway .sale-pos-submit button:hover,
.sale-pos-screen--layaway .button:not(.secondary):hover {
    background: #1e40af;
    border-color: #1e40af;
}

.sale-pos-screen--layaway .sale-pos-cash-highlight {
    color: #1d4ed8;
}

.sale-operation-tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 10px;
    padding: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #f8fafc;
}

.sale-operation-tab {
    min-height: 34px;
    padding: 6px 14px;
    border: 0;
    border-radius: 6px;
    color: #334155;
    background: transparent;
}

.sale-operation-tab.is-active {
    color: #fff;
    background: #1d4ed8;
}

.sale-return-panel {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    background: #eff6ff;
}

.sale-return-panel.is-collapsed {
    padding: 8px 10px;
}

.sale-return-panel[hidden],
.sale-return-collapsed[hidden],
.sale-return-panel [data-return-editor][hidden],
.sale-return-ticket-summary[hidden],
.sale-return-lines-wrap[hidden],
.sale-return-meta[hidden],
.sale-return-credit-summary[hidden],
.sale-return-continue[hidden] {
    display: none !important;
}

.sale-return-collapsed {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.sale-return-collapsed-main {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    align-items: center;
    min-width: 0;
    font-size: 12px;
}

.sale-return-collapsed-main > strong {
    font-size: 13px;
    color: #1e3a8a;
}

.sale-return-collapsed-main > span {
    white-space: nowrap;
}

.sale-return-collapsed-balance {
    padding: 3px 7px;
    border-radius: 999px;
    color: #1e40af;
    background: #dbeafe;
    font-weight: 700;
}

.sale-return-collapsed button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 5px 10px;
}

.sale-return-search {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) auto auto;
    gap: 8px;
    align-items: end;
}

.sale-return-search label,
.sale-return-meta label {
    margin: 0;
}

.sale-return-status {
    margin: 8px 0 0;
    font-size: 12px;
}

.sale-return-ticket-summary {
    margin-top: 8px;
    padding: 7px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: #dbeafe;
}

.sale-return-lines-wrap {
    margin-top: 8px;
    max-height: 190px;
    overflow: auto;
}

.sale-return-lines-table th,
.sale-return-lines-table td {
    padding: 6px;
    font-size: 11px;
}

.sale-return-lines-table select {
    min-width: 64px;
}

.sale-return-discount-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 4px;
    border-radius: 4px;
    color: #92400e;
    background: #fef3c7;
}

.sale-return-meta {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(190px, 1fr);
    gap: 10px;
    margin-top: 9px;
}

.sale-return-meta textarea {
    width: 100%;
    resize: vertical;
}

.sale-return-credit-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    align-items: center;
    margin-top: 9px;
    padding: 9px 11px;
    border: 1px solid #60a5fa;
    border-radius: 7px;
    background: #fff;
}

.sale-return-credit-summary strong {
    font-size: 18px;
    color: #1d4ed8;
}

.sale-return-credit-summary small {
    grid-column: 1 / -1;
}

.sale-return-continue {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 9px;
}

.sale-return-continue span {
    color: #475569;
    font-size: 11px;
}

.sale-return-continue button {
    flex: 0 0 auto;
}

@media (max-width: 760px) {
    .sale-return-search,
    .sale-return-meta {
        grid-template-columns: 1fr;
    }

    .sale-return-collapsed,
    .sale-return-continue {
        align-items: stretch;
        flex-direction: column;
    }

    .sale-return-collapsed button,
    .sale-return-continue button {
        width: 100%;
    }
}

.sale-pos-screen .col-qty {
    width: 56px;
    text-align: center;
}

.sale-pos-screen .col-money {
    width: 88px;
    text-align: right;
    white-space: nowrap;
}

.sale-pos-screen .col-action {
    width: 34px;
}

@media (max-width: 1100px) {
    body.sale-pos-layout {
        overflow: auto;
    }

    .has-app-sidebar .shell:has(.sale-pos-screen) {
        height: auto;
        overflow: visible;
    }

    .sale-pos-screen.panel,
    .sale-pos-screen form {
        overflow: visible;
    }

    .sale-pos-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sale-pos-meta-strip {
        justify-content: flex-start;
    }

    .sale-pos-workspace {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .sale-pos-stage {
        grid-template-columns: 140px minmax(0, 1fr);
        overflow: visible;
    }

    .sale-pos-preview-frame {
        max-height: 220px;
        min-height: 140px;
    }

    .sale-pos-main,
    .sale-pos-stage-main,
    .sale-pos-cart,
    .sale-lines-wrap {
        overflow: visible;
        min-height: auto;
    }

    .sale-lines-wrap {
        max-height: min(40vh, 360px);
    }
}

@media (max-width: 760px) {
    .sale-pos-topbar {
        grid-template-columns: 1fr;
    }

    .sale-pos-meta-strip,
    .sale-pos-scan-grid,
    .sale-pos-payment-grid {
        grid-template-columns: 1fr;
    }

    .sale-pos-stage {
        grid-template-columns: 1fr;
    }

    .sale-pos-preview {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .sale-pos-preview-frame {
        width: 96px;
        min-height: 96px;
        max-height: 120px;
        flex: 0 0 96px;
    }

    .sale-pos-preview-hint {
        display: none;
    }

    .sale-lines-wrap,
    .sale-payments-wrap {
        max-height: none;
    }
}

/* POS cart line readability */
.sale-product-cell {
    line-height: 1.25;
    word-break: break-word;
}

.sale-line-main {
    font-weight: 800;
    color: var(--ink);
    white-space: normal;
}

.sale-line-meta {
    margin-top: 1px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    white-space: normal;
}

.sale-screen td.sale-product-cell {
    padding-top: 4px;
    padding-bottom: 4px;
}

.manual-discount-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px;
    border-radius: 5px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    font-size: 10px;
    font-weight: 600;
    color: #92400e;
    white-space: nowrap;
}

/* Cash register screen */
.cash-screen.panel {
    padding: 12px 14px;
}

.cash-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.cash-toolbar-meta {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.cash-actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.cash-reprint-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    font-size: 12px;
    color: #1e3a5f;
}

.cash-reprint-banner .button {
    white-space: nowrap;
}

.cash-hint {
    margin: 0 0 8px;
    font-size: 12px;
    color: #64748b;
}

.cash-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 8px;
}

.cash-filter-bar label {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
}

.cash-filter-bar input[type="date"] {
    min-height: 32px;
    font-size: 13px;
}

.cash-filter-bar button {
    min-height: 32px;
    padding: 6px 12px;
}

.cash-screen h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
}

.cash-screen .subsection,
.cash-screen .cash-subsection {
    margin-top: 10px;
    padding-top: 10px;
}

.cash-screen .cash-subsection--last {
    margin-bottom: 0;
}

.cash-status-grid,
.cash-layout {
    display: grid;
    gap: 8px;
}

.cash-status-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 8px 0;
}

.cash-status-grid--compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.cash-status-grid div,
.cash-total-list div {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
    padding: 6px 8px;
}

.cash-status-grid small,
.cash-total-list span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cash-status-grid strong,
.cash-total-list strong {
    display: block;
    margin-top: 2px;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.2;
}

.cash-folio-value {
    font-size: 11px !important;
    font-weight: 700;
    word-break: break-word;
}

.cash-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
    align-items: start;
    margin-top: 8px;
}

.cash-layout--compact {
    grid-template-columns: minmax(0, 1.2fr) minmax(200px, 0.8fr);
}

.cash-layout--stack {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.85fr);
}

.cash-total-list {
    display: grid;
    gap: 4px;
}

.cash-total-list--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cash-total-list .span-2 {
    grid-column: span 2;
}

.cash-total-list .cash-expected {
    background: #ecfeff;
    border-color: #99f6e4;
}

.cash-total-list .cash-expected strong {
    font-size: 16px;
}

.cash-total-list .cash-diff-warn {
    background: #fff1f2;
    border-color: #fecaca;
}

.cash-total-list .cash-diff-warn strong {
    color: #991b1b;
}

.cash-table-compact {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.cash-table-compact th,
.cash-table-compact td {
    padding: 4px 6px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.cash-table-compact th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.cash-cell-sub {
    font-size: 10px;
    color: #64748b;
    margin-top: 1px;
}

.cash-folio-cell {
    font-size: 11px;
    max-width: 120px;
    word-break: break-word;
}

.cash-row-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 108px;
}

.cash-btn-mini {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
}

.cash-scroll-panel {
    max-height: min(42vh, 300px);
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.cash-scroll-panel--short {
    max-height: min(28vh, 220px);
}

.cash-scroll-panel--history {
    max-height: min(58vh, 520px);
}

.cash-movements-table {
    margin-top: 0;
}

.cash-movement-form,
.cash-close-form {
    margin-bottom: 8px;
}

.cash-open-card p {
    margin: 0 0 8px;
    font-size: 12px;
    color: #64748b;
}

@media (max-width: 900px) {
    .cash-status-grid,
    .cash-status-grid--compact,
    .cash-layout,
    .cash-layout--compact,
    .cash-layout--stack {
        grid-template-columns: 1fr;
    }

    .cash-total-list--grid,
    .cash-total-list .span-2 {
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .cash-row-actions {
        min-width: 0;
    }
}

.cash-folios {
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.cash-folios strong {
    color: var(--ink);
}

/* Manual del sistema */
.manual.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 24px;
}

.manual-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.manual-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    color: #1f2937;
}

.manual-subtitle {
    margin: 0;
    color: #6b7280;
    max-width: 640px;
}

.manual-search {
    margin-bottom: 24px;
}

.manual-search-label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #374151;
}

.manual-search-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.manual-search-row input[type="search"] {
    flex: 1 1 280px;
    min-height: 44px;
    font-size: 16px;
}

.manual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.manual-topic-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #fafbfc;
}

.manual-topic-card h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.manual-topic-card h2 a {
    color: var(--brand);
    text-decoration: none;
}

.manual-topic-card h2 a:hover {
    text-decoration: underline;
}

.manual-mini-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #4b5563;
    font-size: 14px;
}

.manual-mini-list a {
    color: #1f2937;
}

.manual-more {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: bold;
    color: var(--brand);
    text-decoration: none;
}

.manual-article-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.manual-article-list li {
    border-bottom: 1px solid #eef1f5;
    padding: 12px 0;
}

.manual-article-list-large li {
    padding: 16px 0;
}

.manual-article-list a {
    color: var(--brand);
    text-decoration: none;
}

.manual-article-list a:hover {
    text-decoration: underline;
}

.manual-meta {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.manual-excerpt {
    margin: 6px 0 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.45;
}

.manual-breadcrumb {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
}

.manual-breadcrumb a {
    color: var(--brand);
    text-decoration: none;
}

.manual-article-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.manual-article-header h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.2;
}

.manual-content {
    line-height: 1.6;
    color: #1f2937;
    max-width: 760px;
}

.manual-content h2 {
    margin-top: 28px;
    margin-bottom: 10px;
    font-size: 22px;
    color: #111827;
}

.manual-content h3 {
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 18px;
}

.manual-content p {
    margin: 0 0 14px;
}

.manual-content ul,
.manual-content ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.manual-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 90%;
}

.manual-related {
    margin-top: 28px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.manual-related h2 {
    margin: 0 0 10px;
    font-size: 16px;
}

.manual-related ul {
    margin: 0;
    padding-left: 18px;
}

.manual-footer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.manual-hint,
.manual-empty,
.manual-results-count {
    color: #4b5563;
}

.manual-not-found {
    text-align: center;
    padding: 40px 24px;
}

.nav-manual {
    white-space: nowrap;
}

/* Compra / entrada inventario / traspaso — estilo compacto tipo escritorio */
.inventory-entry-screen,
.transfer-screen {
    font-size: 13px;
}

.inventory-entry-screen .sectionbar,
.transfer-screen .sectionbar {
    margin-bottom: 10px;
}

.inventory-entry-screen .sectionbar h1,
.transfer-screen .sectionbar h1 {
    font-size: 1.15rem;
    margin-bottom: 2px;
}

.inventory-entry-screen .sectionbar.compact h2,
.transfer-screen .sectionbar.compact h2 {
    font-size: 0.95rem;
    margin: 0;
}

.inventory-entry-screen .sectionbar.compact p,
.transfer-screen .sectionbar.compact p {
    font-size: 11px;
    margin: 2px 0 0;
}

.inventory-entry-screen .subsection,
.transfer-screen .subsection {
    margin-top: 8px;
    padding-top: 8px;
}

.inventory-entry-screen label,
.transfer-screen label {
    margin-bottom: 6px;
    gap: 3px;
    font-size: 12px;
}

.inventory-entry-screen input:not([type="hidden"]),
.inventory-entry-screen select,
.transfer-screen input:not([type="hidden"]),
.transfer-screen select {
    min-height: 30px;
    padding: 3px 7px;
    font-size: 13px;
}

.inventory-entry-screen button,
.inventory-entry-screen .button,
.transfer-screen button,
.transfer-screen .button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.inventory-entry-screen .grid-form,
.transfer-screen .grid-form {
    gap: 6px 8px;
}

.inventory-entry-screen .add-line-row,
.transfer-screen .add-line-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.inventory-entry-screen .adjustment-add-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inventory-entry-screen .adjustment-add-row .form-actions {
    align-self: end;
}

@media (max-width: 900px) {
    .inventory-entry-screen .adjustment-add-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.transfer-screen .purchase-load-row {
    grid-template-columns: minmax(200px, 2fr) auto;
}

.transfer-screen .transfer-add-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.transfer-screen .form-inline-fields {
    display: grid;
    grid-template-columns: minmax(160px, 1.5fr) minmax(88px, 110px) auto;
    gap: 8px 12px;
    grid-column: 1 / -1;
    align-items: end;
}

.transfer-screen .form-inline-fields label {
    margin: 0;
    min-width: 0;
}

.transfer-screen .form-inline-fields .form-actions {
    margin: 0;
}

.inventory-entry-screen table,
.transfer-screen table {
    font-size: 12px;
}

.inventory-entry-screen th,
.inventory-entry-screen td,
.transfer-screen th,
.transfer-screen td {
    padding: 4px 6px;
}

.inventory-entry-screen .summary-grid,
.transfer-screen .summary-grid {
    gap: 8px;
    font-size: 12px;
}

.inventory-entry-screen .field-help,
.inventory-entry-screen .field-note,
.transfer-screen .field-help,
.transfer-screen .field-note {
    font-size: 11px;
    margin: 2px 0 0;
}

.transfer-screen .compact-notice {
    font-size: 12px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.transfer-screen .top-space-sm {
    margin-top: 8px;
}

.transfer-screen [data-variant-search],
.transfer-screen [data-purchase-load-search] {
    position: relative;
}

.transfer-screen [data-variant-results],
.transfer-screen [data-purchase-load-results] {
    position: absolute;
    z-index: 30;
    top: calc(100% - 4px);
    left: 0;
    right: 0;
}

.transfer-screen tr.warning {
    background: #fff8e6;
}

.transfer-screen .line-desc {
    font-size: 11px;
    color: #64748b;
}

.transfer-screen .variant-search-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.transfer-screen .variant-search-input-row > input[data-variant-query] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.transfer-screen .variant-zero-stock-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin: 0;
    padding: 0;
    font-size: 10px;
    line-height: 1.1;
    font-weight: normal;
    white-space: nowrap;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.transfer-screen .variant-zero-stock-toggle span {
    display: inline-block;
    max-width: 4.5rem;
    text-align: right;
}

.transfer-screen .variant-zero-stock-toggle input {
    margin: 0;
    flex-shrink: 0;
    min-height: auto !important;
    width: 13px;
    height: 13px;
    padding: 0;
}

/* Checkboxes compactos en formularios */
.panel input[type="checkbox"],
.checkbox-compact {
    width: 13px;
    height: 13px;
    min-height: auto !important;
    margin: 0;
    flex-shrink: 0;
    padding: 0;
    accent-color: #275427;
}

.checkbox-compact-label,
.panel label.checkbox-compact-label,
.transfer-screen .variant-zero-stock-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    font-size: 10px;
    line-height: 1.1;
    font-weight: normal;
    white-space: nowrap;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

/* Inventario — estilo compacto */
.inventory-screen,
.inventory-screen.inventory-entry-screen {
    font-size: 13px;
}

.inventory-screen .sectionbar {
    margin-bottom: 10px;
}

.inventory-screen .sectionbar h1 {
    font-size: 1.15rem;
    margin-bottom: 2px;
}

.inventory-screen label {
    margin-bottom: 6px;
    gap: 3px;
    font-size: 12px;
}

.inventory-screen input:not([type="hidden"]),
.inventory-screen select {
    min-height: 30px;
    padding: 3px 7px;
    font-size: 13px;
}

.inventory-screen button,
.inventory-screen .button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.inventory-screen .button.accent-warn {
    background: #ff9800;
    border-color: #e68900;
}

.inventory-screen .compact-notice,
.inventory-screen .inventory-empty-prompt {
    font-size: 12px;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.inventory-screen .inventory-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: end;
    margin-bottom: 8px;
}

.inventory-screen .inventory-summary-line {
    font-size: 12px;
    margin: 0 0 8px;
}

.inventory-screen .muted-inline {
    font-size: 11px;
    color: #64748b;
}

.inventory-screen table {
    font-size: 12px;
}

.inventory-screen th,
.inventory-screen td {
    padding: 4px 6px;
    vertical-align: top;
}

.inventory-screen th {
    font-size: 11px;
    background: #eef2f7;
    user-select: none;
}

.kardex-totals-row td {
    background: #f8fafc;
    border-top: 2px solid #cbd5e1;
    font-size: 12px;
}

.kardex-screen .kardex-header-line {
    font-size: 13px;
    margin: 0 0 10px;
}

.kardex-screen .kardex-filter-toolbar {
    align-items: end;
}

.kardex-reconcile-panel {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
}

.kardex-reconcile-panel.is-ok {
    border-color: #86efac;
    background: #f0fdf4;
}

.kardex-reconcile-panel.is-warn {
    border-color: #fcd34d;
    background: #fffbeb;
}

.kardex-reconcile-panel h2 {
    margin: 0 0 4px;
    font-size: 15px;
}

.kardex-reconcile-scope {
    margin: 0 0 10px;
    font-size: 12px;
    color: #64748b;
}

.kardex-reconcile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.kardex-reconcile-grid div {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
}

.kardex-reconcile-grid span {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 2px;
}

.kardex-reconcile-grid strong {
    font-size: 18px;
}

.kardex-ok {
    color: #15803d;
}

.kardex-bad {
    color: #b45309;
}

.kardex-breakdown-wrap {
    margin-top: 8px;
}

.kardex-breakdown-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
}

.kardex-reconcile-hint {
    margin-top: 10px;
}

.inventory-screen th.sort-asc::after {
    content: ' ▲';
    font-size: 9px;
}

.inventory-screen th.sort-desc::after {
    content: ' ▼';
    font-size: 9px;
}

.inventory-screen th.num,
.inventory-screen td.num {
    text-align: right;
    white-space: nowrap;
}

.inventory-screen tr.inventory-group-header {
    background: #f1f5f9;
}

.inventory-screen tr.inventory-group-header td {
    border-top: 2px solid #cbd5e1;
    padding-top: 6px;
}

.inventory-screen tr.inventory-legacy-row {
    background: #fffdf5;
}

.inventory-screen .group-meta {
    font-size: 11px;
    color: #64748b;
}

.inventory-screen .badge-soft {
    background: #eef3f7;
    color: #334155;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
}

.inventory-screen .badge-legacy {
    background: #fff3cd;
    color: #856404;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 9px;
    margin-left: 4px;
    font-weight: bold;
}

.inventory-screen .badge-general {
    background: #e8f4ec;
    color: #275427;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: bold;
}

.inventory-screen .empty-cell {
    text-align: center;
    color: #64748b;
    padding: 16px;
}

.inventory-screen .inventory-classify-qty-summary {
    margin: 0 0 10px;
    font-size: 13px;
    color: #475569;
}

.inventory-screen .inventory-classify-qty-summary.is-over {
    color: #b91c1c;
    font-weight: 600;
}

.inventory-screen .inventory-classify-qty-summary.is-ok {
    color: #166534;
}

.inventory-screen .inventory-classify-form-error {
    margin-bottom: 12px;
}

.inventory-screen .inventory-classify-size-guide {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a8a;
}

.inventory-screen .inventory-classify-size-guide .field-help {
    margin: 0;
    color: inherit;
}

.inventory-screen .inventory-classify-panel {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #c5d4f0;
    border-radius: 6px;
    background: #f5f9ff;
}

.inventory-screen .inventory-classify-panel h2 {
    margin: 0;
    font-size: 14px;
}

.inventory-screen .inventory-classify-meta {
    margin: 4px 0 0;
    font-size: 11px;
    color: #475569;
}

.inventory-screen .inventory-classify-lines {
    margin-top: 8px;
    font-size: 11px;
}

.inventory-screen .inventory-classify-lines select,
.inventory-screen .inventory-classify-lines input {
    font-size: 11px;
    padding: 2px 4px;
    max-width: 100%;
}

.inventory-screen .inventory-classify-notes {
    display: block;
    margin-top: 8px;
    font-size: 11px;
}

.inventory-screen .inventory-classify-notes textarea {
    width: 100%;
    font-size: 11px;
    margin-top: 4px;
}

.inventory-screen .classify-link {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    font-weight: bold;
}

.inventory-screen .pending-adj-mark {
    color: #c2410c;
    font-weight: 800;
    font-size: 15px;
    line-height: 1;
    margin-right: 4px;
    vertical-align: baseline;
}

.inventory-screen .pending-adj-legend .pending-adj-mark {
    margin-right: 2px;
    font-size: 13px;
}

.purchase-matrix-wrap {
    margin-top: 0.5rem;
}

.purchase-matrix-scroll {
    overflow-x: auto;
    max-width: 100%;
}

.purchase-matrix-table {
    width: auto;
    min-width: 0;
    font-size: 11px;
    line-height: 1.1;
}

.purchase-matrix-table th,
.purchase-matrix-table td {
    padding: 2px 3px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    white-space: nowrap;
}

.purchase-matrix-table thead th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: #eef2f7;
    padding: 3px 4px;
}

.purchase-matrix-table tbody th {
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    background: #f4f6f8;
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 4.5rem;
    max-width: 6rem;
    box-shadow: 1px 0 0 var(--line);
}

.inventory-entry-screen .purchase-matrix-table input.purchase-matrix-qty,
.inventory-entry-screen .purchase-matrix-table [data-purchase-matrix-qty],
.inventory-entry-screen .purchase-matrix-table [data-matrix-qty] {
    width: 2.1rem !important;
    min-width: 2.1rem !important;
    max-width: 2.1rem !important;
    min-height: 22px !important;
    height: 22px !important;
    padding: 0 2px !important;
    margin: 0 auto;
    text-align: center;
    font-size: 11px !important;
    border-radius: 3px;
    box-sizing: border-box;
}

.purchase-matrix-table small {
    display: block;
    font-size: 9px;
    color: #64748b;
    line-height: 1;
    margin-bottom: 1px;
}

.purchase-matrix-table td:not(:first-child) {
    text-align: center;
}

.kardex-reconcile-hint {
    margin-top: 10px;
}

.inventory-audit-screen .inventory-audit-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.inventory-audit-toolbar {
    align-items: end;
    margin-bottom: 10px;
}

.inventory-audit-summary-line {
    font-size: 13px;
    margin: 0 0 10px;
    color: #475569;
}

.inventory-audit-diff-row td {
    background: #fff7ed;
}

.inventory-audit-pager {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

@media (max-width: 700px) {
    .manual-header {
        flex-direction: column;
        align-items: stretch;
    }
}

.category-size-group-picker .category-size-group-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.category-size-group-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.category-size-group-option:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.category-size-group-option input {
    margin-top: 3px;
    flex-shrink: 0;
}

.category-size-group-option-body {
    min-width: 0;
}

.category-size-group-option-title {
    display: block;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.35;
}

.category-size-group-option-sizes {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #475569;
    line-height: 1.45;
    word-break: break-word;
}

.category-size-group-option-sizes.is-empty {
    font-style: italic;
    color: #94a3b8;
}

.sales-movements-meta {
    margin: 4px 0 0;
    color: var(--muted, #666);
    font-size: 13px;
}

.sales-movements-checks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 170px;
    justify-content: flex-end;
}

.sales-movements-checks label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.movement-dashboard {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #f8fafc;
}

/* Resumen ventas y movimientos — dashboard v2 */
.movement-summary {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.movement-summary-header {
    margin-bottom: 12px;
}

.movement-summary-header h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #334155;
}

.movement-summary-sub {
    margin: 4px 0 0;
    font-size: 12px;
    color: #64748b;
}

.movement-summary-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.movement-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.movement-kpi--primary {
    border-color: #99f6e4;
    background: linear-gradient(135deg, #f0fdfa 0%, #fff 100%);
}

.movement-kpi--margin {
    border-color: #fde68a;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
}

.movement-kpi-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
}

.movement-kpi-value {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.15;
}

.movement-kpi small {
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
}

.movement-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.movement-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.movement-card--sales { border-top: 3px solid #0d9488; }
.movement-card--returns { border-top: 3px solid #2563eb; }
.movement-card--exchanges { border-top: 3px solid #ea580c; }
.movement-card--cancellations { border-top: 3px solid #dc2626; }

.movement-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.movement-card-header h3 {
    margin: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #475569;
}

.movement-card-count {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    background: #e2e8f0;
    border-radius: 999px;
    padding: 2px 8px;
    min-width: 28px;
    text-align: center;
}

.movement-card-metrics {
    margin: 0;
    padding: 8px 12px 10px;
    display: grid;
    gap: 6px;
}

.movement-card-metrics > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.movement-card-metrics dt {
    margin: 0;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.movement-card-metrics dd {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
}

.movement-card-hint {
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: #64748b;
}

.movement-cash-flow {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}

.movement-cash-flow-title {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.movement-cash-flow-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 6px;
}

.movement-cash-step {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    min-width: 120px;
}

.movement-cash-step span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.movement-cash-step strong {
    font-size: 15px;
    color: #0f172a;
}

.movement-cash-step--out strong {
    color: #b91c1c;
}

.movement-cash-step--result {
    background: #f0fdfa;
    border-color: #99f6e4;
}

.movement-cash-step--result strong {
    color: #0f766e;
}

.movement-cash-op {
    font-size: 18px;
    font-weight: 700;
    color: #94a3b8;
    padding: 0 2px;
}

.movement-cash-op--eq {
    color: #0f766e;
}

.movement-positive {
    color: #0f766e !important;
}

.movement-negative {
    color: #b91c1c !important;
}

.movement-dashboard > h2 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
}

.movement-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.movement-dashboard-group {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}

.movement-dashboard-group--wide {
    grid-column: span 2;
}

.movement-dashboard-group h3 {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.movement-metric-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

.movement-metric-list--dense {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

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

.movement-metric span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.movement-metric strong {
    font-size: 16px;
    color: #0f172a;
    line-height: 1.2;
}

.movement-metric--highlight strong {
    color: #0f766e;
}

.movement-negative {
    color: #b91c1c !important;
}

.sales-movements-screen .returns-results-block {
    margin-top: 12px;
}

@media (max-width: 900px) {
    .movement-dashboard-group--wide {
        grid-column: span 1;
    }
}

.returns-screen.panel {
    padding: 12px 14px;
}

.returns-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.returns-toolbar-meta {
    margin: 0;
    font-size: 12px;
    color: #475569;
    max-width: 720px;
}

.returns-search-card {
    margin-top: 0;
    padding: 12px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #f8fafc;
}

.returns-search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    align-items: end;
}

.returns-search-form label {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.returns-search-form input,
.returns-search-form select {
    min-height: 34px;
    font-size: 13px;
}

.returns-search-ticket {
    grid-column: span 2;
}

.returns-search-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.returns-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #64748b;
}

.returns-empty-prompt {
    margin-top: 12px;
    padding: 18px 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #fff;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

.returns-results-block h2 {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
}

.returns-results-block--last {
    margin-bottom: 0;
}

.returns-no-results {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.returns-limit-note {
    margin: 8px 0 0;
    font-size: 11px;
    color: #94a3b8;
}

.returns-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff;
}

.returns-badge--return {
    background: #0891b2;
}

.returns-badge--exchange {
    background: #ea580c;
}

.returns-badge--sale {
    background: #15803d;
}

.returns-badge--cancelled {
    background: #b91c1c;
}

.returns-badge--layaway-open {
    background: #dbeafe;
    color: #1d4ed8;
}

.returns-badge--layaway-liquidated {
    background: #dcfce7;
    color: #166534;
}

.returns-badge--layaway-cancelled {
    background: #f3f4f6;
    color: #4b5563;
}

.movement-card--layaways .movement-card-header h3 {
    color: #1d4ed8;
}

.returns-refund {
    color: #b91c1c;
    font-weight: 700;
}

.returns-reason {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

.returns-cancelled-ticket {
    color: #b91c1c;
    font-weight: 700;
}

.returns-cancelled-amount {
    text-decoration: line-through;
    color: #64748b;
}

.returns-detail-summary {
    margin-bottom: 20px;
}

.returns-detail-reason {
    background: #f8f9fa;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 24px;
}

.returns-detail-reason p {
    margin: 8px 0 0;
    line-height: 1.5;
}

/* Fotos de producto (móvil) */
.product-photo-page {
    max-width: 640px;
    margin: 0 auto;
}

.product-photo-header h1 {
    font-size: 1.35rem;
}

.product-photo-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-photo-label {
    display: block;
    margin: 0 0 8px;
    font-weight: 700;
    color: #1e293b;
}

.product-photo-search-input {
    width: 100%;
    font-size: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
}

.product-photo-results,
.product-photo-variant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.product-photo-result,
.product-photo-variant {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.product-photo-result:hover,
.product-photo-variant:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.product-photo-result-title,
.product-photo-variant-title {
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
}

.product-photo-result-meta,
.product-photo-variant-meta {
    font-size: 12px;
    color: #64748b;
}

.product-photo-variant.is-model {
    border-style: dashed;
    background: #f8fafc;
}

.product-photo-selected {
    margin: 0 0 10px;
    font-size: 14px;
    color: #334155;
}

.product-photo-scope {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.product-photo-scope-option {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
}

.product-photo-preview-block {
    margin-bottom: 14px;
}

.product-photo-preview-frame {
    min-height: 220px;
    max-height: 50vh;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
}

.product-photo-preview-frame img {
    max-width: 100%;
    max-height: 48vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.product-photo-preview-meta {
    margin: 8px 0 0;
    font-size: 12px;
    color: #64748b;
}

.product-photo-camera-btn {
    display: flex;
    justify-content: center;
    width: 100%;
    font-size: 16px;
    padding: 14px;
    margin-bottom: 8px;
}

.product-photo-hint {
    margin: 0 0 14px;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

.product-photo-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-photo-actions .button {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 15px;
}

.product-photo-back {
    width: 100%;
}

.product-photo-status {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.product-photo-status.is-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.product-photo-status.is-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.product-photo-status.is-pending {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.product-photo-empty {
    margin: 8px 0 0;
    font-size: 13px;
    color: #64748b;
}

@media (min-width: 700px) {
    .product-photo-actions {
        flex-direction: row;
    }

    .product-photo-actions .button,
    .product-photo-back {
        width: auto;
        flex: 1;
    }
}