.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* ========== TEMA OSCURO GLOBAL DEL PORTAL ========== */
.portal-dark-theme {
    --portal-bg: #0d0d0d;
    --portal-bg-card: #1a1a1a;
    --portal-bg-input: #2d2d2d;
    --portal-border: #2d2d2d;
    --portal-text: #fff;
    --portal-text-muted: #9ca3af;
}

.portal-dark-theme {
    background: var(--portal-bg) !important;
    color: var(--portal-text);
}

/* Cards */
.portal-dark-theme .card {
    background: var(--portal-bg-card);
    border-color: var(--portal-border);
    color: var(--portal-text);
}

.portal-dark-theme .card-header {
    background: rgba(255,255,255,0.05);
    border-color: var(--portal-border);
    color: var(--portal-text);
}

.portal-dark-theme .card-footer {
    background: rgba(255,255,255,0.03);
    border-color: var(--portal-border);
    color: var(--portal-text-muted);
}

/* Tablas */
.portal-dark-theme .table {
    color: var(--portal-text);
}

.portal-dark-theme .table thead th {
    background: rgba(255,255,255,0.06);
    border-color: var(--portal-border);
    color: var(--portal-text-muted);
}

.portal-dark-theme .table tbody td {
    border-color: var(--portal-border);
}

.portal-dark-theme .table-hover tbody tr:hover {
    background: rgba(255,255,255,0.04);
}

.portal-dark-theme .table-light {
    --bs-table-bg: rgba(255,255,255,0.06);
    --bs-table-border-color: var(--portal-border);
    --bs-table-striped-bg: rgba(255,255,255,0.03);
}

/* Formularios */
.portal-dark-theme .form-control,
.portal-dark-theme .form-select {
    background: var(--portal-bg-input);
    border-color: var(--portal-border);
    color: var(--portal-text);
}

.portal-dark-theme .form-control::placeholder {
    color: var(--portal-text-muted);
}

.portal-dark-theme .form-control:focus,
.portal-dark-theme .form-select:focus {
    background: var(--portal-bg-input);
    border-color: #ffc107;
    color: var(--portal-text);
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.portal-dark-theme .form-label,
.portal-dark-theme .form-text {
    color: var(--portal-text-muted);
}

.portal-dark-theme .input-group-text {
    background: var(--portal-bg-input);
    border-color: var(--portal-border);
    color: var(--portal-text-muted);
}

/* Alertas */
.portal-dark-theme .alert-warning {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.portal-dark-theme .alert-danger {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
    color: #f87171;
}

.portal-dark-theme .alert-info {
    background: rgba(13, 202, 240, 0.15);
    border-color: rgba(13, 202, 240, 0.3);
    color: #22d3ee;
}

.portal-dark-theme .alert-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

/* Texto */
.portal-dark-theme .text-muted {
    color: var(--portal-text-muted) !important;
}

.portal-dark-theme .text-secondary {
    color: var(--portal-text-muted) !important;
}

/* Modal */
.portal-dark-theme .modal-content {
    background: var(--portal-bg-card);
    border-color: var(--portal-border);
}

.portal-dark-theme .modal-header {
    border-color: var(--portal-border);
    color: var(--portal-text);
}

.portal-dark-theme .modal-footer {
    border-color: var(--portal-border);
}

/* Print ticket modal: all footer buttons same size */
.ticket-print-modal-footer {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}
.ticket-print-modal-footer .ticket-print-modal-btn {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    min-height: 2.5rem;
    padding: 0.5rem 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
}

.portal-dark-theme .modal .btn-close {
    filter: invert(1);
}

/* Dropdown */
.portal-dark-theme .dropdown-menu {
    background: var(--portal-bg-card);
    border-color: var(--portal-border);
}

.portal-dark-theme .dropdown-item {
    color: var(--portal-text);
}

.portal-dark-theme .dropdown-item:hover,
.portal-dark-theme .dropdown-item:focus {
    background: rgba(255,255,255,0.08);
}

.portal-dark-theme .dropdown-divider {
    border-color: var(--portal-border);
}

/* Placeholder / Loading skeleton */
.portal-dark-theme .placeholder {
    background-color: rgba(255,255,255,0.1);
}

.portal-dark-theme .placeholder-glow .placeholder {
    animation: placeholder-glow 2s ease-in-out infinite;
}

/* Loading progress */
.portal-dark-theme .loading-progress circle:last-child {
    stroke: #ffc107;
}

.portal-dark-theme .loading-progress-text {
    color: var(--portal-text-muted);
}

/* Blazor error UI */
.portal-dark-theme #blazor-error-ui {
    background: #1a1a1a;
    color: #fff;
    border-top: 1px solid var(--portal-border);
}

/* Login page - dark theme, yellow accents (image design) */
.login-layout-root {
    position: fixed;
    inset: 0;
    background: #000;
    overflow-y: auto;
    z-index: 9999;
}

.login-page {
    min-height: 100vh;
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: #000;
    background: radial-gradient(ellipse 85% 65% at 50% 45%, rgba(50, 55, 30, 0.15) 0%, transparent 65%, #000 100%);
}

.login-card {
    max-width: 420px;
    width: 100%;
    background: #1a1a1a;
    border-radius: 10px;
}

.login-logo .login-bar {
    display: block;
    background: #ffc107;
    border-radius: 2px;
}

.login-logo .login-bar:nth-child(1) { width: 10px; height: 8px; }
.login-logo .login-bar:nth-child(2) { width: 14px; height: 12px; }
.login-logo .login-bar:nth-child(3) { width: 18px; height: 14px; }

.login-brand { font-size: 1.2rem; font-weight: 700; color: #fff; }
.login-welcome { font-size: 1.5rem; font-weight: 700; color: #fff; }
.login-subtitle { font-size: 0.9rem; }

.form-control-dark {
    background: #2d2d2d;
    border: 1px solid #444;
    color: #fff;
}

.form-control-dark::placeholder { color: #6b7280; }
.input-group .input-group-text.bg-dark {
    background: #2d2d2d !important;
    border-color: #444;
    color: #9ca3af;
}

.form-control-dark:focus {
    background: #2d2d2d;
    border-color: #ffc107;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.btn-outline-secondary {
    background: #2d2d2d;
    border-color: #444;
    color: #9ca3af;
}

.btn-outline-secondary:hover {
    background: #3d3d3d;
    border-color: #555;
    color: #ffc107;
}

.login-link {
    color: #ffc107;
    text-decoration: none;
}

.login-link:hover { color: #e6ac00; text-decoration: underline; }

.login-back-link {
    color: #fff;
    text-decoration: none;
}

.login-back-link:hover { color: #ffc107; }

.login-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-loading-content {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.btn-warning {
    background: #ffc107;
    color: #000;
    border: none;
}

.btn-warning:hover { background: #e6ac00; color: #000; }

/* App layout - RestoAdmin dark theme, sidebar + topbar */
.resto-admin-theme {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --topbar-height: 60px;
    --bg-dark: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-sidebar: #121212;
    --border-color: #2d2d2d;
    --text-primary: #fff;
    --text-secondary: #94a3b8;
    --accent-yellow: #f9a20b;
    --accent-green: #22c55e;
    --accent-blue: #3b82f6;
    --resto-primary: #f9a20b;
}

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-dark);
    position: relative;
}

/* Topbar */
.app-topbar {
    flex-shrink: 0;
    min-height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    transition: left 0.25s ease;
}

.resto-admin-theme .app-topbar {
    left: var(--sidebar-width);
}

.resto-admin-theme .app-sidebar.collapsed ~ .app-topbar {
    left: var(--sidebar-collapsed-width);
}

.app-topbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.topbar-breadcrumb {
    flex: 1;
}

.breadcrumb-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem;
}

.breadcrumb-sep {
    margin: 0 0.25rem;
    opacity: 0.5;
    color: var(--text-muted);
}

.breadcrumb-restaurant {
    color: var(--primary);
    font-weight: 500;
}

.breadcrumb-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-search {
    display: flex;
    align-items: center;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    min-width: 220px;
}

.topbar-search .search-icon {
    margin-right: 0.5rem;
    opacity: 0.6;
}

.topbar-search .form-control {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0;
}

.topbar-search .form-control::placeholder {
    color: var(--text-secondary);
}

.topbar-search .form-control:focus {
    box-shadow: none;
    outline: none;
}

.restaurant-name {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 0.35rem;
    cursor: pointer;
    border-radius: 6px;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
}

.resto-admin-theme .app-topbar .btn-outline-light {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.resto-admin-theme .app-topbar .btn-outline-light:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.resto-admin-theme .app-topbar .btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.resto-admin-theme .app-topbar .btn-outline-secondary:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

/* Sidebar */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: width 0.25s ease, transform 0.25s ease;
}

@media (min-width: 992px) {
    .app-sidebar {
        transform: translateX(0);
    }
}

.app-sidebar.open {
    transform: translateX(0);
}

.app-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.app-sidebar.collapsed .sidebar-header .sidebar-brand,
.app-sidebar.collapsed .nav-text,
.app-sidebar.collapsed .user-info {
    display: none !important;
}

.app-sidebar.collapsed .sidebar-toggle-btn .toggle-icon {
    transform: rotate(180deg);
}

.app-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1029;
}

@media (min-width: 992px) {
    .app-sidebar-overlay { display: none !important; }
}

.app-sidebar-overlay.show {
    display: block;
}

/* Sidebar header (logo) */
.sidebar-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-yellow) 100%);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Sidebar nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
}

.app-sidebar .nav-link {
    color: var(--text-secondary);
    padding: 0.65rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.app-sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.app-sidebar .nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
}

.app-sidebar .nav-link.active {
    color: #000;
    background: var(--accent-yellow);
}

.app-sidebar .nav-link.active:hover {
    background: #e6ac00;
    color: #000;
}

.app-sidebar .nav-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    margin-right: 0.75rem;
}

.app-sidebar.collapsed .nav-icon {
    margin-right: 0;
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
}

.nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.app-sidebar.collapsed .nav-badge {
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(80%, -50%);
    margin-left: 0;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-toggle-btn {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-sidebar.collapsed .sidebar-user {
    justify-content: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-yellow);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Orders page - dark mode table */
.orders-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.orders-table-container .table-responsive {
    margin: 0;
}

.orders-table-dark,
.orders-table-dark thead th,
.orders-table-dark tbody td {
    background: transparent !important;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.orders-table-dark thead th {
    background: rgba(255,255,255,0.06) !important;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.orders-table-dark tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.orders-table-dark tbody tr:hover {
    background: rgba(255,255,255,0.04) !important;
}

.orders-table-dark tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.orders-table-dark tbody tr:last-child {
    border-bottom: none;
}

.orders-filter-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.orders-status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.orders-status-filters .btn {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.orders-status-filters .btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.orders-status-filters .btn-outline-secondary:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.orders-status-filters .badge {
    font-size: 0.7rem;
    padding: 0.2em 0.5em;
    vertical-align: middle;
}

.orders-pagination-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border-top: 1px solid var(--border-color);
}

.orders-pagination-left,
.orders-pagination-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.orders-pagination-left strong,
.orders-pagination-right strong {
    color: var(--text-primary);
}

.orders-pagination-label {
    color: var(--text-secondary);
}

.orders-pagination-select {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.orders-pagination-select:focus {
    outline: none;
    border-color: var(--accent-yellow);
}

.orders-pagination-center {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.orders-page-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    min-width: 32px;
    text-align: center;
}

.orders-page-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.orders-page-btn.active {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
    color: #000;
    font-weight: 600;
}

.orders-page-btn:disabled {
    opacity: 0.4;
}

/* ============================================
   Portal Generic Table & Pagination Styles
   ============================================ */
.portal-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.portal-table-container .table-responsive {
    margin: 0;
}

.portal-table-dark,
.portal-table-dark thead th,
.portal-table-dark tbody td {
    background: transparent !important;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.portal-table-dark thead th {
    background: rgba(255,255,255,0.06) !important;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.portal-table-dark tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.portal-table-dark tbody tr:hover {
    background: rgba(255,255,255,0.04) !important;
}

.portal-table-dark tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.portal-table-dark tbody tr:last-child {
    border-bottom: none;
}

.portal-pagination-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border-top: 1px solid var(--border-color);
}

.portal-pagination-left,
.portal-pagination-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.portal-pagination-left strong,
.portal-pagination-right strong {
    color: var(--text-primary);
}

.portal-pagination-label {
    color: var(--text-secondary);
}

.portal-pagination-select {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.portal-pagination-select:focus {
    outline: none;
    border-color: var(--accent-yellow);
}

.portal-pagination-center {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.portal-page-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    min-width: 32px;
    text-align: center;
}

.portal-page-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.portal-page-btn.active {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
    color: #000;
    font-weight: 600;
}

.portal-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    cursor: not-allowed;
}

.orders-table-container {
    overflow: visible;
}

.orders-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}
.orders-row-actions .dropdown-menu {
    z-index: 1060;
}
.orders-table-dark .dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    min-width: 10rem;
}
.orders-table-dark .dropdown-item {
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
}
.orders-folio-cell { vertical-align: middle; }
.orders-customer-cell { color: var(--text-primary); max-width: 140px; }
.orders-map-btn { padding: 0.2rem 0.4rem; font-size: 1rem; text-decoration: none; }
.orders-folio-link { color: inherit; }
.orders-folio-link:hover { color: var(--bs-warning); }
.orders-folio-number { font-size: 1.1rem; font-weight: 700; }
.orders-order-number-small { font-size: 0.8rem; }
.orders-action-btn { min-width: 5rem; }

/* Driver waiting flag (Order.driverArrivedAtUtc) */
.orders-driver-waiting-badge {
    background: rgba(255, 193, 7, 0.14);
    color: var(--bs-warning);
    border: 1px solid rgba(255, 193, 7, 0.28);
    font-weight: 700;
    letter-spacing: 0.2px;
}

.driver-waiting-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 14px;
    background: rgba(255, 193, 7, 0.10);
    border: 1px solid rgba(255, 193, 7, 0.22);
    color: var(--text-primary);
}

.driver-waiting-banner .text-muted {
    color: var(--text-secondary) !important;
}

.driver-waiting-banner-sep {
    opacity: 0.6;
}
.orders-table-dark .dropdown-item:hover {
    background: rgba(255,255,255,0.08);
}
.orders-table-dark td:last-child {
    overflow: visible;
    white-space: nowrap;
}

/* Dashboard Active orders table — dark theme (same as orders-table-dark) */
.dashboard-active-orders-table,
.dashboard-active-orders-table thead th,
.dashboard-active-orders-table tbody td {
    background: transparent !important;
    color: var(--text-primary);
    border-color: var(--border-color);
}
.dashboard-active-orders-table thead th {
    background: rgba(255,255,255,0.06) !important;
    color: var(--text-secondary);
    font-weight: 500;
}
.dashboard-active-orders-table tbody tr:hover {
    background: rgba(255,255,255,0.04) !important;
}
.dashboard-active-orders-table .btn { white-space: nowrap; }
/* Alineación uniforme: mismos padding y alineación en th/td */
.dashboard-active-orders-table th,
.dashboard-active-orders-table td {
    padding: 0.7rem 0.85rem;
    vertical-align: middle;
    box-sizing: border-box;
}
.dashboard-active-orders-table .dashboard-ao-folio {
    text-align: center;
    width: 1%;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.dashboard-active-orders-table .dashboard-ao-app-folio {
    text-align: center;
    min-width: 14rem;
    max-width: 22rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    word-break: break-word;
    overflow-wrap: break-word;
}
.dashboard-active-orders-table .dashboard-ao-time {
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    padding-left: 1rem;
    padding-right: 1rem;
}
.dashboard-active-orders-table .dashboard-ao-status {
    text-align: center;
    white-space: nowrap;
}
.dashboard-active-orders-table .dashboard-ao-actions {
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    padding-left: 1rem;
}
.dashboard-active-orders-table thead .dashboard-ao-folio,
.dashboard-active-orders-table thead .dashboard-ao-app-folio,
.dashboard-active-orders-table thead .dashboard-ao-time,
.dashboard-active-orders-table thead .dashboard-ao-status,
.dashboard-active-orders-table thead .dashboard-ao-actions { text-align: center; }
.dashboard-active-orders-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    justify-content: center;
}
.dashboard-active-orders-table td:last-child { overflow: visible; }
.dashboard-active-orders-table { table-layout: auto; min-width: 100%; }

/* Columnas financieras en tablas tipo dashboard (Analytics): alineación a la derecha y números tabulares */
.dashboard-active-orders-table th.text-end,
.dashboard-active-orders-table td.text-end {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

.orders-earnings-tooltip {
    opacity: 0.7;
    font-size: 0.85em;
    cursor: help;
}

/* Finance page - restaurant-focused */
.finance-page {
    color: var(--text-primary);
}

.finance-summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.finance-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    min-width: 180px;
    flex: 1 1 200px;
}

.finance-card-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.finance-card-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.finance-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Finance filter: From, To, Apply in one row - aligned */
.finance-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.finance-filter-field {
    min-width: 0;
}

.finance-filter-field .finance-filter-input {
    width: 100%;
    height: 38px;
}

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

.finance-filter-apply {
    min-width: 120px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .finance-filter-grid {
        grid-template-columns: 1fr;
    }
    .finance-filter-apply {
        width: 100%;
    }
}

.finance-filter-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.finance-filter-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.finance-filter-controls {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.5rem;
}

.finance-filter-controls .input-group {
    flex-shrink: 0;
}

.finance-filter-controls .input-group .form-control,
.finance-filter-controls .input-group .btn {
    height: 2.25rem;
}

.finance-note {
    font-size: 0.85rem;
}

.finance-card-empty-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    line-height: 1.35;
}

.finance-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.finance-empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.finance-empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.finance-empty-state-inline {
    max-width: 420px;
    margin: 0 auto;
}

.finance-empty-state-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.5;
}

.restaurant-info-logo-preview {
    max-height: 80px;
    max-width: 160px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Main content */
.app-content {
    flex: 1;
    padding: 1.5rem;
    padding-bottom: 6rem;
    margin-top: var(--topbar-height);
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s ease;
    background: var(--bg-dark);
    overflow-y: auto;
    overflow-x: hidden;
}

.resto-admin-theme .app-sidebar.collapsed ~ .app-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Page footer - service status, support email, phone */
.app-footer {
    flex-shrink: 0;
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 1000;
    transition: left 0.25s ease;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 0.65rem 1.5rem;
}
.resto-admin-theme .app-sidebar.collapsed ~ .app-footer {
    left: var(--sidebar-collapsed-width);
}
.app-footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.app-footer-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.app-footer-label {
    color: var(--text-secondary);
}
.app-footer-status {
    color: #22c55e;
    font-weight: 600;
}
.app-footer-sep {
    opacity: 0.5;
    user-select: none;
}
.app-footer-link {
    color: var(--accent-yellow);
    text-decoration: none;
}
.app-footer-link:hover {
    text-decoration: underline;
    color: var(--accent-yellow);
}
.app-footer-copyright {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 991px) {
    .app-content {
        margin-left: 0;
    }
    .app-footer {
        left: 0;
    }
    .resto-admin-theme .app-topbar {
        left: 0;
    }
}

/* Dashboard page - RestoAdmin style (faithful to reference HTML) */
.dashboard-page {
    color: var(--text-primary);
    overflow-x: hidden;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* KPI cards - grid layout to avoid squashing/overlap */
.resto-dashboard .stat-cards-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
@media (max-width: 991px) {
    .resto-dashboard .stat-cards-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 575px) {
    .resto-dashboard .stat-cards-row {
        grid-template-columns: minmax(0, 1fr);
    }
}
.resto-dashboard .stat-card-col {
    min-width: 0;
}
.resto-dashboard .stat-card-col a {
    min-width: 0;
}
.resto-dashboard .stat-card-inner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 0.875rem;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.resto-dashboard .stat-card-inner .stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.4rem;
    gap: 0.35rem;
    min-height: 28px;
}
.resto-dashboard .stat-card-inner .stat-card-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.resto-dashboard .stat-card-inner .stat-icon-box {
    width: 28px;
    height: 28px;
    border-radius: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.resto-dashboard .stat-icon-box-primary { background: rgba(249, 162, 11, 0.15); color: var(--resto-primary); }
.resto-dashboard .stat-icon-box-green { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.resto-dashboard .stat-icon-box-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.resto-dashboard .stat-icon-box-orange { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.resto-dashboard .stat-card-inner .stat-big-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.resto-dashboard .stat-card-inner .d-flex.align-items-baseline {
    flex-wrap: nowrap;
    gap: 0.35rem;
    min-width: 0;
}
.resto-dashboard .stat-card-inner .stat-change {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.7rem;
}
.resto-dashboard .stat-card-inner .stat-subtitle {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.resto-dashboard .stat-card-inner.stat-card-highlight {
    border-color: rgba(249, 162, 11, 0.5);
    box-shadow: 0 0 0 1px rgba(249, 162, 11, 0.2);
}

/* Live Operations Hub - title + pulse + 4 cards */
.resto-dashboard .live-ops-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.resto-dashboard .live-ops-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    margin: 0;
    min-width: 0;
}
.resto-dashboard .live-ops-title span {
    flex-shrink: 0;
}
.resto-dashboard .live-ops-realtime {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.resto-dashboard .live-ops-pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: live-ops-pulse 1.5s ease-in-out infinite;
}
@keyframes live-ops-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.resto-dashboard .live-ops-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
@media (max-width: 767px) {
    .resto-dashboard .live-ops-grid { grid-template-columns: repeat(2, 1fr); }
}
.resto-dashboard .live-ops-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    transition: border-color 0.2s;
}
.resto-dashboard .live-ops-card:hover {
    border-color: rgba(249, 162, 11, 0.5);
}
.resto-dashboard .live-ops-card .live-ops-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}
.resto-dashboard .live-ops-card .live-ops-count {
    font-size: 2.25rem;
    font-weight: 900;
    line-height: 1.2;
}
.resto-dashboard .live-ops-card.live-ops-preparing .live-ops-count { color: var(--resto-primary); }
.resto-dashboard .live-ops-card.live-ops-ready .live-ops-count { color: #22c55e; }
.resto-dashboard .live-ops-card.live-ops-delivery .live-ops-count { color: #3b82f6; }
.resto-dashboard .live-ops-card.live-ops-delivered .live-ops-count { color: #e2e8f0; }

/* Active Orders table - Folio, Platform, Customer, Time, Status, Actions */
.resto-dashboard .table-active-orders {
    width: 100%;
    min-width: 680px;
    table-layout: auto;
    text-align: left;
    font-size: 0.875rem;
}
.resto-dashboard .table-active-orders thead th:nth-child(1) { min-width: 160px; }   /* Folio */
.resto-dashboard .table-active-orders thead th:nth-child(2) { min-width: 90px; }  /* Platform */
.resto-dashboard .table-active-orders thead th:nth-child(3) { min-width: 56px; }  /* Time */
.resto-dashboard .table-active-orders thead th:nth-child(4) { min-width: 95px; }  /* Status */
.resto-dashboard .table-active-orders thead th:nth-child(5) { min-width: 180px; }  /* Actions */
.resto-dashboard .table-active-orders thead {
    background: rgba(15, 15, 15, 0.4);
    color: var(--text-secondary);
}
.resto-dashboard .table-active-orders thead th {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.65rem;
    border-bottom: 1px solid var(--border-color);
}
.resto-dashboard .table-active-orders tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.resto-dashboard .table-active-orders tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}
.resto-dashboard .table-active-orders td:last-child {
    position: relative;
    overflow: visible;
}
.resto-dashboard .table-active-orders .dropdown-menu {
    z-index: 1060;
}
.resto-dashboard .dashboard-actions-dropdown-menu {
    display: block;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    min-width: 10rem;
    z-index: 1060;
    list-style: none;
    padding: 0.25rem 0;
    margin: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.3);
}
.resto-dashboard .dashboard-actions-dropdown-menu .dropdown-item {
    display: block;
    width: 100%;
    padding: 0.35rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
}
.resto-dashboard .dashboard-actions-dropdown-menu .dropdown-item:hover:not(:disabled) {
    background: rgba(255,255,255,0.08);
}
.resto-dashboard .dashboard-actions-dropdown-menu .dropdown-item:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.resto-dashboard .dashboard-actions-dropdown-menu li {
    list-style: none;
}
.resto-dashboard .table-active-orders td .dropdown.position-relative {
    position: relative;
}
/* When actions menu is open, bring row above table so dropdown is visible */
.resto-dashboard .table-active-orders tr.dashboard-ao-actions-open td {
    position: relative;
    z-index: 5;
}
.resto-dashboard .table-active-orders tr.dashboard-ao-actions-open td:last-child {
    z-index: 6;
}
.dashboard-actions-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: transparent;
}
.dashboard-actions-floating-menu {
    position: fixed;
    z-index: 1050;
    margin-top: 0.25rem;
    min-width: 10rem;
}
.dashboard-actions-floating-menu .dashboard-actions-dropdown-menu {
    position: static;
    margin: 0;
}
.resto-dashboard .table-active-orders .folio-cell {
    font-family: ui-monospace, monospace;
    font-weight: 700;
    color: var(--resto-primary);
}
.resto-dashboard .table-active-orders .dashboard-folio-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: var(--resto-primary);
    cursor: pointer;
    text-align: left;
}
.resto-dashboard .table-active-orders .dashboard-folio-link:hover {
    color: var(--accent-yellow);
}
.resto-dashboard .table-active-orders .platform-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}
.resto-dashboard .table-active-orders tbody td {
    white-space: nowrap;
}
.resto-dashboard .table-active-orders .folio-cell {
    min-width: 160px;
    max-width: 220px;
    overflow: visible;
    white-space: nowrap;
}
.resto-dashboard .table-active-orders .folio-cell .dashboard-folio-link {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0.25rem;
    white-space: nowrap;
}
.resto-dashboard .table-active-orders .folio-cell .dashboard-folio-platform {
    flex-shrink: 0;
    font-weight: 500;
}
.resto-dashboard .table-active-orders .fw-medium {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.resto-dashboard .table-active-orders .dashboard-ao-customer {
    color: var(--text-primary);
}
.resto-dashboard .dashboard-ao-actions-btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}
.resto-dashboard .dashboard-ao-view-btn {
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.resto-dashboard .dashboard-ao-view-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-color);
}
.resto-dashboard .dashboard-ao-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.resto-dashboard .dashboard-ao-pager .pagination .page-link {
    color: var(--text-primary);
    background: var(--bg-card);
    border-color: var(--border-color);
}
.resto-dashboard .dashboard-ao-pager .pagination .page-item.disabled .page-link {
    color: var(--text-secondary);
}
.resto-dashboard .dashboard-ao-pager .pagination .page-link:hover:not(:disabled) {
    background: var(--border-color);
    color: var(--text-primary);
}
.resto-dashboard .time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.resto-dashboard .time-badge-green { background: rgba(34, 197, 94, 0.15); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.25); }
.resto-dashboard .time-badge-yellow { background: rgba(234, 179, 8, 0.15); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.25); }
.resto-dashboard .time-badge-red { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); }
.resto-dashboard .status-preparing {
    color: var(--resto-primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.resto-dashboard .status-preparing .status-dot {
    width: 6px;
    height: 6px;
    background: var(--resto-primary);
    border-radius: 50%;
    animation: live-ops-pulse 1.5s ease-in-out infinite;
}
.resto-dashboard .status-ready { color: #22c55e; font-weight: 500; }
.resto-dashboard .table-actions-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 0.5rem;
}
.resto-dashboard .table-actions-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Quick Inventory - icon box + name + toggle (reference HTML) */
.resto-dashboard .quick-inv-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    flex-shrink: 0;
}
.resto-dashboard .quick-inv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}
.resto-dashboard .quick-inv-title {
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-primary);
}
.resto-dashboard .quick-inv-title-icon {
    color: var(--resto-primary);
    font-size: 1rem;
}
.resto-dashboard .quick-inv-stock-btn {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}
.resto-dashboard .quick-inv-stock-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}
.resto-dashboard .quick-inv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
    border-radius: 0.4rem;
    background: rgba(15, 15, 15, 0.5);
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    min-height: 40px;
    gap: 0.5rem;
}
.resto-dashboard .quick-inv-row:last-of-type { margin-bottom: 0; }
.resto-dashboard .quick-inv-row-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}
.resto-dashboard .quick-inv-icon-box {
    width: 26px;
    height: 26px;
    border-radius: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.resto-dashboard .quick-inv-icon-box-on {
    background: rgba(249, 162, 11, 0.2);
    color: var(--resto-primary);
}
.resto-dashboard .quick-inv-icon-box-off {
    background: #1e293b;
    color: var(--text-secondary);
}
.resto-dashboard .quick-inv-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.resto-dashboard .quick-inv-name.out {
    color: var(--text-secondary);
    text-decoration: line-through;
}
.resto-dashboard .quick-inv-note {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
    margin-top: 0.5rem;
}
/* Quick Inventory: same switch as Availability (form-check form-switch) for alignment */
.resto-dashboard .quick-inv-switch-wrap {
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    line-height: 1;
    font-size: 1rem;
}
.resto-dashboard .quick-inv-switch-wrap.form-check {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 0;
    min-height: 0;
    padding-left: 0;
}
.resto-dashboard .quick-inv-switch-wrap .form-check-input {
    cursor: pointer;
    margin: 0;
    margin-left: 0;
    flex-shrink: 0;
    align-self: center;
    float: none;
}
.resto-dashboard .quick-inv-switch.quick-inv-switch-on {
    background-color: var(--resto-primary, #f9a20b);
    border-color: var(--resto-primary, #f9a20b);
}
.resto-dashboard .quick-inv-switch.quick-inv-switch-off {
    background-color: #374151;
    border-color: #374151;
}
.resto-dashboard .quick-inv-switch:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
/* Quick Inventory list with scroll */
.resto-dashboard .quick-inv-list {
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}
.resto-dashboard .quick-inv-list::-webkit-scrollbar {
    width: 6px;
}
.resto-dashboard .quick-inv-list::-webkit-scrollbar-track {
    background: rgba(15, 15, 15, 0.5);
    border-radius: 3px;
}
.resto-dashboard .quick-inv-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
.resto-dashboard .quick-inv-row {
    flex-shrink: 0;
}

/* Bottom utility row */
.resto-dashboard .dashboard-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.75rem;
}
.resto-dashboard .dashboard-footer-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.resto-dashboard .dashboard-footer-status span {
    color: #22c55e;
    font-weight: 600;
}
.resto-dashboard .dashboard-footer-links {
    display: flex;
    gap: 1rem;
}
.resto-dashboard .dashboard-footer-links button,
.resto-dashboard .dashboard-footer-links a {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.resto-dashboard .dashboard-footer-links button:hover,
.resto-dashboard .dashboard-footer-links a:hover {
    color: var(--text-primary);
}
.resto-dashboard .dashboard-footer-links a.primary-link {
    color: var(--resto-primary);
}
.resto-dashboard .dashboard-footer-links a.primary-link:hover {
    text-decoration: underline;
}

/* Dashboard main grid - prevent overlap and overflow */
.resto-dashboard .row.g-4 {
    align-items: stretch;
}
.resto-dashboard .col-12.col-lg-8 {
    min-width: 0;
}
.resto-dashboard .col-12.col-lg-4 {
    min-width: 0;
}
.resto-dashboard .dashboard-card.overflow-hidden {
    min-height: 0;
}
.resto-dashboard .dashboard-card .overflow-x-auto {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}
.resto-dashboard .orders-chart-card {
    min-height: 180px;
    overflow: hidden;
}
.resto-dashboard .orders-chart-card h3 {
    flex-shrink: 0;
}

.dashboard-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.dashboard-link {
    color: var(--accent-yellow);
    text-decoration: none;
    font-size: 0.9rem;
}

.dashboard-link:hover {
    color: #e6ac00;
}

/* Stat cards - equal width distribution for all 5 cards */
.stat-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.stat-card-col {
    flex: 1 1 0;
    min-width: 0;
}

@media (max-width: 1199px) {
    .stat-card-col {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 140px;
    }
}

@media (max-width: 575px) {
    .stat-card-col {
        flex: 1 1 100%;
    }
}

.stat-cards-row .dashboard-card.stat-card {
    flex: 1;
    min-height: 120px;
    width: 100%;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon-orders { background: rgba(59, 130, 246, 0.2); }
.stat-icon-revenue { background: rgba(34, 197, 94, 0.2); color: var(--accent-green); }
.stat-icon-riders { background: rgba(255, 193, 7, 0.2); }
.stat-icon-time { background: rgba(156, 163, 175, 0.2); }
.stat-icon-new { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.stat-card-link { display: block; color: inherit; }
.stat-card-link:hover { color: inherit; }
.stat-card-new-orders { border-left: 3px solid var(--accent-yellow); }
.stat-card-new-orders.stat-card-highlight {
    border-left-color: #ef4444;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
    animation: stat-card-new-pulse 2.5s ease-in-out infinite;
}

@keyframes stat-card-new-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35), 0 0 12px rgba(239, 68, 68, 0.15); }
}
.stat-hint { font-size: 0.7rem; color: var(--text-secondary); }

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-change {
    font-size: 0.75rem;
}

.stat-change.positive {
    color: var(--accent-green);
}

.stat-change.negative {
    color: #ef4444;
}

.stat-change.neutral {
    color: var(--text-secondary);
}

.expenses-info-icon {
    opacity: 0.7;
    font-size: 0.85em;
    cursor: help;
}

/* Pending action alert */
.dashboard-pending-alert {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 8px;
    color: #ffc107;
}

.dashboard-all-caught-up {
    font-size: 0.9rem;
    color: var(--accent-green);
    padding: 0.5rem 0;
}

/* Pending acceptance table - rows older than 5 min */
.dashboard-pending-table { color: var(--text-primary, #e2e8f0); }
.dashboard-pending-row-old {
    background: rgba(245, 158, 11, 0.15);
    border-left: 3px solid #f59e0b;
}

/* Not accepting orders banner */
.dashboard-paused-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 99, 71, 0.15);
    border: 1px solid rgba(255, 99, 71, 0.4);
    border-radius: 8px;
}

/* Dashboard availability bar */
.dashboard-availability-bar {
    padding: 0.75rem 1rem;
    background: var(--surface, #1e1e2e);
    border-radius: 8px;
}

/* Availability toggle - aligned switch (icon + track) */
.availability-toggle-wrap { font-size: 0.9rem; display: flex; align-items: center; }
.availability-toggle-wrap .form-check { display: flex; align-items: center; margin-bottom: 0; }
.availability-toggle-wrap .form-check-input { margin-top: 0; flex-shrink: 0; }
.availability-label { color: var(--text-secondary, #adb5bd); }
.availability-switch.availability-on { background-color: var(--accent-green, #28a745); border-color: var(--accent-green, #28a745); }
.availability-switch.availability-paused { background-color: #ffc107; border-color: #ffc107; }
.availability-badge { font-size: 0.7rem; }

/* Notification sounds - same alignment as Availability */
.notification-sound-toggle-wrap { font-size: 0.9rem; display: flex; align-items: center; }
.notification-sound-toggle-wrap .form-check { display: flex; align-items: center; margin-bottom: 0; }
.notification-sound-toggle-wrap .form-check-input { margin-top: 0; flex-shrink: 0; }
.notification-sound-label { color: var(--text-secondary, #adb5bd); }

.stat-avg-prep-tooltip {
    cursor: help;
}

.dashboard-chart-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* Orders chart (last 12h) */
.orders-chart-card {
    min-height: 150px;
}

.orders-chart {
    height: 150px;
}

.orders-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.orders-chart-svg {
    width: 100%;
    height: 120px;
    display: block;
}

.orders-chart-bar {
    fill: var(--accent-yellow);
    opacity: 0.85;
}

.orders-chart-label {
    fill: var(--text-secondary);
    font-size: 10px;
}

.orders-chart-value {
    fill: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
}

.orders-chart-bar-current {
    fill: var(--accent-yellow);
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(255, 193, 7, 0.5));
}

.orders-chart-now-label {
    fill: var(--accent-yellow);
    font-size: 9px;
    font-weight: 600;
}

/* Hourly Distribution stacked chart - colores de alto contraste en tema oscuro */
.hourly-distribution-chart {
    min-height: 140px;
    overflow: hidden;
}
.hourly-distribution-chart .orders-chart-svg {
    max-width: 100%;
    display: block;
}
.hourly-bar-yesterday {
    fill: var(--text-secondary);
    opacity: 0.85;
}
.hourly-bar-delivery {
    fill: var(--accent-yellow);
    opacity: 0.95;
}
.hourly-bar-instore {
    fill: #06b6d4; /* cyan-500: alto contraste sobre fondo oscuro para Pickup */
    stroke: #22d3ee;
    stroke-width: 1;
    opacity: 0.95;
}
.hourly-bar-current.hourly-bar-delivery,
.hourly-bar-current.hourly-bar-instore {
    filter: drop-shadow(0 0 4px rgba(255, 193, 7, 0.4));
}
.hourly-bar-current.hourly-bar-instore {
    filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.5));
}
.hourly-distribution-legend {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.legend-yesterday { background: var(--text-secondary); opacity: 0.9; }
.legend-delivery { background: var(--accent-yellow); }
.legend-instore { background: #06b6d4; border: none; }

/* Quick Inventory */
.quick-inventory-list {
    max-height: 280px;
    overflow-y: auto;
}
.quick-inventory-item:last-child {
    border-bottom: none !important;
}
.quick-inventory-icon {
    font-size: 1rem;
    opacity: 0.9;
}
.quick-inventory-switch {
    cursor: pointer;
}

/* Status cards - clickable, prominent for Preparing/Ready */
.status-card-link {
    display: block;
    color: inherit;
    transition: opacity 0.2s ease;
}
.status-card-link:hover { color: inherit; opacity: 0.9; }
.status-card-link:active { opacity: 0.95; }

.status-card-prominent {
    border-left: 3px solid var(--accent-yellow);
}

.status-card-urgent {
    animation: status-card-pulse 2s ease-in-out infinite;
}
.status-card-urgent .status-count {
    color: var(--accent-yellow);
}

@keyframes status-card-pulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.3); }
}

/* Status cards */
.status-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-align: center;
}

.status-count-lg {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.status-icon {
    font-size: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.status-count {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.status-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Sales chart */
.period-select {
    background: var(--bg-dark) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    font-size: 0.85rem;
    max-width: 120px;
}

.sales-chart {
    position: relative;
    padding: 1rem 0;
}

.chart-svg {
    width: 100%;
    height: 100px;
    display: block;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Dashboard table */
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.dashboard-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.dashboard-table td {
    padding: 0.65rem 0.75rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
}

.order-link {
    color: var(--accent-yellow);
    text-decoration: none;
}

.order-link:hover {
    color: #e6ac00;
}

/* Top items list */
.top-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.top-item-row:last-child {
    border-bottom: none;
}

.top-item-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.top-item-placeholder {
    font-size: 1.5rem;
}

.top-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.top-item-name {
    font-weight: 600;
    color: var(--text-primary);
}

.top-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ========== New Order Modal - Dark theme, restaurant-only ========== */
.new-order-modal-dark .modal-dialog { max-width: 560px; }
.new-order-modal-dark .modal-content,
.new-order-modal-content {
    background: #1a1a1a;
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 12px;
    box-shadow: 0 0 24px rgba(255, 193, 7, 0.15);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.new-order-header {
    text-align: center;
    padding: 0.65rem 1rem 0.5rem;
    width: 100%;
    box-sizing: border-box;
}
.new-order-bell { font-size: 1.4rem; filter: grayscale(0); }
.new-order-title {
    font-size: 1rem;
    font-weight: 600;
    color: #9ca3af;
    margin: 0.25rem 0 0;
}
.new-order-order-number {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
    margin: 0.35rem 0 0.4rem;
    line-height: 1.2;
}
.new-order-folio {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
    margin: 0.35rem 0 0.1rem;
    line-height: 1.2;
}
.new-order-order-number-small {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    margin: 0 0 0.35rem;
}
.new-order-just-now {
    font-size: 0.85rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.new-order-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
}

/* Body: full width of modal */
.new-order-body-grid {
    display: block;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}
.new-order-body-left { min-width: 0; }
/* Sections inside grid use full width of padded area so they match siblings (comments, items-wrap) */
.new-order-body-left .new-order-section { margin-left: 0; margin-right: 0; }
.new-order-body-right { min-width: 0; }

.new-order-route-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.new-order-meta-item {
    min-width: 0;
}
.new-order-address {
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    min-width: 0;
}

.new-order-order-id-header {
    margin-top: 0.5rem;
}
.new-order-order-id-header .new-order-order-id {
    display: inline-block;
}

.new-order-section {
    background: #2d2d2d;
    margin: 0 0 0.5rem;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}
.new-order-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    display: block;
    margin-bottom: 0.2rem;
}
.new-order-value { color: #fff; font-weight: 600; }
.new-order-section .new-order-address { text-align: left; }
.new-order-route-row { justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.new-order-meta-item { min-width: 0; flex: 1; min-width: 6rem; }
.new-order-meta-item .new-order-value { text-align: left; }
.new-order-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.new-order-row-delivery {
    flex-wrap: wrap;
}
.new-order-col { flex: 1; min-width: 0; }
.new-order-col-delivery-meta .new-order-value {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.new-order-order-id {
    background: #22c55e;
    color: #000;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.new-order-comments {
    border: 1px solid #444;
}
.new-order-comment-text {
    color: #fff;
    font-style: italic;
    margin-top: 0.5rem;
}

.new-order-items-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.new-order-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.new-order-item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: #fff;
    font-size: 0.9rem;
}
.new-order-item-row:last-of-type { border-bottom: none; }
.new-order-item-qty {
    background: #ffc107;
    color: #000;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 2.5rem;
    text-align: center;
}
.new-order-item-name { flex: 1; }
.new-order-item-price { font-weight: 600; }

.new-order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.9rem;
}
.new-order-total-row strong { font-size: 1rem; }

.new-order-timer {
    margin: 0 1rem 1rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: #9ca3af;
}
.new-order-timer strong { color: #fff; margin-left: 0.25rem; }

/* Quick view (New Order Arrived minimal) */
.new-order-quick-body {
    padding: 0 1rem 0.75rem;
}
.new-order-quick-body .new-order-section-compact {
    margin: 0 0 0.5rem;
    padding: 0.5rem 0.75rem;
}
.new-order-route-inline .new-order-value {
    font-size: 0.9rem;
}
.new-order-items-list-quick {
    max-height: 12rem;
    overflow-y: auto;
}
.new-order-totals-quick {
    margin-top: 0.5rem;
    margin-bottom: 0;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.new-order-prep-time-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}
.new-order-quick-body .new-order-totals-section.new-order-totals-quick {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 0.75rem;
    margin-bottom: 0;
}

/* Prep time (ETA for customer) — full width */
.new-order-eta-prep-card {
    background: #2d2d2d;
    margin: 0 0 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}
.new-order-eta-prep-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
    display: block;
    margin-bottom: 0.2rem;
}
.new-order-eta-prep-card .d-flex { justify-content: flex-start; flex-wrap: nowrap; gap: 0.5rem; }
.new-order-eta-prep-card .small { font-size: 0.8rem; white-space: nowrap; }
.new-order-eta-prep-card .btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    min-width: 4.5rem;
    flex-shrink: 0;
}

.new-order-prep-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.25rem;
}
.new-order-prep-buttons .btn {
    min-width: 2.5rem;
}

.new-order-modal-dialog { max-height: 85vh; }
.new-order-modal-content {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    width: 100%;
}
.new-order-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: 65vh;
    width: 100%;
    box-sizing: border-box;
}
/* Order items y demás secciones fuera del grid: mismo ancho que customer/delivery (margen 1rem) */
/* Secciones fuera del grid (Order items, comments, etc.): mismo ancho que customer/delivery */
.new-order-modal-body > .new-order-section {
    margin-left: 1rem;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    width: auto;
    max-width: calc(100% - 2rem);
    box-sizing: border-box;
}
.new-order-items-wrap {
    margin: 0 1rem 0.5rem;
    width: auto;
    max-width: calc(100% - 2rem);
    box-sizing: border-box;
}
.new-order-actions,
.new-order-actions-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding: 0.65rem 1rem;
    flex-shrink: 0;
    width: 100%;
    background: #1a1a1a;
    border-top: 1px solid rgba(255,255,255,0.08);
    align-items: stretch;
    justify-content: center;
    box-sizing: border-box;
}
.new-order-actions-footer .new-order-accepted-block {
    width: 100%;
}
.new-order-footer-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
}
.new-order-footer-btn {
    flex: 1 1 0;
    min-width: 5rem;
    min-height: 38px;
    padding: 0.5rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    white-space: nowrap;
}
.new-order-btn-ready {
    background: #22c55e;
    border: none;
    color: #fff;
}
.new-order-btn-ready:hover:not(:disabled) {
    background: #16a34a;
    color: #fff;
}
.new-order-btn-close {
    background: transparent;
    border: 1px solid #6b7280;
    color: #9ca3af;
}
.new-order-btn-close:hover:not(:disabled) {
    background: rgba(107, 114, 128, 0.15);
    border-color: #6b7280;
    color: #d1d5db;
}
.new-order-actions .btn,
.new-order-actions-footer .btn {
    flex: 1 1 auto;
    min-width: 7rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.new-order-actions-footer .new-order-footer-btn.new-order-btn-print {
    background: #0ea5e9;
    border: none;
    color: #fff;
}
.new-order-actions-footer .new-order-footer-btn.new-order-btn-print:hover:not(:disabled) {
    background: #0284c7;
    color: #fff;
}
.new-order-accepted-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}
.new-order-accepted-msg {
    flex: none;
    text-align: center;
    color: #22c55e;
    font-size: 0.9rem;
    width: 100%;
}
.new-order-accepted-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    justify-content: center;
    width: 100%;
}
.new-order-btn-print,
.new-order-btn-done {
    flex: 1 1 auto;
    min-width: 7rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}
.new-order-btn-print {
    background: #0ea5e9;
    border: none;
    color: #fff;
}
.new-order-btn-print:hover:not(:disabled) {
    background: #0284c7;
    color: #fff;
}
.new-order-btn-done {
    background: transparent;
    border: 1px solid #6b7280;
    color: #9ca3af;
}
.new-order-btn-done:hover:not(:disabled) {
    background: rgba(107, 114, 128, 0.15);
    border-color: #6b7280;
    color: #d1d5db;
}
.btn-print-ticket { flex: 0 1 auto; min-width: 8rem; }
.new-order-btn-reject {
    flex: 1;
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}
.new-order-btn-reject:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}
.new-order-btn-accept {
    flex: 1;
    background: #ffc107;
    border: none;
    color: #000;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}
.new-order-btn-accept:hover:not(:disabled) {
    background: #e6ac00;
    color: #000;
}

/* ========== TICKET PRINT MODAL ========== */
.ticket-print-iframe {
    width: 100%;
    height: 70vh;
    min-height: 400px;
    border: none;
    background: #1a1a1a;
}

/* ========== ORDER TICKET (THERMAL PRINT) ========== */
/* POS-58 / POS-80: full paper width, zero margins, large fonts in @media print. */
@page ticket-58 {
    size: 58mm auto;
    margin: 0;
}
@page ticket-80 {
    size: 80mm auto;
    margin: 0;
}
@page {
    margin: 0;
}

.print-layout-root {
    min-height: 100vh;
    padding: 1rem;
}
/* Ticket template: always white background, black text (screen and print) */
.ticket-print-page {
    max-width: 80mm;
    margin: 0 auto;
    background: #fff !important;
    color: #000 !important;
}
.ticket-print-page.ticket-w58 {
    max-width: 58mm;
}
.ticket-print-page.ticket-w58 .order-ticket-print {
    max-width: 58mm;
    font-size: 11px;
}
/* Modal preview: ticket area on white (portal stays dark) */
.ticket-print-page--in-modal {
    background: #fff !important;
    min-height: 100%;
    padding: 1rem;
    color: #000 !important;
}

/* Batch: each ticket on its own page */
.ticket-batch-item {
    margin-bottom: 1rem;
}
.ticket-batch-item .ticket-type-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    color: #333;
}
.page-break {
    page-break-after: always;
}

/* Screen preview: Courier, box-sizing; print overrides in @media print */
.order-ticket-print {
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: #000 !important;
    background: #fff !important;
    max-width: 80mm;
    padding: 4mm;
    box-sizing: border-box;
}
.order-ticket-print,
.order-ticket-print * {
    color: #000 !important;
}
.order-ticket-print.ticket-w58 {
    max-width: 58mm;
    font-size: 11px;
}
.ticket-header { text-align: left; margin-bottom: 4px; }
.ticket-platform { font-size: 0.85em; font-weight: 700; margin-bottom: 2px; color: #333; }
.ticket-restaurant { font-size: 1.35em; font-weight: 700; letter-spacing: 0.03em; margin-bottom: 2px; }
.ticket-folio { font-size: 1.1em; font-weight: 700; letter-spacing: 0.05em; }
.ticket-order-id { font-size: 0.7em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ticket-order { font-size: 1em; font-weight: 600; }
.ticket-sep { text-align: left; margin: 5px 0; font-family: inherit; letter-spacing: 0; }
.ticket-fulfillment { text-align: left; font-weight: 700; margin: 4px 0; font-size: 1em; }
.ticket-section { margin: 5px 0; }
.ticket-label { font-weight: 700; font-size: 0.95em; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.ticket-value { margin: 1px 0; word-break: break-word; font-weight: 600; }
.ticket-address { font-size: 1em; font-weight: 600; }
.ticket-item { margin: 2px 0; }
.ticket-item-qty { margin-right: 6px; }
.ticket-item-line { display: flex; justify-content: space-between; gap: 8px; margin: 2px 0; }
.ticket-item-left { flex: 1; min-width: 0; font-weight: 600; text-align: left; }
.ticket-item-right { flex-shrink: 0; width: 10em; min-width: 10em; max-width: 10em; font-weight: 600; text-align: right !important; }
.ticket-item-mod { margin-left: 12px; font-size: 0.95em; font-weight: 600; color: #333; padding-left: 1ch; }
.ticket-totals { margin: 6px 0; }
.ticket-total-row { display: flex; justify-content: space-between; margin: 2px 0; font-weight: 600; }
.ticket-grand { font-weight: 700; font-size: 1.15em; margin-top: 6px; }
.ticket-footer { font-size: 0.95em; margin-top: 6px; font-weight: 600; }
.ticket-payment { font-weight: 700; }
.ticket-warning { font-weight: 700; margin-top: 4px; text-transform: uppercase; }
.ticket-checklist { margin: 5px 0; }
.ticket-checklist-item { margin: 2px 0; font-weight: 600; }
.ticket-handoff { margin: 6px 0; text-align: left; }
.ticket-handoff-code { font-size: 1.2em; font-weight: 700; letter-spacing: 0.1em; }
.ticket-thanks { text-align: left; font-weight: 700; margin: 6px 0; }
.ticket-order-id { font-size: 0.9em; font-weight: 600; color: #333; }
.ticket-cut { text-align: left; margin-top: 10px; font-size: 0.9em; font-weight: 600; letter-spacing: 0.15em; }
.ticket-amounts-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ticket-amounts-table .ticket-td-left { text-align: left; }
.ticket-amounts-table .ticket-td-right { text-align: right !important; width: 1%; white-space: nowrap; font-weight: 700; }
.no-print { }

@media print {
    /* POS thermal: no horizontal margins, full paper width, large readable fonts */
    html, body, #app, .print-layout-root {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
        background: #fff !important;
        height: auto !important;
        min-height: 0 !important;
        box-sizing: border-box !important;
    }
    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .portal-dark-theme,
    body { background: #fff !important; }
    .print-layout-root { display: block !important; }

    .ticket-print-page {
        margin: 0 !important;
        padding: 0 !important;
        width: 80mm !important;
        max-width: 80mm !important;
        height: auto !important;
        min-height: 0 !important;
        display: block !important;
        page: ticket-80;
        box-sizing: border-box !important;
    }
    .ticket-print-page.ticket-w58 {
        width: 58mm !important;
        max-width: 58mm !important;
        page: ticket-58;
    }
    .ticket-print-page.ticket-w80 {
        page: ticket-80;
    }

    .order-ticket-print {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        display: block !important;
        box-sizing: border-box !important;
        font-family: "Courier New", Courier, monospace !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        color: #000 !important;
        background: #fff !important;
        text-align: left !important;
    }
    .order-ticket-print * {
        box-sizing: border-box !important;
    }
    .order-ticket-print .ticket-header {
        margin-bottom: 4px !important;
    }
    .order-ticket-print .ticket-restaurant {
        font-size: 18px !important;
        font-weight: 700 !important;
        margin-bottom: 2px !important;
    }
    .order-ticket-print .ticket-folio {
        font-size: 16px !important;
        font-weight: 700 !important;
    }
    .order-ticket-print .ticket-order-id,
    .order-ticket-print .ticket-order {
        font-size: 14px !important;
        font-weight: 700 !important;
    }
    .order-ticket-print .ticket-sep {
        margin: 4px 0 !important;
        font-size: 13px !important;
    }
    .order-ticket-print .ticket-fulfillment {
        font-size: 16px !important;
        font-weight: 700 !important;
        margin: 4px 0 !important;
    }
    .order-ticket-print .ticket-label {
        font-size: 16px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        margin-bottom: 2px !important;
    }
    .order-ticket-print .ticket-value,
    .order-ticket-print .ticket-address,
    .order-ticket-print .ticket-item-left,
    .order-ticket-print .ticket-item-mod,
    .order-ticket-print .ticket-checklist-item {
        font-size: 14px !important;
        font-weight: 700 !important;
    }
    .order-ticket-print .ticket-item-right {
        font-size: 14px !important;
        font-weight: 700 !important;
        text-align: right !important;
        width: 10em !important;
        min-width: 10em !important;
        max-width: 10em !important;
    }
    .order-ticket-print .ticket-totals .ticket-total-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: baseline !important;
        width: 100% !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        gap: 8px !important;
        margin: 2px 0 !important;
    }
    .order-ticket-print .ticket-totals .ticket-total-row .ticket-item-left {
        flex: 1 !important;
        min-width: 0 !important;
        text-align: left !important;
    }
    .order-ticket-print .ticket-totals .ticket-total-row .ticket-item-right {
        flex-shrink: 0 !important;
        text-align: right !important;
        width: 10em !important;
        min-width: 10em !important;
        max-width: 10em !important;
    }
    .order-ticket-print .ticket-grand {
        font-size: 20px !important;
        font-weight: 700 !important;
        margin-top: 6px !important;
    }
    .order-ticket-print .ticket-footer,
    .order-ticket-print .ticket-payment {
        font-size: 14px !important;
        font-weight: 700 !important;
    }
    .order-ticket-print .ticket-handoff-code {
        font-size: 18px !important;
        font-weight: 700 !important;
    }
    .order-ticket-print .ticket-thanks {
        font-size: 16px !important;
        font-weight: 700 !important;
    }
    .order-ticket-print .ticket-cut {
        font-size: 12px !important;
        margin-top: 8px !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    .ticket-print-page.ticket-w58 .order-ticket-print {
        font-size: 12px !important;
    }
    .ticket-print-page.ticket-w58 .order-ticket-print .ticket-restaurant {
        font-size: 16px !important;
    }
    .ticket-print-page.ticket-w58 .order-ticket-print .ticket-folio,
    .ticket-print-page.ticket-w58 .order-ticket-print .ticket-label {
        font-size: 15px !important;
    }
    .ticket-print-page.ticket-w58 .order-ticket-print .ticket-grand {
        font-size: 18px !important;
    }
    .ticket-print-page.ticket-w58 .order-ticket-print .ticket-value,
    .ticket-print-page.ticket-w58 .order-ticket-print .ticket-address,
    .ticket-print-page.ticket-w58 .order-ticket-print .ticket-item-left {
        font-size: 13px !important;
    }
    .ticket-print-page.ticket-w58 .order-ticket-print .ticket-item-right {
        font-size: 13px !important;
        text-align: right !important;
        width: 10em !important;
        min-width: 10em !important;
        max-width: 10em !important;
    }

    .order-ticket-print .ticket-item-line {
        display: flex !important;
        justify-content: space-between !important;
        gap: 0 !important;
        margin: 2px 0 !important;
    }
    .order-ticket-print .ticket-amounts-table {
        width: 100% !important;
        border-collapse: collapse !important;
        table-layout: fixed !important;
    }
    .order-ticket-print .ticket-amounts-table .ticket-td-right {
        text-align: right !important;
        width: 1% !important;
    }
    .order-ticket-print .ticket-cut {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .ticket-batch-item {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        page-break-after: always;
    }
    .ticket-batch-item:last-child { page-break-after: auto; }
    .ticket-batch-item .ticket-type-label {
        margin-bottom: 2px !important;
        font-size: 14px !important;
    }
    .ticket-sep { margin: 4px 0 !important; }
    .ticket-section { margin: 4px 0 !important; }
    .ticket-checklist { margin: 4px 0 !important; }
    .ticket-footer { margin-top: 4px !important; margin-bottom: 0 !important; }

    .no-print,
    .btn,
    header,
    aside,
    .app-sidebar,
    .app-topbar,
    .loading-progress,
    .spinner-border,
    #blazor-error-ui { display: none !important; }
    .ticket-cut-line { page-break-after: always; }
    .page-break { page-break-after: always !important; }
}
.ticket-58mm .order-ticket-print { max-width: 58mm; }
