/* ============================================
   ADMIN ROSARIO YA - ESTILOS MODERNOS
   ============================================ */

:root {
    --primary: #0f766e;
    --primary-dark: #0d5c56;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #2563eb;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ===== LAYOUT ===== */
.admin-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#panelAdmin {
    width: 100%;
}

.login-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #0f766e 0%, #0d5c56 100%);
}

.admin-panel-wrapper {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

/* ===== HEADER ===== */
.admin-header {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.admin-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.admin-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

/* ===== ESTADO / LOADING ===== */
.estado {
    background: var(--card);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== LOCAL CARD ===== */
.local-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.local-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.local-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.logo-preview-container {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background: #f8fafc;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.local-card h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

/* ===== FORMULARIOS ===== */
.local-card label {
    display: block;
    margin-top: 16px;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.local-card input,
.local-card textarea,
.local-card select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--card);
}

.local-card input:focus,
.local-card textarea:focus,
.local-card select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,118,110,0.1);
}

.local-card textarea {
    min-height: 80px;
    resize: vertical;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.badge.activo {
    background: #d1fae5;
    color: #065f46;
}

.badge.inactivo {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== BOTONES ===== */
button {
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.btn-guardar {
    background: var(--success);
    color: white;
}

.btn-guardar:hover {
    background: #15803d;
}

.btn-toggle {
    background: var(--text);
    color: white;
}

.btn-toggle:hover {
    background: #1e293b;
}

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

.btn-eliminar-local:hover {
    background: #b91c1c;
}

/* ===== CATEGORÍAS Y PRODUCTOS ===== */
.menu-admin {
    margin-top: 20px;
    border-top: 2px solid var(--border);
    padding-top: 20px;
}

.categoria-admin {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 16px;
    background: #fafafa;
    overflow: hidden;
}

.categoria-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.categoria-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.categoria-contenido {
    padding: 16px;
}

.producto-admin {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.btn-guardar-producto {
    background: var(--info);
    color: white;
}

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

.btn-agregar-producto {
    background: var(--success);
    color: white;
}

/* ===== OPCIONES ===== */
.opciones-admin {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    margin-top: 12px;
}

.opcion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.btn-eliminar-opcion {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 10px;
}

.nueva-opcion {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.nueva-opcion input {
    flex: 1;
}

.btn-agregar-opcion {
    background: var(--success);
    color: white;
}

/* ===== HORARIOS ===== */
.horarios-admin {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
}

.dia-horario {
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.dia-horario:last-child {
    border-bottom: none;
}

.dia-horario h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.turno-horario {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

.turno-horario span {
    min-width: 65px;
    font-weight: 600;
    font-size: 0.8rem;
}

.turno-horario input {
    width: auto;
    padding: 6px 10px;
}

/* ===== CHECKS ===== */
.checks-local {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.check-item input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ===== ACCIONES ===== */
.acciones {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 2px solid var(--border);
}

.acciones-producto {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ===== LOGIN ===== */
.login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 20px;
    margin-bottom: 12px;
}

.login-brand h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.login-brand p {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-form h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text);
}

.login-form label {
    display: block;
    margin-top: 16px;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,118,110,0.1);
}

.btn-login {
    width: 100%;
    margin-top: 24px;
    padding: 12px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    justify-content: center;
}

.btn-login:hover {
    background: var(--primary-dark);
}

/* ===== NUEVO LOCAL ===== */
.nuevo-local-box {
    background: white;
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.nuevo-local-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.nuevo-local-box h2 {
    font-size: 1.2rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nuevo-local-box p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.45;
}

.nuevo-local-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.nuevo-local-grid label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-size: .86rem;
    font-weight: 750;
}

.nuevo-local-full {
    grid-column: 1 / -1;
}

.nuevo-local-box input,
.nuevo-local-box select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.nuevo-local-box input:focus,
.nuevo-local-box select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 90, 0, .12);
}

.nuevo-local-grid small {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 500;
}

.nuevo-local-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.nuevo-local-options .check-item {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f8fafc;
}

.nuevo-local-box button {
    background: var(--primary);
    color: white;
    width: 100%;
    justify-content: center;
    padding: 12px;
}

@media (max-width: 720px) {
    .nuevo-local-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== UPLOAD IMAGENES ===== */
.logo-upload {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.input-logo-file {
    flex: 1;
}

.btn-subir-logo {
    background: var(--primary);
    color: white;
}

.preview-producto {
    width: 100%;
    max-width: 180px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    background: #e5e7eb;
    display: block;
    margin-bottom: 10px;
}

.upload-producto {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.foto-producto-admin {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
}

.acciones-foto-producto {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.btn-subir-foto-producto {
    background: var(--primary);
    color: white;
}

.btn-eliminar-foto-producto {
    background: var(--danger);
    color: white;
}

/* ===== ICONOS ===== */
.icon {
    width: 1.1em;
    height: 1.1em;
    stroke-width: 1.8;
    stroke: currentColor;
    fill: none;
}

button .icon {
    width: 1em;
    height: 1em;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .admin-panel-wrapper {
        padding: 16px;
    }

    .local-card {
        padding: 16px;
    }

    .categoria-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .categoria-header h3 {
        width: 100%;
    }

    .acciones {
        flex-direction: column;
    }

    .acciones button {
        width: 100%;
        justify-content: center;
    }

    .checks-local {
        flex-direction: column;
        gap: 10px;
    }

    .turno-horario {
        flex-direction: column;
        align-items: flex-start;
    }

    .turno-horario input {
        width: 100%;
    }

    .logo-upload {
        flex-direction: column;
    }

    .upload-producto {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px;
    }

    .local-header {
        flex-direction: column;
        text-align: center;
    }

    .login-brand img {
        width: 64px;
        height: 64px;
    }
}

/* ============================================
   BOTONES DE ORDEN (↑ ↓)
   ============================================ */
.categoria-orden {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-mover-categoria-up,
.btn-mover-categoria-down,
.btn-mover-item-up,
.btn-mover-item-down {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.btn-mover-categoria-up:hover,
.btn-mover-categoria-down:hover,
.btn-mover-item-up:hover,
.btn-mover-item-down:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
    color: var(--primary);
}

.producto-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.producto-orden {
    display: flex;
    gap: 6px;
    align-items: center;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.orden-numero {
    font-size: 0.7rem;
    color: #64748b;
    margin-left: 6px;
    font-family: monospace;
    font-weight: 600;
}

.producto-contenido {
    flex: 1;
    min-width: 200px;
}

@media (max-width: 768px) {
    .producto-header {
        flex-direction: column;
    }

    .producto-orden {
        align-self: flex-start;
    }

    .categoria-orden {
        margin-top: 8px;
    }
}
/* ============================================
   ORDEN DE LOCALES
   ============================================ */

.local-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
}

.local-header-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.local-header-info h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
}

.local-orden-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #f8fafc;
    padding: 6px 12px;
    border-radius: 40px;
    border: 1px solid var(--border);
}

.btn-mover-local-up,
.btn-mover-local-down {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 10px;
    border-radius: 30px;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.btn-mover-local-up:hover,
.btn-mover-local-down:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
    color: var(--primary);
}

.orden-local-numero {
    font-size: 0.8rem;
    color: #64748b;
    font-family: monospace;
    font-weight: 600;
    min-width: 35px;
    text-align: center;
}

@media (max-width: 600px) {
    .local-header-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .local-orden-buttons {
        align-self: flex-start;
    }
}

/* ============================================
   SOLICITUDES
   ============================================ */

.btn-nav {
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: var(--text);
}

.btn-nav.activo {
    background: var(--primary);
    color: white;
}

.solicitud-card {
    border-left: 4px solid var(--warning);
}

.solicitud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.solicitud-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.badge.pendiente {
    background: #fef3c7;
    color: #b45309;
}

.solicitud-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
}

.solicitud-info p {
    margin: 0;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.solicitud-acciones {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-aprobar-solicitud {
    background: var(--success);
    color: white;
}

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

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

.estadisticas-view {
    display: grid;
    gap: 28px;
}

.estadisticas-lista {
    display: grid;
    gap: 24px;
}

.estadisticas-local-card {
    overflow: hidden;
    padding: 28px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.estadisticas-card-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.estadisticas-kicker {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
}

.estadisticas-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.estadisticas-status.activo {
    background: #dcfce7;
    color: #166534;
}

.estadisticas-status.inactivo {
    background: #f1f5f9;
    color: #64748b;
}

.estadisticas-local-card h2 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.12;
    font-weight: 800;
}

.estadisticas-local-card p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.35;
}

.estadisticas-summary-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

.estadisticas-summary-card {
    min-width: 0;
    padding: 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.estadisticas-summary-card.principal {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.estadisticas-summary-card span,
.estadisticas-trend span {
    display: block;
    color: inherit;
    opacity: 0.74;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.estadisticas-summary-card strong {
    display: block;
    margin-top: 6px;
    color: inherit;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    line-height: 1;
    font-weight: 850;
}

.estadisticas-summary-card small {
    display: block;
    margin-top: 8px;
    color: inherit;
    opacity: 0.74;
    font-size: 0.82rem;
    font-weight: 650;
}

.estadisticas-delta {
    display: inline-flex;
    width: fit-content;
    margin-top: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 850;
}

.estadisticas-summary-card .estadisticas-delta {
    display: inline-flex;
    color: inherit;
    opacity: 1;
    text-transform: none;
}

.estadisticas-delta.positivo {
    background: #dcfce7;
    color: #166534;
}

.estadisticas-delta.negativo {
    background: #fee2e2;
    color: #991b1b;
}

.estadisticas-delta.neutral {
    background: #e2e8f0;
    color: #475569;
}

.estadisticas-trend {
    display: grid;
    grid-template-columns: minmax(130px, 180px) 1fr;
    align-items: end;
    gap: 18px;
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.estadisticas-trend strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 0.98rem;
}

.estadisticas-trend-bars {
    display: grid;
    grid-template-columns: repeat(14, minmax(6px, 1fr));
    align-items: end;
    gap: 6px;
    height: 78px;
}

.estadisticas-trend-bar {
    display: flex;
    align-items: end;
    height: 100%;
    min-width: 0;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
}

.estadisticas-trend-bar span {
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(180deg, #14b8a6, #0f766e);
    opacity: 1;
}

.estadisticas-trend-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 78px;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 700;
}

.estadisticas-intelligence-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

.estadisticas-insight-card {
    min-width: 0;
    padding: 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.estadisticas-insight-card.funnel {
    grid-row: span 2;
}

.estadisticas-section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.estadisticas-section-title span {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: #ecfeff;
    color: #0e7490;
    font-size: 0.7rem;
    font-weight: 850;
    text-transform: uppercase;
}

.estadisticas-section-title strong {
    color: #0f172a;
    font-size: 0.94rem;
    line-height: 1.2;
    text-align: right;
}

.estadisticas-funnel,
.estadisticas-rank-list {
    display: grid;
    gap: 12px;
}

.estadisticas-funnel-step,
.estadisticas-rank-item {
    display: grid;
    gap: 7px;
}

.estadisticas-funnel-step > div:first-child,
.estadisticas-rank-item > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.estadisticas-funnel-step strong,
.estadisticas-rank-item strong {
    min-width: 0;
    color: #0f172a;
    font-size: 0.86rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.estadisticas-funnel-step span,
.estadisticas-rank-item span {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 750;
}

.estadisticas-funnel-bar,
.estadisticas-rank-bar {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}

.estadisticas-funnel-bar span,
.estadisticas-rank-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f766e, #14b8a6);
}

.estadisticas-rank-bar span {
    background: linear-gradient(90deg, #334155, #64748b);
}

.estadisticas-hourly {
    display: grid;
    gap: 10px;
}

.estadisticas-hourly-bars {
    display: grid;
    grid-template-columns: repeat(24, minmax(3px, 1fr));
    align-items: end;
    gap: 3px;
    height: 92px;
}

.estadisticas-hourly-bars > span {
    display: flex;
    align-items: end;
    height: 100%;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.estadisticas-hourly-bars > span > span {
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(180deg, #22c55e, #0f766e);
}

.estadisticas-hourly small,
.estadisticas-empty {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 750;
}

.estadisticas-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
}

.estadisticas-divider {
    height: 1px;
    margin: 24px 0;
    background: #e2e8f0;
}

.estadisticas-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.estadisticas-metric-card {
    min-height: 126px;
    padding: 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.estadisticas-metric-card:hover {
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.estadisticas-metric-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
    font-size: 0.88rem;
    line-height: 1.25;
    font-weight: 800;
}

.estadisticas-metric-label .icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: #0f766e;
}

.estadisticas-metric-card strong {
    display: block;
    margin-top: 14px;
    color: #0f172a;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    line-height: 1;
    font-weight: 850;
}

.estadisticas-metric-card small {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 650;
}

@media (max-width: 600px) {
    .solicitud-info {
        grid-template-columns: 1fr;
    }

    .solicitud-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .estadisticas-local-card {
        padding: 20px;
        border-radius: 18px;
    }

    .estadisticas-card-header,
    .estadisticas-trend {
        grid-template-columns: 1fr;
    }

    .estadisticas-card-header {
        flex-direction: column;
        gap: 12px;
    }

    .estadisticas-summary-grid {
        grid-template-columns: 1fr;
    }

    .estadisticas-intelligence-grid {
        grid-template-columns: 1fr;
    }

    .estadisticas-insight-card.funnel {
        grid-row: auto;
    }

    .estadisticas-section-title {
        display: grid;
    }

    .estadisticas-section-title strong {
        text-align: left;
    }

    .estadisticas-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .estadisticas-metric-card {
        min-height: 118px;
        padding: 14px;
    }
}

/* ===== PANEL PROFESIONAL ===== */
.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.admin-logout {
    flex: 0 0 auto;
}

.btn-nav {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: #475569;
    background: transparent;
    white-space: nowrap;
}

.btn-nav:hover {
    background: #f8fafc;
    transform: none;
}

.btn-nav.activo {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.admin-summary-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.admin-summary-card span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-summary-card strong {
    display: block;
    margin-top: 8px;
    color: var(--text);
    font-size: 2rem;
    line-height: 1;
}

.admin-summary-card small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-weight: 650;
}

.locales-stack {
    display: grid;
    gap: 18px;
}

.local-card-editor {
    margin-bottom: 0;
}

.local-header-info p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.local-quick-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.local-quick-metrics span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #f8fafc;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 750;
}

.multirubro-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.multirubro-section h4 {
    margin-bottom: 12px;
    color: var(--primary);
}

.estado-vacio {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 220px;
    padding: 36px;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius);
    background: #fff;
    color: var(--text-muted);
    text-align: center;
}

.estado-vacio .icon {
    width: 46px;
    height: 46px;
    color: var(--primary);
}

.estado-vacio strong {
    color: var(--text);
    font-size: 1rem;
}

.estado-vacio p {
    max-width: 520px;
    margin: 0;
}

.pedido-card {
    display: grid;
    gap: 16px;
}

.pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.pedido-header h2 {
    margin: 4px 0;
    font-size: 1.25rem;
}

.pedido-header p {
    margin: 0;
    color: var(--text-muted);
}

.pedido-kicker {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.pedido-header-side {
    display: grid;
    justify-items: end;
    gap: 8px;
    flex: 0 0 auto;
}

.pedido-header-side strong {
    color: var(--text);
    font-size: 1.6rem;
    line-height: 1;
}

.pedido-estado.estado-nuevo {
    background: #dbeafe;
    color: #1d4ed8;
}

.pedido-estado.estado-confirmado,
.pedido-estado.estado-preparando {
    background: #fef3c7;
    color: #92400e;
}

.pedido-estado.estado-enviado {
    background: #e0f2fe;
    color: #0369a1;
}

.pedido-estado.estado-entregado {
    background: #dcfce7;
    color: #166534;
}

.pedido-items {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.pedido-item,
.pedido-total-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.pedido-item span {
    min-width: 0;
}

.pedido-total-row {
    flex-wrap: wrap;
    border-bottom: 0;
    background: #f8fafc;
}

.btn-estado-pedido {
    background: #eef2ff;
    color: #3730a3;
}

.btn-estado-pedido:disabled {
    cursor: default;
    opacity: 0.58;
    transform: none;
}

.app-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    max-width: min(380px, calc(100vw - 36px));
    padding: 14px 16px;
    border-radius: var(--radius);
    background: #0f172a;
    color: #fff;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.medio-pago-item,
.zona-envio-item,
.nuevo-medio-pago,
.nueva-zona-envio,
.nueva-categoria,
.nuevo-producto {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.medio-pago-item,
.zona-envio-item {
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.btn-toggle-categoria {
    padding: 7px;
    background: #f8fafc;
    color: var(--text);
    border: 1px solid var(--border);
}

.promo-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 0.82rem;
}

.categoria-info {
    flex: 1;
    min-width: 180px;
}

.categoria-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .admin-header {
        display: grid;
    }

    .admin-logout {
        width: 100%;
        justify-content: center;
    }

    .admin-summary-grid {
        grid-template-columns: 1fr;
    }

    .pedido-header {
        display: grid;
    }

    .pedido-header-side {
        justify-items: start;
    }

    .pedido-item,
    .pedido-total-row {
        align-items: flex-start;
    }
}

.tv-admin-card {
    border-top: 4px solid #dc2626;
}

.tv-admin-header {
    align-items: flex-start;
}

.tv-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 22px;
    align-items: start;
}

.tv-admin-form {
    min-width: 0;
}

.tv-active-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.tv-admin-row {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 14px;
}

.tv-admin-preview {
    position: sticky;
    top: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafc;
}

.tv-preview-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 800;
}

.tv-preview-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: #111827;
}

.tv-preview-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.tv-preview-empty {
    min-height: 220px;
    display: grid;
    place-items: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #fff;
    font-size: .86rem;
    font-weight: 700;
}

.tv-preview-empty .icon {
    width: 36px;
    height: 36px;
}

@media (max-width: 820px) {
    .tv-admin-grid,
    .tv-admin-row {
        grid-template-columns: 1fr;
    }

    .tv-admin-preview {
        position: static;
    }
}

/* Rosario Ya TV admin polish */
.tv-admin-card-pro {
    border-top: 0;
    padding: 0;
    overflow: hidden;
}

.tv-admin-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    background: linear-gradient(135deg, #0f172a 0%, #1f2937 55%, #7c2d12 100%);
    color: #fff;
}

.tv-admin-hero h2 {
    margin: 8px 0 6px;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    color: #fff;
}

.tv-admin-hero p {
    max-width: 680px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
}

.tv-admin-kicker,
.tv-admin-section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
}

.tv-admin-kicker {
    color: #fed7aa;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.tv-admin-card-pro .tv-admin-grid,
.tv-admin-card-pro .tv-admin-library,
.tv-admin-card-pro .tv-admin-actions {
    margin: 24px;
}

.tv-admin-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 24px 0;
}

.tv-admin-stat {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.tv-admin-stat span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: .76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.tv-admin-stat strong {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    font-size: 1.15rem;
    line-height: 1.15;
}

.tv-admin-stat .icon {
    width: 18px;
    height: 18px;
    color: #f97316;
}

.tv-admin-section-title {
    margin: 0 0 14px;
    color: var(--text-main);
}

.tv-admin-section-title-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.tv-admin-section-title-row span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tv-admin-section-title-row strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: .82rem;
    font-weight: 900;
}

.tv-preview-note {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--border);
}

.tv-preview-note strong {
    color: var(--text-main);
}

.tv-preview-note span {
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 700;
}

.tv-admin-library {
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.tv-admin-library-empty,
.tv-admin-library-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafc;
}

.tv-admin-library-list {
    display: grid;
    gap: 10px;
}

.tv-admin-library-item strong,
.tv-admin-library-item span {
    display: block;
}

.tv-admin-library-item span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: .84rem;
    font-weight: 700;
}

.tv-admin-library-item {
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.tv-admin-library-item:hover {
    border-color: rgba(249, 115, 22, .28);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.tv-admin-library-item a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #f97316;
    font-weight: 900;
    text-decoration: none;
}

.tv-admin-actions {
    padding-top: 0;
}

@media (max-width: 760px) {
    .tv-admin-hero,
    .tv-admin-library-item {
        display: grid;
    }

    .tv-admin-overview {
        grid-template-columns: 1fr 1fr;
        margin: 16px 16px 0;
    }

    .tv-admin-card-pro .tv-admin-grid,
    .tv-admin-card-pro .tv-admin-library,
    .tv-admin-card-pro .tv-admin-actions {
        margin: 16px;
    }
}

@media (max-width: 520px) {
    .tv-admin-overview {
        grid-template-columns: 1fr;
    }
}

.tv-admin-subtitle {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.tv-admin-managed-item {
    align-items: flex-start;
}

.tv-admin-managed-item small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: .76rem;
    font-weight: 800;
}

.tv-admin-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 230px;
}

.btn-tv-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-main);
    font-size: .78rem;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.btn-tv-mini:hover {
    border-color: #f97316;
    color: #ea580c;
}

.btn-tv-mini.is-selected {
    border-color: rgba(249, 115, 22, .32);
    background: #fff7ed;
    color: #c2410c;
}

.btn-tv-mini.danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff7f7;
}

.btn-tv-mini.danger:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

.btn-tv-mini .icon {
    width: 14px;
    height: 14px;
}

.tv-admin-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .68);
}

.tv-admin-modal {
    width: min(720px, 100%);
    max-height: 90vh;
    overflow: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}

.tv-admin-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.tv-admin-modal-title {
    color: var(--text-main);
    font-size: 1.08rem;
    font-weight: 900;
}

.tv-admin-modal-subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: .84rem;
}

.tv-admin-modal-form {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.tv-admin-modal-form label {
    display: grid;
    gap: 6px;
    color: var(--text-main);
    font-size: .9rem;
    font-weight: 800;
}

.tv-admin-modal-form input,
.tv-admin-modal-form textarea,
.tv-admin-modal-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-main);
    font: inherit;
}

.tv-admin-modal-form textarea {
    min-height: 92px;
    resize: vertical;
}

.tv-admin-row-modal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tv-admin-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 6px;
}

@media (max-width: 760px) {
    .tv-admin-item-actions {
        justify-content: flex-start;
        min-width: 0;
        width: 100%;
    }

    .btn-tv-mini {
        flex: 1 1 auto;
    }

    .tv-admin-row-modal {
        grid-template-columns: 1fr;
    }

    .tv-admin-modal-actions {
        flex-direction: column-reverse;
    }
}
