/* SinFila Admin */

[x-cloak] { display: none !important; }

:root {
    /* Mundo crema (2026-10-15): barra lateral verde albahaca, lienzo crema,
       tarjetas blancas de borde cálido, naranja SinFila para la acción. */
    --admin-sidebar: #15301f;
    --admin-sidebar-hover: #1f4d36;
    --admin-accent: #fe5b22;
    --admin-accent-hover: #ff6b35;
    --admin-accent-rgb: 254, 91, 34;
    /* Texto sobre el naranja: casi negro (6:1); blanco daba 3.1:1. */
    --admin-on-accent: #1a0b04;
    --admin-bg: #fff9f1;
    --admin-card: #ffffff;
    --admin-border: #ede1cb;
    --admin-text: #241608;
    --admin-muted: #6b5642;
    --admin-danger: #c0271d;
    --admin-warning: #a85d06;
    --admin-success: #12805c;
    --admin-font: 'Manrope', system-ui, sans-serif;
    --admin-display: 'Fraunces', Georgia, serif;
    --admin-sidebar-w: 260px;
}

* { box-sizing: border-box; }

body.admin-body {
    margin: 0;
    font-family: var(--admin-font);
    background: var(--admin-bg);
    color: var(--admin-text);
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--admin-sidebar-w);
    background: var(--admin-sidebar);
    color: #fff9f1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.24s ease;
}

.admin-sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar-brand h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}

.admin-sidebar-brand span {
    font-size: 0.75rem;
    color: #a7c4b2;
}

.admin-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #d6e4da;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--admin-sidebar-hover);
    color: white;
}

.admin-nav a.active {
    background: var(--admin-accent);
    color: var(--admin-on-accent);
}

.admin-nav a.active .admin-nav-icon { color: var(--admin-on-accent); }

.admin-nav-icon {
    flex-shrink: 0;
    opacity: 0.8;
}

.admin-nav a:hover .admin-nav-icon,
.admin-nav a.active .admin-nav-icon {
    opacity: 1;
}

.admin-nav-group-label {
    padding: 16px 14px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #86a894;
}

.admin-nav-group-label:first-child {
    padding-top: 4px;
}

.admin-nav-back {
    font-size: 0.8rem;
    color: #a7c4b2;
    margin-bottom: 8px;
}

.admin-nav-back:hover {
    color: white;
    background: transparent;
}

.admin-nav-badge {
    margin-left: auto;
}

.admin-sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: #a7c4b2;
}

.admin-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--admin-sidebar-w);
    padding: 28px 32px;
    max-width: calc(1200px + var(--admin-sidebar-w));
}

.admin-header {
    margin-bottom: 28px;
}

.admin-header h2 {
    margin: 0 0 6px;
    font-size: 1.75rem;
    font-weight: 800;
}

.admin-header p {
    margin: 0;
    color: var(--admin-muted);
    font-size: 0.95rem;
}

.admin-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.admin-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 20px;
    align-items: start;
}

.admin-cards-grid .admin-card {
    max-width: none;
    margin: 0;
}

@media (max-width: 980px) {
    .admin-cards-grid { grid-template-columns: 1fr; }
}

.admin-stat {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 20px;
}

.admin-stat-label {
    font-size: 0.8rem;
    color: var(--admin-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.admin-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--admin-muted);
    font-weight: 600;
}

.admin-table tr:hover td {
    background: #fffaf3;
}

.admin-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-active { background: #dcfce7; color: #166534; }
.badge-suspended { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-preparing { background: #ffedd5; color: #9a3412; }
.badge-ready { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #fff1de; color: #5a4632; }
.badge-alert { background: #c0392b; color: #fff; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-neutral { background: #fff1de; color: #6b5642; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-danger-soft { background: #fee2e2; color: #b91c1c; }

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    font-family: var(--admin-font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: filter 0.15s;
}

.admin-btn-primary {
    background: var(--admin-accent);
    color: var(--admin-on-accent);
}

.admin-btn-primary:hover { filter: brightness(1.08); }

.admin-btn-secondary {
    background: white;
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
}

.admin-btn-danger {
    background: var(--admin-danger);
    color: white;
}

/* Borrado por fila: destructivo pero sin competir con el primario.
   Fantasma en reposo, se tiñe de rojo al hover/focus. */
.admin-btn-danger-ghost {
    background: transparent;
    color: var(--admin-danger);
    border: 1px solid var(--admin-border);
}

.admin-btn-danger-ghost:hover,
.admin-btn-danger-ghost:focus-visible {
    background: #fef2f2;
    border-color: var(--admin-danger);
}

.admin-btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .admin-form-grid { grid-template-columns: 1fr; }
}

.admin-form-group {
    margin-bottom: 16px;
}

.admin-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--admin-muted);
    margin-bottom: 6px;
}

.admin-form-group input,
.admin-form-group select,
.admin-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    font-family: var(--admin-font);
    font-size: 0.9rem;
}

.admin-form-group input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus,
.admin-input:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(var(--admin-accent-rgb), 0.18);
}

/* Inputs fuera de .admin-form-group (p. ej. Wompi) */
.admin-input,
.admin-form-grid .admin-form-group input,
.admin-form-grid .admin-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    font-family: var(--admin-font);
    font-size: 0.9rem;
    background: #fff;
    color: var(--admin-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-input::placeholder {
    color: #9b8875;
}

.admin-input--mono {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.admin-secret-field .admin-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.admin-secret-field .admin-input {
    padding-right: 72px;
}

.admin-input-toggle {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    padding: 0 12px;
    border: none;
    border-radius: 6px;
    background: var(--admin-bg);
    color: var(--admin-muted);
    font-family: var(--admin-font);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.admin-input-toggle:hover {
    background: var(--admin-border);
    color: var(--admin-text);
}

.admin-form-grid .admin-form-group {
    margin-bottom: 0;
}

.admin-pickup-code-block {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--admin-border);
}

.admin-pickup-code-block label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--admin-muted);
    margin-bottom: 8px;
}

.admin-pickup-code-input {
    width: 100%;
    max-width: 200px;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    text-align: center;
    text-transform: uppercase;
    background: #fff;
    color: var(--admin-text);
}

.admin-pickup-code-input:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(var(--admin-accent-rgb), 0.18);
}

.admin-pickup-code-input::placeholder {
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 500;
    color: #9b8875;
}

.admin-error {
    color: var(--admin-danger);
    font-size: 0.8rem;
    margin-top: 4px;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--admin-border);
    padding-bottom: 0;
}

.admin-tab {
    padding: 10px 16px;
    border: none;
    background: none;
    font-family: var(--admin-font);
    font-weight: 600;
    color: var(--admin-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.admin-tab.active {
    color: var(--admin-accent);
    border-bottom-color: var(--admin-accent);
}

.admin-order-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-order-items li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--admin-border);
}

.admin-order-items li:last-child {
    border-bottom: none;
}

.admin-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(40% 50% at 12% 18%, rgba(242, 169, 59, 0.28), transparent 70%),
        radial-gradient(40% 50% at 90% 85%, rgba(254, 91, 34, 0.16), transparent 70%),
        var(--admin-bg);
}

.admin-login-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 28px;
    padding: 44px 40px 34px;
    width: 100%;
    max-width: 430px;
    box-shadow: 0 30px 60px -34px rgba(66, 36, 10, 0.45);
}

.admin-login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 26px;
    font-family: var(--admin-display);
    font-weight: 700;
    font-size: 1.35rem;
}

.admin-login-brand span {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--admin-accent);
    transform: rotate(-6deg);
    box-shadow: inset 0 0 0 9px var(--admin-accent), inset 0 0 0 12px #fff;
}

.admin-login-card h1 {
    margin: 0 0 8px;
    font-size: 2.1rem;
    line-height: 1.05;
}

.admin-login-card h1 em { font-style: italic; font-weight: 500; color: #e94e17; }

.admin-login-card .subtitle {
    color: var(--admin-muted);
    margin: 0 0 28px;
    font-size: 0.93rem;
}

.admin-login-card .admin-form-group input {
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--admin-bg);
}

.admin-login-remember { margin: 4px 0 20px; }
.admin-login-card .admin-btn-primary { border-radius: 999px; padding: 13px 18px; font-size: 0.97rem; justify-content: center; }
.admin-login-foot { margin: 22px 0 0; text-align: center; font-size: 0.85rem; }
.admin-login-foot a { color: var(--admin-muted); font-weight: 600; text-decoration: none; }
.admin-login-foot a:hover { color: #c43a0a; }

.admin-flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.admin-flash-success {
    background: #dcfce7;
    color: #166534;
}

.admin-flash-error {
    background: #fee2e2;
    color: #b91c1c;
}

.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-modal {
    background: white;
    border-radius: 12px;
    padding: 28px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.admin-modal h3 {
    margin: 0 0 20px;
}

.admin-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

.admin-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.admin-hint-box {
    background: #fffaf3;
    border: 1px solid #ede1cb;
    border-radius: 8px;
    padding: 12px 16px;
}

.admin-tour-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--admin-accent);
    color: var(--admin-on-accent);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    z-index: 40;
}

.admin-tour-fab:hover { filter: brightness(1.08); }

.admin-btn-link {
    background: none;
    border: none;
    color: #6b5642;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
}

/* Feedback visual mientras una acción de Livewire está en curso (guardar,
   eliminar, etc.) — evita clics dobles en formularios sin loading por botón. */
.admin-busy {
    pointer-events: none;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}

/* ==================================================== */
/* ADMIN — refresh (móvil, estados, utilidades)         */
/* ==================================================== */

/* --- Botones: feedback físico + foco visible --- */
.admin-btn { transition: filter 0.15s ease, transform 0.1s ease; }
.admin-btn:active { transform: scale(0.97); }
.admin-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--admin-accent-rgb), 0.35);
}
.admin-btn-danger:focus-visible {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

/* --- Barra superior móvil (hamburguesa + contexto) --- */
.admin-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 90;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--admin-sidebar);
    color: #fffaf3;
}

.admin-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fffaf3;
    cursor: pointer;
}

.admin-menu-toggle:active { transform: scale(0.94); }

.admin-topbar-title {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

/* --- Barra inferior para roles de piso (cajero / mesero / cocina) --- */
.admin-tabbar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    background: var(--admin-sidebar);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
}

.admin-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 10px;
    border-radius: 10px;
    color: #a7c4b2;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
}

.admin-tabbar a.active {
    color: var(--admin-on-accent);
    background: var(--admin-accent);
}

.admin-tabbar-logout { display: flex; }
.admin-tabbar-logout button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 10px;
    background: none;
    border: none;
    border-radius: 10px;
    color: #a7c4b2;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
}

.admin-sidebar-profile-link {
    display: inline-block;
    margin-top: 6px;
    color: #a7c4b2;
    font-size: 0.8rem;
    text-decoration: none;
}
.admin-sidebar-profile-link:hover { color: #fff; }

@media (max-width: 900px) {
    .admin-sidebar {
        transform: translateX(-100%);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    }

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

    .admin-main {
        margin-left: 0;
        max-width: 100%;
        padding: 20px 16px 80px;
    }

    .admin-topbar { display: flex; }

    .admin-sidebar-overlay.is-open { display: block; }

    body.admin-floor .admin-tabbar { display: flex; }

    body.admin-floor .admin-sidebar { display: none; }

    body.admin-floor .admin-topbar .admin-menu-toggle { display: none; }
}

/* --- Stat: menos plantilla "hero-métrica" (label arriba, número contenido,
   alineado a la izquierda, con espacio para una línea de contexto) --- */
.admin-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
}

.admin-stat-label {
    order: -1;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.admin-stat-value {
    font-size: 1.5rem;
    line-height: 1.1;
}

.admin-stat--accent .admin-stat-value { color: var(--admin-accent); }

.admin-stat-note {
    font-size: 0.78rem;
    color: var(--admin-muted);
    font-weight: 500;
}

/* --- Píldoras de estado que faltaban --- */
.badge-awaiting-payment { background: #fee2e2; color: #b91c1c; }
.badge-awaiting-approval { background: #fef9c3; color: #854d0e; }
.badge-in_fila,
.badge-en-fila { background: #fef3c7; color: #92400e; }

/* --- Alertas / recomendaciones con severidad --- */
.admin-notice-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.admin-notice {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--admin-border);
}

.admin-notice:last-child { border-bottom: none; }

.admin-notice--warn .admin-notice-text::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    background: var(--admin-danger);
    vertical-align: middle;
}

/* --- Utilidades (reemplazan style="" inline) --- */
.admin-card-title { margin: 0 0 12px; font-size: 1rem; }
.admin-card--narrow { max-width: 480px; }
.admin-note { font-size: 0.85rem; color: var(--admin-muted); }
.admin-cell-sub { color: var(--admin-muted); font-size: 0.85rem; }
.admin-cell-list { margin: 0; padding-left: 16px; font-size: 0.85rem; }
.admin-cell-actions { white-space: nowrap; display: flex; gap: 6px; flex-wrap: wrap; }
.admin-cell-negative { color: var(--admin-danger); font-weight: 700; }
.admin-table-empty { color: var(--admin-muted); text-align: center; padding: 28px 12px; }
.admin-pagination { margin-top: 16px; }
.admin-row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-btn-cluster { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-filter-row { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-input--search { min-width: 220px; flex: 1; }
.admin-input--filter { min-width: 180px; }
.admin-mb-12 { margin-bottom: 12px; }
.admin-mb-16 { margin-bottom: 16px; }
.admin-mt-16 { margin-top: 16px; display: inline-block; }
.admin-mt-24 { margin-top: 24px; }
.admin-stat-value--sm { font-size: 1rem; }
.admin-note--tight { margin-top: -8px; margin-bottom: 12px; }
.admin-inline-field { display: flex; gap: 6px; align-items: center; }
.admin-change-hint { font-size: 0.85rem; color: #5a4632; white-space: nowrap; }
.admin-input--xs { max-width: 110px; }
.admin-arqueo-table td { padding: 5px 10px; border-bottom: none; }
.admin-arqueo-table tfoot td { border-top: 1px solid var(--admin-border); padding-top: 10px; }

.admin-zone-map { height: 260px; margin-top: 8px; border-radius: 10px; overflow: hidden; border: 1px solid var(--admin-border); background: #f3e8d6; }
.admin-zone-map-wrap { margin-top: 8px; }

.admin-hourly { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: 12px; }
.admin-hourly-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.admin-hourly-bar { width: 100%; min-height: 2px; background: var(--admin-accent); border-radius: 3px 3px 0 0; }
.admin-hourly-label { font-size: 0.65rem; color: var(--admin-muted); }
.admin-arqueo-table .admin-input--xs { max-width: 90px; }
.admin-input--sm { max-width: 140px; }
.admin-split-row { padding: 12px 0; border-bottom: 1px solid var(--admin-border); }
.admin-split-row:last-child { border-bottom: none; }
.admin-split-editor { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.admin-split-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* --- Utilidades de layout (reemplazan style="" repetidos) --- */
.admin-flex { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-flex-col { display: flex; flex-direction: column; gap: 8px; }
.admin-flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.admin-flex-center { display: flex; align-items: center; gap: 8px; }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.admin-grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
@media (max-width: 720px) {
    .admin-grid-2 { grid-template-columns: 1fr; }
    .admin-grid-3 { grid-template-columns: 1fr; }
}
.admin-muted-text { color: var(--admin-muted); }
.admin-small { font-size: 0.85rem; }
.admin-xs { font-size: 0.8rem; }
.admin-strong { font-weight: 700; }
.admin-mt-8 { margin-top: 8px; }
.admin-mt-12 { margin-top: 12px; }
.admin-mt-20 { margin-top: 20px; }
.admin-mb-8 { margin-bottom: 8px; }
.admin-mb-24 { margin-bottom: 24px; }
.admin-mb-0 { margin-bottom: 0; }
.admin-divider-top { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--admin-border); }
.admin-pl-16 { padding-left: 16px; }
.admin-offer-card { border-color: var(--admin-accent); }
.admin-offer-timer { font-weight: 800; color: var(--admin-accent); font-variant-numeric: tabular-nums; }
.admin-w-narrow { max-width: 480px; }
.admin-w-mid { max-width: 640px; }
.admin-nowrap { white-space: nowrap; }
.admin-w-full { width: 100%; }
.admin-list-plain { list-style: none; margin: 0; padding: 0; }
.admin-uppercase-input { text-transform: uppercase; }
.admin-hr { margin: 20px 0; border: none; border-top: 1px solid var(--admin-border); }

/* --- Más utilidades del barrido de inline styles --- */
.admin-back-link { color: var(--admin-muted); font-size: 0.9rem; text-decoration: none; }
.admin-back-link:hover { color: var(--admin-text); }
.admin-p-tight { margin: 4px 0; }
.admin-field-hint { font-size: 0.75rem; color: var(--admin-muted); margin-top: 4px; }
.admin-h4 { margin: 16px 0 8px; }
.admin-total-divider {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 800;
}
.admin-line-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--admin-border);
}
.admin-line-row:last-child { border-bottom: none; }
.admin-subcard {
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}

.admin-subcard.is-paid {
    opacity: 0.6;
    background: var(--admin-bg);
}

.admin-qr-share {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 8px;
}

.admin-qr {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 6px;
}

.admin-qr img,
.admin-qr canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.admin-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.admin-tile {
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}
.admin-tile-label { font-weight: 700; }
.admin-tile-state { font-size: 0.8rem; color: #5a4632; margin: 6px 0; }
.admin-tile.is-occupied { background: #fee2e2; }
.admin-tile.is-free { background: #dcfce7; }
.admin-thumb-sm {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    vertical-align: middle;
    margin-right: 8px;
}
.admin-img-preview { max-width: 120px; border-radius: 8px; margin-bottom: 8px; display: block; }
.admin-flex-1 { flex: 1; }
.admin-flex-2 { flex: 2 1 200px; min-width: 0; }
.admin-flex-row-6 { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin-bottom: 6px; }
.admin-flex-col-8 { display: flex; flex-direction: column; gap: 8px; }
.admin-line-row--block { display: block; padding: 10px 0; border-bottom: 1px solid var(--admin-border); }
.admin-line-row--block:last-child { border-bottom: none; }
.admin-sublist { margin: 6px 0 0; padding-left: 18px; color: #5a4632; }
.admin-bill-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: var(--admin-bg);
    font-weight: 800;
    font-size: 1.05rem;
}

/* --- Cierre del barrido de inline styles --- */
.admin-section-note { font-size: 0.85rem; color: var(--admin-muted); margin: 0 0 16px; }
.admin-col-span { grid-column: 1 / -1; }
.admin-mt-0 { margin-top: 0; }
.admin-mt-10 { margin-top: 10px; }
.admin-mt-14 { margin-top: 14px; }
.admin-mb-20 { margin-bottom: 20px; }
.admin-word-break { word-break: break-all; }
.admin-w-720 { max-width: 720px; }
.admin-w-900 { max-width: 900px; }
.admin-filter-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.admin-check-block { display: block; font-weight: 400; }
.admin-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
    background: var(--swatch, #999);
}
.admin-logo-preview {
    max-height: 80px;
    max-width: 200px;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    margin-bottom: 12px;
    display: block;
}
.admin-logo-preview--sm { max-height: 60px; }
.admin-logo-preview--xs { max-height: 32px; max-width: 32px; border-radius: 6px; }
.admin-shift-divider {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.admin-shift-label { font-size: 0.7rem; opacity: 0.6; margin: 0 0 8px; }
.admin-shift-value { font-size: 0.75rem; opacity: 0.85; margin: 0 0 6px; }

/* Campo de dinero (pesos enteros, separador de miles) */
.admin-money-input {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    min-height: 40px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    max-width: 220px;
}

.admin-money-input:focus-within {
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(var(--admin-accent-rgb), 0.18);
}

.admin-money-input-symbol {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: var(--admin-bg);
    color: var(--admin-muted);
    font-weight: 700;
    font-size: 0.9rem;
}

.admin-money-input input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    padding: 10px 12px;
    font-family: var(--admin-font);
    font-size: 0.9rem;
    color: var(--admin-text);
    background: transparent;
}

/* Zonas de entrega — fila editable en Ajustes */
.admin-zone-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.admin-zone-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 92px;
}

.admin-zone-field--name {
    flex: 1;
    min-width: 140px;
}

.admin-zone-field.admin-checkbox-row {
    flex-direction: row;
    align-items: center;
    width: auto;
    gap: 6px;
    padding-bottom: 9px;
}

.admin-zone-row input[type="text"],
.admin-zone-row input[type="number"] {
    width: 100%;
}

/* ==================================================== */
/* DASHBOARD — "operación ahora" (reemplaza el grid KPI) */
/* ==================================================== */

.ops-now { padding: 20px 22px; }

.ops-flow {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 4px 18px;
}

.ops-stage {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 68px;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    padding: 4px 6px;
    margin: -4px -6px;
    transition: background-color 0.12s ease;
}

a.ops-stage:hover { background: var(--admin-bg); }

.ops-stage-num {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--admin-text);
}

.ops-stage.is-live .ops-stage-num { color: var(--admin-accent); }

.ops-stage-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--admin-muted);
    letter-spacing: 0.03em;
}

.ops-stage--muted .ops-stage-num { color: var(--admin-muted); font-weight: 700; }

.ops-arrow {
    align-self: center;
    color: var(--admin-border);
    font-size: 1.1rem;
    line-height: 1;
    margin-bottom: 6px;
}

.ops-sep {
    width: 1px;
    align-self: stretch;
    background: var(--admin-border);
    margin: 2px 6px;
}

.ops-today {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--admin-border);
    font-size: 0.9rem;
    color: var(--admin-muted);
}

.ops-today strong { color: var(--admin-text); }

.ops-summary {
    margin: 0;
    font-size: 1rem;
    color: var(--admin-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.ops-summary strong { color: var(--admin-text); font-size: 1.15rem; }
.ops-summary-dim { color: var(--admin-muted); }

@media (max-width: 560px) {
    .ops-arrow { display: none; }
    .ops-sep { display: none; }
    .ops-flow { gap: 12px 20px; }
}
.admin-metric-accent { font-size: 1.4rem; font-weight: 800; color: var(--admin-accent); }

/* Empty state con marco (reemplaza el texto pelado) */
.admin-empty {
    text-align: center;
    color: var(--admin-muted);
    padding: 28px 16px;
    border: 1px dashed var(--admin-border);
    border-radius: 10px;
    font-size: 0.9rem;
}

/* --- Sidebar: cerrar (móvil), selector de sucursal, logout --- */
.admin-sidebar-brand { position: relative; }

.admin-sidebar-close {
    display: none;
    position: absolute;
    top: 16px;
    right: 12px;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff9f1;
    cursor: pointer;
}

.admin-nav-location { margin: 8px 0; }

.admin-nav-location-select {
    width: 100%;
    font-size: 0.8rem;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--admin-sidebar-hover);
    color: #fff9f1;
    font-family: var(--admin-font);
}

.admin-sidebar-logout { margin-top: 12px; }
.admin-sidebar-logout .admin-btn { width: 100%; }

@media (max-width: 900px) {
    .admin-sidebar-close { display: inline-flex; }
}

/* Fase H — historias (panel del restaurante) */
.story-preview { max-width: 160px; border-radius: 10px; margin-top: 10px; }
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 12px; }
.story-tile { border: 1px solid var(--admin-border); border-radius: 12px; overflow: hidden; background: var(--admin-bg-alt, #2a1a0c); }
.story-tile img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; }
.story-tile__meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.story-tile__meta p { margin: 0; font-size: 0.82rem; }
.story-tile--dim img { opacity: 0.55; }

/* R-1 — checklist de recogida */
.admin-pickup-list { margin: 0 0 12px; padding-left: 18px; font-size: 0.9rem; }
.admin-pickup-list li { margin-bottom: 3px; }

/* R-2 — mini-mapa y navegación del rider */
.rider-nav-card { border: 1px solid var(--admin-border); border-radius: 12px; overflow: hidden; background: var(--admin-card); }
.rider-map { height: 220px; width: 100%; background: #f3e8d6; }
.rider-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    font-size: 0.9rem;
}

/* R-3 — ganancia estimada en oferta + panel Hoy */
.admin-offer-earn { margin: 4px 0 8px; font-size: 0.92rem; }
.rider-today { display: flex; gap: 20px; margin-top: 8px; flex-wrap: wrap; }
.rider-today > div { display: flex; flex-direction: column; }
.rider-today .admin-stat-value { font-size: 1.25rem; }

/* R-4 — notas destacadas + chat rápido del rider */
.rider-note-box { padding: 10px 12px; border-radius: 10px; background: rgba(var(--admin-accent-rgb), 0.1); border: 1px solid var(--admin-border); font-size: 0.9rem; }
.rider-note-box p { margin: 4px 0 0; }
.rider-chat { margin: 8px 0; padding: 8px 10px; background: var(--admin-bg); border-radius: 8px; font-size: 0.85rem; }
.rider-chat__line { margin: 2px 0; }
.rider-chat__line span { font-weight: 700; }
.rider-chat__line--customer { color: var(--admin-accent); }
.rider-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* R-5 — reportar problema + SOS */
.rider-sos {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: none;
    border-radius: 10px;
    background: var(--admin-danger);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
}
.admin-sos-banner {
    background: #7f1d1d;
    color: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
}
.admin-sos-banner .admin-btn { align-self: flex-start; }
.admin-radio-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 0.9rem; font-weight: 400; }

/* R-6 — panel del rider mobile-first */
.rider-view .admin-subcard { padding: 16px; margin-bottom: 12px; }
.rider-view .admin-card { padding: 16px; }
.rider-view .admin-subcard .admin-btn-cluster { flex-direction: column; align-items: stretch; gap: 8px; }
.rider-view .admin-subcard .admin-btn-cluster .admin-btn { width: 100%; justify-content: center; padding: 13px 16px; font-size: 0.95rem; }
.rider-view .admin-subcard strong { font-size: 1.05rem; }
@media (min-width: 720px) {
    .rider-view .admin-subcard .admin-btn-cluster { flex-direction: row; align-items: center; }
    .rider-view .admin-subcard .admin-btn-cluster .admin-btn { width: auto; }
}

/* D-7 — batching */
.admin-inline-check { display: inline-flex; margin-right: 6px; vertical-align: middle; }
.admin-inline-check input { width: 18px; height: 18px; }

/* D-10 — onboarding del repartidor */
.admin-doc-links { display: flex; flex-wrap: wrap; gap: 6px; }

/* Torre de control del local — mapa en vivo de repartidores y pedidos */
.tower-map { height: 420px; width: 100%; border-radius: 8px; background: #f3e8d6; }
.tower-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.tower-row--late { background: #fef2f2; }
.tower-row--late td:first-child { box-shadow: inset 3px 0 0 #c0392b; }
@media (max-width: 720px) {
    .tower-map { height: 300px; }
}

/* Incentivos / misiones del repartidor */
.rider-mission { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--admin-border, #ede1cb); border-radius: 10px; }
.rider-mission.is-done { border-color: #1f4d36; background: rgba(26,107,69,0.06); }
.rider-mission__reward { color: #1f4d36; font-weight: 700; white-space: nowrap; }
.rider-mission__bar { height: 8px; border-radius: 999px; background: #ede1cb; overflow: hidden; margin: 8px 0 6px; }
.rider-mission__fill { width: 100%; height: 100%; background: var(--admin-accent, #fe5b22); border-radius: 999px; transform-origin: left; transition: transform .3s ease; }
.rider-mission.is-done .rider-mission__fill { background: #1f4d36; }

/* Mensaje libre repartidor -> cliente (chat sin teléfonos) */
.rider-chat-compose { display: flex; gap: 6px; }
.rider-chat-compose input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 0.9rem; }

/* Filas inactivas en listados admin (proveedores, misiones) */
.admin-row-muted { opacity: 0.55; }

/* Menu engineering — clasificación de platos */
.menu-class--star { background: #dcfce7; color: #166534; }
.menu-class--plowhorse { background: #fef9c3; color: #854d0e; }
.menu-class--puzzle { background: #dbeafe; color: #1e40af; }
.menu-class--dog { background: #fee2e2; color: #991b1b; }

/* Fase P2 — plan base + módulos (Facturación) */
.billing-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.billing-total strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.billing-modules { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--admin-border); }
.billing-module { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--admin-border); }
.billing-module-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.billing-module.is-on .billing-module-info strong::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--admin-success); vertical-align: middle; }
.billing-module-price { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.billing-module-price small { color: var(--admin-muted); }
.billing-module-ending { color: var(--admin-warning); }
.billing-qty { display: flex; align-items: center; gap: 6px; }
.billing-qty-value { min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 600px) {
    .billing-module { grid-template-columns: 1fr auto; }
    .billing-module-action { grid-column: 1 / -1; }
}

/* Fase P3 — Despacho de domicilios */
.dispatch-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.dispatch-kpis { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.dispatch-kpis > div { min-width: 110px; padding: 10px 14px; border-radius: 12px; background: var(--admin-card); border: 1px solid var(--admin-border); }
.dispatch-kpis dt { font-size: 0.72rem; color: var(--admin-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dispatch-kpis dd { margin: 2px 0 0; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dispatch-kpis dd small { font-size: 0.85rem; color: var(--admin-muted); font-weight: 500; }
.dispatch-kpis .is-alert { border-color: var(--admin-danger); }
.dispatch-kpis .is-alert dd { color: var(--admin-danger); }

.dispatch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; margin-top: 20px; align-items: start; }
.dispatch-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.dispatch-lane { background: #f3e8d6; border-radius: 14px; padding: 12px; min-height: 160px; }
.dispatch-lane-title { display: flex; align-items: center; justify-content: space-between; margin: 0; font-size: 0.95rem; }
.dispatch-lane-count { min-width: 24px; padding: 2px 8px; border-radius: 999px; background: var(--admin-card); font-size: 0.8rem; text-align: center; font-variant-numeric: tabular-nums; }
.dispatch-lane--dispatch .dispatch-lane-count { background: var(--admin-accent); color: var(--admin-on-accent); }
.dispatch-lane-hint { margin: 4px 0 10px; font-size: 0.75rem; color: var(--admin-muted); }

.dispatch-card { background: var(--admin-card); border: 1px solid var(--admin-border); border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05); }
.dispatch-card.needs-rider { border-color: rgba(var(--admin-accent-rgb), 0.55); background: linear-gradient(rgba(var(--admin-accent-rgb), 0.05), rgba(var(--admin-accent-rgb), 0.05)), var(--admin-card); }
.dispatch-card.is-late { border-color: rgba(220, 38, 38, 0.55); background: linear-gradient(rgba(220, 38, 38, 0.05), rgba(220, 38, 38, 0.05)), var(--admin-card); }
.dispatch-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dispatch-card-number { font-weight: 700; color: var(--admin-text); text-decoration: none; }
.dispatch-card-number:hover { color: var(--admin-accent); }
.dispatch-card-time { font-size: 0.78rem; color: var(--admin-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dispatch-card.is-late .dispatch-card-time { color: var(--admin-danger); font-weight: 600; }
.dispatch-card-customer { margin: 4px 0 0; font-size: 0.88rem; }
.dispatch-card-address { margin: 2px 0 0; font-size: 0.8rem; color: var(--admin-muted); overflow-wrap: anywhere; }
.dispatch-card-state { margin: 8px 0 0; font-size: 0.8rem; }
.dispatch-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dispatch-pick { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--admin-border); }
.dispatch-pick-rider { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 1px solid var(--admin-border); border-radius: 8px; background: transparent; font: inherit; font-size: 0.85rem; text-align: left; cursor: pointer; }
.dispatch-pick-rider:hover, .dispatch-pick-rider:focus-visible { border-color: var(--admin-accent); background: rgba(var(--admin-accent-rgb), 0.06); }
.dispatch-empty { margin: 4px 0; font-size: 0.8rem; color: var(--admin-muted); }

.dispatch-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.dispatch-map-card { padding: 12px; }
.dispatch-map-card .tower-map { height: 340px; }
.dispatch-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 0; font-size: 0.72rem; color: var(--admin-muted); }
.dispatch-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dispatch-riders { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dispatch-riders li { display: flex; align-items: center; gap: 10px; }
.dispatch-riders li > div { display: flex; flex-direction: column; min-width: 0; }
.dispatch-avatar { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--admin-border); color: var(--admin-text); font-size: 0.8rem; font-weight: 700; }
.dispatch-avatar.is-free { background: var(--admin-accent); color: var(--admin-on-accent); }
.dispatch-avatar.is-busy { background: #7c2d12; color: #fff; }

@media (max-width: 1280px) {
    .dispatch-layout { grid-template-columns: 1fr; }
    .dispatch-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .dispatch-board { grid-template-columns: 1fr; }
    .dispatch-side { grid-template-columns: 1fr; }
}

/* Fase P3 — app del repartidor (/repartidor) */
.rider-app { min-height: 100dvh; background: var(--admin-bg); }
.rider-topbar { position: sticky; top: 0; z-index: 900; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--admin-sidebar); color: #fff; }
.rider-topbar-brand { margin: 0; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.rider-topbar-brand small { font-weight: 500; color: var(--admin-accent); margin-left: 4px; }
.rider-topbar-tenant { font-size: 0.82rem; color: #d6e4da; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rider-main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.rider-main .admin-header { margin-bottom: 12px; }
.rider-main .admin-header h2 { font-size: 1.35rem; }

.rider-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--admin-sidebar); border-top: 1px solid rgba(255, 255, 255, 0.08); }
.rider-tabbar a, .rider-tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 4px; border: 0; border-radius: 12px; background: transparent; color: #a7c4b2; font: inherit; font-size: 0.72rem; font-weight: 600; text-decoration: none; cursor: pointer; width: 100%; }
.rider-tabbar form { display: contents; }
.rider-tabbar a.is-active { color: #fff; background: rgba(var(--admin-accent-rgb), 0.18); }
.rider-tabbar a.is-active svg { color: var(--admin-accent); }
.rider-tabbar a:focus-visible, .rider-tabbar button:focus-visible { outline: 2px solid var(--admin-accent); outline-offset: 2px; }

.rider-login { display: grid; place-items: center; padding: 24px 16px; background: var(--admin-sidebar); }
.rider-login-card { width: 100%; max-width: 400px; background: var(--admin-card); border-radius: 20px; padding: 28px 22px; }
.rider-login-card .rider-topbar-brand { color: var(--admin-text); }
.rider-login-card h1 { font-size: 1.5rem; margin: 16px 0 4px; line-height: 1.2; }
.rider-login-card form { margin-top: 20px; }
.rider-login-submit { width: 100%; justify-content: center; padding: 14px; font-size: 1rem; margin-top: 12px; }
.rider-status-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.rider-status-title { display: block; font-size: 1.05rem; }
.rider-status-sub { display: block; font-size: 0.82rem; color: var(--admin-muted); margin-top: 2px; }
.rider-status.is-online { border-color: var(--admin-success); background: linear-gradient(rgba(22, 163, 74, 0.06), rgba(22, 163, 74, 0.06)), var(--admin-card); }
.rider-switch { flex: none; position: relative; width: 60px; height: 34px; border-radius: 999px; border: 0; background: #e0cfb1; cursor: pointer; transition: background-color 0.2s ease; }
.rider-switch-knob { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s ease; }
.rider-status.is-online .rider-switch { background: var(--admin-success); }
.rider-status.is-online .rider-switch-knob { transform: translateX(26px); }
.rider-switch:focus-visible { outline: 2px solid var(--admin-accent); outline-offset: 3px; }
.rider-sos--compact { margin: 4px 0 16px; padding: 12px; font-size: 0.95rem; background: transparent; color: var(--admin-danger); border: 2px solid var(--admin-danger); }
@media (prefers-reduced-motion: reduce) { .rider-switch, .rider-switch-knob { transition: none; } }
.admin-fieldset { border: 1px solid var(--admin-border); border-radius: 12px; padding: 14px 16px 6px; margin: 0; }
.admin-fieldset legend { padding: 0 6px; font-weight: 700; font-size: 0.9rem; }

/* Fase P5 — horario de atención por sucursal */
.hours-now { font-weight: 600; }
.hours-now.is-open { color: var(--admin-success); }
.hours-now.is-closed { color: var(--admin-danger); }
.hours-week { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--admin-border); }
.hours-day { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--admin-border); }
.hours-day-toggle { display: flex; align-items: center; gap: 8px; font-weight: 600; padding-top: 6px; cursor: pointer; }
.hours-closed { padding-top: 6px; color: var(--admin-muted); font-size: 0.9rem; }
.hours-ranges { display: flex; flex-direction: column; gap: 6px; }
.hours-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hours-range input[type="time"] { width: 118px; padding-inline: 8px; }
.hours-day { grid-template-columns: 120px 1fr; }
.hours-day-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.hours-closures { list-style: none; margin: 12px 0 0; padding: 0; }
.hours-closures li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--admin-border); }
@media (max-width: 600px) { .hours-day { grid-template-columns: 1fr; gap: 6px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tour (driver.js) con la tipografía y los botones del panel, no los de la librería */
.driver-popover { font-family: var(--admin-font); border-radius: 12px; padding: 18px 18px 14px; color: var(--admin-text); box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.35); }
.driver-popover-title { font-family: var(--admin-font); font-size: 1rem; font-weight: 700; }
.driver-popover-description { font-family: var(--admin-font); font-size: 0.9rem; line-height: 1.5; color: var(--admin-muted); }
.driver-popover-progress-text { font-family: var(--admin-font); font-size: 0.78rem; color: var(--admin-muted); }
.driver-popover-footer button { font-family: var(--admin-font); font-size: 0.85rem; font-weight: 600; text-shadow: none; border-radius: 8px; padding: 6px 12px; border: 1px solid var(--admin-border); background: var(--admin-card); color: var(--admin-text); }
.driver-popover-footer .driver-popover-next-btn { background: var(--admin-accent); border-color: var(--admin-accent); color: var(--admin-on-accent); }
.driver-popover-close-btn { font-family: var(--admin-font); }

.dispatch-legend .dot-local { background: var(--admin-sidebar); }
.dispatch-legend .dot-free { background: var(--admin-accent); }
.dispatch-legend .dot-busy { background: var(--admin-text); }
.dispatch-legend .dot-assigned { background: var(--admin-success); }
.dispatch-legend .dot-alert { background: var(--admin-danger); }
.rider-sos { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--admin-font); }
.btn-with-icon { display: inline-flex; align-items: center; gap: 6px; }

/* Demo pública */
.demo-bar { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; font-size: 0.86rem; }
.demo-bar a { color: #9a3412; font-weight: 700; }


/* ---------------------------------------------------- */
/* MUNDO CREMA — títulos de carta (2026-10-15)           */
/* ---------------------------------------------------- */
::selection { background: var(--admin-accent); color: #fff; }

.admin-header h2,
.admin-card-title,
.admin-sidebar-brand h1,
.admin-login-card h1,
.admin-stat-value {
    font-family: var(--admin-display);
    font-weight: 600;
    letter-spacing: -0.015em;
    font-optical-sizing: auto;
}

.admin-header h2 { font-size: 2rem; }
.admin-card { border-radius: 18px; box-shadow: 0 14px 32px -28px rgba(66, 36, 10, 0.45); }
.admin-sidebar-brand h1 { font-weight: 700; }
.admin-nav-group-label { color: var(--admin-mustard, #f2a93b); opacity: 0.85; }

.admin-checkbox { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 600; color: var(--admin-text); cursor: pointer; }
.admin-checkbox input { width: 18px; height: 18px; accent-color: var(--admin-accent); flex: none; }

.admin-table a:not(.admin-btn) { color: #c43a0a; font-weight: 700; text-decoration: none; }
.admin-table a:not(.admin-btn):hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------- */
/* CONTROLES DE FORMULARIO — base común (2026-10-15)     */
/* Muchos inputs del panel no tienen clase propia (tablas*/
/* de caja, arqueo, filtros, modales). :where() deja la  */
/* especificidad en 0: cualquier estilo más concreto gana.*/
/* ---------------------------------------------------- */
:where(.admin-body) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]), select, textarea) {
    box-sizing: border-box;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    background: #fff;
    color: var(--admin-text);
    font-family: var(--admin-font);
    font-size: 0.9rem;
    line-height: 1.3;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

:where(.admin-body) :where(select) {
    appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b5642' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

:where(.admin-body) :where(textarea) { min-height: 84px; resize: vertical; }

:where(.admin-body) :where(input, select, textarea)::placeholder { color: #9b8875; opacity: 1; }

:where(.admin-body) :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(var(--admin-accent-rgb), 0.18);
}

:where(.admin-body) :where(input, select, textarea):disabled { background-color: #fff1de; color: var(--admin-muted); cursor: not-allowed; }

/* Casillas y radios: tamaño fijo, nunca estirados por un "input { width: 100% }" */
.admin-body input[type="checkbox"],
.admin-body input[type="radio"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    padding: 0;
    flex: none;
    accent-color: var(--admin-accent);
    vertical-align: middle;
    cursor: pointer;
}

/* Etiqueta que envuelve una casilla: casilla + texto en una línea, alineados */
.admin-body label:has(> input[type="checkbox"]),
.admin-body label:has(> input[type="radio"]) {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.admin-money-input input:focus { box-shadow: none; }

/* Archivo y color: el botón nativo del navegador también lleva el estilo del panel */
.admin-body input[type="file"] { font-family: var(--admin-font); font-size: 0.85rem; color: var(--admin-muted); border: 0; padding: 0; min-height: 0; background: transparent; }
.admin-body input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 16px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: #fff1de;
    color: var(--admin-text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.admin-body input[type="file"]::file-selector-button:hover { background: #ffe6d4; border-color: var(--admin-accent); }
.admin-body input[type="color"] { width: 72px !important; height: 42px; padding: 4px; border: 1px solid var(--admin-border); border-radius: 10px; background: #fff; cursor: pointer; }
.admin-body input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.admin-body input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }

/* Botones: pill y misma altura que los campos (40px; 32px en -sm) para que filas de
   campo + botón queden alineadas */
.admin-btn { min-height: 40px; justify-content: center; border-radius: 999px; padding: 9px 18px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.admin-btn-sm { min-height: 32px; padding: 5px 13px; }
.admin-btn:disabled, .admin-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.admin-btn-secondary { border: 1px solid var(--admin-border); }
.admin-btn-secondary:hover { border-color: var(--admin-accent); filter: none; background: #fffaf3; }
form .admin-btn, .admin-flex-row-6 > .admin-btn { align-self: center; }
