:root {
    --font-title: "Outfit", "Sora", sans-serif;
    --font-body: "Manrope", sans-serif;
    --font-script: "Outfit", "Sora", sans-serif;
    --bg: #09101f;
    --bg-2: #0f1830;
    --panel: rgba(19, 28, 48, 0.86);
    --panel-2: rgba(19, 28, 48, 0.94);
    --card: rgba(19, 28, 48, 0.9);
    --text: #eef3ff;
    --muted: #9ab0d2;
    --accent: #1f84ff;
    --accent-2: #11c5ff;
    --line: rgba(255, 255, 255, 0.12);
    --success: #17a96b;
    --warning: #eb7a16;
    --danger: #ef4444;
    --shadow: 0 14px 30px rgba(7, 16, 31, 0.32);
    --shadow-soft: 0 10px 24px rgba(7, 16, 31, 0.24);
}
html[data-theme="light"] {
    --bg: #ffffff;
    --bg-2: #f7fbff;
    --panel: #ffffff;
    --panel-2: #ffffff;
    --card: #ffffff;
    --text: #111111;
    --muted: #3f3f46;
    --accent: #0b72e6;
    --accent-2: #00a6e8;
    --line: rgba(15, 23, 42, 0.12);
    --shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
    --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(900px 480px at 12% -12%, rgba(31, 132, 255, 0.26), transparent 60%),
        radial-gradient(900px 550px at 88% 0%, rgba(17, 197, 255, 0.22), transparent 62%),
        var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}
html[data-theme="light"] body {
    background: #ffffff;
}
body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    filter: blur(70px);
    pointer-events: none;
    opacity: 0.45;
    animation: drift 14s ease-in-out infinite alternate;
}
body::before {
    width: 320px;
    height: 320px;
    background: rgba(31, 132, 255, 0.45);
    top: 12%;
    left: -90px;
}
body::after {
    width: 360px;
    height: 360px;
    background: rgba(17, 197, 255, 0.35);
    right: -120px;
    bottom: 10%;
    animation-delay: 1.1s;
}
html[data-theme="light"] body::before,
html[data-theme="light"] body::after {
    opacity: 0;
}
@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(28px, -22px, 0) scale(1.08); }
}
@keyframes titleShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#login-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(59, 130, 246, 0.35) 0%, transparent 60%),
        radial-gradient(900px 500px at 90% 0%, rgba(29, 78, 216, 0.3) 0%, transparent 55%),
        #0b1020;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.login-box {
    width: 360px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    color: #fff;
}
html[data-theme="light"] .login-box {
    background: #fff;
    color: var(--text);
}
.login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.login-logo {
    width: min(220px, 100%);
    max-height: 76px;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    border: 0;
    padding: 0;
}
.login-box h2 {
    margin: 0 0 10px 0;
}
.input-box {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.04);
    color: inherit;
}
html[data-theme="light"] .input-box {
    background: #fff;
}
.login-help-row {
    display: flex;
    justify-content: flex-end;
    margin: -2px 0 8px;
}
.login-link-btn {
    border: 0;
    background: transparent;
    color: var(--accent-2);
    font-size: 12px;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
}
.login-link-btn:hover {
    color: #fff;
    text-decoration: underline;
}
html[data-theme="light"] .login-link-btn:hover {
    color: var(--accent);
}
.btn-primary {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22);
}
.btn-primary:hover {
    background: var(--accent-2);
}
.muted {
    color: var(--muted);
}
.auth-feedback {
    min-height: 18px;
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--muted);
}
.auth-feedback.ok {
    color: var(--success);
}
.auth-feedback.error {
    color: var(--danger);
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--panel);
    border-right: 1px solid var(--line);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-soft);
}
.sidebar-backdrop {
    display: none;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
}
.mode-toggle {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.06);
}
.mode-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}
.mode-btn.active {
    background: rgba(37,99,235,0.12);
    border-color: rgba(37,99,235,0.25);
    color: var(--accent);
}
.brand-logo {
    width: 168px;
    height: 58px;
    border-radius: 0;
    display: grid;
    place-items: center;
    background: transparent;
    border: 0;
    padding: 0;
}
.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.brand-name {
    font-weight: 700;
}
.brand-sub {
    color: var(--muted);
    font-size: 12px;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 260px;
}
.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}
.nav-item i {
    font-size: 14px;
    line-height: 1;
}
.nav-item.active {
    background: rgba(37,99,235,0.12);
    border-color: rgba(37,99,235,0.25);
    color: var(--accent);
}
html[data-theme="light"] .nav-item.active {
    color: #1d4ed8;
}
.nav-item.danger {
    color: var(--danger);
}
.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
    display: flex;
    gap: 10px;
    align-items: center;
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    display: grid;
    place-items: center;
    font-weight: 700;
}
.sidebar-footer span {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.content {
    padding: 20px 26px 26px 26px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--panel);
    margin-bottom: 18px;
    box-shadow: var(--shadow-soft);
}
.title-block h1 {
    margin: 0;
    font-size: clamp(26px, 4vw, 38px);
    font-family: var(--font-title);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: 0.06px;
    background: linear-gradient(112deg, #ffffff 0%, #e8f6ff 54%, #bcdfff 100%);
    background-size: 180% 180%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 14px rgba(130, 190, 255, 0.16);
    animation: titleShift 8s ease-in-out infinite;
}
.title-block h1 .accent-line {
    display: block;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}
.title-block h1 .client-inline {
    display: inline;
    color: inherit;
}
html[data-theme="light"] .title-block h1 {
    background: none;
    color: #111111;
    -webkit-text-fill-color: initial;
    text-shadow: none;
    animation: none;
}
.title-block p {
    margin: 6px 0 0 0;
    color: var(--muted);
    font-size: 14px;
}
.service-tags-panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    margin-bottom: 16px;
    padding: 14px;
    box-shadow: var(--shadow-soft);
}
.service-tags-head h2 {
    margin: 0;
    font-size: 18px;
    font-family: var(--font-title);
}
.service-tags-head p {
    margin: 4px 0 0 0;
    color: var(--muted);
    font-size: 13px;
}
.service-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.tab-btn {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
    font-family: var(--font-title);
    cursor: pointer;
}
.tab-btn.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.top-actions .input {
    min-width: 180px;
}
.top-actions .btn-soft {
    width: auto;
    margin-bottom: 0;
}
#theme-toggle {
    width: auto;
    margin-bottom: 0;
}
.theme-quick-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(10, 87, 207, 0.25);
}
.theme-quick-toggle:hover {
    color: #fff;
    filter: brightness(1.05);
}
.theme-quick-toggle i {
    font-size: 14px;
}
.theme-dropdown .dropdown-menu {
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    border-radius: 12px;
    padding: 6px;
}
.theme-dropdown .dropdown-item {
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.theme-dropdown .dropdown-item.active::after {
    content: "✓";
    margin-left: auto;
    font-weight: 700;
}
.app-tab-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.app-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-family: var(--font-title);
    font-weight: 600;
    cursor: pointer;
}
.app-tab-btn i {
    font-size: 13px;
}
.app-tab-btn.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.app-tab-btn.app-tab-logout {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.28);
}
.pill {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.6);
    font-size: 12px;
}
.lot-pill {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
}
.lot-pill-ok {
    color: #0f8a4f;
    border-color: rgba(15, 138, 79, 0.35);
    background: rgba(15, 138, 79, 0.12);
}
.lot-pill-warn {
    color: #b86500;
    border-color: rgba(184, 101, 0, 0.35);
    background: rgba(184, 101, 0, 0.12);
}
.lot-pill-danger {
    color: #be123c;
    border-color: rgba(190, 18, 60, 0.35);
    background: rgba(190, 18, 60, 0.12);
}
.btn-soft {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    cursor: pointer;
    color: var(--text);
}

.section-view { display: none; }
.section-view.active { display: block; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.col-fixed {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.col-fluid {
    flex: 1;
    min-width: 300px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
    color: var(--text);
}
.product-actions-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.product-actions-note {
    margin-top: 0;
}
.btn-inline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.product-modal-content {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow);
}
.product-modal-header {
    border-bottom: 1px solid var(--line);
    background: linear-gradient(120deg, rgba(31, 132, 255, 0.12), rgba(17, 197, 255, 0.08));
}
.product-modal-header .modal-title {
    font-family: var(--font-title);
    font-weight: 700;
}
#productoModal .modal-body {
    padding: 16px 18px 18px 18px;
}
#productoModal .btn-close {
    filter: invert(1) grayscale(100%) brightness(1.7);
}
html[data-theme="light"] #productoModal .btn-close {
    filter: none;
}
.crud-action-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.crud-action-card .card-title {
    margin-bottom: 0;
}
.crud-action-card .btn-primary,
.crud-action-card .btn-soft {
    margin-bottom: 0;
}
.crud-modal-content {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow);
}
.crud-modal-header {
    border-bottom: 1px solid var(--line);
    background: linear-gradient(120deg, rgba(31, 132, 255, 0.12), rgba(17, 197, 255, 0.08));
}
.crud-modal-header .modal-title {
    font-family: var(--font-title);
    font-weight: 700;
}
.crud-form-modal .modal-body {
    padding: 16px 18px 18px 18px;
}
#crudModal-ventas_admin .modal-dialog {
    max-width: min(1280px, 96vw);
}
#crudModal-ventas_admin .table-compact {
    min-width: 940px;
}
.crud-form-modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(1.7);
}
html[data-theme="light"] .crud-form-modal .btn-close {
    filter: none;
}
.crud-modal-form-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(120px, 165px) minmax(0, 1fr);
    gap: 10px 14px;
}
.crud-modal-form-card > .card-title {
    display: none;
}
.crud-modal-form-card .label {
    margin: 0;
    align-self: center;
}
.crud-modal-form-card .input {
    margin: 0;
}
.crud-modal-form-card input[type="hidden"] {
    display: none;
}
.crud-modal-form-card textarea.input,
.crud-modal-form-card .soft-card,
.crud-modal-form-card .helper-text,
.crud-modal-form-card .btn-row,
.crud-modal-form-card .btn-primary,
.crud-modal-form-card .btn-soft {
    grid-column: 1 / -1;
}
.crud-modal-form-card .btn-primary,
.crud-modal-form-card .btn-soft {
    width: 100%;
    margin-bottom: 0;
}
.crud-modal-form-card .btn-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 2px;
}
.crud-modal-companion-card {
    margin-top: 12px;
}
.sales-grid {
    align-items: flex-start;
}
.sales-registry-card {
    flex: 1 1 620px;
    min-width: 520px;
}
.sales-registry-card .table-wrapper {
    max-height: 520px;
    overflow: auto;
}
.sales-registry-card .btn-soft {
    margin-bottom: 0;
}
.sales-filters-card {
    margin-bottom: 16px;
}
.sales-filter-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.sales-filter-row {
    display: grid;
    gap: 10px;
    width: 100%;
    align-items: center;
}
.sales-filter-row-dates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.sales-filter-row-selects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.sales-filter-row-search {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 150px);
    align-items: stretch;
}
.sales-filter-stack .input {
    min-width: 0;
    width: 100%;
}
.sales-filter-stack .input,
.sales-filter-stack .btn-soft {
    margin-bottom: 0;
}
.sales-filter-button-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.sales-filter-button-stack .btn-soft {
    width: 100%;
    min-height: 44px;
}
.sales-filter-search {
    min-width: 0;
}
.sales-panels-grid {
    align-items: stretch;
}
.sales-filter-panel {
    flex: 1 1 620px;
    min-width: 420px;
}
.sales-summary-card {
    flex: 1 1 320px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sales-summary-card .helper-text {
    margin-top: auto;
}
.sales-report-card {
    margin-top: 16px;
}
.sales-report-card .table-wrapper {
    max-height: 520px;
    overflow: auto;
}
.modal-form-actions {
    margin-top: 10px;
    align-items: stretch;
}
.modal-form-actions .btn-primary,
.modal-form-actions .btn-soft {
    width: auto;
    flex: 1;
    margin-bottom: 0;
}
.card-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: inherit;
}
.card span,
.card b,
.card td,
.card th {
    color: inherit;
}
.label {
    font-size: 12px;
    color: var(--muted);
    margin: 6px 0;
    display: block;
}
.input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    margin-bottom: 10px;
    background: rgba(255,255,255,0.04);
    color: var(--text);
}
select.input,
select.input-compact {
    color-scheme: light;
}
html[data-theme="dark"] select.input,
html[data-theme="dark"] select.input-compact {
    color-scheme: dark;
}
/* Fallback for browsers that paint the dropdown list with light background. */
select.input option,
select.input-compact option,
select.input optgroup,
select.input-compact optgroup {
    background: #ffffff;
    color: #111111;
}
html[data-theme="dark"] select.input option,
html[data-theme="dark"] select.input-compact option,
html[data-theme="dark"] select.input optgroup,
html[data-theme="dark"] select.input-compact optgroup {
    background: #0f1830;
    color: #eef3ff;
}
html[data-theme="light"] .input,
html[data-theme="light"] .input-compact {
    background: #fff;
}
.input:focus {
    outline: none;
    border-color: rgba(37,99,235,0.45);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.btn-soft {
    width: 100%;
    margin-bottom: 10px;
}
.total-row {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}
.kpi-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}
.info-row:last-child {
    border-bottom: none;
}
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.kpi-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: var(--panel);
}

.table-wrapper {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: var(--card);
    color: var(--text);
}
th, td {
    padding: 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    color: inherit;
}
thead th {
    background: rgba(15, 23, 42, 0.04);
    font-weight: 700;
}
tbody tr:hover {
    background: rgba(37,99,235,0.06);
}

.chart-container {
    height: 260px;
}

.soft-card {
    margin-top: 6px;
    padding: 12px;
    background: var(--panel);
}
.table-compact th,
.table-compact td {
    padding: 6px;
    font-size: 12px;
}
.input-compact {
    padding: 6px 8px;
    margin-bottom: 0;
    border-radius: 8px;
    font-size: 12px;
}
.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.helper-text {
    margin: 8px 0 0 0;
    color: var(--muted);
    font-size: 12px;
}
.pending-action {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pending-action .input-compact {
    min-width: 120px;
    margin-bottom: 0;
}
.pending-empty {
    text-align: center;
    color: var(--muted);
    padding: 12px;
}
.btn-del {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
}
.btn-action {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
}
.btn-action.danger {
    color: var(--danger);
}
.pill,
.btn-soft,
.input,
.input-compact,
.btn-del,
.btn-action {
    color: var(--text);
}
.error-text {
    color: var(--danger);
}
.success-text {
    color: var(--success);
}
.mt-16 {
    margin-top: 16px;
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 10;
    }
}

@media (max-width: 900px) {
    .title-block h1 {
        font-size: clamp(24px, 7vw, 30px);
    }
    body {
        background:
            radial-gradient(800px 400px at 20% -10%, rgba(59,130,246,0.22) 0%, transparent 60%),
            radial-gradient(700px 360px at 85% 10%, rgba(29,78,216,0.2) 0%, transparent 55%),
            var(--bg);
    }
    .sidebar {
        position: fixed;
        inset: 0 0 auto 0;
        width: min(86vw, 320px);
        height: 100vh;
        transform: translateX(-110%);
        transition: transform 0.25s ease;
        border-right: none;
        border-bottom: none;
        padding: 14px;
        z-index: 20;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, 0.55);
        backdrop-filter: blur(2px);
        z-index: 15;
        display: none;
    }
    .sidebar-backdrop.open {
        display: block;
    }
    .sidebar-brand {
        width: 100%;
    }
    .side-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: thin;
    }
    .nav-item {
        flex: 0 0 auto;
        text-align: center;
        padding: 10px 12px;
        white-space: nowrap;
    }
    .side-nav::-webkit-scrollbar {
        height: 6px;
    }
    .side-nav::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.35);
        border-radius: 999px;
    }
    .content {
        padding: 16px;
    }
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        background: var(--panel-2);
        border-radius: 16px;
        padding: 14px;
    }
    .top-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .app-tab-row {
        width: 100%;
    }
    .theme-quick-toggle {
        align-self: flex-start;
        min-height: 44px;
    }
    .app-tab-btn {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }
    .grid {
        gap: 12px;
    }
    .col-fixed {
        width: 100%;
    }
    .col-fluid {
        min-width: 0;
    }
    .app-shell {
        display: block;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        background: rgba(255,255,255,0.04);
        border: 1px solid var(--line);
        border-radius: 14px;
        padding: 12px;
    }
    .card,
    .kpi-card,
    .soft-card,
    .topbar,
    .section-header {
        box-shadow: 0 10px 24px rgba(2, 6, 23, 0.18);
        border-radius: 16px;
    }
    .card {
        background: var(--card);
    }
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #productoModal .modal-dialog {
        margin: 12px;
    }
    #productoModal .modal-content {
        border-radius: 16px;
    }
    .crud-form-modal .modal-dialog {
        margin: 12px;
    }
    .crud-form-modal .modal-content {
        border-radius: 16px;
    }
    .crud-modal-form-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .crud-modal-form-card .label {
        margin-top: 4px;
        margin-bottom: 0;
    }
    .crud-modal-form-card .btn-row {
        grid-template-columns: 1fr;
    }
    .crud-modal-companion-card {
        margin-top: 10px;
    }
    .sales-registry-card {
        min-width: 0;
        flex-basis: 100%;
    }
    .sales-registry-card .table-wrapper {
        max-height: none;
    }
    .sales-filter-row-dates,
    .sales-filter-row-selects,
    .sales-filter-row-search {
        grid-template-columns: 1fr;
    }
    .sales-filter-panel {
        min-width: 0;
        flex-basis: 100%;
    }
    .sales-report-card .table-wrapper {
        max-height: none;
    }
    .kpi-card {
        background: rgba(255,255,255,0.04);
        border: 1px solid var(--line);
        padding: 14px;
    }
    .table-wrapper {
        border-radius: 14px;
        overflow: hidden;
        border: 1px solid var(--line);
        background: var(--card);
    }
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
    thead, tbody, tr, th, td {
        white-space: nowrap;
    }
    .btn-primary,
    .btn-soft,
    .btn-action {
        border-radius: 12px;
    }
    .pending-action {
        min-width: 190px;
    }
    .input,
    .input-compact {
        border-radius: 12px;
        background: rgba(255,255,255,0.04);
    }
    html[data-theme="light"] .input,
    html[data-theme="light"] .input-compact {
        background: #fff;
    }
}
