:root {
    --app-bg: #fbf7f4;
    --app-border: #efe1d8;
    --app-text: #322b27;
    --app-muted: #82756f;
    --app-coral: #e8a095;
    --app-coral-dark: #c9796f;
    --app-coral-soft: #fff0ed;
    --app-radius: 1.05rem;
    --sidebar-width: 225px;
}

html,
body {
    min-height: 100%;
    width: 100%;
}

body {
    margin: 0;
    background: var(--app-bg);
    color: var(--app-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::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 {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.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;
    flex: 0 0 var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--app-border);
}

.main-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
}

.brand-area {
    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: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: 0 10px 30px rgba(76, 54, 45, .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: #e58f86;
    background: #fff0ed;
}

.icon-warning {
    color: #f3b55b;
    background: #fff8ea;
}

.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: #2f7668;
    background: #cbeee8;
}

.status-warning {
    color: #8a6422;
    background: #ffe9b6;
}

.status-danger {
    color: #a33e38;
    background: #ffd8d4;
}

.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(--app-muted);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    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;
    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;
}

.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: #7b706a;
    background: rgba(255, 255, 255, .52);
    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: #8e837d;
}

.product-select select {
    appearance: none;
    cursor: pointer;
}

.products-table-wrap {
    overflow: auto;
    border: 1px solid var(--app-border);
    border-radius: .8rem;
    background: #fff;
}

.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: #171412;
    background: #fff;
    font-size: .78rem;
    font-weight: 800;
    text-align: left;
}

.products-table tbody tr:last-child td {
    border-bottom: 0;
}

.products-table tbody tr:hover {
    background: #fffaf7;
}

.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;
    padding: 1.5rem;
}

.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-table tbody tr.is-selected td {
    background: var(--app-coral-soft);
}

.roles-select-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    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: var(--app-soft);
    cursor: pointer;
}

.roles-permission-option:hover {
    border-color: var(--app-coral);
    background: var(--app-coral-soft);
}

.roles-permission-option.is-disabled {
    color: var(--app-muted);
    background: #f8f2ee;
    cursor: not-allowed;
}

.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 #ead8cf;
    border-radius: .75rem;
    background: #fffaf7;
    box-shadow: 0 24px 70px rgba(47, 37, 31, .28);
    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-modal .product-textarea {
    min-height: 5.5rem;
}

.product-edit-modal .product-calculated-prices {
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    background: linear-gradient(180deg, var(--app-soft) 0%, #fff 100%);
}

.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(--app-border);
    border-radius: .75rem;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.product-edit-modal .product-calculated-price-card:hover {
    border-color: var(--app-coral);
    box-shadow: 0 8px 20px rgba(232, 165, 152, .12);
}

.product-edit-modal .product-calculated-price-card.is-best {
    border-color: var(--app-coral);
    background: var(--app-coral-soft);
}

.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: #fff;
    background: var(--app-coral);
    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-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-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: #4e403b;
    background: #f5ede6;
    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: #7b706a;
    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 {
    display: block;
    margin-bottom: .45rem;
    color: #4e403b;
    font-size: .82rem;
    font-weight: 800;
}

.product-input {
    display: block;
    width: 100%;
    min-height: 2.4rem;
    border: 1px solid transparent;
    border-radius: .65rem;
    padding: .55rem .7rem;
    color: var(--app-text);
    background: #fff;
    font: inherit;
    font-size: .82rem;
    outline: none;
}

.product-input::placeholder {
    color: #968a84;
}

.product-input:focus {
    border-color: var(--app-coral);
    box-shadow: 0 0 0 .18rem rgba(232, 160, 149, .25);
}

.product-input[readonly] {
    color: #7f746e;
    background: #fffaf7;
}

.product-select-input {
    appearance: none;
    color: #7f746e;
    background-image: linear-gradient(45deg, transparent 50%, #b3a7a1 50%), linear-gradient(135deg, #b3a7a1 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: #4a3a35;
    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: #e4d8d1;
    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 #dfd0c7;
    border-radius: .85rem;
    padding: .55rem .8rem;
    color: var(--app-text);
    background: #fff;
    font: inherit;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-coral);
    box-shadow: 0 0 0 .25rem rgba(232, 160, 149, .25);
    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 {
        min-height: 100%;
    }

    .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: #e8a598;
    --bs-secondary: #f4e4d7;
    --bs-success: #98c7c1;
    --bs-warning: #f7d9a7;
    --bs-danger: #e07768;
    --bs-body-bg: #fef9f6;
    --bs-body-color: #3d3935;
    --bs-border-color: #ebe2d9;
    --bs-border-radius: .75rem;
    --bs-card-bg: #ffffff;
    --app-bg: #fef9f6;
    --app-border: #ebe2d9;
    --app-text: #3d3935;
    --app-muted: #8a8176;
    --app-coral: #e8a598;
    --app-coral-dark: #e09080;
    --app-coral-soft: rgba(232, 165, 152, .12);
    --app-soft: #f7f0eb;
    --app-input-bg: #fafaf9;
    --app-secondary: #f4e4d7;
    --app-accent: #d9e7e5;
    --app-danger: #e07768;
    --app-radius: .75rem;
    --sidebar-width: 240px;
}

html,
body {
    background: var(--app-bg);
    color: var(--app-text);
    font-size: 16px;
    line-height: 1.5;
}

body,
button,
input,
select,
textarea {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    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);
    background: #fff;
    border-right: 1px solid var(--app-border);
}

.main-panel {
    width: calc(100% - var(--sidebar-width));
    background: var(--app-bg);
}

.brand-area,
.mobile-navbar,
.page-toolbar,
.products-header {
    min-height: 64px;
    background: #fff !important;
    border-color: var(--app-border) !important;
}

.brand-icon,
.stat-icon {
    border-radius: .75rem;
    color: var(--app-text);
    background: var(--app-coral-soft);
}

.app-nav-link {
    position: relative;
    border-left: 3px solid transparent;
    border-radius: .75rem;
    color: var(--app-text);
    font-weight: 400;
}

.app-nav-link i {
    color: var(--app-muted);
    font-size: 1.25rem;
}

.app-nav-link:hover {
    background: var(--app-bg);
    color: var(--app-text);
}

.app-nav-link.active {
    border-left-color: var(--app-coral);
    background: var(--app-coral-soft);
    color: var(--app-coral);
}

.app-nav-link:hover i,
.app-nav-link.active i {
    color: var(--app-coral);
}

.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,
.products-table-wrap,
.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,
.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);
}

.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(--app-muted);
    background: var(--app-soft);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.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: hidden auto;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
}

.status-badge {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: .125rem .625rem;
    font-size: .75rem;
    font-weight: 500;
}

.status-success {
    border-color: #98c7c1;
    color: #2d7a74;
    background: #d4edeb;
}

.status-warning {
    border-color: #f7d9a7;
    color: #8a6d1e;
    background: #fdf3dc;
}

.status-danger {
    border-color: #e8a598;
    color: #b04030;
    background: #fde8e4;
}

.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(--app-border);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .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;
    }
}

.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.is-open .app-select-trigger,
.app-select-trigger:focus {
    border-color: var(--app-coral);
    box-shadow: 0 0 0 .2rem rgba(232, 165, 152, .25);
    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-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-inline: 1rem !important;
    }

    .mobile-navbar > .d-flex {
        min-width: 0;
    }

    .mobile-navbar .brand-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(--app-border);
        background: #fffaf7;
    }

    .product-modal-backdrop {
        align-items: flex-end;
        padding: .75rem;
    }

    .product-modal,
    .crud-modal {
        width: 100%;
        max-height: calc(100dvh - 1.5rem);
        border-radius: 1rem;
        padding: 1rem;
    }

    .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%;
    }

    .main-panel {
        padding-bottom: calc(5.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: .75rem;
        bottom: .75rem;
        left: .75rem;
        z-index: 1040;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: end;
        min-height: 4.75rem;
        padding: .65rem .55rem calc(.55rem + env(safe-area-inset-bottom));
        border: 1px solid var(--app-border);
        border-radius: 1.35rem;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 16px 40px rgba(76, 54, 45, .14);
        backdrop-filter: blur(14px);
    }

    .mobile-bottom-link,
    .mobile-bottom-scan {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: .25rem;
        min-width: 0;
        border: 0;
        color: var(--app-muted);
        background: transparent;
        font: inherit;
        font-size: .7rem;
        font-weight: 600;
        line-height: 1.1;
        text-align: center;
        text-decoration: none;
    }

    .mobile-bottom-link i,
    .mobile-bottom-scan i {
        color: inherit;
        font-size: 1.25rem;
        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: 4.15rem;
        height: 4.15rem;
        margin: -1.85rem auto 0;
        border: .35rem solid var(--app-bg);
        border-radius: 50%;
        color: #fff;
        background: var(--app-coral) !important;
        box-shadow: 0 12px 24px rgba(224, 144, 128, .32);
        cursor: not-allowed;
        opacity: 1;
    }

    .mobile-bottom-scan i {
        font-size: 1.45rem;
    }

    .mobile-bottom-scan span {
        font-size: .62rem;
    }
}

.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: #fff;
    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: #faf6f3;
}

.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: #f1e4dc;
}

.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: #fff;
}

.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: #faf6f3;
    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;
    color: var(--app-muted);
    text-align: center;
}

.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;
    }
}

