:root {
    --font-sans: "Manrope", "Segoe UI", sans-serif;
    --font-heading: "Sora", "Manrope", sans-serif;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --radius-xl: 34px;
    --sidebar-width: 280px;
    --shadow-sm: 0 12px 28px rgba(78, 115, 154, 0.08);
    --shadow-md: 0 22px 48px rgba(78, 115, 154, 0.12);
    --shadow-lg: 0 34px 72px rgba(78, 115, 154, 0.16);
}

body.theme-light {
    --bg: #f8f4ec;
    --bg-soft: #edf3fb;
    --surface: rgba(255, 253, 248, 0.94);
    --surface-strong: #fffdfa;
    --surface-muted: #f3f7fc;
    --line: rgba(83, 116, 150, 0.14);
    --line-strong: rgba(83, 116, 150, 0.28);
    --text: #223244;
    --muted: #667a91;
    --accent: #6c8bad;
    --accent-soft: #e7eff9;
    --accent-strong: #336995;
    --success: #e3f1ec;
    --warning: #f1ecdf;
    --danger: #f6e1dc;
    --info: #e6eff9;
    --ok-text: #4a6b5d;
    --danger-text: #9b5f57;
}

body.theme-dark {
    --bg: #131a22;
    --bg-soft: #1b2632;
    --surface: rgba(23, 31, 40, 0.9);
    --surface-strong: #212d39;
    --surface-muted: #1a2430;
    --line: rgba(209, 227, 245, 0.12);
    --line-strong: rgba(209, 227, 245, 0.24);
    --text: #ecf4fb;
    --muted: #aabfd1;
    --accent: #b9d2ea;
    --accent-soft: rgba(81, 121, 161, 0.16);
    --accent-strong: #7fc0ff;
    --success: #243a32;
    --warning: #3b3728;
    --danger: #472f2f;
    --info: #22384c;
    --ok-text: #c8e4d8;
    --danger-text: #f4c7c0;
    --shadow-sm: 0 12px 24px rgba(3, 8, 14, 0.28);
    --shadow-md: 0 26px 52px rgba(3, 8, 14, 0.34);
    --shadow-lg: 0 38px 84px rgba(3, 8, 14, 0.4);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background:
        radial-gradient(circle at top left, rgba(128, 170, 214, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.72), transparent 22%),
        linear-gradient(180deg, var(--bg-soft), var(--bg));
    color: var(--text);
    font-family: var(--font-sans);
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
input,
select,
textarea {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-strong);
    color: var(--text);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.85rem 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 4px rgba(75, 126, 176, 0.12);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

label {
    font-size: 0.93rem;
    color: var(--muted);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(63, 104, 145, 0.14);
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.button-primary {
    background: linear-gradient(135deg, #45739d, var(--accent-strong));
    color: var(--surface-strong);
}

body.theme-dark .button-primary {
    color: #231d18;
}

.button-secondary {
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-color: var(--line);
}

.button-secondary:hover,
.button-ghost:hover {
    border-color: var(--line-strong);
}

.button-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--line);
}

.button-danger {
    background: var(--danger);
    color: var(--danger-text);
    border-color: transparent;
}

.button-small {
    min-height: 36px;
    padding: 0.5rem 0.8rem;
    font-size: 0.92rem;
}

.button-full {
    width: 100%;
}

.guest-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.auth-copy,
.auth-card,
.panel,
.metric-card,
.sidebar-card,
.flash {
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
}

.auth-copy,
.auth-card,
.panel {
    border-radius: var(--radius-xl);
    padding: 1.4rem;
}

.panel,
.metric-card,
.sidebar-card,
.entity-card,
.table-tile,
.order-card,
.division-card,
.kitchen-card {
    transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.panel:hover,
.metric-card:hover,
.entity-card:hover,
.table-tile:hover,
.order-card:hover,
.division-card:hover,
.kitchen-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--line-strong);
}

.login-shell {
    width: 100%;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(520px, 100%);
    padding: 2.1rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: var(--surface-strong);
    box-shadow: var(--shadow-lg);
}

.login-brand,
.login-copy {
    display: grid;
    gap: 0.5rem;
    justify-items: center;
    text-align: center;
}

.login-brand {
    margin-bottom: 1.5rem;
}

.login-mark {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    color: #fff;
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.login-brand strong {
    font-size: 1.65rem;
    font-family: var(--font-heading);
}

.login-brand span {
    color: var(--muted);
}

.login-copy h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.35rem);
    line-height: 1.1;
}

.login-form {
    margin-top: 1.5rem;
}

.auth-copy {
    display: grid;
    align-content: center;
    gap: 0.9rem;
    min-height: 420px;
}

.auth-copy h1,
.hero-panel h1,
.hero-highlight h2,
.panel h2,
.ticket-header h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1;
}

.auth-copy h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
}

.auth-badges,
.hero-actions,
.inline-actions,
.order-card-actions,
.action-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.hero-actions form,
.inline-actions form {
    display: inline-flex;
}

.action-grid > * {
    flex: 1 1 180px;
}

.soft-badge,
.status-pill,
.sidebar-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--muted);
    font-size: 0.88rem;
}

.app-frame {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1.2rem;
    border-right: 1px solid var(--line);
    background: rgba(249, 246, 239, 0.9);
    backdrop-filter: blur(18px);
    overflow: auto;
    box-shadow: inset -1px 0 0 rgba(83, 116, 150, 0.05);
}

body.theme-dark .app-sidebar {
    background: rgba(18, 26, 34, 0.88);
}

.sidebar-brand,
.sidebar-stack,
.sidebar-nav {
    display: grid;
    gap: 0.9rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.95rem;
}

.brand-seal {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    color: var(--surface-strong);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-heading);
    font-size: 1.7rem;
}

body.theme-dark .brand-seal {
    color: #261f19;
}

.brand-link strong {
    display: block;
    font-size: 1.36rem;
    font-family: var(--font-heading);
}

.brand-link small,
.muted-copy,
.inline-note,
.empty-state,
.auth-copy p,
.sidebar-card span,
.metric-card small,
.product-card-head span,
.order-card-body span,
.activity-row span,
.table-tile span,
.item-card-meta,
.item-card-top span,
.division-card span {
    color: var(--muted);
}

.sidebar-nav {
    margin-top: 1.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    color: var(--muted);
}

.nav-item.is-active,
.nav-item:hover {
    background: var(--accent-soft);
    color: var(--accent-strong);
    box-shadow: inset 0 0 0 1px var(--line);
}

.sidebar-card {
    border-radius: 22px;
    padding: 1rem;
}

.sidebar-label,
.eyebrow {
    margin: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
}

.sidebar-actions {
    display: grid;
    gap: 0.7rem;
}

.app-main {
    padding: 1.2rem;
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.flash {
    border-radius: 18px;
    padding: 0.9rem 1rem;
}

.flash-success {
    background: color-mix(in srgb, var(--success) 78%, var(--surface-strong) 22%);
}

.flash-error {
    background: color-mix(in srgb, var(--danger) 78%, var(--surface-strong) 22%);
}

.flash-info {
    background: color-mix(in srgb, var(--info) 78%, var(--surface-strong) 22%);
}

.page-hero,
.metric-grid,
.content-grid,
.flash-stack {
    margin-bottom: 1rem;
}

.hero-grid,
.layout-main,
.order-layout {
    display: grid;
    gap: 1rem;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
}

.hero-panel,
.hero-highlight,
.metric-card,
.table-tile,
.order-card,
.product-card,
.item-card,
.division-card,
.kitchen-card,
.activity-row,
.compact-product-card,
.user-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.hero-panel,
.hero-highlight {
    padding: 1.4rem;
}

.hero-panel h1 {
    font-size: clamp(1.9rem, 3.6vw, 3rem);
    line-height: 1.08;
}

.hero-highlight {
    display: grid;
    gap: 1rem;
}

.hero-metric-block strong {
    display: block;
    font-size: clamp(1.85rem, 3.5vw, 2.7rem);
    font-family: var(--font-heading);
}

.hero-mini-grid,
.metric-grid,
.product-meta-grid,
.split-label-grid,
.form-grid {
    display: grid;
    gap: 0.8rem;
}

.hero-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-mini-grid div,
.metric-card,
.product-meta-grid div {
    padding: 0.85rem;
    border-radius: 18px;
    background: var(--surface-muted);
}

.hero-mini-grid span,
.metric-card span,
.product-meta-grid span {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.hero-mini-grid strong,
.metric-card strong,
.product-meta-grid strong {
    font-size: 1.1rem;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.layout-main {
    grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.95fr);
}

.order-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.95fr);
}

.content-stack,
.form-stack {
    display: grid;
    gap: 1rem;
}

.module-shell {
    display: grid;
    gap: 1rem;
}

.module-shell.module-narrow {
    width: min(760px, 100%);
}

.module-bar {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(232, 240, 250, 0.75));
    box-shadow: var(--shadow-sm);
}

body.theme-dark .module-bar {
    background: linear-gradient(180deg, rgba(30, 45, 59, 0.7), rgba(24, 37, 48, 0.85));
}

.module-bar h1 {
    margin: 0.18rem 0 0;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-family: var(--font-heading);
}

.entity-list {
    display: grid;
    gap: 0.9rem;
}

.entity-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.95rem 1.05rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.entity-card-compact {
    grid-template-columns: 76px minmax(0, 1fr) auto;
}

.entity-media {
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 22px;
    background: var(--surface-muted);
}

.entity-media-small {
    width: 76px;
    height: 76px;
}

.entity-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.entity-main {
    display: grid;
    gap: 0.7rem;
    min-width: 0;
}

.entity-topline {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.entity-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.entity-metrics > div {
    min-width: 108px;
    padding: 0.7rem 0.8rem;
    border-radius: 18px;
    background: var(--surface-muted);
}

.entity-metrics span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.entity-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

.preview-card {
    max-width: 260px;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: var(--surface-muted);
}

.preview-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.product-card-body,
.item-card-body,
.kitchen-card-body {
    display: grid;
    gap: 0.9rem;
}

.panel-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-head h2 {
    margin: 0.15rem 0 0;
    font-size: 1.35rem;
}

.search-inline,
.inline-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}

.search-inline input {
    min-width: 220px;
}

.inline-filter > div,
.form-grid.two-up {
    display: grid;
    gap: 0.4rem;
}

.form-grid.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.checkbox-inline input {
    width: auto;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 20px;
    border: 1px solid var(--line);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.data-table th,
.data-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    background: var(--surface-muted);
}

.catalog-grid,
.table-grid,
.order-list,
.item-list,
.division-grid,
.user-grid,
.kitchen-queue,
.compact-product-grid {
    display: grid;
    gap: 1rem;
}

.catalog-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.table-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.order-list {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.item-list,
.kitchen-queue {
    grid-template-columns: 1fr;
}

.division-grid,
.user-grid,
.compact-product-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.table-tile,
.order-card,
.product-card,
.item-card,
.division-card,
.kitchen-card,
.compact-product-card,
.activity-row {
    padding: 1rem;
}

.table-tile-head,
.table-tile-body,
.order-card-top,
.order-card-body,
.order-card-foot,
.product-card-head,
.item-card-top,
.division-card-head,
.division-card-foot,
.kitchen-card-top,
.activity-row,
.compact-product-card {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
}

.table-tile,
.order-card,
.product-card,
.item-card,
.division-card,
.kitchen-card {
    display: grid;
    gap: 0.95rem;
}

.table-tile.table-open {
    border-color: rgba(79, 139, 96, 0.24);
}

.table-tile.table-busy {
    border-color: rgba(143, 112, 72, 0.24);
}

.delivery-state {
    font-size: 0.9rem;
    color: var(--muted);
}

.delivery-state.is-delivered {
    color: var(--ok-text);
}

.product-card-media,
.item-card-media,
.kitchen-card-media {
    overflow: hidden;
    border-radius: 22px;
    background: var(--surface-muted);
    aspect-ratio: 4 / 3;
}

.product-card-media img,
.item-card-media img,
.kitchen-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-placeholder {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.product-placeholder-large {
    width: 100%;
    height: 100%;
    min-height: 160px;
    font-size: 3rem;
}

.details-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-muted);
    overflow: hidden;
}

.details-card summary {
    cursor: pointer;
    padding: 0.95rem 1rem;
    list-style: none;
}

.details-card summary::-webkit-details-marker {
    display: none;
}

.details-card[open] summary {
    border-bottom: 1px solid var(--line);
}

.details-card form,
.details-card .form-stack {
    padding: 1rem;
}

.item-card {
    grid-template-columns: 140px minmax(0, 1fr);
}

.item-card-meta,
.kitchen-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.92rem;
}

.division-items,
.activity-list {
    display: grid;
    gap: 0.7rem;
}

.division-item-row,
.ticket-list-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.split-label-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.split-input {
    min-width: 74px;
    padding: 0.55rem 0.65rem;
}

.split-table input[readonly] {
    background: var(--surface-muted);
}

.activity-row {
    align-items: center;
    background: var(--surface-muted);
}

.compact-product-card {
    align-items: center;
}

.compact-product-card img {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    object-fit: cover;
}

.user-card summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.status-pill {
    min-height: 30px;
    font-size: 0.8rem;
}

.status-ok,
.status-entregado,
.status-pagada,
.status-disponible {
    background: var(--success);
    color: var(--ok-text);
}

.status-pendiente,
.status-abierta,
.status-ocupada,
.status-listo {
    background: var(--warning);
    color: var(--accent-strong);
}

.status-cancelada,
.status-cancelado {
    background: var(--danger);
    color: var(--danger-text);
}

.danger-panel {
    border-color: rgba(147, 75, 67, 0.18);
}

.kitchen-alert-banner {
    display: none;
}

.kitchen-alert-banner.is-visible {
    display: block;
    background: color-mix(in srgb, var(--warning) 78%, var(--surface-strong) 22%);
}

.empty-state-block {
    padding: 1.2rem 0;
}

@media (max-width: 1180px) {
    .metric-grid,
    .compact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .layout-main,
    .order-layout,
    .hero-grid,
    .auth-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .app-frame {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .sidebar-nav {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (max-width: 720px) {
    .app-main,
    .guest-main {
        padding: 1rem;
    }

    .metric-grid,
    .compact-grid,
    .hero-mini-grid,
    .form-grid.two-up,
    .split-label-grid {
        grid-template-columns: 1fr;
    }

    .item-card {
        grid-template-columns: 1fr;
    }

    .item-card-media,
    .kitchen-card-media {
        max-width: 100%;
    }

    .order-card-top,
    .order-card-body,
    .order-card-foot,
    .table-tile-head,
    .table-tile-body,
    .product-card-head,
    .division-card-head,
    .division-card-foot,
    .kitchen-card-top,
    .activity-row,
    .compact-product-card,
    .panel-head {
        flex-direction: column;
        align-items: start;
    }

    .button,
    .search-inline input {
        width: 100%;
    }
}
/* Contenedor del formulario interno */
.form-box {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    background: #ffffff;
    margin-top: 1.5rem;
}

/* Pestañas (Tabs) */
.login-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem; /* Extiende las pestañas a los bordes del box */
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn.active {
    background-color: #f0fdfa; /* Tono azul/celeste muy claro */
    color: #0284c7;
    border-bottom: 2px solid #0284c7;
}

/* Header de los labels (para alinear "Olvidó su contraseña" a la derecha) */
.label-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.forgot-link {
    color: #0284c7;
    font-size: 0.875rem;
    text-decoration: none;
}

.text-danger {
    color: #ef4444; /* Asterisco rojo */
}

/* Input con icono de ojo */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    width: 100%;
    padding-right: 2.5rem; /* Espacio para el icono */
}

.btn-icon.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
}

.kitchen-screen .kitchen-board {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface) 90%, #fff 10%), var(--surface)),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 31px,
            color-mix(in srgb, var(--line) 75%, transparent 25%) 31px,
            color-mix(in srgb, var(--line) 75%, transparent 25%) 32px
        );
}

.kitchen-screen .kitchen-queue {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.15rem;
}

.kitchen-ticket {
    display: grid;
    gap: 1rem;
    padding: 1.15rem;
    border: 1px solid color-mix(in srgb, var(--line) 78%, #fff 22%);
    border-radius: 24px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 92%, #fff 8%), var(--surface)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent);
    box-shadow: 0 16px 36px rgba(18, 26, 35, 0.08);
    position: relative;
    overflow: hidden;
}

.kitchen-ticket::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: linear-gradient(180deg, #d28d39, #c85639);
}

.kitchen-ticket-head,
.kitchen-ticket-ident,
.kitchen-ticket-status {
    display: flex;
    gap: 0.85rem;
}

.kitchen-ticket-head {
    justify-content: space-between;
    align-items: flex-start;
}

.kitchen-ticket-ident {
    min-width: 0;
    align-items: flex-start;
}

.kitchen-ticket-copy {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.kitchen-ticket-qty {
    display: grid;
    place-items: center;
    min-width: 68px;
    min-height: 68px;
    padding: 0.5rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #18334a, #2b5e88);
    color: #f3fbff;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.kitchen-ticket-title {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    line-height: 1.05;
    color: var(--text);
    letter-spacing: -0.03em;
}

.kitchen-ticket-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.kitchen-ticket-tag,
.kitchen-ticket-wait {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-muted) 82%, #fff 18%);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kitchen-ticket-status {
    flex-direction: column;
    align-items: flex-end;
}

.kitchen-ticket-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.kitchen-ticket-block,
.kitchen-ticket-notes {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface-muted) 82%, #fff 18%);
    padding: 0.85rem 0.95rem;
}

.kitchen-ticket-block strong,
.kitchen-ticket-notes p {
    color: var(--text);
    margin: 0;
}

.kitchen-ticket-notes {
    background:
        linear-gradient(180deg, rgba(210, 141, 57, 0.12), rgba(200, 86, 57, 0.08)),
        color-mix(in srgb, var(--surface-muted) 84%, #fff 16%);
    border-color: rgba(210, 141, 57, 0.22);
}

.kitchen-ticket-notes p {
    margin-top: 0.4rem;
    font-size: 1rem;
    line-height: 1.45;
}

.kitchen-ticket-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.kitchen-ticket-action {
    min-height: 48px;
    font-size: 1rem;
    font-weight: 700;
}

@media (max-width: 900px) {
    .kitchen-screen .kitchen-queue {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .kitchen-ticket-head,
    .kitchen-ticket-ident,
    .kitchen-ticket-status {
        flex-direction: column;
        align-items: stretch;
    }

    .kitchen-ticket-status {
        align-items: flex-start;
    }

    .kitchen-ticket-grid {
        grid-template-columns: 1fr;
    }
}
/* Importar la nueva fuente Inter desde Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Nueva tipografía limpia y estandarizada */
    --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: "Inter", system-ui, -apple-system, sans-serif;
    
    /* Mantengo tus radios y sombras intactos */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 20px; /* Reducido un poco para que no se vea tan redondo tipo móvil */
    --radius-xl: 24px;
    --sidebar-width: 280px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

/* Modificaciones estructurales para las tarjetas de métricas */
.metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}

.metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.metric-data {
    display: flex;
    flex-direction: column;
}

.metric-data span {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.metric-data strong {
    font-size: 1.4rem;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}

.metric-data small {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.2rem;
}

/* Ajustes visuales para listas y textos */
.text-success { color: #10b981; }
.text-danger { color: #ef4444; }

.eyebrow i {
    margin-right: 0.3rem;
    opacity: 0.8;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
}

.empty-state i {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.danger-panel {
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(254, 242, 242, 0.5);
}

.danger-row {
    background: #fff;
    border: 1px solid rgba(239, 68, 68, 0.1);
}

body.theme-dark .danger-panel {
    background: rgba(127, 29, 29, 0.1);
}
body.theme-dark .danger-row {
    background: rgba(127, 29, 29, 0.2);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Importar Inter si no lo has hecho */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Variables Base estilo Filament */
:root {
    --filament-bg: #f9fafb; /* Fondo gris claro */
    --filament-surface: #ffffff; /* Tarjetas blancas */
    --filament-border: #e5e7eb; /* Bordes muy sutiles */
    --filament-text: #111827; /* Texto principal oscuro */
    --filament-muted: #6b7280; /* Texto secundario */
    --filament-primary: #3b82f6; /* Azul o tu color de acento */
    --filament-success: #10b981;
    --filament-warning: #f59e0b;
    --filament-danger: #ef4444;
    --filament-radius: 0.5rem; /* 8px - Esquinas menos redondeadas */
    --filament-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

body {
    background-color: var(--filament-bg);
    color: var(--filament-text);
    font-family: 'Inter', sans-serif;
}

/* Utilidades rápidas */
.mb-6 { margin-bottom: 1.5rem; }
.mt-6 { margin-top: 1.5rem; }
.p-0 { padding: 0 !important; }
.p-6 { padding: 1.5rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--filament-muted); }
.text-success { color: var(--filament-success); }
.text-warning { color: var(--filament-warning); }
.text-danger { color: var(--filament-danger); }
.text-primary { color: var(--filament-primary); }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.border-b { border-bottom: 1px solid var(--filament-border); }
.text-right { text-align: right; }
.block { display: block; }

/* Estructura de Tarjetas (Paneles) */
.panel {
    background: var(--filament-surface);
    border: 1px solid var(--filament-border);
    border-radius: var(--filament-radius);
    box-shadow: var(--filament-shadow);
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--filament-text);
}

.panel-body {
    padding: 1.5rem;
}

/* Tarjeta de Bienvenida */
.welcome-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
}

.welcome-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    background-color: var(--filament-text);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
}

.welcome-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.welcome-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--filament-muted);
}

.logout-btn {
    border: 1px solid var(--filament-border);
    color: var(--filament-text);
}

/* Grid de Métricas Top */
.filament-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
}

.stat-label {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.stat-desc {
    margin: 0;
    font-size: 0.75rem;
}

/* Grid Principal (2 columnas) */
.filament-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Columna izquierda más ancha */
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .filament-content-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablas estilo Filament */
.filament-table {
    width: 100%;
    border-collapse: collapse;
}

.filament-table th {
    background-color: var(--filament-bg);
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--filament-muted);
    border-bottom: 1px solid var(--filament-border);
}

.filament-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--filament-border);
    vertical-align: middle;
}

.filament-table tr:last-child td {
    border-bottom: none;
}

/* Listas estilo Filament (Para sidebar derecho) */
.filament-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--filament-border);
}

.list-item:last-child {
    border-bottom: none;
}

.product-avatar {
    width: 32px;
    height: 32px;
    background-color: var(--filament-bg);
    border: 1px solid var(--filament-border);
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--filament-muted);
}

/* Badges de estado */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-abierta, .badge-pendiente { background-color: #fef3c7; color: #b45309; }
.badge-pagada, .badge-entregado { background-color: #d1fae5; color: #047857; }
.badge-cancelada { background-color: #fee2e2; color: #b91c1c; }

/* Panel de Peligro (Stock Crítico) */
.border-danger { border-color: #fca5a5; }
.bg-danger-light { background-color: #fef2f2; border-bottom-color: #fca5a5; }


/* =========================================
   LAYOUT BASE (ESTILO FILAMENT)
   ========================================= */

body.filament-body {
    display: flex;
    min-height: 100vh;
    background-color: var(--filament-bg); /* El fondo gris claro de la variable que creamos antes */
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: #111827;
    overflow-x: hidden;
}

/* --- SIDEBAR (Menú Lateral) --- */
.filament-sidebar {
    width: 260px;
    background-color: #f8f9fa; /* Un blanco/gris MUY sutil como en tu imagen */
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: fixed; /* Se queda quieto aunque bajes en la página */
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    overflow-y: auto; /* Por si hay muchas opciones y pantalla pequeña */
}

/* Cabecera del sidebar (Restobar) */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
}

.brand-avatar {
    width: 40px;
    height: 40px;
    background-color: #6366f1; /* Azul/Indigo de admin */
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.brand-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Badge de fecha */
.sidebar-date-badge {
    margin: 0 1.5rem 1rem 1.5rem;
    background-color: #eff6ff; /* Azul clarito */
    color: #3b82f6;
    padding: 0.5rem;
    border-radius: 20px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Lista de navegación */
.sidebar-nav {
    flex: 1;
    padding: 0 1rem;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: #f3f4f6;
    color: #111827;
}

/* El link activo (El estilo azul de Filament) */
.nav-link.is-active {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

/* Footer del Sidebar (Usuario) */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #ffffff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
}

.user-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.user-name {
    font-size: 0.875rem;
    color: #111827;
}

/* --- ÁREA PRINCIPAL (Main Content) --- */
.filament-main {
    flex: 1;
    margin-left: 260px; /* Deja el espacio exacto del sidebar */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    /* El padding ya se lo dimos al div .filament-dashboard en tu dashboard.html */
}

/* --- MENSAJES DE ALERTA FLASH --- */
.flash-container {
    padding: 1rem 1.5rem 0 1.5rem;
}

.flash-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flash-success { background-color: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background-color: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info { background-color: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
/* =========================================
   8. MODO OSCURO (DARK THEME FILAMENT)
   ========================================= */

body.theme-dark {
    --filament-bg: #111827;       /* Fondo general súper oscuro */
    --filament-surface: #1f2937;  /* Tarjetas gris oscuro */
    --filament-border: #374151;   /* Bordes tenues */
    --filament-text: #f9fafb;     /* Texto blanco/gris claro */
    --filament-muted: #9ca3af;    /* Texto secundario gris medio */
    
    /* Sombras más intensas para modo oscuro */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* 1. Forzar Fondo a Sidebar y Tarjeta de Bienvenida */
body.theme-dark .filament-sidebar,
body.theme-dark .sidebar-footer,
body.theme-dark .welcome-card,
body.theme-dark .panel {
    background-color: var(--filament-surface) !important;
    border-color: var(--filament-border) !important;
}

/* 2. Arreglar los parches blancos (Cabeceras, tablas y Alertas) */
body.theme-dark .bg-gray-50,
body.theme-dark .bg-gray-light,
body.theme-dark .filament-table th {
    background-color: #111827 !important; /* Gris más oscuro para contraste */
    color: var(--filament-muted) !important;
    border-color: var(--filament-border) !important;
}

body.theme-dark .bg-white {
    background-color: var(--filament-surface) !important;
}

/* 3. Textos que se quedaron negros */
body.theme-dark,
body.theme-dark .text-gray-800,
body.theme-dark .brand-title,
body.theme-dark .user-name {
    color: var(--filament-text) !important;
}

/* 4. Enlaces del Menú Lateral */
body.theme-dark .nav-link {
    color: var(--filament-muted);
}
body.theme-dark .nav-link:hover {
    background-color: var(--filament-border) !important;
    color: var(--filament-text);
}
body.theme-dark .nav-link.is-active {
    background-color: rgba(59, 130, 246, 0.15) !important; 
    color: #60a5fa !important; 
}
body.theme-dark .sidebar-date-badge {
    background-color: rgba(59, 130, 246, 0.15) !important; 
    color: #60a5fa !important; 
}

/* 5. Tablas y Bordes */
body.theme-dark .filament-table td,
body.theme-dark .list-item,
body.theme-dark .border-b {
    border-color: var(--filament-border) !important;
}
body.theme-dark .hover-row:hover {
    background-color: #374151 !important;
}

/* 6. Fondos de íconos (para que no brillen feo) */
body.theme-dark .bg-primary-light { background-color: rgba(59, 130, 246, 0.15) !important; }
body.theme-dark .bg-success-light { background-color: rgba(16, 185, 129, 0.15) !important; }
body.theme-dark .bg-warning-light { background-color: rgba(245, 158, 11, 0.15) !important; }
body.theme-dark .bg-danger-light,
body.theme-dark .bg-red-50 { background-color: rgba(239, 68, 68, 0.15) !important; }

/* 7. Bordes rebeldes */
body.theme-dark .border-gray-100,
body.theme-dark .border-gray-200,
body.theme-dark .border-red-100,
body.theme-dark .border-danger {
    border-color: var(--filament-border) !important;
}

body.theme-dark .quick-order-toolbar,
body.theme-dark .quick-order-summary,
body.theme-dark .quick-qty-button {
    background: #111827;
    border-color: var(--filament-border);
}

body.theme-dark .quick-search-field,
body.theme-dark .quick-category-tab,
body.theme-dark .quick-product-card,
body.theme-dark .quick-product-media {
    background: var(--filament-surface);
    border-color: var(--filament-border);
}

body.theme-dark .quick-category-tab.is-active {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(96, 165, 250, 0.42);
    color: #93c5fd;
}

body.theme-dark .quick-product-card.is-selected {
    border-color: #60a5fa;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

body.theme-dark .quick-qty-add {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(74, 222, 128, 0.36);
    color: #86efac;
}

/* =========================================
   10. AJUSTES DE CONSISTENCIA Y RESPONSIVE
   ========================================= */

body.guest-body.filament-body {
    display: block;
}

.filament-main {
    margin-left: 260px;
    padding: 1rem 1rem 2rem;
    box-sizing: border-box;
}

.content-wrapper {
    flex: 1;
}

.filament-dashboard {
    width: min(100%, 1480px);
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-actions,
.entity-actions,
.table-actions,
.form-footer-actions,
.sidebar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sidebar-actions {
    margin-top: 1rem;
    flex-direction: column;
}

.sidebar-action-button {
    justify-content: center;
    gap: 0.55rem;
}

.sidebar-close,
.mobile-nav-toggle {
    display: none;
}

.sidebar-close {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--muted);
}

.mobile-nav-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 60;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 45;
}

.flash-container {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 70;
    width: min(420px, calc(100vw - 1.5rem));
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.flash-message {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: start;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    margin-bottom: 0.8rem;
    pointer-events: auto;
}

.flash-icon {
    padding-top: 0.1rem;
}

.flash-copy {
    min-width: 0;
}

.flash-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.4);
    color: inherit;
}

.flash-message.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.confirm-modal[hidden] {
    display: none !important;
}

.payment-modal[hidden] {
    display: none !important;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.42);
}

.payment-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
}

.confirm-dialog {
    width: min(100%, 460px);
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 1.25rem;
}

.payment-dialog {
    width: min(100%, 480px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    padding: 1.25rem;
}

.confirm-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.payment-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.confirm-dialog-kicker {
    margin: 0 0 0.3rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-strong);
    font-weight: 700;
}

.payment-dialog-kicker {
    margin: 0 0 0.3rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-strong);
    font-weight: 800;
}

.confirm-dialog-title {
    margin: 0;
    font-size: 1.15rem;
}

.payment-dialog-title {
    margin: 0;
    font-size: 1.2rem;
}

.confirm-dialog-message {
    margin: 1rem 0 1.25rem;
    color: var(--muted);
    line-height: 1.55;
}

.confirm-quantity-field {
    display: grid;
    gap: 0.45rem;
    margin: 0 0 1.25rem;
}

.confirm-quantity-field[hidden] {
    display: none !important;
}

.confirm-quantity-field span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.confirm-quantity-field input {
    min-height: 50px;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--accent-strong);
}

.payment-dialog-message {
    min-height: 1.35rem;
    margin: 0.85rem 0 1rem;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.payment-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.confirm-dialog-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
    color: var(--muted);
}

.payment-dialog-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
    color: var(--muted);
}

.payment-summary,
.payment-change-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-muted);
}

.payment-summary span,
.payment-change-box span,
.payment-received-field span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.payment-summary strong,
.payment-change-box strong {
    color: var(--text);
    font-size: 1.45rem;
    font-weight: 900;
}

.payment-received-field {
    display: grid;
    gap: 0.45rem;
    margin: 0.8rem 0;
}

.payment-received-field[hidden] {
    display: none !important;
}

.payment-received-field input {
    min-height: 54px;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--accent-strong);
}

.payment-change-box {
    background: #ecfdf5;
    border-color: rgba(16, 185, 129, 0.32);
}

.payment-change-box strong {
    color: #047857;
}

.payment-change-box.is-warning {
    background: #fff7ed;
    border-color: #fdba74;
}

.payment-change-box.is-warning strong {
    color: #9a3412;
}

body.modal-open {
    overflow: hidden;
}

.inline-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.inline-alert[hidden] {
    display: none !important;
}

.inline-alert-warning {
    border-color: #fdba74;
    background: #fff7ed;
    color: #9a3412;
}

.inline-alert-info {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.table-badges {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
}

.badge-clean {
    background: #ecfeff;
    color: #155e75;
    border: 1px solid #a5f3fc;
}

.badge-dirty {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.order-item-main {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.order-item-copy {
    min-width: 0;
}

.order-item-thumb {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface-muted);
    overflow: hidden;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 700;
    flex-shrink: 0;
}

.order-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.action-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    flex-shrink: 0;
}

.quick-order-panel {
    overflow: visible;
}

.quick-order-head {
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-order-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.quick-order-toggle i {
    transition: transform 0.18s ease;
}

.quick-order-panel.is-collapsed .quick-order-content {
    display: none;
}

.quick-order-toolbar {
    display: grid;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--filament-border);
    background: #f8fafc;
}

.quick-search-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0 0.9rem;
    border: 1px solid var(--filament-border);
    border-radius: var(--filament-radius);
    background: #fff;
    color: var(--filament-muted);
}

.quick-search-field input {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0.65rem 0;
    box-shadow: none;
}

.quick-search-field input:focus {
    box-shadow: none;
}

.quick-category-tabs {
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.quick-category-tab {
    min-height: 38px;
    padding: 0.5rem 0.85rem;
    border-radius: var(--filament-radius);
    border: 1px solid var(--filament-border);
    background: #fff;
    color: var(--filament-muted);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 700;
}

.quick-category-tab.is-active {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.quick-order-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 1.25rem;
    align-items: start;
    padding: 1.25rem;
}

.quick-order-catalog,
.quick-order-category {
    display: grid;
    gap: 1rem;
}

.quick-category-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--filament-border);
}

.quick-category-title strong {
    display: block;
    font-size: 1rem;
}

.quick-category-title span {
    color: var(--filament-muted);
    font-size: 0.82rem;
}

.quick-category-title i {
    color: var(--filament-warning);
}

.quick-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 0.85rem;
}

.quick-product-card {
    display: grid;
    gap: 0.7rem;
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid var(--filament-border);
    border-radius: var(--filament-radius);
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.quick-product-card.is-selected {
    border-color: #60a5fa;
    box-shadow: 0 14px 28px rgba(59, 130, 246, 0.14);
    transform: translateY(-2px);
}

.quick-product-media {
    display: grid;
    place-items: center;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: var(--filament-radius);
    background: #eef2f7;
}

.quick-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quick-product-copy {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.65rem;
    min-height: 42px;
}

.quick-product-copy strong {
    min-width: 0;
    line-height: 1.25;
}

.quick-product-copy span {
    flex-shrink: 0;
    font-weight: 800;
    color: var(--filament-primary);
}

.quick-stock-pill {
    justify-self: start;
    padding: 0.28rem 0.55rem;
    border: 1px solid rgba(59, 130, 246, 0.24);
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 800;
}

.quick-stock-pill.is-low {
    border-color: #fdba74;
    background: #fff7ed;
    color: #9a3412;
}

.quick-stock-pill.is-empty {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.product-stock-alert {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    margin-top: 0.65rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid #fdba74;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.78rem;
    font-weight: 800;
}

.quick-product-controls {
    display: grid;
    grid-template-columns: 42px minmax(48px, 1fr) 42px;
    gap: 0.45rem;
    align-items: center;
}

.quick-qty-button {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--filament-radius);
    border: 1px solid var(--filament-border);
    background: #f8fafc;
    color: var(--filament-text);
    cursor: pointer;
}

.quick-qty-add {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.quick-qty-input {
    height: 42px;
    padding: 0.35rem;
    text-align: center;
    font-weight: 800;
}

.quick-note-input {
    min-height: 38px;
    padding: 0.55rem 0.7rem;
    font-size: 0.82rem;
}

.quick-product-card:not(.is-selected) .quick-note-input {
    opacity: 0.72;
}

.quick-order-summary {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--filament-border);
    border-radius: var(--filament-radius);
    background: #f8fafc;
}

.quick-order-summary strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.25rem;
}

.split-product-meta {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: var(--muted);
}

.split-config-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(241, 245, 249, 0.95));
}

.split-launch-card {
    display: grid;
    gap: 1rem;
    padding: 1.15rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
}

.split-launch-head,
.split-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.split-launch-copy {
    max-width: 680px;
}

.split-launch-title,
.split-table-title {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.split-launch-points,
.split-steps,
.split-person-grid {
    display: grid;
    gap: 0.85rem;
}

.split-launch-points,
.split-steps {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.split-person-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.split-launch-point,
.split-step,
.split-person-card {
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
}

.split-launch-point strong,
.split-step strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.split-launch-point span,
.split-step span {
    font-size: 0.84rem;
    color: var(--muted);
}

.split-person-card input {
    width: 100%;
}

.split-config-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.split-help {
    flex: 1;
    min-height: 44px;
}

.split-table-toolbar {
    margin-bottom: 0.8rem;
}

.split-table-wrap {
    border-radius: 22px;
}

.inline-alert-compact {
    padding: 0.75rem 0.9rem;
    font-size: 0.84rem;
    border-radius: 16px;
}

.split-qty-input {
    width: 3.4rem;
    min-height: 36px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.35rem 0.25rem;
    background: #fff;
    font-weight: 700;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.split-account-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.split-account-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.9rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.split-account-card.is-active {
    border-color: rgba(69, 115, 157, 0.45);
    box-shadow: 0 10px 22px rgba(69, 115, 157, 0.12);
    transform: translateY(-1px);
}

.split-account-select {
    width: 100%;
    border: 0;
    border-radius: 14px;
    background: var(--primary-light);
    color: var(--text);
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-align: left;
}

.split-account-name,
.split-account-total {
    font-weight: 800;
}

.split-account-total {
    color: var(--primary);
}

.split-account-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.split-account-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
}

.split-live-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.split-live-bar strong {
    display: block;
    color: var(--text);
    margin-top: 0.2rem;
}

.split-item-list {
    display: grid;
    gap: 0.85rem;
}

.split-item-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
}

.split-item-card.is-complete {
    border-color: rgba(16, 185, 129, 0.35);
}

.split-item-card.has-overflow {
    border-color: rgba(239, 68, 68, 0.45);
}

.split-item-main {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.split-item-main strong,
.split-item-main span {
    display: block;
}

.split-item-main span {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.split-item-count {
    min-width: 112px;
    text-align: right;
}

.split-item-count strong {
    color: var(--primary);
    font-size: 1.45rem;
    line-height: 1;
}

.split-assign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.7rem;
    padding: 0.9rem;
}

.split-assign-cell {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.split-assign-cell label {
    display: grid;
    place-items: center;
    gap: 0.3rem;
    min-width: 0;
}

.split-assign-cell label span {
    max-width: 100%;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.split-mini-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.split-plus-button {
    background: var(--filament-primary);
    color: #fff;
    border-color: var(--filament-primary);
    box-shadow: 0 10px 18px rgba(59, 130, 246, 0.22);
}

.split-mini-button:disabled,
.split-account-select:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.split-command-bar {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) repeat(3, minmax(130px, 1fr));
    gap: 0.75rem;
    align-items: end;
    padding: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.split-command-metric {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}

.split-command-metric span,
.split-account-stats-line {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.split-command-metric strong {
    display: block;
    color: var(--text);
    margin-top: 0.15rem;
}

.split-workbench {
    display: grid;
    grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.8fr);
    gap: 1rem;
    align-items: start;
}

.split-roster,
.split-board {
    display: grid;
    gap: 0.75rem;
}

.split-roster {
    position: sticky;
    top: 1rem;
}

.split-account-card {
    border-radius: 14px;
    padding: 0.7rem;
}

.split-account-select > span {
    min-width: 0;
}

.split-account-stats-line {
    margin-top: 0.25rem;
    text-transform: none;
}

.split-account-name-input {
    width: 100%;
    margin-top: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    font-size: 0.86rem;
}

.split-product-row {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(170px, 0.9fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
}

.split-product-row.is-complete {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(90deg, #ffffff, #f0fdf4);
}

.split-product-row.has-overflow {
    border-color: rgba(239, 68, 68, 0.45);
}

.split-product-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.split-product-info strong,
.split-product-info span {
    display: block;
}

.split-product-info strong {
    color: var(--text);
}

.split-product-info span {
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

.split-product-kind {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: var(--primary-light);
    flex-shrink: 0;
}

.split-product-progress {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.split-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.split-person-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 140px;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: #f8fafc;
    font-size: 0.75rem;
}

.split-person-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.split-person-chip b {
    color: var(--text);
}

.split-person-chip.is-active {
    border-color: rgba(69, 115, 157, 0.45);
    background: var(--primary-light);
    color: var(--primary);
}

.split-person-chip.has-qty {
    border-color: rgba(16, 185, 129, 0.32);
}

.split-pending-pill {
    justify-self: start;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.75rem;
    font-weight: 800;
}

.split-product-row.is-complete .split-pending-pill {
    background: #ecfdf5;
    color: #047857;
}

.split-active-controls {
    display: grid;
    grid-template-columns: minmax(44px, 1fr) minmax(54px, 0.8fr) minmax(44px, 1fr);
    gap: 0.55rem;
    align-items: center;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    padding-top: 0.65rem;
    border-top: 1px solid var(--line);
}

.split-active-count {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-weight: 900;
    color: var(--text);
}

.split-active-controls .split-mini-button {
    width: 100%;
    min-width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
}

.division-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.table-open-orders {
    display: grid;
    gap: 0.45rem;
}

.table-open-order {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    color: inherit;
    text-decoration: none;
}

.table-open-order strong,
.table-open-order span {
    display: block;
}

.table-open-order:hover {
    border-color: rgba(69, 115, 157, 0.35);
    background: #eff6ff;
}

.table-zone-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.table-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.table-tile-free {
    border-color: rgba(16, 185, 129, 0.28) !important;
}

.table-tile-occupied {
    border-color: rgba(239, 68, 68, 0.48) !important;
    box-shadow:
        inset 3px 0 0 rgba(239, 68, 68, 0.82),
        var(--app-shadow-soft, var(--shadow-sm)) !important;
}

.table-tile-dirty {
    border-color: rgba(245, 158, 11, 0.38) !important;
}

.entity-actions form,
.table-actions form,
.page-actions form {
    display: flex;
}

.guest-main {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.guest-main .content-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.login-shell {
    width: 100%;
    min-height: calc(100vh - 2.5rem);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(520px, 100%);
    margin: 0 auto;
}

.button-warning {
    background-color: var(--filament-warning) !important;
    color: white !important;
}

.button-success {
    background-color: var(--filament-success) !important;
    color: white !important;
}

.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.rounded { border-radius: 0.75rem; }
.rounded-md { border-radius: 0.9rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.border-0 { border: 0; }
.border-t { border-top: 1px solid var(--line); }
.border-info { border-color: #93c5fd !important; }
.border-warning { border-color: #fdba74 !important; }
.border-primary { border-color: rgba(69, 115, 157, 0.35) !important; }
.bg-info-light { background: #eff6ff !important; }
.bg-primary-light { background: #eff6ff !important; }
.bg-warning-light { background: #fff7ed !important; }
.bg-success-light { background: #ecfdf5 !important; }
.bg-danger-light { background: #fef2f2 !important; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.h-full { height: 100%; }
.object-cover { object-fit: cover; }
.shrink-0 { flex-shrink: 0; }
.block { display: block; }
.max-h-32 { max-height: 8rem; }
.max-w-\[120px\] { max-width: 120px; }
.min-w-\[120px\] { min-width: 120px; }
.text-\[10px\] { font-size: 10px; }

body.theme-dark .sidebar-close,
body.theme-dark .mobile-nav-toggle,
body.theme-dark .confirm-dialog,
body.theme-dark .payment-dialog,
body.theme-dark .payment-summary,
body.theme-dark .payment-change-box,
body.theme-dark .split-qty-input,
body.theme-dark .order-item-thumb,
body.theme-dark .inline-alert,
body.theme-dark .flash-close {
    background: var(--filament-surface) !important;
    color: var(--filament-text) !important;
    border-color: var(--filament-border) !important;
}

body.theme-dark .flash-message {
    background: var(--filament-surface) !important;
}

body.theme-dark .badge-clean {
    background: rgba(34, 211, 238, 0.12);
    color: #67e8f9;
    border-color: rgba(34, 211, 238, 0.35);
}

body.theme-dark .badge-dirty,
body.theme-dark .inline-alert-warning {
    background: rgba(251, 146, 60, 0.12);
    color: #fdba74;
    border-color: rgba(251, 146, 60, 0.3);
}

body.theme-dark .inline-alert-info {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

body.theme-dark .split-config-card {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.92), rgba(31, 41, 55, 0.96));
    border-color: var(--filament-border) !important;
}

body.theme-dark .split-launch-card,
body.theme-dark .split-launch-point,
body.theme-dark .split-step,
body.theme-dark .split-person-card,
body.theme-dark .split-account-card,
body.theme-dark .split-live-bar,
body.theme-dark .split-item-card,
body.theme-dark .split-assign-cell,
body.theme-dark .split-command-bar,
body.theme-dark .split-command-metric,
body.theme-dark .split-product-row,
body.theme-dark .split-active-count,
body.theme-dark .split-account-name-input,
body.theme-dark .table-open-order {
    background: rgba(17, 24, 39, 0.92);
    border-color: var(--filament-border) !important;
}

body.theme-dark .split-account-select,
body.theme-dark .split-item-main,
body.theme-dark .split-account-stats span,
body.theme-dark .split-product-kind,
body.theme-dark .split-person-chip {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--filament-border) !important;
}

body.theme-dark .split-product-row.is-complete {
    background: rgba(20, 83, 45, 0.18);
}

body.theme-dark .split-pending-pill {
    background: rgba(251, 146, 60, 0.12);
    color: #fdba74;
}

body.theme-dark .split-product-row.is-complete .split-pending-pill {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
}

body.theme-dark .split-mini-button {
    background: var(--filament-surface);
    border-color: var(--filament-border);
}

body.theme-dark .split-plus-button {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

body.theme-dark .login-card,
body.theme-dark .form-box,
body.theme-dark .login-tabs {
    background-color: var(--filament-surface) !important;
    border-color: var(--filament-border) !important;
}

body.theme-dark .tab-btn {
    color: var(--filament-muted) !important;
}

body.theme-dark .tab-btn.active {
    color: #93c5fd !important;
    background: rgba(59, 130, 246, 0.12) !important;
}

@media (max-width: 1200px) {
    .entity-card,
    .entity-card-compact {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .entity-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .flash-container {
        right: 0.75rem;
        bottom: 0.75rem;
        width: min(380px, calc(100vw - 1.25rem));
    }
}

@media (max-width: 1024px) {
    .mobile-nav-toggle,
    .sidebar-close {
        display: inline-flex;
    }

    .filament-sidebar {
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        z-index: 50;
    }

    body.sidebar-open .filament-sidebar {
        transform: translateX(0);
    }

    .filament-main {
        margin-left: 0;
        padding-top: 4rem;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-actions {
        width: 100%;
    }

    .quick-order-shell {
        grid-template-columns: 1fr;
    }

    .quick-order-summary {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
    }

    .quick-order-summary .button {
        min-width: 0;
    }

    .split-live-bar {
        grid-template-columns: 1fr;
    }

    .split-command-bar,
    .split-workbench,
    .split-product-row {
        grid-template-columns: 1fr;
    }

    .split-roster {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .split-active-controls {
        justify-content: stretch;
        justify-self: stretch;
    }
}

@media (max-width: 768px) {
    .filament-main {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .page-actions,
    .entity-actions,
    .table-actions,
    .form-footer,
    .form-footer-actions,
    .order-item-row,
    .order-item-main,
    .action-stack,
    .split-config-top,
    .split-launch-head,
    .split-table-toolbar {
        width: 100%;
    }

    .order-item-row,
    .order-item-main,
    .form-footer,
    .split-config-top,
    .split-launch-head,
    .split-table-toolbar,
    .split-item-main {
        flex-direction: column;
        align-items: stretch;
    }

    .split-item-count {
        text-align: left;
    }

    .split-roster {
        grid-template-columns: 1fr;
    }

    .action-stack,
    .entity-actions,
    .table-actions {
        align-items: stretch;
    }

    .table-badges {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .flash-container {
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        bottom: 0.75rem;
    }

    .entity-card,
    .entity-card-compact {
        grid-template-columns: 1fr;
    }

    .entity-media,
    .entity-media-small {
        width: 100%;
        height: 180px;
    }

    .sm\:flex-row,
    .md\:flex-row {
        flex-direction: column;
    }

    .sm\:grid-cols-2,
    .md\:grid-cols-4,
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 1.35rem;
    }

    .quick-order-toolbar,
    .quick-order-shell {
        padding: 0.9rem;
    }

    .quick-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .quick-product-copy {
        flex-direction: column;
        gap: 0.3rem;
    }

    .quick-order-summary {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   9. UTILIDADES EXTRA DE LAYOUT (FLEX & GRID)
   ========================================= */

/* Grid responsivo para las mesas */
.grid-mesas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
}

/* Clases de utilidad Tailwind-like que usamos en los HTML */
.flex-col { flex-direction: column; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.flex-1 { flex: 1; }

.w-full { width: 100%; }
.max-w-2xl { max-width: 42rem; } /* Limita el ancho del formulario */

.min-h-\[50px\] { min-height: 50px; }
.mt-auto { margin-top: auto; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-5 { padding-top: 1.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }

.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }

/* Asegurar compatibilidad de inputs dentro de modo oscuro */
body.theme-dark input, 
body.theme-dark select {
    background-color: #111827;
    color: var(--filament-text);
    border-color: var(--filament-border);
}

/* Colores puros para botones de acción directa */
.button-success { background-color: var(--filament-success) !important; color: white !important; }
.button-warning { background-color: var(--filament-warning) !important; color: white !important; }

/* Utilidades de Tailwind para el detalle de la orden */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-5 { width: 1.25rem; }
.h-\[42px\] { height: 42px; }
.h-\[44px\] { height: 44px; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sm\:flex-col { flex-direction: column; }
.sm\:flex-row { flex-direction: row; }
.max-w-xs { max-width: 20rem; }

/* =========================================
   11. REFINAMIENTO VISUAL GLOBAL
   ========================================= */

body.theme-light {
    --app-bg: #f4f7fb;
    --app-bg-end: #fbfaf7;
    --app-sidebar: rgba(255, 255, 255, 0.82);
    --app-sidebar-strong: rgba(255, 255, 255, 0.94);
    --app-surface: rgba(255, 255, 255, 0.92);
    --app-surface-solid: #ffffff;
    --app-surface-muted: #f6f8fb;
    --app-border: rgba(15, 23, 42, 0.09);
    --app-border-strong: rgba(15, 23, 42, 0.15);
    --app-text: #101827;
    --app-muted: #64748b;
    --app-primary: #2f6fa7;
    --app-primary-soft: #eaf4ff;
    --app-accent: #6d5df6;
    --app-shadow: 0 18px 48px rgba(44, 62, 88, 0.10);
    --app-shadow-soft: 0 8px 24px rgba(44, 62, 88, 0.08);
}

body.theme-dark {
    --app-bg: #0e1721;
    --app-bg-end: #111922;
    --app-sidebar: rgba(20, 30, 42, 0.92);
    --app-sidebar-strong: rgba(24, 35, 49, 0.96);
    --app-surface: rgba(30, 42, 57, 0.88);
    --app-surface-solid: #1c2938;
    --app-surface-muted: #121d29;
    --app-border: rgba(203, 213, 225, 0.13);
    --app-border-strong: rgba(203, 213, 225, 0.22);
    --app-text: #eef5ff;
    --app-muted: #9fb1c5;
    --app-primary: #7bbcff;
    --app-primary-soft: rgba(79, 142, 205, 0.18);
    --app-accent: #9f94ff;
    --app-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
    --app-shadow-soft: 0 10px 32px rgba(0, 0, 0, 0.24);
}

body.filament-body {
    background:
        radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--app-primary) 14%, transparent), transparent 26rem),
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--app-accent) 10%, transparent), transparent 30rem),
        linear-gradient(145deg, var(--app-bg), var(--app-bg-end));
    color: var(--app-text);
}

body.theme-dark.filament-body {
    background:
        radial-gradient(circle at 10% -6%, rgba(89, 151, 210, 0.20), transparent 28rem),
        radial-gradient(circle at 92% 12%, rgba(149, 133, 255, 0.14), transparent 34rem),
        linear-gradient(145deg, var(--app-bg), var(--app-bg-end));
}

.filament-sidebar {
    width: var(--sidebar-width);
    background:
        linear-gradient(180deg, var(--app-sidebar-strong), var(--app-sidebar)),
        var(--app-sidebar);
    border-right: 1px solid var(--app-border);
    box-shadow: 14px 0 42px rgba(15, 23, 42, 0.05);
    padding: 1.15rem 0.85rem;
    gap: 0.8rem;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--app-primary) 45%, transparent) transparent;
}

body.theme-dark .filament-sidebar {
    background:
        linear-gradient(180deg, rgba(29, 42, 58, 0.96), rgba(17, 27, 39, 0.96)),
        var(--app-sidebar);
    border-right-color: var(--app-border);
    box-shadow: 16px 0 50px rgba(0, 0, 0, 0.22);
}

.sidebar-header {
    padding: 0.25rem 0.35rem 0.85rem;
    border-bottom: 0 !important;
}

.brand-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6d5df6, #2f8ee8);
    box-shadow: 0 12px 22px rgba(79, 70, 229, 0.22);
}

.brand-title,
.user-name,
.panel-title,
.welcome-title,
.stat-value {
    color: var(--app-text) !important;
}

.brand-subtitle,
.text-muted,
.welcome-subtitle,
.stat-label,
.stat-desc,
.user-label {
    color: var(--app-muted) !important;
}

.sidebar-date-badge {
    position: relative;
    margin: 0.15rem 0.35rem 1rem;
    padding: 0.58rem 0.85rem;
    border-radius: 14px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--app-primary) 15%, transparent), color-mix(in srgb, var(--app-accent) 10%, transparent)),
        var(--app-primary-soft);
    border: 1px solid color-mix(in srgb, var(--app-primary) 18%, transparent);
    color: var(--app-primary) !important;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), var(--app-shadow-soft);
}

.sidebar-date-badge::before {
    content: "";
    position: absolute;
    inset: -8px 12%;
    z-index: -1;
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-primary) 14%, transparent);
    filter: blur(12px);
    opacity: 0.7;
}

.sidebar-nav {
    padding: 0;
}

.nav-list {
    gap: 0.35rem;
}

.nav-link {
    min-height: 42px;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    color: color-mix(in srgb, var(--app-text) 72%, var(--app-muted));
    border: 1px solid transparent;
}

.nav-link:hover {
    background: color-mix(in srgb, var(--app-primary) 9%, transparent) !important;
    color: var(--app-text) !important;
    border-color: color-mix(in srgb, var(--app-primary) 12%, transparent);
}

.nav-link.is-active {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--app-primary) 22%, transparent), color-mix(in srgb, var(--app-accent) 10%, transparent)) !important;
    color: var(--app-primary) !important;
    border-color: color-mix(in srgb, var(--app-primary) 16%, transparent);
    box-shadow: inset 3px 0 0 var(--app-primary), 0 10px 24px color-mix(in srgb, var(--app-primary) 13%, transparent);
}

.sidebar-footer {
    margin: auto 0 0;
    padding: 1rem;
    border: 1px solid var(--app-border) !important;
    border-radius: 18px;
    background: var(--app-sidebar-strong) !important;
    box-shadow: var(--app-shadow-soft);
}

.sidebar-footer .bg-gray-50 {
    border-radius: 13px !important;
    background: var(--app-surface-muted) !important;
    border-color: var(--app-border) !important;
}

.filament-main {
    margin-left: var(--sidebar-width);
    padding: 2rem 1.75rem 2.5rem;
}

.filament-dashboard {
    width: min(100%, 1540px);
}

.panel,
.welcome-card,
.stat-card,
.entity-card,
.table-tile,
.order-card,
.compact-product-card,
.kitchen-ticket,
.split-config-card,
.split-launch-card {
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 14px !important;
    box-shadow: var(--app-shadow-soft) !important;
    backdrop-filter: blur(18px);
}

.panel:hover,
.welcome-card:hover,
.stat-card:hover,
.entity-card:hover,
.table-tile:hover,
.order-card:hover {
    transform: translateY(-2px);
    border-color: var(--app-border-strong) !important;
    box-shadow: var(--app-shadow) !important;
}

.panel-header {
    background: transparent !important;
    border-bottom-color: var(--app-border) !important;
}

.panel-header.bg-gray-50,
.bg-gray-50,
.bg-gray-light {
    background: var(--app-surface-muted) !important;
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: none;
    display: none;
}

.stat-card > * {
    position: relative;
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    border-radius: 12px;
    border: 1px solid var(--app-border, rgba(15, 23, 42, 0.09));
    font-size: 1rem;
    line-height: 1;
    box-shadow: none !important;
}

.panel > .panel-header.bg-gray-50,
.panel > .panel-header.bg-danger-light,
.panel > .panel-header.bg-primary-light {
    margin: 0.75rem 0.75rem 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--app-border) !important;
    border-radius: 12px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--app-surface-solid) 72%, transparent), color-mix(in srgb, var(--app-surface-muted) 92%, transparent)),
        var(--app-surface-muted) !important;
    box-shadow: none !important;
}

.panel > .panel-body.bg-gray-light {
    background: transparent !important;
}

.bg-gray-50:not(.panel-header),
.bg-gray-light:not(.panel-body) {
    border-radius: 12px;
    background: color-mix(in srgb, var(--app-surface-muted) 86%, var(--app-surface-solid)) !important;
    box-shadow: none !important;
}

body.theme-dark .panel > .panel-header.bg-gray-50,
body.theme-dark .panel > .panel-header.bg-danger-light,
body.theme-dark .panel > .panel-header.bg-primary-light {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--app-surface-solid) 78%, transparent), color-mix(in srgb, var(--app-surface-muted) 88%, transparent)),
        var(--app-surface-muted) !important;
}

body.theme-dark .bg-gray-50:not(.panel-header),
body.theme-dark .bg-gray-light:not(.panel-body),
body.theme-dark .bg-white {
    background: color-mix(in srgb, var(--app-surface-solid) 78%, var(--app-surface-muted)) !important;
    box-shadow: none !important;
}

button.table-summary-card {
    appearance: none;
    width: 100%;
    min-height: 0;
    padding: 0.9rem 1rem;
    text-align: left;
    cursor: pointer;
}

button.table-summary-card:disabled {
    cursor: not-allowed;
    opacity: 0.64;
    transform: none;
}

.table-summary-card .stat-header {
    gap: 0.65rem;
}

.table-summary-card .stat-icon {
    width: 2rem;
    height: 2rem;
    flex-basis: 2rem;
    border-radius: 10px;
    font-size: 0.92rem;
}

.table-summary-card .stat-label {
    margin-bottom: 0;
    font-size: 0.8rem;
}

.table-summary-card .stat-value {
    margin: 0.65rem 0 0.15rem;
    font-size: 1.45rem;
}

.table-summary-card .stat-desc {
    line-height: 1.25;
}

.table-insight-modal {
    position: fixed;
    inset: 0;
    z-index: 75;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.42);
}

.table-insight-dialog {
    display: flex;
    flex-direction: column;
    width: min(860px, 100%);
    max-height: min(86vh, 820px);
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 18px;
    background: var(--app-surface-solid);
    color: var(--app-text);
}

.table-insight-dialog-wide {
    width: min(1120px, 100%);
}

.table-insight-header,
.table-insight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--app-border);
    background: color-mix(in srgb, var(--app-surface-muted) 78%, transparent);
}

.table-insight-footer {
    border-top: 1px solid var(--app-border);
    border-bottom: 0;
}

.table-insight-body {
    overflow: auto;
    padding: 1rem;
}

.table-insight-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--app-border);
    background: var(--app-surface-solid);
    color: var(--app-muted);
    cursor: pointer;
}

.table-modal-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.table-modal-tile {
    display: grid;
    gap: 0.8rem;
    padding: 0.95rem;
}

.table-zone-modal-list {
    display: grid;
    gap: 1rem;
}

.table-zone-modal-section .panel-body {
    padding: 1rem;
}

.table-mini-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-surface);
}

.table-mini-card strong,
.table-mini-card span {
    display: block;
}

.table-mini-card span {
    color: var(--app-muted);
    font-size: 0.78rem;
}

.dirty-clean-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-surface-muted);
}

.dirty-select-card {
    position: relative;
    cursor: pointer;
}

.dirty-select-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dirty-check-icon {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    border: 1px solid var(--app-border);
    background: var(--app-surface-solid);
    color: transparent;
}

.dirty-select-card:has(input:checked) {
    border-color: rgba(16, 185, 129, 0.55) !important;
    box-shadow:
        inset 3px 0 0 rgba(16, 185, 129, 0.82),
        var(--app-shadow-soft) !important;
}

.dirty-select-card:has(input:checked) .dirty-check-icon {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.dirty-select-copy {
    display: grid;
    gap: 0.45rem;
    padding-right: 2.2rem;
}

.waitlist-panel {
    scroll-margin-top: 1rem;
}

.table-summary-card-waitlist {
    border-color: rgba(59, 130, 246, 0.28) !important;
}

.waitlist-modal-body {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.3fr);
    gap: 1rem;
    align-items: start;
}

.waitlist-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.35fr);
    gap: 1rem;
    align-items: start;
}

.waitlist-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    padding: 0.9rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--app-surface-muted) 72%, transparent);
}

.waitlist-notes-field,
.waitlist-submit {
    grid-column: 1 / -1;
}

.waitlist-form-modal {
    position: sticky;
    top: 0;
}

.waitlist-list {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.waitlist-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr);
    gap: 0.85rem;
    align-items: center;
    padding: 0.85rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-surface-solid);
}

.waitlist-card-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.waitlist-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    border: 1px solid var(--app-border);
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.waitlist-card strong,
.table-map-node strong {
    overflow-wrap: anywhere;
}

.waitlist-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    margin-top: 0.2rem;
    color: var(--app-muted);
    font-size: 0.78rem;
}

.waitlist-note {
    margin: 0.45rem 0 0;
    color: var(--app-muted);
    font-size: 0.82rem;
}

.waitlist-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
}

.waitlist-seat-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 0.5rem;
}

.waitlist-seat-map-form {
    display: flex;
    min-width: 0;
}

button.table-map-node.waitlist-seat-node {
    width: 100%;
    color: var(--app-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

button.table-map-node.waitlist-seat-node:hover {
    transform: translateY(-2px);
    box-shadow: var(--app-shadow);
}

.waitlist-empty {
    padding: 1.25rem;
}

.waitlist-cash-note {
    margin-top: 0.2rem;
}

.table-view-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem !important;
}

.table-view-switch {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--app-surface-muted) 82%, transparent);
}

.table-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 38px;
    padding: 0.5rem 0.85rem;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--app-muted);
    cursor: pointer;
}

.table-view-button.is-active {
    background: var(--app-surface-solid);
    color: var(--app-primary);
    box-shadow: var(--app-shadow-soft);
}

.table-map-board {
    display: grid;
    gap: 1rem;
}

.table-map-zone {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-soft);
}

.table-map-zone-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--app-border);
}

.table-map-zone-head h3 {
    margin: 0;
    font-size: 1rem;
}

.table-map-zone-head p {
    margin: 0.25rem 0 0;
    color: var(--app-muted);
    font-size: 0.82rem;
}

.table-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem;
}

.table-map-node {
    display: grid;
    gap: 0.7rem;
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-surface-solid);
}

.table-map-node.is-free {
    border-color: rgba(16, 185, 129, 0.35);
}

.table-map-node.is-occupied {
    border-color: rgba(239, 68, 68, 0.52);
    box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.82), var(--app-shadow-soft);
}

.table-map-node.is-dirty {
    border-color: rgba(245, 158, 11, 0.45);
}

.table-map-node-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.table-map-node-top span,
.table-map-node-meta span {
    color: var(--app-muted);
    font-size: 0.76rem;
}

.table-map-shape {
    position: relative;
    display: grid;
    place-items: center;
    width: min(122px, 100%);
    height: 74px;
    margin: 0.15rem auto 0.05rem;
}

.table-map-center {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border: 2px solid currentColor;
    border-radius: 18px;
    background: color-mix(in srgb, currentColor 10%, var(--app-surface-solid));
}

.table-map-node.is-free .table-map-shape {
    color: #10b981;
}

.table-map-node.is-occupied .table-map-shape {
    color: #ef4444;
}

.table-map-node.is-dirty .table-map-shape {
    color: #f59e0b;
}

.table-map-node-meta {
    display: grid;
    gap: 0.15rem;
    text-align: center;
}

.table-map-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.table-map-actions form {
    display: flex;
}

.dashboard-action-card {
    display: block;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}

.dashboard-action-card:focus-visible,
button.table-map-node.waitlist-seat-node:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--app-primary) 35%, transparent);
    outline-offset: 3px;
}

@media (max-width: 980px) {
    .waitlist-modal-body,
    .waitlist-layout,
    .waitlist-card {
        grid-template-columns: 1fr;
    }

    .waitlist-form-modal {
        position: static;
    }

    .waitlist-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .waitlist-form,
    .waitlist-seat-form,
    .table-view-toolbar,
    .table-map-zone-head {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .table-view-switch,
    .waitlist-actions .button,
    .waitlist-seat-form .button,
    .table-map-actions .button {
        width: 100%;
    }

    .table-map-grid {
        grid-template-columns: 1fr;
    }
}

.stat-value {
    letter-spacing: 0;
}

.table-wrap {
    border: 1px solid var(--app-border);
    border-radius: 14px;
    overflow: hidden;
}

.filament-table th {
    background: var(--app-surface-muted) !important;
    border-bottom: 1px solid var(--app-border) !important;
    color: var(--app-muted) !important;
}

.filament-table td,
.list-item {
    border-bottom-color: var(--app-border) !important;
}

.hover-row:hover,
.filament-table tbody tr:hover {
    background: color-mix(in srgb, var(--app-primary) 6%, transparent) !important;
}

.badge {
    min-height: 22px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    font-weight: 700;
}

.button {
    border-radius: 13px;
}

.button-primary {
    background: linear-gradient(135deg, #2f6fa7, #407fb6) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 24px rgba(47, 111, 167, 0.20);
}

.button-ghost,
.button-secondary {
    background: color-mix(in srgb, var(--app-surface-solid) 72%, transparent) !important;
    color: var(--app-primary) !important;
    border-color: var(--app-border) !important;
}

.button-danger {
    border-radius: 999px;
}

.flash-container {
    padding-top: 1.25rem;
}

body.theme-dark .button-ghost,
body.theme-dark .button-secondary {
    background: rgba(20, 30, 42, 0.72) !important;
    color: #9dccff !important;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    background: #111b27 !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
}

body.theme-dark .filament-table th,
body.theme-dark .panel-header.bg-gray-50,
body.theme-dark .bg-gray-50,
body.theme-dark .bg-gray-light {
    background: rgba(13, 22, 33, 0.78) !important;
}

body.theme-dark .avatar-circle {
    background: linear-gradient(135deg, #223149, #111827);
    color: #ffffff;
    border: 1px solid var(--app-border);
}

body.theme-dark .badge-pagada,
body.theme-dark .badge-entregado,
body.theme-dark .badge-clean {
    background: rgba(16, 185, 129, 0.16) !important;
    color: #7ee5b8 !important;
}

body.theme-dark .badge-cancelada {
    background: rgba(239, 68, 68, 0.16) !important;
    color: #fda4a4 !important;
}

body.theme-dark .badge-abierta,
body.theme-dark .badge-pendiente,
body.theme-dark .badge-dirty {
    background: rgba(245, 158, 11, 0.17) !important;
    color: #f8c56d !important;
}

@media (max-width: 1024px) {
    .filament-sidebar {
        padding: 1rem 0.85rem;
    }

    .filament-main {
        margin-left: 0;
        padding: 1rem;
    }

    .sidebar-date-badge {
        margin-left: 0.35rem;
        margin-right: 0.35rem;
    }
}

/* Sidebar compacto con navegacion por iconos */
.filament-sidebar,
.filament-main,
.brand-info,
.nav-link-text,
.sidebar-date-badge,
.sidebar-footer,
.sidebar-action-button span,
.sidebar-collapse-toggle span {
    transition:
        width 0.24s ease,
        margin-left 0.24s ease,
        opacity 0.18s ease,
        transform 0.24s ease,
        padding 0.24s ease,
        background 0.24s ease,
        color 0.24s ease;
}

.sidebar-collapse-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--app-primary) 16%, transparent);
    border-radius: 999px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--app-surface-solid) 88%, transparent), color-mix(in srgb, var(--app-primary) 7%, var(--app-surface-solid))),
        var(--app-surface-solid);
    color: color-mix(in srgb, var(--app-primary) 62%, var(--app-muted));
    cursor: pointer;
    font-size: 0.72rem;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--app-primary) 10%, transparent);
}

.sidebar-collapse-toggle:hover {
    color: var(--app-primary);
    border-color: color-mix(in srgb, var(--app-primary) 30%, transparent);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--app-primary) 9%, var(--app-surface-solid)), var(--app-surface-solid)),
        var(--app-surface-solid);
    transform: translateX(-1px);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--app-primary) 15%, transparent);
}

.sidebar-collapse-toggle .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nav-link {
    gap: 0.72rem;
    white-space: nowrap;
}

.nav-link-icon {
    width: 1.2rem;
    min-width: 1.2rem;
    text-align: center;
    font-size: 0.98rem;
    color: currentColor;
}

.nav-link-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

body.sidebar-collapsed {
    --sidebar-width: 92px;
}

body.sidebar-collapsed .filament-sidebar {
    padding: 1.05rem 0.7rem;
    align-items: center;
    overflow-x: hidden;
}

body.sidebar-collapsed .sidebar-header {
    width: 100%;
    flex-direction: column;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.15rem 0 0.75rem;
}

body.sidebar-collapsed .sidebar-header > a {
    width: auto !important;
    justify-content: center;
}

body.sidebar-collapsed .brand-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
}

body.sidebar-collapsed .brand-info,
body.sidebar-collapsed .nav-link-text,
body.sidebar-collapsed .sidebar-action-button span,
body.sidebar-collapsed .sidebar-collapse-toggle span {
    width: 0;
    opacity: 0;
    pointer-events: none;
}

body.sidebar-collapsed .sidebar-collapse-toggle {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
}

body.sidebar-collapsed .sidebar-date-badge {
    width: 44px;
    height: 38px;
    margin: 0.1rem 0 0.8rem;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 0;
}

body.sidebar-collapsed .sidebar-date-badge::after {
    content: "\f073";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.98rem;
}

body.sidebar-collapsed .sidebar-nav {
    width: 100%;
}

body.sidebar-collapsed .nav-list {
    align-items: center;
}

body.sidebar-collapsed .nav-list > li {
    width: 100%;
}

body.sidebar-collapsed .nav-link {
    width: 48px;
    height: 48px;
    min-height: 48px;
    margin: 0 auto;
    padding: 0;
    justify-content: center;
    border-radius: 15px;
}

body.sidebar-collapsed .nav-link.is-active {
    box-shadow:
        inset 0 -3px 0 var(--app-primary),
        0 12px 22px color-mix(in srgb, var(--app-primary) 16%, transparent);
}

body.sidebar-collapsed .nav-link-icon {
    width: auto;
    min-width: 0;
    font-size: 1.05rem;
}

body.sidebar-collapsed .sidebar-footer {
    width: 100%;
    padding: 0.55rem;
    border-radius: 18px;
}

body.sidebar-collapsed .sidebar-footer > .mb-3 {
    display: none;
}

body.sidebar-collapsed .sidebar-actions {
    margin-top: 0;
    gap: 0.55rem;
}

body.sidebar-collapsed .sidebar-actions form {
    width: 100%;
    flex: 0 0 auto !important;
}

body.sidebar-collapsed .sidebar-action-button {
    width: 44px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    margin: 0 auto;
    border-radius: 14px;
}

.brand-avatar.has-image,
.login-mark.has-image,
.preference-preview-mark.has-image {
    background: var(--app-surface-solid, #ffffff) !important;
    border: 1px solid var(--app-border, rgba(15, 23, 42, 0.09));
    padding: 3px;
    overflow: hidden;
}

.brand-avatar img,
.login-mark img,
.preference-preview-mark img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.preference-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid var(--app-border, rgba(15, 23, 42, 0.09));
    background: var(--app-surface-muted, #f6f8fb);
}

.preference-preview-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6d5df6, #2f8ee8);
    color: #ffffff;
    font-size: 1.45rem;
    font-weight: 800;
}

.preference-preview-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.preference-preview-copy strong,
.preference-preview-copy span,
.preference-preview-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preference-preview-copy strong {
    color: var(--app-text, var(--text));
    font-size: 1rem;
}

.preference-preview-copy span,
.preference-preview-copy small {
    color: var(--app-muted, var(--muted));
}

@media (max-width: 1024px) {
    body.sidebar-collapsed {
        --sidebar-width: 280px;
    }

    .sidebar-collapse-toggle {
        display: none;
    }

    body.sidebar-collapsed .filament-sidebar,
    body.sidebar-collapsed .sidebar-header {
        align-items: stretch;
    }

    body.sidebar-collapsed .filament-sidebar {
        padding: 1rem 0.85rem;
    }

    body.sidebar-collapsed .sidebar-header {
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.75rem;
        padding: 0.25rem 0.35rem 0.85rem;
    }

    body.sidebar-collapsed .sidebar-header > a {
        width: 100% !important;
        justify-content: flex-start;
    }

    body.sidebar-collapsed .brand-info,
    body.sidebar-collapsed .nav-link-text,
    body.sidebar-collapsed .sidebar-action-button span {
        width: auto;
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-collapsed .sidebar-date-badge {
        width: auto;
        height: auto;
        display: block;
        font-size: 0.75rem;
        padding: 0.58rem 0.85rem;
        margin-left: 0.35rem;
        margin-right: 0.35rem;
    }

    body.sidebar-collapsed .sidebar-date-badge::after {
        content: none;
    }

    body.sidebar-collapsed .nav-link {
        width: auto;
        height: auto;
        min-height: 42px;
        padding: 0.7rem 0.9rem;
        justify-content: flex-start;
    }

    body.sidebar-collapsed .nav-list {
        align-items: stretch;
    }

    body.sidebar-collapsed .nav-list > li {
        width: auto;
    }

    body.sidebar-collapsed .nav-link.is-active {
        box-shadow: inset 3px 0 0 var(--app-primary), 0 10px 24px color-mix(in srgb, var(--app-primary) 13%, transparent);
    }

    body.sidebar-collapsed .sidebar-footer > .mb-3 {
        display: block;
    }

    body.sidebar-collapsed .sidebar-actions {
        margin-top: 1rem;
        gap: 0.75rem;
    }

    body.sidebar-collapsed .sidebar-action-button {
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 0.5rem 0.75rem;
    }
}

/* Blindaje responsive para pantallas estrechas */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 320px;
}

img,
video,
canvas,
svg {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

.content-wrapper,
.filament-dashboard,
.panel,
.panel-body,
.page-header,
.filament-content-grid,
.filament-stats-grid,
.quick-order-shell,
.quick-order-catalog,
.quick-order-summary,
.split-workbench,
.split-board,
.grid-mesas,
.waitlist-layout,
.waitlist-card,
.waitlist-list,
.table-map-board,
.table-map-zone,
.table-map-node,
.entity-card,
.entity-card-compact {
    min-width: 0;
}

@media (pointer: coarse) {
    .button,
    .nav-link,
    .sidebar-action-button,
    .quick-qty-button,
    .split-mini-button,
    .flash-close {
        min-height: 44px;
    }
}

@media (max-width: 640px) {
    .filament-main {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .filament-dashboard {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .panel-header,
    .page-header {
        align-items: stretch;
    }

    .panel-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .panel-header .button,
    .page-actions .button,
    .form-footer-actions .button,
    .action-grid .button {
        width: 100%;
        justify-content: center;
    }

    .page-actions,
    .form-footer,
    .form-footer-actions,
    .action-grid,
    .table-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .entity-card,
    .entity-card-compact {
        grid-template-columns: 1fr !important;
    }

    .entity-actions {
        width: 100%;
        justify-content: stretch;
    }

    .entity-actions .button {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .filament-main {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .panel {
        border-radius: 12px !important;
    }

    .panel-body {
        padding-left: 0.9rem !important;
        padding-right: 0.9rem !important;
    }

    .mobile-nav-toggle {
        top: 0.75rem;
        left: 0.75rem;
    }

    .filament-sidebar {
        width: min(280px, calc(100vw - 1.5rem));
    }
}

/* Ajustes finales solo para tablet y celular */
@media (max-width: 1024px) {
    .filament-main {
        margin-left: 0 !important;
        padding: 4.5rem 1rem 1.5rem !important;
        width: 100%;
    }

    .content-wrapper,
    .filament-dashboard {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .filament-dashboard > header.flex,
    .filament-dashboard > header.page-header {
        display: flex;
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }

    .filament-dashboard > header.flex > div,
    .filament-dashboard > header.page-header > div {
        min-width: 0;
    }

    .filament-dashboard > header.flex > .flex,
    .filament-dashboard > header.flex > div:last-child,
    .filament-dashboard > header.page-header > .page-actions {
        width: 100%;
    }

    .filament-dashboard > header.flex > .flex,
    .filament-dashboard header form.flex {
        flex-wrap: wrap;
        align-items: stretch;
    }

    .filament-dashboard header form.flex {
        width: 100%;
    }

    .filament-dashboard header form.flex > div {
        flex: 1 1 150px;
        min-width: 0;
    }

    .grid-mesas,
    .table-map-grid,
    .table-modal-grid,
    .quick-product-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    }

    .table-insight-dialog {
        width: min(100%, calc(100vw - 1.5rem));
    }
}

@media (max-width: 768px) {
    .filament-dashboard {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .button {
        min-width: 0;
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }

    .button i,
    .table-view-button i,
    .quick-category-tab i {
        flex-shrink: 0;
    }

    .grid-cols-2,
    .sm\:grid-cols-2,
    .md\:grid-cols-4 {
        grid-template-columns: 1fr !important;
    }

    .sm\:flex-row,
    .md\:flex-row {
        flex-direction: column !important;
    }

    .min-w-\[120px\] {
        min-width: 0;
    }

    .page-actions,
    .entity-actions,
    .table-actions,
    .form-footer-actions,
    .action-grid,
    .quick-order-head-actions,
    .confirm-dialog-actions,
    .payment-dialog-actions,
    .table-map-actions,
    .waitlist-actions {
        width: 100%;
        align-items: stretch;
        gap: 0.65rem;
    }

    .page-actions > form,
    .entity-actions > form,
    .table-actions > form,
    .form-footer-actions > form,
    .action-grid > form,
    .quick-order-head-actions > form,
    .confirm-dialog-actions > form,
    .payment-dialog-actions > form,
    .table-map-actions > form,
    .waitlist-actions > form {
        display: flex;
        flex: 1 1 180px;
        min-width: 0;
    }

    .page-actions .button,
    .entity-actions .button,
    .table-actions .button,
    .form-footer-actions .button,
    .action-grid .button,
    .quick-order-head-actions .button,
    .table-map-actions .button,
    .waitlist-actions .button {
        flex: 1 1 160px;
    }

    .filament-dashboard header form.flex {
        flex-direction: column;
    }

    .filament-dashboard header form.flex > div,
    .filament-dashboard header form.flex .button {
        width: 100%;
        flex: 1 1 auto;
    }

    .panel-header,
    .dirty-clean-toolbar,
    .table-mini-card,
    .preference-preview,
    .search-inline,
    .inline-filter {
        flex-direction: column;
        align-items: stretch !important;
    }

    .search-inline input,
    .inline-filter input,
    .inline-filter select {
        min-width: 0;
    }

    .search-inline .button,
    .inline-filter .button {
        width: 100%;
    }

    .stat-card {
        padding: 1.1rem;
    }

    .stat-value {
        font-size: 1.6rem;
        overflow-wrap: anywhere;
    }

    .filament-table {
        min-width: 600px;
    }

    .list-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .list-item > *:last-child {
        align-self: flex-start;
    }

    .entity-topline,
    .table-open-order,
    .payment-summary,
    .payment-change-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .entity-metrics {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .entity-metrics > div {
        min-width: 0;
    }

    .quick-order-summary {
        position: static;
        grid-template-columns: 1fr;
    }

    .split-account-select,
    .split-item-main,
    .split-product-info {
        min-width: 0;
    }

    .division-grid .flex.justify-between,
    .division-grid form.flex {
        flex-wrap: wrap;
    }

    .table-insight-header,
    .table-insight-footer {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .filament-main {
        padding: 4.35rem 0.75rem 1.25rem !important;
    }

    .filament-stats-grid,
    .table-summary-grid,
    .grid-mesas,
    .table-map-grid,
    .table-modal-grid,
    .quick-product-grid,
    .split-account-grid,
    .division-grid,
    .user-grid,
    .compact-product-grid {
        grid-template-columns: 1fr !important;
    }

    .page-actions,
    .entity-actions,
    .table-actions,
    .form-footer,
    .form-footer-actions,
    .action-grid,
    .quick-order-head-actions,
    .table-map-actions,
    .waitlist-actions,
    .dirty-clean-toolbar {
        flex-direction: column;
    }

    .page-actions > *,
    .entity-actions > *,
    .table-actions > *,
    .form-footer-actions > *,
    .action-grid > *,
    .quick-order-head-actions > *,
    .table-map-actions > *,
    .waitlist-actions > *,
    .dirty-clean-toolbar > * {
        width: 100%;
        flex: 1 1 auto;
    }

    .page-actions .button,
    .entity-actions .button,
    .table-actions .button,
    .form-footer-actions .button,
    .action-grid .button,
    .quick-order-head-actions .button,
    .table-map-actions .button,
    .waitlist-actions .button,
    .confirm-dialog-actions .button,
    .payment-dialog-actions .button {
        width: 100%;
        justify-content: center;
    }

    .confirm-dialog-actions,
    .payment-dialog-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .confirm-dialog-actions .button,
    .payment-dialog-actions .button {
        flex: 1 1 auto;
    }

    .entity-actions form,
    .table-actions form,
    .page-actions form,
    .form-footer-actions form,
    .table-map-actions form,
    .waitlist-actions form {
        width: 100%;
    }

    .entity-actions form .button,
    .table-actions form .button,
    .page-actions form .button,
    .form-footer-actions form .button,
    .table-map-actions form .button,
    .waitlist-actions form .button {
        width: 100%;
    }

    .entity-metrics {
        grid-template-columns: 1fr;
    }

    .table-view-switch,
    .table-view-button {
        width: 100%;
    }

    .order-item-thumb {
        width: 100%;
        height: 150px;
    }

    .action-stack form,
    .action-stack .button {
        width: 100%;
    }

    .split-product-row,
    .split-assign-cell,
    .waitlist-card,
    .table-open-order {
        width: 100%;
    }

    .division-grid form.flex {
        width: 100%;
        flex-direction: column;
    }

    .division-grid form.flex select,
    .division-grid form.flex .button {
        width: 100%;
    }

    .table-insight-modal {
        padding: 0.75rem;
    }

    .table-insight-dialog {
        width: 100%;
        max-height: calc(100dvh - 1.5rem);
    }
}

@media (max-width: 420px) {
    .filament-main {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .stat-card,
    .panel-body,
    .quick-order-toolbar,
    .quick-order-shell,
    .table-map-zone,
    .table-insight-body {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    .button {
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }

    .kitchen-ticket-qty {
        min-width: 58px;
        min-height: 58px;
        font-size: 1.25rem;
    }
}
