:root {
    color-scheme: light only;
    --color-primary: #A898C6;
    --color-primary-hover: #9584B8;
    --color-primary-soft: #F0EBF7;
    --color-primary-contrast: #FFFFFF;
    --color-bg: #F3F4F6;
    --color-surface: #FFFFFF;
    --color-border: #E5E7EB;
    --color-text: #2F2A38;
    --color-text-muted: #7A7289;
    --color-sidebar-bg: #3D3550;
    --color-sidebar-text: #F3EFF8;
    --color-sidebar-muted: #B9AECF;
    --color-sidebar-active-bg: #5E5080;
    --color-sidebar-active-text: #FFFFFF;
    --color-success: #2E7D52;
    --color-success-soft: #E3F2EA;
    --color-warning: #9A6B00;
    --color-warning-soft: #FFF4D6;
    --color-danger: #B63D3D;
    --color-danger-soft: #FDECEC;
    --sidebar-width-collapsed: 4.5rem;
    --sidebar-width-expanded: 16.25rem;
    --app-bg: var(--color-bg);
    --app-border: var(--color-border);
    --app-text: var(--color-text);
    --app-muted: var(--color-text-muted);
    --app-coral: var(--color-primary);
    --app-coral-dark: var(--color-primary-hover);
    --app-coral-soft: var(--color-primary-soft);
    --app-soft: var(--color-primary-soft);
    --app-input-bg: var(--color-surface);
    --app-input-bg-readonly: var(--color-bg);
    --app-surface-muted: var(--color-bg);
    --app-radius: 1.05rem;
    --sidebar-width: var(--sidebar-width-collapsed);
    --font-family-sans: "DM Sans", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --bs-body-font-family: var(--font-family-sans);
    --bs-font-sans-serif: var(--font-family-sans);
}

html,
body {
    min-height: 100%;
    width: 100%;
    color-scheme: light only;
}

body {
    margin: 0;
    background: var(--app-bg);
    color: var(--app-text);
    font-family: var(--font-family-sans);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.align-items-center { align-items: center !important; }
.align-items-sm-center { align-items: center !important; }
.align-items-md-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.min-vh-100 { min-height: 100vh !important; }
.h-100 { height: 100% !important; }
.text-center { text-align: center !important; }
.text-end, .text-md-end { text-align: right !important; }
.text-secondary { color: var(--app-muted) !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.lh-1 { line-height: 1 !important; }
.small { font-size: .82rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-auto { margin-top: auto !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.p-0 { padding: 0 !important; }
.p-3 { padding: 1rem !important; }
.py-3 { padding-block: 1rem !important; }
.px-3 { padding-inline: 1rem !important; }
.border { border: 1px solid var(--app-border) !important; }
.border-top { border-top: 1px solid var(--app-border) !important; }
.border-bottom { border-bottom: 1px solid var(--app-border) !important; }
.bg-white { background: #fff !important; }
.nav { display: flex; }
.nav-link { text-decoration: none; }
.sticky-top { position: sticky; top: 0; }
.offcanvas {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1060;
    display: flex;
    visibility: hidden;
    flex-direction: column;
    width: min(86vw, 340px);
    max-width: 100%;
    overflow-y: auto;
    background: #fff;
    box-shadow: 0 20px 60px rgba(47, 37, 31, .18);
    transform: translateX(-100%);
    transition: transform .24s ease, visibility .24s ease;
}

.offcanvas.show,
.offcanvas.showing {
    visibility: visible;
    transform: none;
}

.offcanvas.hiding {
    visibility: visible;
}

.offcanvas-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(26, 24, 23, .36);
}

.offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}

.offcanvas-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.btn-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    cursor: pointer;
}

.btn-close::before {
    content: "\F62A";
    color: var(--app-muted);
    font-family: "bootstrap-icons";
    font-size: 1.1rem;
    line-height: 1;
}

body.offcanvas-open {
    overflow: hidden;
}

@media (min-width: 992px) {
    .d-lg-flex { display: flex !important; }
    .d-lg-grid { display: grid !important; }
    .d-lg-none { display: none !important; }
}

@media (max-width: 991.98px) {
    .product-filters,
    .product-form-grid,
    .product-modal-grid {
        grid-template-columns: 1fr;
    }

    .product-edit-modal .product-modal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .product-modal-actions {
        justify-content: stretch;
    }

    .product-modal-actions .app-button {
        flex: 1;
    }

    .products-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .d-lg-flex,
    .d-lg-grid { display: none !important; }
    .d-lg-none { display: flex !important; }
}


.min-width-0 {
    min-width: 0;
}

.app-shell {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    background: var(--app-bg);
}

.sidebar {
    position: sticky;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    max-height: 100vh;
    flex: 0 0 var(--sidebar-width);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-sidebar-bg);
    border-right: 1px solid color-mix(in srgb, var(--color-sidebar-bg) 80%, #000);
    color: var(--color-sidebar-text);
    transition: width .22s ease, flex-basis .22s ease;
}

.menu-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: transparent;
}

.menu-nav-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--color-sidebar-muted) 55%, transparent) transparent;
}

.menu-nav-scroll::-webkit-scrollbar {
    width: 5px;
}

.menu-nav-scroll::-webkit-scrollbar-track {
    margin: .35rem 0;
    background: transparent;
}

.menu-nav-scroll::-webkit-scrollbar-thumb {
    border: 1px solid transparent;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-sidebar-muted) 40%, transparent);
    background-clip: padding-box;
}

.menu-nav-scroll::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--color-sidebar-muted) 65%, transparent);
    background-clip: padding-box;
}

.menu-footer {
    flex-shrink: 0;
    background: transparent;
}

.main-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
}

.brand-area {
    flex-shrink: 0;
    min-height: 76px;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--app-border);
}

.brand-icon {
    display: inline-grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border-radius: .85rem;
    color: #8d4a42;
    background: var(--app-coral);
    font-size: 1.1rem;
}

.mobile-navbar {
    min-height: 68px;
    z-index: 1030;
}

.mobile-bottom-nav {
    display: none;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 44px;
    border-radius: .75rem;
    color: var(--app-muted);
    font-size: .9rem;
    font-weight: 500;
    padding: .68rem .85rem;
}

.app-nav-link i {
    width: 1.15rem;
    color: #81746d;
    text-align: center;
}

.app-nav-link:hover,
.app-nav-link.active {
    background: var(--app-coral);
    color: #382724;
}

.app-nav-link:hover i,
.app-nav-link.active i {
    color: #53332f;
}

.app-nav-link.disabled {
    opacity: .85;
    pointer-events: none;
}

.app-logout {
    color: var(--app-coral-dark) !important;
}

.page-toolbar {
    min-height: 76px;
}

.dashboard-content,
.crud-layout {
    margin: 0;
}

.page-content {
    width: 100%;
    max-width: 1440px;
    margin-inline: auto;
    padding: 1.5rem;
}

.page-toolbar {
    padding-inline: clamp(1rem, 2.5vw, 2rem) !important;
}

.page-toolbar > div {
    width: 100%;
    max-width: 1440px;
    margin-inline: auto;
}

.crud-layout,
.page-toolbar + .alert,
.page-toolbar + .alert + .alert {
    margin: 1rem auto;
}

.page-toolbar + .alert,
.page-toolbar + .alert + .alert {
    width: calc(100% - 2rem);
    max-width: 1440px;
}

.welcome-card,
.content-card,
.stat-card,
.product-row,
.login-card {
    background: var(--color-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: 0 10px 30px rgba(47, 42, 56, .04);
}


.dashboard-stats,
.quick-actions-grid {
    display: grid;
    gap: 1rem;
}

.dashboard-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quick-actions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.crud-layout.page-content {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 1.5rem;
}

.crud-layout.crud-list-layout {
    grid-template-columns: minmax(0, 1fr);
}

.crud-modal {
    width: min(100%, 520px);
}

.crud-modal-grid {
    align-items: end;
}

.crud-modal-check {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--app-coral);
}

.crud-form,
.crud-table-panel {
    min-width: 0;
}

.welcome-card,
.content-card {
    padding: 1.25rem;
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 112px;
    padding: 1.35rem;
}

.stat-card p {
    margin: 0 0 .55rem;
    color: var(--app-muted);
    font-size: .82rem;
    font-weight: 600;
}

.stat-card strong {
    display: block;
    color: var(--app-text);
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1;
}

.stat-icon {
    display: inline-grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border-radius: .9rem;
    font-size: 1.2rem;
}

.icon-coral {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}

.icon-warning {
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.icon-danger {
    color: #ef6e68;
    background: #fff0f0;
}

.icon-teal {
    color: #72bdb6;
    background: #effbf9;
}

.icon-green {
    color: #8fcf95;
    background: #f2fbf1;
}

.btn-primary-soft,
.quick-action-primary {
    --bs-btn-color: #4a2f2b;
    --bs-btn-bg: var(--app-coral);
    --bs-btn-border-color: var(--app-coral);
    --bs-btn-hover-color: #4a2f2b;
    --bs-btn-hover-bg: #df9187;
    --bs-btn-hover-border-color: #df9187;
    --bs-btn-active-color: #4a2f2b;
    --bs-btn-active-bg: #d7867b;
    --bs-btn-active-border-color: #d7867b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.5rem;
    border: 1px solid var(--app-coral);
    border-radius: .7rem;
    padding: .55rem 1rem;
    color: #4a2f2b;
    background: var(--app-coral);
    font-weight: 700;
    text-decoration: none;
}

.btn-primary-soft:hover,
.quick-action-primary:hover {
    color: #4a2f2b;
    background: #df9187;
    border-color: #df9187;
}

.quick-action {
    display: grid;
    width: 100%;
    min-height: 88px;
    place-items: center;
    gap: .35rem;
    border: 1px solid var(--app-border);
    border-radius: .85rem;
    background: #fff;
    color: var(--app-text);
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
}

.quick-action:disabled {
    opacity: 1;
}

.quick-action i {
    color: #716862;
}

.product-list {
    max-height: 52vh;
    overflow: auto;
    padding-right: .25rem;
}

.product-row {
    padding: 1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .25rem .65rem;
    font-size: .75rem;
    font-weight: 700;
}

.status-success {
    color: var(--color-success);
    background: var(--color-success-soft);
}

.status-warning {
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.status-danger {
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.status-muted {
    color: #5f6368;
    background: #e9ecef;
}

.empty-state {
    color: var(--app-muted);
}

.table-wrapper {
    overflow-x: auto;
}

.app-table {
    min-width: 760px;
}

.app-table thead th {
    border-bottom-color: var(--app-border);
    color: var(--color-text-muted);
    background: transparent;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.app-table tbody td {
    border-bottom-color: var(--app-border);
}

.crud-form .content-card,
.table-wrapper.content-card {
    padding: 1rem;
}


.app-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    min-height: 2.8rem;
    border: 1px solid transparent;
    border-radius: .65rem;
    padding: .7rem 1.15rem;
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.app-button-primary {
    color: #382724;
    background: var(--app-coral);
    border-color: var(--app-coral);
}

.app-button-primary:hover {
    background: #df9187;
    border-color: #df9187;
}

.app-button-secondary {
    color: var(--app-text);
    background: #fff;
    border-color: var(--app-border);
}

.app-alert {
    width: calc(100% - 3rem);
    max-width: 1440px;
    margin: 1rem auto 0;
    border-radius: .95rem;
    padding: .85rem 1rem;
    font-weight: 600;
}

.app-alert-success {
    color: #2f7668;
    background: #e2f6f2;
}

.app-alert-danger {
    color: #a33e38;
    background: #fff0f0;
}

.products-page {
    min-height: 100vh;
    min-width: 0;
    background: var(--app-bg);
}

.products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 92px;
    padding: 1.55rem 1.75rem;
    background: #fff;
    border-bottom: 1px solid var(--app-border);
}

.products-header h1 {
    margin: 0 0 .35rem;
    color: #211b18;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.products-header p {
    margin: 0;
    color: var(--app-muted);
    font-size: .86rem;
}

.product-list-card {
    margin: 0;
    padding: 1.75rem;
    min-width: 0;
    max-width: 100%;
}

.product-filters {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 190px 180px;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.product-search,
.product-select {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 2.8rem;
    border: 1px solid transparent;
    border-radius: .8rem;
    color: var(--color-text-muted);
    background: var(--color-surface);
    padding: 0 .75rem;
}

.product-search input,
.product-select select {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--app-text);
    background: transparent;
    font: inherit;
    font-size: .86rem;
}

.product-search input::placeholder {
    color: var(--color-text-muted);
}

.product-select select {
    appearance: none;
    cursor: pointer;
}

.products-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.products-table-scroll {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.products-table {
    width: 100%;
    min-width: 1060px;
    border-collapse: separate;
    border-spacing: 0;
    color: #1f1b18;
    font-size: .84rem;
}

.products-table th,
.products-table td {
    padding: .85rem .75rem;
    border-bottom: 1px solid var(--app-border);
    vertical-align: middle;
    white-space: nowrap;
}

.products-table th {
    color: var(--color-text-muted);
    background: transparent;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: left;
}

.products-table tbody tr:last-child td {
    border-bottom: 0;
}

.products-table tbody tr:hover {
    background: var(--color-primary-soft);
}

.code-cell {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: -.02em;
}

.name-cell,
.price-cell {
    font-weight: 700;
}

.muted-cell {
    color: var(--app-muted);
}

.price-cell {
    text-align: right;
}

.stock-cell {
    text-align: center;
}

.stock-cell span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    min-height: 1.65rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: #fff;
    font-size: .78rem;
}

.actions-cell {
    display: flex;
    justify-content: flex-end;
    gap: .8rem;
}

.icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border: 0;
    color: #4f4843;
    background: transparent;
    border-radius: .45rem;
    cursor: pointer;
}

.icon-action:hover {
    color: #382724;
    background: var(--app-coral-soft);
}

.icon-action.danger {
    color: #ef6e68;
}

.product-empty {
    border: 1px solid var(--app-border);
    border-radius: .9rem;
    background: #fff;
    padding: 2rem;
    color: var(--app-muted);
    text-align: center;
}

.roles-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 1.25rem;
}

.roles-card {
    min-width: 0;
}

.roles-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.roles-card-header h2 {
    margin: 0 0 .25rem;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 800;
}

.roles-card-header p {
    margin: 0;
    color: var(--app-muted);
    font-size: .84rem;
}

.roles-table-wrap {
    overflow: hidden;
}

.roles-table {
    min-width: 0;
}

.roles-list {
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    background: #fff;
}

.roles-list-header,
.roles-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
}

.roles-list-header {
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-muted);
    background: var(--app-soft);
    font-size: .78rem;
    font-weight: 500;
}

.roles-list-header span:last-child {
    justify-self: end;
}

.roles-list-item {
    border-bottom: 1px solid var(--app-border);
    transition: background .18s ease;
}

.roles-list-item:last-child {
    border-bottom: 0;
}

.roles-list-item:hover {
    background: var(--app-soft);
}

.roles-list-item.is-selected {
    background: var(--app-coral-soft);
    box-shadow: inset 3px 0 0 var(--app-coral);
}

.roles-list-item-select {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    min-width: 0;
    width: 100%;
    border: 0;
    padding: .85rem 1rem;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.roles-list-item-select:focus-visible {
    outline: 2px solid rgba(224, 127, 117, .45);
    outline-offset: -2px;
}

.roles-list-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 2.75rem;
    padding: .85rem 1rem;
}

.roles-list-item-actions .muted-cell {
    font-size: .78rem;
    white-space: nowrap;
}

.roles-table tbody tr.is-selected td {
    background: var(--app-coral-soft);
}

.roles-select-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: .5rem;
    width: 100%;
    border: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.roles-role-name {
    color: var(--app-text);
    font-weight: 700;
}

.roles-info {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    padding: .9rem 1rem;
    color: var(--app-text);
    background: var(--app-coral-soft);
    font-size: .88rem;
}

.roles-info i {
    color: var(--app-coral-dark);
    font-size: 1.15rem;
}

.roles-permissions {
    display: grid;
    gap: 1rem;
}

.roles-permission-group {
    border: 1px solid var(--app-border);
    border-radius: .85rem;
    background: #fff;
    padding: 1rem;
}

.roles-permission-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .85rem;
}

.roles-permission-group-header h3 {
    margin: 0;
    color: var(--app-text);
    font-size: .95rem;
    font-weight: 800;
}

.roles-permission-group-header span {
    color: var(--app-muted);
    font-size: .78rem;
}

.roles-permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .75rem;
}

.roles-permission-option {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    min-height: 4rem;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    padding: .8rem .9rem;
    color: var(--app-text);
    background: #fff;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.roles-permission-option:has(input:checked) {
    border-color: rgba(224, 127, 117, .55);
    background: var(--app-coral-soft);
    box-shadow: inset 0 0 0 1px rgba(224, 127, 117, .18);
}

.roles-permission-option:hover {
    border-color: var(--app-coral);
    background: var(--app-coral-soft);
}

.roles-permission-option.is-disabled {
    color: var(--app-muted);
    background: var(--app-input-bg-readonly);
    cursor: not-allowed;
    box-shadow: none;
}

.roles-permission-option.is-disabled:has(input:checked) {
    border-color: var(--app-border);
    background: var(--app-input-bg-readonly);
}

.roles-permission-option input {
    margin-top: .15rem;
    accent-color: var(--app-coral);
}

.roles-permission-option span {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.roles-permission-option strong {
    font-size: .84rem;
    font-weight: 700;
}

.roles-permission-option small {
    color: var(--app-muted);
    font-size: .73rem;
    overflow-wrap: anywhere;
}

.roles-modal {
    width: min(100%, 460px);
}

.users-layout {
    grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
}

.users-filters {
    grid-template-columns: 1fr;
    margin-bottom: 1rem;
}

.users-table {
    min-width: 0;
}

.users-table tbody tr.is-selected td {
    background: var(--app-coral-soft);
}

.users-email {
    display: block;
    margin-top: .15rem;
    color: var(--app-muted);
    font-size: .75rem;
    overflow-wrap: anywhere;
}

.users-config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.users-actions-card {
    margin-bottom: 1rem;
}

.users-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.users-modal {
    width: min(100%, 520px);
}


.product-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(26, 24, 23, .52);
}

.product-modal {
    width: min(100%, 448px);
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: .75rem;
    background: var(--color-surface);
    box-shadow: 0 24px 70px rgba(47, 42, 56, .18);
    padding: 1.35rem 1.35rem 1.25rem;
}

.product-modal.product-edit-modal {
    width: min(96vw, 1040px);
    max-height: calc(100vh - 2rem);
    padding: 1.75rem 2rem 1.5rem;
}

.product-edit-modal .product-modal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 1.25rem;
    row-gap: 1.15rem;
}

.product-edit-mobile-hero {
    display: none;
}

.product-edit-section,
.product-edit-section-body,
.product-edit-section-grid {
    display: contents;
}

.product-edit-section-header {
    display: none;
}

.product-edit-modal .product-textarea {
    min-height: 5.5rem;
}

.product-edit-modal .product-calculated-prices {
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: .75rem;
    background: var(--color-primary-soft);
}

.product-edit-modal .product-calculated-prices-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .85rem;
}

.product-edit-modal .product-calculated-prices-header label {
    margin: 0;
    color: var(--app-text);
    font-size: .875rem;
    font-weight: 500;
}

.product-edit-modal .product-calculated-prices-count {
    color: var(--app-muted);
    font-size: .75rem;
    font-weight: 500;
}

.product-edit-modal .product-calculated-prices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .75rem;
}

.product-edit-modal .product-calculated-price-card {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .9rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: .75rem;
    background: var(--color-surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.product-edit-modal .product-calculated-price-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 20px rgba(47, 42, 56, .08);
}

.product-edit-modal .product-calculated-price-card.is-best {
    border-color: var(--color-primary);
    background: var(--color-surface);
}

.product-edit-modal .product-calculated-price-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.product-edit-modal .product-calculated-price-name {
    color: var(--app-text);
    font-size: .8125rem;
    font-weight: 500;
}

.product-edit-modal .product-calculated-price-badge {
    display: inline-flex;
    align-items: center;
    padding: .1rem .45rem;
    border-radius: 999px;
    color: var(--color-primary-contrast);
    background: var(--color-primary);
    font-size: .625rem;
    font-weight: 500;
    white-space: nowrap;
}

.product-edit-modal .product-calculated-price-amount {
    color: var(--app-text);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.2;
}

.product-edit-modal .product-calculated-price-card.is-best .product-calculated-price-amount {
    color: var(--app-coral-dark);
}

.product-edit-modal .product-calculated-price-meta {
    color: var(--app-muted);
    font-size: .75rem;
    line-height: 1.35;
}

.product-edit-modal .product-calculated-price-card.is-best .product-calculated-price-meta {
    color: var(--app-text);
}

.product-edit-modal .product-impuestos-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
    min-height: 2.4rem;
    border: 1px solid var(--color-border);
    border-radius: .65rem;
    padding: .55rem .7rem;
    color: var(--color-text);
    background: var(--color-surface);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.product-edit-modal .product-impuestos-button:hover {
    border-color: var(--color-primary);
}

.product-edit-modal .product-impuestos-button:focus-visible {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 .18rem color-mix(in srgb, var(--color-primary) 18%, transparent);
    outline: none;
}

.product-edit-modal .product-impuestos-button-label {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
}

.product-edit-modal .product-impuestos-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    color: var(--color-text-muted);
    background: var(--color-bg);
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
}

.product-edit-modal .product-impuestos-count.has-value {
    color: var(--color-primary-contrast);
    background: var(--color-primary);
}

.product-edit-modal .product-impuestos-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.product-edit-modal .product-impuesto-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .85rem;
    border: 1px solid var(--app-border);
    border-radius: .65rem;
    cursor: pointer;
}

.product-edit-modal .product-impuesto-option:hover {
    border-color: var(--app-coral);
}

.product-edit-modal .product-impuesto-name {
    flex: 1;
    font-size: .875rem;
    font-weight: 500;
}

.product-edit-modal .product-impuesto-porcentaje {
    color: var(--app-muted);
    font-size: .8125rem;
}

.product-depositos-list {
    gap: .65rem;
}

.product-edit-modal .product-deposito-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: .65rem .85rem;
    border: 1px solid var(--app-border);
    border-radius: .65rem;
}

.product-edit-modal .product-deposito-check {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.product-edit-modal .product-deposito-name {
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.2;
}

.product-edit-modal .product-deposito-cantidad {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    flex: 0 0 auto;
}

.product-edit-modal .product-deposito-cantidad-label {
    color: var(--app-muted);
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.product-edit-modal .product-deposito-qty-input {
    width: 5rem;
    min-width: 5rem;
    min-height: 2.35rem;
    padding: .35rem .55rem;
}

.product-edit-modal .product-deposito-default {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex: 0 0 auto;
    margin: 0;
    color: var(--app-muted);
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

@media (max-width: 767.98px) {
    .product-edit-modal .product-deposito-option {
        flex-wrap: wrap;
    }

    .product-edit-modal .product-deposito-check {
        flex: 1 1 100%;
    }
}

.product-edit-modal .product-impuesto-resumen {
    display: grid;
    gap: .65rem;
    margin-top: .5rem;
}

.product-edit-modal .product-impuesto-resumen > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .5rem .75rem;
    border-radius: .5rem;
    background: var(--app-surface-muted);
}

.product-modal-backdrop-nested {
    z-index: 2200;
    background: rgba(26, 24, 23, .68);
}

.product-edit-modal .product-modal-footer {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--app-border);
}

.product-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.product-modal-header h2 {
    margin: 0;
    color: #4a3a35;
    font-size: 1rem;
    font-weight: 800;
}

.product-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border: 0;
    border-radius: .5rem;
    color: #82756f;
    background: transparent;
    cursor: pointer;
}

.product-modal-close:hover {
    color: #4a3a35;
    background: var(--app-coral-soft);
}

.product-validation {
    margin: 0 0 1rem;
    color: #a33e38;
    font-size: .82rem;
}

.product-modal-alerts {
    display: grid;
    gap: .75rem;
    margin-bottom: 1rem;
}

.product-modal .app-alert {
    width: 100%;
    max-width: none;
    margin: 0;
}

.product-modal-validation.validation-summary-valid {
    display: none;
}

.product-modal-validation ul,
.product-modal-validation li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.product-modal-validation li + li {
    margin-top: .35rem;
}

.product-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: .9rem;
    row-gap: 1rem;
}

.product-field {
    min-width: 0;
}

.product-field-full {
    grid-column: 1 / -1;
}

.typed-prices-list {
    margin: 0;
    padding: .75rem .9rem;
    list-style: none;
    border-radius: .65rem;
    color: var(--color-text);
    background: var(--app-input-bg-readonly);
    font-size: .82rem;
    line-height: 1.5;
}

.typed-prices-list li + li {
    margin-top: .35rem;
}

.typed-prices-scan {
    margin-top: .5rem;
    font-size: .9rem;
}

.product-price-label {
    display: block;
    margin-bottom: .25rem;
    color: var(--color-text-muted);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.config-hint {
    display: block;
    margin-top: .35rem;
    color: var(--app-muted);
    font-size: .75rem;
    line-height: 1.4;
}

.product-field label:not(.app-select-search) {
    display: block;
    margin-bottom: .45rem;
    color: var(--color-text);
    font-size: .82rem;
    font-weight: 800;
}

.product-field .app-select-search {
    display: flex;
    align-items: center;
    margin-bottom: .1rem;
    min-height: 0;
    font-weight: normal;
}

.product-input {
    display: block;
    width: 100%;
    min-height: 2.4rem;
    border: 1px solid var(--color-border);
    border-radius: .65rem;
    padding: .55rem .7rem;
    color: var(--color-text);
    background: var(--color-surface);
    font: inherit;
    font-size: .82rem;
    outline: none;
}

.product-input::placeholder {
    color: var(--color-text-muted);
}

.product-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 .18rem color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.product-input[readonly],
.product-input:read-only,
.product-input:disabled,
.product-input[disabled],
.form-control[readonly],
.form-control:read-only,
.form-control:disabled,
.form-select:disabled {
    color: var(--color-text-muted);
    background-color: var(--app-input-bg-readonly);
    border-color: var(--color-border);
    cursor: default;
    opacity: 1;
    box-shadow: none;
}

.product-input[readonly]:focus,
.product-input:disabled:focus,
.product-input[disabled]:focus,
.form-control[readonly]:focus,
.form-control:disabled:focus {
    border-color: var(--color-border);
    box-shadow: none;
}

.product-select-input {
    appearance: none;
    color: var(--color-text-muted);
    background-color: var(--app-input-bg-readonly);
    background-image: linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%), linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%);
    background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.product-textarea {
    min-height: 3.35rem;
    resize: vertical;
}

.product-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.product-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
}

.product-switch {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    color: var(--color-text);
    font-size: .86rem;
    font-weight: 600;
    cursor: pointer;
}

.product-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.product-switch-control {
    position: relative;
    width: 1.7rem;
    height: 1rem;
    border-radius: 999px;
    background: var(--color-border);
    transition: background .2s ease;
}

.product-switch-control::after {
    content: "";
    position: absolute;
    top: .15rem;
    left: .15rem;
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(47, 37, 31, .18);
    transition: transform .2s ease;
}

.product-switch input:checked + .product-switch-control {
    background: var(--app-coral);
}

.product-switch input:checked + .product-switch-control::after {
    transform: translateX(.7rem);
}

.product-form-card {
    width: calc(100% - 3.5rem);
    margin: 1.25rem auto 0;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #fff;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(76, 54, 45, .04);
}

.product-form-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.product-form-header h2 {
    margin: 0 0 .25rem;
    font-size: 1rem;
}

.product-form-header p {
    margin: 0;
    color: var(--app-muted);
    font-size: .85rem;
}

.product-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.product-form-grid label:not(.product-check) {
    display: block;
    margin-bottom: .45rem;
    font-weight: 700;
    font-size: .85rem;
}

.product-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
}

.product-form-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1rem;
}

.login-page {
    background:
        radial-gradient(circle at top left, rgba(232, 160, 149, .32), transparent 32rem),
        var(--app-bg);
}

.login-card {
    display: grid;
    grid-template-columns: minmax(280px, .85fr) minmax(320px, 1.15fr);
    width: min(100%, 1040px);
    overflow: hidden;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card > .col-12 {
    width: 100%;
}

.login-card > .login-hero,
.login-card > .bg-white {
    padding: clamp(1.5rem, 4vw, 3rem);
}

.login-hero {
    color: #5a3430;
    background: linear-gradient(135deg, #f0ada3 0%, #f7d7cf 100%);
}

.login-hero small,
.login-hero p {
    color: rgba(90, 52, 48, .72);
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    min-height: 2.6rem;
    border: 1px solid var(--color-border);
    border-radius: .85rem;
    padding: .55rem .8rem;
    color: var(--color-text);
    background: var(--color-surface);
    font: inherit;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--color-primary) 18%, transparent);
    outline: 0;
}

@media (max-width: 1199.98px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .product-filters,
    .product-form-grid,
    .product-modal-grid {
        grid-template-columns: 1fr;
    }

    .product-edit-modal .product-modal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .product-modal-actions {
        justify-content: stretch;
    }

    .product-modal-actions .app-button {
        flex: 1;
    }

    .products-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-shell {
        display: block;
    }

    .main-panel {
        width: 100%;
    }

    .page-content {
        padding: 1rem;
    }

    .quick-actions-grid,
    .crud-layout.page-content {
        grid-template-columns: 1fr;
    }

    .offcanvas .menu-content {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
    }

    .dashboard-content {
        padding-bottom: 5rem !important;
    }

    .stat-card {
        min-height: 98px;
    }
}

@media (max-width: 767.98px) {
    .login-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .stat-card,
    .welcome-card,
    .content-card,
    .product-row {
        border-radius: .9rem;
    }

    .product-list {
        max-height: none;
        overflow: visible;
    }

    .quick-action {
        min-height: 72px;
    }

    .login-card {
        border-radius: .95rem;
    }
}


/* Regalito Stock design system overrides */
:root {
    --bs-primary: var(--color-primary);
    --bs-secondary: var(--color-primary-soft);
    --bs-success: var(--color-success);
    --bs-warning: var(--color-warning);
    --bs-danger: var(--color-danger);
    --bs-body-bg: var(--color-bg);
    --bs-body-color: var(--color-text);
    --bs-border-color: var(--color-border);
    --bs-border-radius: .75rem;
    --bs-card-bg: var(--color-surface);
    --app-secondary: var(--color-primary-soft);
    --app-accent: var(--color-success-soft);
    --app-danger: var(--color-danger);
    --app-radius: .75rem;
}

html,
body {
    background: var(--app-bg);
    color: var(--app-text);
    font-size: 16px;
    line-height: 1.5;
}

body,
button,
input,
select,
textarea {
    font-family: var(--font-family-sans);
    font-weight: 400;
    line-height: 1.5;
}

h1,
h2,
h3,
h4,
.h1,
.h2,
.h3,
.h4,
h1.fw-bold,
h2.fw-bold,
h3.fw-bold,
h4.fw-bold,
.h1.fw-bold,
.h2.fw-bold,
.h3.fw-bold,
.h4.fw-bold {
    color: var(--app-text);
    font-weight: 500 !important;
    letter-spacing: -.01em;
}


h1[tabindex="-1"]:focus {
    outline: 0;
}

label,
.form-label,
button,
.btn,
.app-button {
    font-weight: 500 !important;
}

.app-shell,
.products-page,
.login-page {
    background: var(--app-bg);
}

.sidebar {
    width: var(--sidebar-width);
    flex-basis: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-sidebar-bg);
    border-right: 1px solid color-mix(in srgb, var(--color-sidebar-bg) 80%, #000);
    color: var(--color-sidebar-text);
    transition: width .22s ease, flex-basis .22s ease;
}

.sidebar .menu-content,
.sidebar .menu-footer {
    background: transparent;
    color: inherit;
}

.sidebar .text-secondary,
.sidebar .menu-footer .small {
    color: var(--color-sidebar-muted) !important;
}

.main-panel {
    width: calc(100% - var(--sidebar-width));
    background: var(--app-bg);
    transition: width .22s ease;
}

.brand-area,
.mobile-navbar,
.page-toolbar,
.products-header,
.workspace-header {
    min-height: 64px;
    background: var(--color-surface) !important;
    border-color: var(--app-border) !important;
}

.brand-icon,
.stat-icon {
    border-radius: .75rem;
    color: var(--color-primary-contrast);
    background: var(--color-sidebar-active-bg);
}

.sidebar .brand-icon {
    color: var(--color-sidebar-active-text);
}

.brand-text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.app-nav-link {
    position: relative;
    border-left: 3px solid transparent;
    border-radius: .75rem;
    color: var(--color-sidebar-text);
    font-weight: 400;
}

.app-nav-link i {
    color: var(--color-sidebar-muted);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.app-nav-link span {
    overflow: hidden;
    white-space: nowrap;
}

.app-nav-link:hover {
    background: color-mix(in srgb, var(--color-sidebar-active-bg) 45%, transparent);
    color: var(--color-sidebar-text);
}

.app-nav-link.active {
    border-left-color: transparent;
    background: var(--color-sidebar-active-bg);
    color: var(--color-sidebar-active-text);
}

.app-nav-link:hover i,
.app-nav-link.active i {
    color: inherit;
}

.offcanvas .menu-section-label {
    color: var(--color-text-muted);
}

.offcanvas .app-nav-link {
    border-left: 0;
    color: var(--color-text);
    font-weight: 600;
}

.offcanvas .app-nav-link i {
    color: var(--color-text-muted);
}

.offcanvas .app-nav-link:hover {
    background: var(--color-primary-soft);
    color: var(--color-text);
}

.offcanvas .app-nav-link:hover i {
    color: var(--color-primary);
}

.offcanvas .app-nav-link.active {
    background: var(--color-sidebar-active-bg);
    color: var(--color-sidebar-active-text);
    font-weight: 700;
}

.offcanvas .app-nav-link.active i {
    color: var(--color-sidebar-active-text);
}

.offcanvas .app-nav-link.disabled,
.offcanvas .app-nav-link.disabled i {
    color: var(--color-text-muted);
    opacity: .55;
}

.offcanvas .menu-footer {
    color: var(--color-text-muted);
}

.offcanvas .app-logout {
    color: var(--color-danger);
    font-weight: 600;
}

.offcanvas .app-logout:hover {
    color: var(--color-danger);
}

.page-content,
.page-toolbar > div {
    max-width: 1280px;
}

.page-content,
.product-list-card {
    padding: 2rem;
}

.crud-layout,
.page-toolbar + .alert,
.page-toolbar + .alert + .alert {
    margin: 1.5rem auto;
}

.welcome-card,
.content-card,
.stat-card,
.product-row,
.login-card,
.product-form-card {
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    background: #fff;
    box-shadow: none;
}

.welcome-card,
.content-card,
.product-form-card {
    padding: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
}

.stat-card p,
.products-header p,
.product-form-header p,
.product-empty,
.muted-cell,
.text-secondary {
    color: var(--app-muted) !important;
}

.stat-card p,
.product-field label:not(.app-select-search),
.product-form-grid label:not(.product-check),
.app-table thead th,
.products-table th {
    font-weight: 500;
}

.btn-primary,
.btn-primary-soft,
.quick-action-primary,
.app-button-primary {
    border: 1px solid var(--app-coral) !important;
    border-radius: .5rem !important;
    color: var(--app-text) !important;
    background: var(--app-coral) !important;
    box-shadow: none !important;
    padding: .625rem 1.25rem;
}

.btn-primary:hover,
.btn-primary-soft:hover,
.quick-action-primary:hover,
.app-button-primary:hover {
    border-color: var(--app-coral-dark) !important;
    background: var(--app-coral-dark) !important;
    color: var(--app-text) !important;
}

.btn-light,
.app-button-secondary,
.btn-outline-secondary {
    border: 1px solid var(--app-border) !important;
    border-radius: .5rem !important;
    color: var(--app-text) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.btn-light:hover,
.app-button-secondary:hover,
.btn-outline-secondary:hover {
    background: var(--app-soft) !important;
}

.btn-outline-danger,
.icon-action.danger {
    color: var(--app-danger) !important;
}

.app-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.35rem;
    border: 1px solid rgba(224, 119, 104, .28);
    border-radius: .5rem;
    padding: .45rem .75rem;
    color: var(--app-danger) !important;
    background: rgba(224, 119, 104, .08);
    font: inherit;
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.app-logout:hover,
.app-logout:focus {
    border-color: rgba(224, 119, 104, .42);
    color: #b04030 !important;
    background: #fde8e4;
    outline: 0;
}

.form-control,
.form-select,
.product-input,
.product-search,
.product-select {
    border: 1px solid var(--app-border);
    border-radius: .5rem;
    color: var(--app-text);
    background-color: var(--app-input-bg);
    font-weight: 400;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus,
.product-input:focus,
.product-search:focus-within,
.product-select:focus-within {
    border-color: var(--app-coral);
    box-shadow: 0 0 0 .2rem rgba(232, 165, 152, .25);
    outline: 0;
}

.form-control::placeholder,
.product-input::placeholder,
.product-search input::placeholder {
    color: var(--app-muted);
}

.product-modal .product-input[readonly],
.product-modal .product-input:read-only,
.product-modal .product-input:disabled,
.product-modal .product-input[disabled],
.crud-modal .product-input[readonly],
.crud-modal .product-input:read-only,
.crud-modal .product-input:disabled,
.crud-modal .product-input[disabled],
.product-input[readonly],
.product-input:read-only,
.product-input:disabled,
.product-input[disabled],
.form-control[readonly],
.form-control:read-only,
.form-control:disabled,
.form-select:disabled,
textarea.product-input[readonly],
textarea.product-input:read-only {
    color: var(--color-text-muted);
    background-color: var(--app-input-bg-readonly);
    border-color: var(--color-border);
    cursor: default;
    opacity: 1;
    box-shadow: none;
}

.product-modal .product-input[readonly]:focus,
.product-modal .product-input:read-only:focus,
.product-modal .product-input:disabled:focus,
.product-modal .product-input[disabled]:focus,
.crud-modal .product-input[readonly]:focus,
.crud-modal .product-input:read-only:focus,
.crud-modal .product-input:disabled:focus,
.crud-modal .product-input[disabled]:focus,
.product-input[readonly]:focus,
.product-input:read-only:focus,
.product-input:disabled:focus,
.product-input[disabled]:focus,
.form-control[readonly]:focus,
.form-control:read-only:focus,
.form-control:disabled:focus {
    border-color: var(--color-border);
    box-shadow: none;
}

.app-table,
.products-table {
    color: var(--app-text);
    font-size: .875rem;
}

.app-table thead th,
.products-table th {
    border-bottom: 1px solid var(--app-border);
    color: var(--color-text-muted);
    background: transparent;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.app-table tbody td,
.products-table td {
    border-bottom: 1px solid var(--app-border);
    background: #fff;
}

.app-table tbody tr:hover td,
.products-table tbody tr:hover,
.products-table tbody tr:hover td {
    background: var(--app-soft);
}

.products-table-wrap,
.table-wrapper.content-card {
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.status-badge {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: .125rem .625rem;
    font-size: .75rem;
    font-weight: 500;
}

.status-success {
    border-color: color-mix(in srgb, var(--color-success) 35%, transparent);
    color: var(--color-success);
    background: var(--color-success-soft);
}

.status-warning {
    border-color: color-mix(in srgb, var(--color-warning) 35%, transparent);
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.status-danger {
    border-color: color-mix(in srgb, var(--color-danger) 35%, transparent);
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.status-muted {
    border-color: var(--app-border);
    color: var(--app-muted);
    background: var(--app-soft);
}

.product-modal-backdrop {
    background: rgba(0, 0, 0, .3);
}

.product-modal,
.crud-modal {
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    background: var(--color-surface);
    box-shadow: 0 4px 24px rgba(47, 42, 56, .10);
    padding: 2rem;
}

.product-modal-header h2,
.product-form-header h2 {
    color: var(--app-text);
    font-size: 1.125rem;
    font-weight: 500;
}

.product-modal-close {
    color: var(--app-muted);
    background: transparent;
}

.product-modal-close:hover,
.icon-action:hover {
    color: var(--app-coral);
    background: var(--app-coral-soft);
}

.icon-action {
    color: var(--app-text);
    border-radius: .5rem;
}

.product-switch-control {
    background: var(--app-border);
}

.product-switch input:checked + .product-switch-control {
    background: var(--app-coral);
}

.login-hero {
    color: var(--app-text);
    background: var(--app-secondary);
}

.login-hero small,
.login-hero p {
    color: var(--app-muted);
}

@media (max-width: 991.98px) {
    .page-content,
    .product-list-card {
        padding: 1.5rem;
    }

    .roles-layout {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .roles-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    .roles-list-header {
        display: none;
    }

    .roles-list-item,
    .roles-list-item-actions {
        padding-inline: .85rem;
    }
}

.crud-filters {
    grid-template-columns: minmax(280px, 1fr) 190px;
}

.crud-filters .product-search:only-child {
    grid-column: 1 / -1;
}

.app-select {
    position: relative;
    width: 100%;
}

.app-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
    min-height: 2.4rem;
    border: 1px solid var(--app-border);
    border-radius: .5rem;
    padding: .55rem .7rem;
    color: var(--app-text);
    background: var(--app-input-bg);
    font: inherit;
    text-align: left;
    box-shadow: none;
}

.app-select-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-select-trigger i {
    color: var(--app-muted);
    font-size: 1rem;
    transition: transform .18s ease;
}

.app-select-trigger:disabled {
    color: var(--color-text-muted);
    background-color: var(--app-input-bg-readonly);
    border-color: var(--color-border);
    cursor: not-allowed;
    opacity: 1;
}

.app-select.is-open .app-select-trigger,
.app-select-trigger:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--color-primary) 18%, transparent);
    outline: 0;
}

.app-select.is-open .app-select-trigger i {
    transform: rotate(180deg);
}

.app-select-menu {
    position: absolute;
    z-index: 2100;
    inset-inline: 0;
    top: calc(100% + .35rem);
    display: grid;
    gap: .25rem;
    max-height: 16rem;
    overflow-y: auto;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    padding: .35rem;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

.app-select-search {
    display: flex;
    align-items: center;
    gap: .35rem;
    position: sticky;
    top: 0;
    z-index: 1;
    margin-bottom: .1rem;
    padding: .2rem .35rem;
    border: 1px solid var(--app-border);
    border-radius: .5rem;
    background: var(--app-input-bg);
}

.app-select-search i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--app-muted);
    font-size: .78rem;
    line-height: 1;
    flex-shrink: 0;
}

.app-select-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    padding: 0;
    color: var(--app-text);
    background: transparent;
    font: inherit;
    font-size: .8125rem;
    outline: 0;
}

.app-select-search input::placeholder {
    color: var(--app-muted);
}

.app-select-empty {
    padding: .45rem .55rem;
    color: var(--app-muted);
    font-size: .78rem;
}

.app-select-option {
    width: 100%;
    border: 0;
    border-radius: .5rem;
    padding: .55rem .65rem;
    color: var(--app-text);
    background: transparent;
    font: inherit;
    text-align: left;
}

.app-select-option:hover,
.app-select-option:focus,
.app-select-option.is-selected {
    background: var(--app-accent);
    outline: 0;
}

.product-select .app-select-trigger {
    min-height: auto;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.product-select .app-select-menu {
    min-width: 100%;
}

.app-select-option.is-disabled {
    color: var(--app-muted);
    cursor: default;
    font-size: .78rem;
    font-weight: 500;
    pointer-events: none;
}

.product-select .app-select-trigger span {
    max-width: 8rem;
}

/* Mobile layout refinements: keep desktop styles untouched and override the design-system layer above. */
@media (max-width: 767.98px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-shell {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .main-panel {
        display: block;
        width: 100% !important;
        min-width: 0;
    }

    .mobile-navbar {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 64px;
        gap: .75rem;
        padding-block: .5rem !important;
        padding-inline: 1rem !important;
    }

    .mobile-navbar > .mobile-navbar-context {
        min-width: 0;
    }

    .mobile-navbar .mobile-navbar-section-icon,
    .mobile-navbar .btn {
        flex: 0 0 auto;
    }

    .mobile-navbar .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
    }

    .page-toolbar {
        min-height: auto;
        padding: 1rem !important;
    }

    .page-content,
    .dashboard-content,
    .product-list-card {
        width: 100%;
        max-width: none;
        padding: 1rem;
    }

    .dashboard-content {
        padding-bottom: 2rem !important;
    }

    .products-page {
        width: 100%;
        min-height: calc(100dvh - 64px);
    }

    .products-header {
        align-items: stretch;
        flex-direction: column;
        min-height: auto;
        padding: 1rem;
    }

    .products-header > div,
    .products-header .app-button {
        width: 100%;
    }

    .products-header .app-button,
    .welcome-card .btn-primary-soft {
        min-height: 3rem;
    }

    .products-header h1,
    .page-toolbar h1 {
        font-size: 1.25rem;
        line-height: 1.2;
    }

    .welcome-card {
        align-items: stretch !important;
        width: 100%;
        padding: 1rem;
    }

    .welcome-card h2 {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .welcome-card .btn-primary-soft {
        width: 100%;
    }

    .dashboard-stats,
    .quick-actions-grid,
    .crud-layout.page-content,
    .product-filters,
    .product-form-grid,
    .product-modal-grid {
        grid-template-columns: 1fr !important;
    }

    .stat-card {
        min-height: auto;
        padding: 1rem;
    }

    .app-alert,
    .page-toolbar + .alert,
    .page-toolbar + .alert + .alert {
        width: calc(100% - 2rem);
        margin-inline: 1rem;
    }

    .product-list-card {
        margin: 0;
    }

    .product-filters {
        gap: .75rem;
        margin-bottom: 1rem;
    }

    .product-search,
    .product-select {
        width: 100%;
        min-height: 3rem;
        border-color: var(--app-border);
        background: #fff;
    }

    .product-select .app-select-trigger {
        min-height: 100%;
    }

    .product-select .app-select-trigger span {
        max-width: none;
    }

    .products-table-wrap {
        overflow: visible !important;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .products-table {
        display: block;
        width: 100%;
        min-width: 0;
        border-collapse: collapse;
        border-spacing: 0;
    }

    .products-table thead {
        display: none;
    }

    .products-table tbody,
    .products-table tr,
    .products-table td {
        display: block;
        width: 100%;
    }

    .products-table tbody {
        display: grid;
        gap: .85rem;
    }

    .products-table tbody tr {
        overflow: hidden;
        border: 1px solid var(--app-border);
        border-radius: .95rem;
        background: #fff;
        box-shadow: 0 10px 24px rgba(76, 54, 45, .05);
    }

    .products-table tbody tr:hover,
    .products-table tbody tr:hover td {
        background: #fff;
    }

    .products-table td {
        display: grid;
        grid-template-columns: minmax(6.75rem, 40%) minmax(0, 1fr);
        align-items: center;
        gap: .75rem;
        min-height: 2.9rem;
        padding: .7rem .85rem;
        border-bottom: 1px solid var(--app-border);
        background: #fff;
        white-space: normal;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .products-table td:last-child {
        border-bottom: 0;
    }

    .products-table td::before {
        content: attr(data-label);
        color: var(--app-muted);
        font-size: .72rem;
        font-weight: 700;
        letter-spacing: .04em;
        text-align: left;
        text-transform: uppercase;
    }

    .products-table .price-cell,
    .products-table .stock-cell {
        text-align: right;
    }

    .products-table .actions-cell {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: .55rem;
        flex-wrap: wrap;
    }

    .products-table .actions-cell::before {
        margin-right: auto;
    }

    .icon-action {
        width: 2.35rem;
        height: 2.35rem;
        border: 1px solid var(--color-border);
        background: var(--color-surface);
    }

    .product-modal-backdrop {
        align-items: flex-end;
        padding: .75rem;
    }

    .product-edit-modal-backdrop {
        align-items: flex-end;
        padding: .35rem .15rem .45rem;
    }

    .product-modal,
    .crud-modal {
        width: 100%;
        max-height: calc(100dvh - 1.5rem);
        border-radius: 1rem;
        padding: 1rem;
    }

    .product-edit-modal-backdrop .product-edit-modal {
        width: 100%;
        max-width: 100%;
        border-radius: .85rem;
        padding: .5rem .2rem .55rem;
    }

    .product-edit-modal .product-modal-grid {
        grid-template-columns: 1fr !important;
    }

    .product-edit-modal .product-calculated-prices-grid {
        grid-template-columns: 1fr;
    }

    .product-modal-header {
        margin-bottom: 1rem;
    }

    .product-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .product-modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .product-modal-actions .app-button {
        width: 100%;
    }

    .product-edit-modal {
        padding: .5rem .2rem .55rem;
        font-size: .78rem;
    }

    .product-edit-modal .product-modal-header {
        position: relative;
        justify-content: center;
        gap: .65rem;
        margin-bottom: .55rem;
        padding-inline: 1.35rem;
    }

    .product-edit-modal .product-modal-header h2 {
        font-size: .92rem;
        font-weight: 700;
        text-align: center;
    }

    .product-edit-modal .product-modal-close {
        position: absolute;
        left: 0;
        width: 1.65rem;
        height: 1.65rem;
        border-radius: .4rem;
    }

    .product-edit-modal .product-modal-close i {
        font-size: .8rem;
    }

    .product-edit-mobile-hero {
        display: flex;
        align-items: flex-start;
        gap: .55rem;
        margin-bottom: .55rem;
        padding: .55rem .5rem;
        border: 1px solid var(--color-border);
        border-radius: .75rem;
        background: var(--color-surface);
        box-shadow:
            0 2px 8px rgba(47, 42, 56, .06),
            0 1px 2px rgba(47, 42, 56, .04);
    }

    .product-edit-mobile-hero-thumb {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        flex-shrink: 0;
        border: 1px solid var(--color-border);
        border-radius: .5rem;
        overflow: hidden;
        background: var(--color-bg);
    }

    .product-edit-mobile-hero-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .product-edit-mobile-hero-thumb-placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        color: var(--color-text-muted);
        font-size: .95rem;
    }

    .product-edit-mobile-hero-content {
        flex: 1;
        min-width: 0;
    }

    .product-edit-mobile-hero-name {
        margin: 0;
        color: var(--color-text);
        font-size: .82rem;
        font-weight: 700;
        line-height: 1.25;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .product-edit-mobile-hero-meta {
        margin: .15rem 0 0;
        color: var(--color-text-muted);
        font-size: .66rem;
        line-height: 1.35;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .product-edit-mobile-hero-id {
        flex-shrink: 0;
        align-self: flex-start;
        padding: .2rem .45rem;
        border-radius: 999px;
        color: var(--color-primary);
        background: var(--color-primary-soft);
        font-size: .62rem;
        font-weight: 700;
        line-height: 1.2;
        white-space: nowrap;
    }

    .product-edit-modal .product-modal-alerts {
        gap: .5rem;
        margin-bottom: .65rem;
    }

    .product-edit-modal .product-modal-grid {
        display: flex;
        flex-direction: column;
        gap: .65rem;
    }

    .product-edit-section {
        display: block;
        border: 1px solid var(--color-border);
        border-radius: .75rem;
        background: var(--color-surface);
        box-shadow:
            0 2px 8px rgba(47, 42, 56, .06),
            0 1px 2px rgba(47, 42, 56, .04);
        overflow: visible;
    }

    .product-edit-section:has(.app-select.is-open) {
        position: relative;
        z-index: 30;
    }

    .product-edit-section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .5rem;
        width: 100%;
        padding: .55rem .5rem;
        border: 0;
        color: var(--color-text);
        background: transparent;
        font: inherit;
        text-align: left;
        cursor: pointer;
    }

    .product-edit-section-header-main {
        display: inline-flex;
        align-items: center;
        gap: .45rem;
        min-width: 0;
        font-size: .78rem;
        font-weight: 700;
    }

    .product-edit-section-header-main i {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.45rem;
        height: 1.45rem;
        border-radius: .4rem;
        color: var(--color-primary);
        background: var(--color-primary-soft);
        font-size: .75rem;
        flex-shrink: 0;
    }

    .product-edit-section-chevron {
        color: var(--color-text-muted);
        font-size: .72rem;
        transition: transform .2s ease;
        flex-shrink: 0;
    }

    .product-edit-section.is-expanded .product-edit-section-chevron {
        transform: rotate(180deg);
    }

    .product-edit-section.is-collapsed .product-edit-section-body {
        display: none;
    }

    .product-edit-section-body {
        display: block;
        padding: 0 .5rem .55rem;
        overflow: visible;
    }

    .product-edit-section-grid {
        display: grid;
        gap: .45rem;
        align-items: end;
    }

    .product-edit-section-grid--ident {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: .4rem;
    }

    .product-edit-section-grid--prices {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: .35rem;
    }

    .product-edit-section-grid--stock {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: .4rem;
    }

    .product-edit-section-grid--media {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-edit-section-grid .product-field-full {
        grid-column: 1 / -1;
    }

    .product-edit-section .product-calculated-prices {
        padding: 0;
        border: 0;
        background: transparent;
    }

    .product-edit-section .product-calculated-prices-header {
        display: none;
    }

    .product-edit-section .galeria-imagenes {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .product-edit-modal .product-field {
        display: flex;
        flex-direction: column;
        gap: .2rem;
        min-width: 0;
    }

    .product-edit-modal .product-edit-section-grid .product-field:not(.product-field-full) label:not(.app-select-search) {
        min-height: 2.15rem;
        display: flex;
        align-items: flex-end;
    }

    .product-edit-modal .product-field label:not(.app-select-search) {
        margin-bottom: 0;
        font-size: .7rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .product-edit-modal .product-field .app-select {
        width: 100%;
    }

    .product-edit-modal .product-field:has(.app-select.is-open) {
        position: relative;
        z-index: 31;
    }

    .product-edit-modal .product-field .app-select.is-open {
        z-index: 32;
    }

    .product-edit-modal .product-input,
    .product-edit-modal .product-field .app-select-trigger {
        width: 100%;
        min-height: 1.95rem;
        height: 1.95rem;
        padding: .3rem .5rem;
        border: 1px solid var(--color-border);
        border-radius: .5rem;
        background: var(--color-surface);
        box-sizing: border-box;
        font-size: .74rem;
        line-height: 1.25;
    }

    .product-edit-modal .product-field .app-select-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .35rem;
    }

    .product-edit-modal .app-select-trigger i {
        font-size: .78rem;
        flex-shrink: 0;
    }

    .product-edit-modal .product-textarea {
        min-height: 3.75rem;
        padding-top: .4rem;
        padding-bottom: .4rem;
    }

    .product-edit-modal .product-impuestos-button {
        min-height: 1.95rem;
        padding: .3rem .5rem;
        border-radius: .5rem;
        font-size: .74rem;
        font-weight: 600;
        gap: .5rem;
    }

    .product-edit-modal .product-impuestos-button-label {
        gap: .35rem;
    }

    .product-edit-modal .product-impuestos-button-label i {
        font-size: .78rem;
    }

    .product-edit-modal .product-impuestos-count {
        width: 1.2rem;
        height: 1.2rem;
        font-size: .62rem;
    }

    .product-edit-modal .product-calculated-prices {
        padding: .65rem .75rem;
        border-radius: .6rem;
    }

    .product-edit-modal .product-calculated-prices-header {
        gap: .5rem;
        margin-bottom: .55rem;
    }

    .product-edit-modal .product-calculated-prices-header label {
        font-size: .74rem;
    }

    .product-edit-modal .product-calculated-prices-count {
        font-size: .66rem;
    }

    .product-edit-modal .product-calculated-prices-grid {
        gap: .5rem;
    }

    .product-edit-modal .product-calculated-price-card {
        gap: .2rem;
        padding: .55rem .65rem;
        border-radius: .55rem;
    }

    .product-edit-modal .product-calculated-price-name {
        font-size: .72rem;
    }

    .product-edit-modal .product-calculated-price-badge {
        padding: .1rem .35rem;
        font-size: .58rem;
    }

    .product-edit-modal .product-calculated-price-amount {
        font-size: .88rem;
    }

    .product-edit-modal .product-calculated-price-meta {
        font-size: .66rem;
    }

    .product-edit-modal .product-switch {
        gap: .4rem;
        font-size: .74rem;
    }

    .product-edit-modal .product-switch-control {
        width: 1.45rem;
        height: .85rem;
    }

    .product-edit-modal .product-switch-control::after {
        top: .12rem;
        left: .12rem;
        width: .6rem;
        height: .6rem;
    }

    .product-edit-modal .product-switch input:checked + .product-switch-control::after {
        transform: translateX(.58rem);
    }

    .product-edit-modal .product-modal-footer {
        gap: .65rem;
        margin-top: .65rem;
        padding-top: .65rem;
    }

    .product-edit-modal .product-modal-actions {
        gap: .4rem;
    }

    .product-edit-modal .product-modal-actions .app-button {
        min-height: 2.1rem;
        padding: .4rem .65rem;
        font-size: .74rem;
    }

    .product-edit-modal .galeria-imagenes {
        gap: .65rem;
        margin-top: .65rem;
        padding-top: .65rem;
    }

    .product-edit-modal .galeria-imagenes-header h3 {
        font-size: .82rem;
    }

    .product-edit-modal .galeria-imagenes-contador {
        font-size: .7rem;
    }

    .product-edit-modal .galeria-dropzone-label {
        gap: .25rem;
        min-height: 5.5rem;
        padding: .75rem;
        font-size: .72rem;
    }

    .product-edit-modal .galeria-dropzone-label i {
        font-size: 1rem;
    }

    .product-edit-modal .galeria-dropzone-label small {
        font-size: .62rem;
        line-height: 1.35;
    }

    .product-edit-modal .galeria-empty {
        padding: .65rem;
        font-size: .72rem;
    }

    .product-edit-modal .galeria-preview-panel {
        padding: .65rem;
    }

    .product-edit-modal .galeria-preview-header {
        align-items: stretch;
        flex-direction: column;
        gap: .45rem;
        margin-bottom: .5rem;
    }

    .product-edit-modal .galeria-preview-header h4 {
        font-size: .72rem;
        font-weight: 700;
    }

    .product-edit-modal .galeria-preview-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .35rem;
        width: 100%;
    }

    .product-edit-modal .galeria-preview-actions .app-button {
        width: 100%;
        min-height: 1.85rem;
        padding: .28rem .4rem;
        font-size: .66rem;
        line-height: 1.2;
    }

    .product-edit-modal .galeria-preview-grid,
    .product-edit-modal .galeria-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .4rem;
    }

    .product-edit-modal .galeria-preview-card,
    .product-edit-modal .galeria-card {
        border-radius: .55rem;
    }

    .product-edit-modal .galeria-preview-card img,
    .product-edit-modal .galeria-card-image img {
        width: 100%;
        height: 4.75rem;
        aspect-ratio: auto;
        object-fit: cover;
    }

    .product-edit-modal .galeria-preview-meta {
        gap: .2rem;
        padding: .35rem .45rem;
    }

    .product-edit-modal .galeria-preview-nombre {
        font-size: .62rem;
    }

    .product-edit-modal .galeria-preview-estado {
        font-size: .6rem;
    }

    .product-edit-modal .galeria-card-actions {
        gap: .25rem;
        padding: .3rem;
    }

    .product-edit-modal .galeria-card-actions .app-button {
        min-width: 1.65rem;
        min-height: 1.65rem;
        padding: .2rem .35rem;
        font-size: .72rem;
    }

    .product-edit-modal .galeria-btn-icon {
        min-width: 1.65rem;
        padding: .2rem .35rem;
    }

    .product-edit-modal .galeria-badge-principal {
        top: .25rem;
        left: .25rem;
        padding: .1rem .35rem;
        font-size: .58rem;
    }

    .main-panel {
        padding-bottom: calc(3.75rem + env(safe-area-inset-bottom));
    }

    body:has(.offcanvas.show) .mobile-bottom-nav,
    body:has(.offcanvas.showing) .mobile-bottom-nav {
        display: none;
    }

    .mobile-bottom-nav {
        position: fixed;
        right: .6rem;
        bottom: .55rem;
        left: .6rem;
        z-index: 1040;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: center;
        min-height: 0;
        height: 2.85rem;
        padding: 0 .3rem calc(.22rem + env(safe-area-inset-bottom));
        border: 1px solid var(--app-border);
        border-radius: .95rem;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 10px 24px rgba(76, 54, 45, .11);
        backdrop-filter: blur(14px);
        overflow: visible;
    }

    .mobile-bottom-link,
    .mobile-bottom-scan {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: .05rem;
        min-width: 0;
        padding: 0;
        border: 0;
        color: var(--app-muted);
        background: transparent;
        font: inherit;
        font-size: .5625rem;
        font-weight: 600;
        line-height: 1;
        text-align: center;
        text-decoration: none;
    }

    .mobile-bottom-link i,
    .mobile-bottom-scan i {
        color: inherit;
        font-size: .9375rem;
        line-height: 1;
    }

    .mobile-bottom-link span,
    .mobile-bottom-scan span {
        overflow: hidden;
        max-width: 100%;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-bottom-link.active {
        color: var(--app-coral-dark);
    }

    .mobile-bottom-scan {
        align-self: start;
        width: 2.65rem;
        height: 2.65rem;
        margin: -.82rem auto 0;
        border: .18rem solid var(--app-bg);
        border-radius: 50%;
        color: #fff;
        background: var(--app-coral) !important;
        box-shadow: 0 6px 14px rgba(224, 144, 128, .24);
        gap: 0;
    }

    .mobile-bottom-scan i {
        font-size: .9375rem;
    }

    .mobile-bottom-scan span {
        font-size: .4375rem;
        line-height: 1;
    }
}

.galeria-imagenes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--app-border);
}

.galeria-imagenes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.galeria-imagenes-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.galeria-imagenes-contador {
    color: var(--app-muted);
    font-size: .85rem;
}

.galeria-dropzone {
    position: relative;
    border: 2px dashed var(--app-border);
    border-radius: var(--app-radius);
    background: var(--color-surface);
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
}

.galeria-dropzone-active {
    border-color: var(--app-coral);
    background: var(--app-coral-soft);
}

.galeria-dropzone-loading {
    border-color: var(--app-coral);
    background: var(--app-coral-soft);
}

.galeria-dropzone-loading .galeria-dropzone-label {
    opacity: .35;
}

.galeria-dropzone-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border-radius: inherit;
    background: rgba(255, 255, 255, .92);
    color: var(--app-text);
    font-size: .875rem;
    font-weight: 500;
    pointer-events: none;
}

.galeria-dropzone-overlay-hint {
    z-index: 1;
    background: rgba(232, 165, 152, .18);
    color: var(--app-coral-dark);
}

.galeria-dropzone-overlay-hint i {
    font-size: 1.5rem;
}

.galeria-dropzone-spinner {
    width: 1.75rem;
    height: 1.75rem;
    border: 3px solid var(--app-border);
    border-top-color: var(--app-coral);
    border-radius: 50%;
    animation: galeria-spin .8s linear infinite;
}

@keyframes galeria-spin {
    to {
        transform: rotate(360deg);
    }
}

.galeria-dropzone-loading .galeria-input-file {
    pointer-events: none;
}

.galeria-input-file {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.galeria-dropzone-label {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 8.5rem;
    padding: 1.25rem;
    text-align: center;
    pointer-events: none;
}

.galeria-dropzone-label i {
    font-size: 1.6rem;
    color: var(--app-coral-dark);
}

.galeria-dropzone-label small {
    color: var(--app-muted);
}

.galeria-preview-panel {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #fff;
    padding: 1rem;
}

.galeria-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .85rem;
}

.galeria-preview-header h4 {
    margin: 0;
    font-size: .95rem;
}

.galeria-preview-actions {
    display: flex;
    gap: .5rem;
}

.galeria-preview-grid,
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .75rem;
}

.galeria-preview-card,
.galeria-card {
    border: 1px solid var(--app-border);
    border-radius: .85rem;
    overflow: hidden;
    background: #fff;
}

.galeria-preview-card img,
.galeria-card-image img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--color-bg);
}

.galeria-preview-meta {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: .55rem .65rem;
}

.galeria-preview-nombre {
    overflow: hidden;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.galeria-preview-estado {
    color: var(--app-muted);
    font-size: .75rem;
}

.galeria-progress {
    overflow: hidden;
    height: .35rem;
    border-radius: 999px;
    background: var(--color-border);
}

.galeria-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: var(--app-coral);
    transition: width .2s ease;
}

.galeria-card-dragging {
    opacity: .55;
}

.galeria-card-drop-target {
    outline: 2px dashed var(--app-coral);
    outline-offset: -2px;
}

.galeria-card-image {
    position: relative;
}

.galeria-badge-principal {
    position: absolute;
    top: .45rem;
    left: .45rem;
    padding: .15rem .45rem;
    border-radius: 999px;
    color: #fff;
    font-size: .68rem;
    font-weight: 600;
    background: rgba(50, 43, 39, .78);
}

.galeria-card-actions {
    display: flex;
    justify-content: space-between;
    gap: .35rem;
    padding: .5rem;
}

.galeria-btn-icon {
    min-width: 2.2rem;
    padding: .35rem .55rem;
}

.galeria-btn-danger {
    color: #b42318;
}

.galeria-empty {
    padding: 1rem;
    border: 1px dashed var(--app-border);
    border-radius: var(--app-radius);
    color: var(--app-muted);
    text-align: center;
    background: var(--app-input-bg-readonly);
}

.galeria-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(47, 37, 31, .45);
}

.galeria-confirm-dialog {
    width: min(100%, 24rem);
    padding: 1.1rem;
    border-radius: var(--app-radius);
    background: #fff;
    box-shadow: 0 18px 40px rgba(47, 37, 31, .18);
}

.galeria-confirm-dialog h4 {
    margin: 0 0 .5rem;
}

.galeria-confirm-dialog p {
    margin: 0 0 1rem;
    color: var(--app-muted);
    font-size: .9rem;
}

.galeria-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}

.imagen-producto-visual {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: inherit;
    overflow: hidden;
    background: var(--color-bg);
    cursor: zoom-in;
}

.imagen-producto-visual img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.imagen-producto-visual-zoom {
    position: absolute;
    right: .45rem;
    bottom: .45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    color: #fff;
    font-size: .9rem;
    background: rgba(50, 43, 39, .72);
    opacity: 0;
    transition: opacity .2s ease;
}

.imagen-producto-visual:hover .imagen-producto-visual-zoom,
.imagen-producto-visual:focus-visible .imagen-producto-visual-zoom {
    opacity: 1;
}

.imagen-ampliada-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(26, 24, 23, .78);
}

.imagen-ampliada-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    width: min(100%, 56rem);
    max-height: calc(100vh - 2.5rem);
}

.imagen-ampliada-close {
    position: absolute;
    top: -.25rem;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(50, 43, 39, .65);
    cursor: pointer;
}

.imagen-ampliada-close:hover {
    background: rgba(50, 43, 39, .85);
}

.imagen-ampliada-img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 6rem);
    border-radius: .65rem;
    object-fit: contain;
    background: #fff;
}

.imagen-ampliada-caption {
    margin: 0;
    color: #fff;
    font-size: .85rem;
    text-align: center;
}

.galeria-vista {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    background: #fff;
}

.galeria-vista-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.galeria-vista-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.galeria-vista-contador {
    color: var(--app-muted);
    font-size: .82rem;
}

.galeria-vista-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}

.galeria-vista-item {
    border-radius: .65rem;
}

.galeria-vista-empty {
    padding: .75rem;
    border: 1px dashed var(--app-border);
    border-radius: var(--app-radius);
    color: var(--app-muted);
    text-align: center;
    background: var(--app-input-bg-readonly);
}

.galeria-vista-ver-mas {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.galeria-card-visual {
    border-radius: 0;
}

@media (max-width: 640px) {
    .galeria-vista-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .galeria-vista-grid {
        grid-template-columns: 1fr;
    }
}

.inventory-index {
    display: grid;
    padding: 1rem 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    background: var(--color-surface);
}

.inventory-index-row {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    min-height: 3.25rem;
    color: var(--app-text);
}

.inventory-index-row i {
    color: var(--app-text);
    font-size: 1.05rem;
    line-height: 1;
    text-align: center;
}

.inventory-index-row span {
    font-size: .9rem;
    line-height: 1.25;
}

.inventory-index-row strong {
    min-width: 3ch;
    color: var(--app-text);
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    line-height: 1;
    text-align: right;
}

@media (max-width: 640px) {
    .inventory-index {
        padding: .75rem 1rem;
    }

    .inventory-index-row {
        grid-template-columns: 1.35rem minmax(0, 1fr) auto;
        gap: .75rem;
        min-height: 3rem;
    }

    .inventory-index-row i {
        font-size: 1rem;
    }

    .inventory-index-row span {
        font-size: .85rem;
    }

    .inventory-index-row strong {
        font-size: 1.1rem;
    }
}

.importaciones-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.importacion-panel {
    display: grid;
    gap: 1rem;
}

.importacion-panel-header {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}

.importacion-panel-icon {
    display: inline-grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: .75rem;
    color: var(--app-text);
    background: var(--app-coral-soft);
    font-size: 1.1rem;
}

.importacion-actions {
    display: grid;
    gap: .65rem;
}

.importacion-upload {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    overflow: hidden;
    cursor: pointer;
}

.importacion-upload.is-disabled {
    opacity: .65;
    cursor: not-allowed;
}

.importacion-upload-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.importacion-upload.is-disabled .importacion-upload-input {
    cursor: not-allowed;
}

.importacion-upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    pointer-events: none;
}

.importacion-file-name {
    word-break: break-word;
}

.importacion-resultado {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.importacion-resultado .products-table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.importacion-resumen {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.importacion-resumen-item {
    display: grid;
    gap: .25rem;
    padding: .85rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.importacion-resumen-item:hover:not(:disabled) {
    border-color: var(--app-coral-dark);
}

.importacion-resumen-item.is-active {
    border-color: var(--app-coral-dark);
    box-shadow: 0 0 0 1px var(--app-coral-dark);
    background: var(--app-coral-soft);
}

.importacion-resumen-item:disabled {
    cursor: default;
    opacity: .55;
}

.importacion-filtro-activo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .5rem;
}

.importacion-filtro-limpiar {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--app-coral-dark);
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.importacion-resumen-item span {
    color: var(--app-muted);
    font-size: .82rem;
}

.importacion-resumen-item strong {
    font-size: 1.35rem;
    line-height: 1;
}

.importacion-resumen-error strong {
    color: #b64a4a;
}

.importaciones-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}

.importaciones-table th,
.importaciones-table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.importaciones-table th:nth-child(1),
.importaciones-table td:nth-child(1) {
    width: 4.5rem;
    white-space: nowrap;
}

.importaciones-table th:nth-child(2),
.importaciones-table td:nth-child(2) {
    width: 11%;
}

.importaciones-table th:nth-child(3),
.importaciones-table td:nth-child(3) {
    width: 9%;
}

.importaciones-table th:nth-child(4),
.importaciones-table td:nth-child(4) {
    width: 24%;
}

.importaciones-table th:nth-child(5),
.importaciones-table td:nth-child(5) {
    width: 6.5rem;
    white-space: nowrap;
}

.importaciones-table th:nth-child(6),
.importaciones-table td:nth-child(6) {
    width: 7.5rem;
    white-space: nowrap;
}

.importaciones-table th:nth-child(7),
.importaciones-table td:nth-child(7) {
    width: 28%;
    min-width: 0;
}

@media (max-width: 992px) {
    .importaciones-grid,
    .importacion-resumen {
        grid-template-columns: 1fr;
    }
}

.table-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
}

.table-pagination-size {
    min-width: 8rem;
}

.table-pagination .pagination-bar {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    flex: 1;
    justify-content: center;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-secondary, #6c757d);
    min-width: 8rem;
    text-align: center;
}

/* Collapsible sidebar (desktop) */
@media (min-width: 992px) {
    .sidebar.sidebar--collapsible {
        z-index: 1200;
    }

    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) {
        width: var(--sidebar-width-collapsed);
        flex-basis: var(--sidebar-width-collapsed);
    }

    .sidebar.sidebar--collapsible.is-pinned,
    .sidebar.sidebar--collapsible:hover,
    .sidebar.sidebar--collapsible:focus-within {
        width: var(--sidebar-width-expanded);
        flex-basis: var(--sidebar-width-expanded);
    }

    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .brand-text,
    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .app-nav-link span,
    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .menu-section-label,
    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .sidebar-pin-label,
    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .menu-footer .text-truncate,
    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .app-logout span,
    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .menu-footer .text-center {
        display: none;
    }

    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .menu-section-label {
        margin: 0;
        padding: 0;
        height: 0;
    }

    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .brand-area {
        justify-content: center;
        padding-inline: .5rem;
    }

    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .menu-nav-scroll {
        align-items: center;
        padding-inline: .35rem;
    }

    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .app-nav-link {
        justify-content: center;
        gap: 0;
        width: 2.5rem;
        min-width: 2.5rem;
        height: 2.5rem;
        min-height: 2.5rem;
        margin-inline: auto;
        padding: 0;
        border-left: 0;
        border-radius: .65rem;
    }

    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .app-nav-link i {
        width: auto;
        margin: 0;
        font-size: 1.15rem;
    }

    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .app-nav-link:hover {
        background: color-mix(in srgb, var(--color-sidebar-active-bg) 40%, transparent);
        color: var(--color-sidebar-text);
    }

    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .app-nav-link.active {
        background: var(--color-sidebar-active-bg);
        color: var(--color-sidebar-active-text);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-sidebar-active-text) 12%, transparent);
    }

    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .app-nav-link.active i,
    .sidebar.sidebar--collapsible:not(.is-pinned):not(:hover):not(:focus-within) .app-nav-link:hover i {
        color: inherit;
    }

    .main-panel {
        width: calc(100% - var(--sidebar-width-collapsed));
    }
}

.sidebar-pin-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--color-sidebar-text) 15%, transparent);
    border-radius: .65rem;
    padding: .45rem .65rem;
    color: var(--color-sidebar-muted);
    background: transparent;
    font: inherit;
    font-size: .78rem;
    cursor: pointer;
}

.sidebar-pin-btn:hover,
.sidebar-pin-btn.is-pinned {
    color: var(--color-sidebar-active-text);
    background: color-mix(in srgb, var(--color-sidebar-active-bg) 55%, transparent);
}

.menu-section-label {
    margin: .75rem 0 .35rem;
    padding-inline: .35rem;
    color: var(--color-sidebar-muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-logout {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 0;
    padding: 0;
    color: var(--color-sidebar-muted);
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.app-logout:hover {
    color: var(--color-sidebar-text);
}

/* Workspace header */
.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.workspace-header-eyebrow {
    margin: 0 0 .15rem;
    color: var(--color-text-muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.workspace-header-title {
    margin: 0;
    color: var(--color-text);
    font-size: 1.35rem;
    font-weight: 700;
}

.workspace-header-user {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

.workspace-header-avatar {
    display: inline-grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    border-radius: 999px;
    color: var(--color-success);
    background: var(--color-success-soft);
    font-size: .85rem;
    font-weight: 700;
}

.workspace-header-email {
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Filter and results cards */
.filter-card,
.results-card {
    border: 1px solid var(--color-border);
    border-radius: .85rem;
    background: var(--color-surface);
    box-shadow: 0 1px 2px rgba(47, 42, 56, .04);
}

.filter-card {
    padding: 1.25rem;
    margin-bottom: 0;
    overflow: visible;
}

.filter-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    overflow: visible;
}

.filter-card-grid-advanced {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.filter-card-grid-advanced-only {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 0;
    overflow: visible;
}

.filter-field label,
.filter-field-label {
    color: var(--color-text);
    font-size: .78rem;
    font-weight: 600;
}

.filter-field-control,
.filter-field .product-search {
    min-height: 2.65rem;
    border: 1px solid var(--color-border);
    border-radius: .55rem;
    background: var(--color-surface);
}

.filter-field .product-search,
.filter-field .product-select {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0 .75rem;
    color: var(--color-text-muted);
}

.filter-field .product-select {
    position: relative;
    gap: 0;
    padding: 0;
    overflow: visible;
}

.filter-field .product-select .app-select {
    width: 100%;
}

.filter-field .product-select .app-select.is-open {
    z-index: 2200;
}

.filter-field .product-select .app-select-trigger {
    min-height: 2.65rem;
    border: 0;
    border-radius: 0;
    padding: 0 .75rem;
    background: transparent;
    box-shadow: none;
}

.filter-field .product-select .app-select-trigger span {
    max-width: none;
}

.filter-field .product-search:focus-within,
.filter-field .product-select:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.filter-field .product-select .app-select.is-open .app-select-trigger,
.filter-field .product-select .app-select-trigger:focus {
    border: 0;
    box-shadow: none;
}

.filter-field .product-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    color: var(--color-text);
}

.filter-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.filter-card-toggle {
    border: 0;
    padding: 0;
    color: var(--color-primary);
    background: transparent;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}

.filter-card-toggle.has-expand-icon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
}

.filter-card-toggle-label {
    text-align: left;
}

.filter-card-toggle-icon {
    flex-shrink: 0;
    font-size: .875rem;
    line-height: 1;
}

.filter-card-meta {
    color: var(--color-primary);
    font-size: .78rem;
    font-weight: 600;
}

.results-card {
    padding: 1.25rem 1.25rem 1rem;
}

.results-card-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.results-card-eyebrow {
    margin: 0 0 .2rem;
    color: var(--color-primary);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.results-card-title {
    margin: 0;
    color: var(--color-text);
    font-size: 1.15rem;
    font-weight: 700;
}

.results-card-header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.results-card-meta {
    color: var(--color-text-muted);
    font-size: .82rem;
    white-space: nowrap;
}

.products-table th {
    color: var(--color-text-muted);
    background: transparent;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.products-table tbody tr:hover {
    background: var(--color-primary-soft);
}

.app-button-primary {
    border-color: var(--color-primary) !important;
    color: var(--color-primary-contrast) !important;
    background: var(--color-primary) !important;
}

.app-button-primary:hover {
    border-color: var(--color-primary-hover) !important;
    background: var(--color-primary-hover) !important;
}

@media (max-width: 991.98px) {
    .filter-card-grid {
        grid-template-columns: 1fr;
    }

    .workspace-header-email {
        display: none;
    }
}

/* Admin workspace — full width desktop layout */
@media (min-width: 992px) {
    .admin-desktop-panel.page-content {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
        background: var(--color-bg);
    }

    .admin-desktop-panel .workspace-header {
        width: 100%;
        margin: 0;
        border-top: 0;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
        padding: 1rem clamp(1.25rem, 2.5vw, 2rem);
        box-shadow: none;
    }

    .admin-workspace-body {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem clamp(1.25rem, 2.5vw, 2rem) 1.5rem;
    }

    .admin-workspace-body .filter-card,
    .admin-workspace-body .results-card {
        width: 100%;
        margin: 0;
        border: 1px solid var(--color-border);
        border-radius: 1rem;
        background: var(--color-surface);
        box-shadow:
            0 10px 28px rgba(47, 42, 56, .06),
            0 2px 8px rgba(47, 42, 56, .04);
        overflow: visible;
    }

    .admin-workspace-body .filter-card {
        padding: 1.25rem 1.5rem 1rem;
    }

    .admin-workspace-body .results-card {
        padding: 1.15rem 1.5rem 1.25rem;
    }

    .admin-workspace-body .products-table-wrap {
        width: 100%;
        max-width: none;
        margin-inline: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-workspace-body .products-table {
        width: 100%;
        min-width: 1060px;
    }

    .admin-workspace-body .products-table tbody tr + tr td {
        border-top: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
    }

    .admin-workspace-card,
    .admin-workspace-body .product-list-card,
    .admin-workspace-body .content-card:not(.importacion-resultado),
    .admin-workspace-body .price-adjust-card,
    .admin-workspace-body .print-qr-card,
    .admin-workspace-body .scan-card,
    .admin-workspace-body .simular-venta-top-card,
    .admin-workspace-body .simular-venta-cart-card,
    .admin-workspace-body .welcome-card {
        border: 1px solid var(--color-border);
        border-radius: 1rem;
        background: var(--color-surface);
        box-shadow:
            0 10px 28px rgba(47, 42, 56, .06),
            0 2px 8px rgba(47, 42, 56, .04);
        overflow: visible;
    }

    .admin-workspace-card,
    .admin-workspace-body .product-list-card,
    .admin-workspace-body .price-adjust-card,
    .admin-workspace-body .print-qr-card,
    .admin-workspace-body .scan-card,
    .admin-workspace-body .simular-venta-top-card,
    .admin-workspace-body .simular-venta-cart-card {
        padding: 1.25rem 1.5rem;
    }

    .admin-workspace-body .roles-layout,
    .admin-workspace-body .users-layout,
    .admin-workspace-body .print-qr-layout,
    .admin-workspace-body .price-adjust-layout,
    .admin-workspace-body .dtp-lab-grid,
    .admin-workspace-body .scan-qr-content,
    .admin-workspace-body .simular-venta-layout {
        padding: 0;
        gap: 1rem;
    }

    .admin-workspace-body .roles-layout {
        grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    }

    .admin-workspace-body .importaciones-grid {
        margin-bottom: 1rem;
    }

    .admin-workspace-body .price-adjust-banner {
        margin: 0 0 1rem;
        border-color: var(--color-border);
        background: var(--color-primary-soft);
        color: var(--color-text-muted);
    }

    .admin-workspace-body .inventory-index,
    .admin-workspace-body .recent-products-section {
        margin-bottom: 0;
    }
}

.admin-workspace-page .admin-workspace-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

@media (min-width: 992px) {
    .admin-workspace-page .admin-workspace-body {
        padding: 1.25rem clamp(1.25rem, 2.5vw, 2rem) 1.5rem;
    }
}
