/* =========================================
   RESET Y FONDO COMPLETO
========================================= */
* { padding: 0; margin: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
a { text-decoration: none; }
body { background: #f5f7fb; overflow: hidden; }

/* =========================================
   PANTALLA DE LOGIN (Fondo completo)
========================================= */
body#bodylogin {
    width: 100vw;
    height: 100vh;
    background-image: url('../img/login.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center; 
    padding-left: 8%; 
}

.login-card {
    background-color: rgba(59, 32, 117, 0.88); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    width: 100%;
    max-width: 420px;
    padding: 45px 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    text-align: left;
    position: relative;
    z-index: 10;
}

.logo-img { display: block; height: 65px; width: auto; margin-bottom: 5px; }
.login-subtitle { font-size: 0.65rem; color: #a491d3; letter-spacing: 3px; margin-bottom: 35px; text-transform: uppercase; }
.login-card h2 { color: #fff; font-size: 2.2rem; margin-bottom: 5px; }
.login-desc { color: #d1c4e9; font-size: 1rem; margin-bottom: 30px; }

.input-group { background: #fff; border-radius: 30px; display: flex; align-items: center; padding: 5px 20px; margin-bottom: 20px; }
.input-group span { color: #555; margin-right: 10px; font-size: 1.2rem; }
.input-group input { width: 100%; padding: 15px 0; border: none; background: transparent; color: #333; font-size: 1rem; outline: none; }
.input-group input::placeholder { color: #777; }

.btn-login { width: 100%; padding: 15px; background: #1b8b3b; color: #fff; border: none; border-radius: 30px; font-size: 1.1rem; font-weight: bold; cursor: pointer; transition: 0.3s; margin-top: 10px; }
.btn-login:hover { background: #14702e; transform: scale(1.02); }

.login-links { display: flex; justify-content: space-between; margin-top: 30px; }
.login-links a { color: #d1c4e9; font-size: 0.85rem; display: flex; align-items: center; gap: 5px; transition: 0.3s; }
.login-links a:hover { color: #fff; }
.login-links .material-icons { font-size: 1.1rem; }
.disabled-link { opacity: 0.5; pointer-events: none; }
.error-msg { background: #ffcccc; color: #900; padding: 10px; border-radius: 10px; text-align: center; margin-bottom: 15px; font-size: 0.9rem; font-weight: bold; }

@media (max-width: 900px) {
    body#bodylogin { padding-left: 0; justify-content: center; }
    .login-card { max-width: 90%; }
}   

/* =========================================
   HEADER Y LAYOUT PRINCIPAL
========================================= */
/* =========================================
   HEADER PRINCIPAL
========================================= */
.main-header {
    background-color: #168526;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: hidden; /* 👈 Evita que el logo se desborde */
}

.header-logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-logo img {
    max-height: 45px;      /* 👈 Altura máxima del logo dentro del header */
    width: auto;
    object-fit: contain;    /* 👈 Ajusta sin deformar */
    display: block;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.95rem;
    font-weight: 600;
}

.btn-logout {
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #29aa3c;
    padding: 8px 16px;
    border-radius: 20px;
    transition: 0.3s;
    text-decoration: none;
    font-weight: 700;
}

.btn-logout:hover {
    background: #1e7a2c;
}

.btn-logout .material-icons {
    font-size: 20px;
}.header-user { display: flex; align-items: center; gap: 20px; }
.btn-logout { color: white; display: flex; align-items: center; gap: 5px; background: #29aa3c; padding: 8px 15px; border-radius: 20px; transition: 0.3s; }
.btn-logout:hover { background: #1e7a2c; }

.main-content { height: calc(100vh - 60px); background: #f5f7fb; padding: 20px; }

/* =========================================
   PANTALLA DE TAQUILLA (POS)
========================================= */
.taquilla-container { display: flex; height: 100%; gap: 20px; }
.taquilla-actions { flex: 1; background: #fff; border-radius: 15px; padding: 30px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); overflow-y: auto; }
.info-top h2 { color: #333; margin-bottom: 5px; }
.info-top p { color: #777; margin-bottom: 30px; }
.section-title { font-weight: bold; color: #4D59FF; margin-bottom: 15px; font-size: 1.1rem; border-bottom: 2px solid #eee; padding-bottom: 5px; }

.botones-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; margin-bottom: 40px; }
.btn-destino, .btn-tipo { padding: 20px 10px; border: none; border-radius: 30px; background: #3b5bdb; color: #fff; font-size: 1.1rem; font-weight: bold; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.btn-destino:hover, .btn-tipo:hover { background: #2a44b5; transform: translateY(-2px); }
.btn-destino.active, .btn-tipo.active { background: #29aa3c; box-shadow: 0 0 15px rgba(41, 170, 60, 0.5); }

.taquilla-summary { width: 350px; background: #1a1a2e; border-radius: 15px; padding: 30px; color: #fff; display: flex; flex-direction: column; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.summary-top h3 { font-size: 1.5rem; margin-bottom: 5px; }
.summary-top p { color: #888; font-size: 0.9rem; margin-bottom: 40px; }
.total-box { text-align: right; margin-bottom: 30px; }
.total-box span { font-size: 1.2rem; color: #ccc; }
.total-box h1 { font-size: 4rem; color: #00ff90; margin-top: 10px; }
.btn-agregar { background: #4D59FF; color: white; border: none; padding: 20px; border-radius: 15px; font-size: 1.2rem; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; margin-bottom: auto; }
.btn-cobrar { background: #168526; color: white; border: none; padding: 20px; border-radius: 15px; font-size: 1.2rem; font-weight: bold; cursor: pointer; width: 100%; }
.btn-cobrar:hover { background: #29aa3c; }

/* =========================================
   PANTALLA DE TAQUILLA (POS MODERNO)
========================================= */
body { background-color: #e9ecef; }
.pos-container { display: flex; height: calc(100vh - 60px); padding: 20px; gap: 20px; max-width: 1600px; margin: 0 auto; }
.pos-main { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.pos-topbar { background: #fff; padding: 15px 25px; border-radius: 12px; display: flex; gap: 40px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); align-items: center; }
.info-item .label { display: block; font-size: 0.75rem; color: #6c757d; text-transform: uppercase; font-weight: 600; margin-bottom: 2px; }
.info-item .value { font-size: 1rem; font-weight: bold; color: #212529; }
.pos-route-display { display: flex; align-items: center; gap: 20px; background: #fff; padding: 20px 30px; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.route-box { flex: 1; }
.route-box .label { font-size: 0.9rem; color: #6c757d; margin-right: 10px; }
.route-box .value { font-size: 1.5rem; font-weight: bold; color: #212529; }
.route-box .text-green { color: #1b8b3b; }
.route-arrow { color: #adb5bd; }
.pos-section { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.btn-pos { padding: 18px 10px; border: none; border-radius: 10px; background: #3b5bdb; color: #fff; font-size: 0.95rem; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-pos:hover { background: #2a44b5; }
.btn-pos.active { background: #1b8b3b; box-shadow: 0 0 15px rgba(27, 139, 59, 0.4); }
.pos-bus-display { background: #00ff90; padding: 15px 25px; border-radius: 12px; color: #000; font-size: 1.1rem; }
.bus-info { display: flex; justify-content: space-between; align-items: center; }
.botones-grid-tipos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; }
.btn-pos-tipo { padding: 20px 10px; border: none; border-radius: 30px; background: #3b5bdb; color: #fff; font-size: 1rem; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-pos-tipo:hover { background: #2a44b5; }
.btn-pos-tipo.active { background: #1b8b3b; box-shadow: 0 0 15px rgba(27, 139, 59, 0.4); }

.pos-sidebar { width: 320px; background: #2b2d42; border-radius: 12px; padding: 25px; display: flex; flex-direction: column; color: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.sidebar-top h3 { font-size: 1.4rem; margin-bottom: 5px; }
.sidebar-top p { color: #8d99ae; font-size: 0.85rem; margin-bottom: 30px; }
.total-display { text-align: right; margin-bottom: 30px; border-bottom: 1px solid #3f4259; padding-bottom: 20px; }
.total-display span { font-size: 1.2rem; color: #8d99ae; }
.total-display h1 { font-size: 3.5rem; color: #00ff90; }
.btn-add-boleto { background: #4D59FF; color: white; border: none; padding: 20px; border-radius: 12px; font-size: 1.2rem; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; transition: 0.3s; margin-bottom: auto; }
.btn-add-boleto:hover { background: #3b46d6; }
.btn-add-boleto .material-icons { font-size: 2rem; }
.sidebar-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-cancelar { background: transparent; color: #ef233c; border: 2px solid #ef233c; padding: 15px; border-radius: 12px; font-size: 1.1rem; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; transition: 0.3s; }
.btn-cancelar:hover { background: #ef233c; color: white; }

/* =========================================
   ESTILOS DEL DASHBOARD (PREMIUM)
========================================= */
body { background: #eef2f6; color: #334155; }
.pos-card { background: #ffffff; border-radius: 16px; box-shadow: 0 10px 30px -5px rgba(0,0,0,0.08); border: 1px solid #e2e8f0; display: flex; flex-direction: column; overflow: hidden; }
.card-title { font-size: 1.3rem; color: #0f172a; font-weight: 800; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid #f1f5f9; }

.form-col label, .form-side > label { font-size: 0.85rem; font-weight: 700; color: #475569; margin-bottom: 8px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }
.form-col input, .form-col select, .form-side textarea { width: 100%; padding: 12px 16px; border: 2px solid #e2e8f0; border-radius: 10px; font-size: 0.95rem; outline: none; transition: all 0.2s ease; background: #f8fafc; color: #1e293b; font-weight: 500; }
.form-col input:focus, .form-col select:focus, .form-side textarea:focus { border-color: #4D59FF; background: #fff; box-shadow: 0 0 0 4px rgba(77, 89, 255, 0.1); }
.btn-primary-full { width: 100%; padding: 16px; background: linear-gradient(135deg, #4D59FF 0%, #3b46d6 100%); color: #fff; border: none; border-radius: 10px; font-weight: 800; font-size: 1rem; cursor: pointer; transition: all 0.3s ease; margin-top: 15px; box-shadow: 0 8px 20px rgba(77, 89, 255, 0.3); display: flex; justify-content: center; align-items: center; gap: 10px; }
.btn-primary-full:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(77, 89, 255, 0.4); }

.modern-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.modern-table th { background: #f1f5f9; color: #64748b; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 18px 24px; border-bottom: 2px solid #e2e8f0; }
.modern-table td { padding: 18px 24px; border-bottom: 1px solid #e2e8f0; font-size: 0.95rem; color: #334155; vertical-align: middle; background: #ffffff; transition: all 0.2s ease; }
.modern-table tbody tr:hover td { background: #f8fafc; transform: scale(1.005); box-shadow: 0 4px 10px rgba(0,0,0,0.03); position: relative; z-index: 1; }
.badge { background: #e0e7ff; color: #4338ca; padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 800; display: inline-block; text-transform: uppercase; letter-spacing: 0.5px; }
.actions-cell { display: flex; gap: 8px; justify-content: center; }
.btn-icon-edit, .btn-icon-delete { display: flex; justify-content: center; align-items: center; width: 40px; height: 40px; border-radius: 10px; text-decoration: none; transition: all 0.2s ease; background: #f1f5f9; color: #475569; }
.btn-icon-edit:hover { background: #4D59FF; color: #fff; box-shadow: 0 4px 10px rgba(77,89,255,0.3); }
.btn-icon-delete:hover { background: #ff006a; color: #fff; box-shadow: 0 4px 10px rgba(255,0,106,0.3); }

/* =========================================
   NOTIFICACIONES FLOTANTES (TOASTS)
========================================= */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #fff; color: #333; padding: 16px 24px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 0.95rem; border-left: 5px solid #ccc; transform: translateX(120%); animation: slideIn 0.4s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.toast.success { border-left-color: #168526; }
.toast.success .material-icons { color: #168526; }
.toast.error { border-left-color: #e11d48; }
.toast.error .material-icons { color: #e11d48; }
@keyframes slideIn { to { transform: translateX(0); } }
@keyframes slideOut { to { transform: translateX(120%); opacity: 0; } }
.toast.hiding { animation: slideOut 0.4s forwards ease-in; }

/* =========================================================
   PROGRAMADOR (SISTEMA DE DISEÑO ANTERIOR)
========================================================= */
:root {
    --primary: #4d59ff; --primary-dark: #3b46d6; --primary-soft: #eef0ff;
    --success: #168526; --success-dark: #116a20; --success-soft: #eaf7ed;
    --danger: #e11d48; --danger-soft: #fff1f2;
    --warning: #d97706; --warning-soft: #fff7ed;
    --text: #0f172a; --text-secondary: #475569; --text-muted: #64748b;
    --border: #e2e8f0; --border-light: #f1f5f9;
    --surface: #ffffff; --background: #eef2f6;
    --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.14);
}
body.programador-body { background: var(--background); color: var(--text); overflow-x: hidden; overflow-y: auto; }
body.modal-open { overflow: hidden; }
.programador-page { min-height: calc(100vh - 60px); }
.pos-tabs-container { display: flex; align-items: flex-end; gap: 6px; padding: 14px 24px 0; background: #f5f7fa; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.pos-tabs-container::-webkit-scrollbar { height: 5px; }
.pos-tabs-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.pos-tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 10px 10px 0 0; color: var(--text-muted); background: #e2e8f0; font-size: 0.88rem; font-weight: 700; white-space: nowrap; transition: all 0.2s ease; }
.pos-tab .material-icons { font-size: 18px; }
.pos-tab:hover { color: var(--text); background: #dbe3ec; }
.pos-tab.active { color: var(--primary); background: var(--surface); }
.pos-tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
.pos-layout { display: flex; gap: 20px; width: 100%; max-width: 1600px; margin: 0 auto; padding: 20px; }
.form-side { width: 360px; flex: 0 0 360px; padding: 24px; align-self: flex-start; position: sticky; top: 20px; }
.card-heading { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.card-heading-icon { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.card-heading-icon .material-icons { font-size: 22px; }
.card-title { margin: 0; color: var(--text); font-size: 1.15rem; font-weight: 800; }
.card-subtitle { margin: 3px 0 0; color: var(--text-muted); font-size: 0.78rem; }
.programador-form { display: flex; flex-direction: column; }
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 12px; margin-bottom: 0; }
.form-col { flex: 1; min-width: 0; }
.form-side label, .modal-content label { display: block; margin-bottom: 7px; color: var(--text-secondary); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.form-side input, .form-side select, .form-side textarea, .modal-content input, .modal-content select, .modal-content textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; outline: none; background: #f8fafc; color: var(--text); font-family: inherit; font-size: 0.9rem; font-weight: 500; transition: all 0.2s ease; }
.form-side input:focus, .form-side select:focus, .form-side textarea:focus, .modal-content input:focus, .modal-content select:focus, .modal-content textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(77, 89, 255, 0.10); }
.form-side textarea, .modal-content textarea { min-height: 80px; resize: vertical; }
.form-side select, .modal-content select { cursor: pointer; }
.btn-primary-full { width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 4px; padding: 13px 16px; border: none; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; font-family: inherit; font-size: 0.92rem; font-weight: 800; cursor: pointer; box-shadow: 0 7px 18px rgba(77, 89, 255, 0.25); transition: all 0.2s ease; }
.btn-primary-full:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(77, 89, 255, 0.32); }
.btn-primary-full:active { transform: translateY(0); }
.table-side { flex: 1; min-width: 0; }
.table-header-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--border); background: #fff; }
.table-heading { min-width: 0; }
.table-heading-label { display: block; margin-bottom: 3px; color: var(--text-muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.table-title { margin: 0; color: var(--text); font-size: 1.25rem; font-weight: 800; }
.table-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-primary, .btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 15px; border-radius: 9px; font-family: inherit; font-size: 0.84rem; font-weight: 800; cursor: pointer; transition: all 0.2s ease; }
.btn-primary { border: none; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 5px 14px rgba(77, 89, 255, 0.22); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(77, 89, 255, 0.30); }
.btn-secondary { border: 1px solid var(--border); background: #f8fafc; color: var(--text-secondary); }
.btn-secondary:hover { background: #f1f5f9; color: var(--text); }
.btn-primary .material-icons, .btn-secondary .material-icons { font-size: 18px; }
.table-responsive { width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.table-responsive::-webkit-scrollbar { height: 7px; }
.table-responsive::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.modern-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; }
.modern-table th { padding: 13px 18px; border-bottom: 1px solid var(--border); background: #f8fafc; color: var(--text-muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; text-align: left; }
.modern-table td { padding: 15px 18px; border-bottom: 1px solid var(--border-light); background: #fff; color: var(--text-secondary); font-size: 0.88rem; vertical-align: middle; transition: background 0.15s ease; }
.modern-table tbody tr:last-child td { border-bottom: none; }
.modern-table tbody tr:hover td { background: #f8faff; }
.modern-table .text-center { text-align: center; }
.column-actions { text-align: center; width: 120px; }
.table-id { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 28px; padding: 0 7px; border-radius: 7px; background: #f1f5f9; color: var(--text-secondary); font-size: 0.76rem; font-weight: 800; }
.time-value { color: var(--text); font-size: 0.95rem; font-weight: 800; }
.badge, .type-badge, .capacity-badge, .route-code, .trips-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.03em; }
.badge { background: #eef0ff; color: #4338ca; text-transform: uppercase; }
.type-badge { background: var(--success-soft); color: var(--success); text-transform: uppercase; }
.capacity-badge { min-width: 42px; background: #f1f5f9; color: var(--text-secondary); }
.route-code { background: #eef0ff; color: var(--primary); }
.trips-badge { min-width: 42px; background: var(--success-soft); color: var(--success); }
.actions-cell { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center !important; }
.btn-icon-edit, .btn-icon-delete { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: none; border-radius: 9px; cursor: pointer; transition: all 0.2s ease; }
.btn-icon-edit { background: #f1f5f9; color: var(--text-secondary); }
.btn-icon-edit:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }
.btn-icon-delete { background: #fff1f2; color: var(--danger); }
.btn-icon-delete:hover { background: var(--danger); color: #fff; transform: translateY(-1px); }
.btn-icon-edit .material-icons, .btn-icon-delete .material-icons { font-size: 18px; }
.empty-state { padding: 55px 25px !important; text-align: center !important; color: var(--text-muted) !important; }
.empty-state-icon { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; border-radius: 50%; background: #f1f5f9; color: #94a3b8; }
.empty-state-icon .material-icons { font-size: 25px; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { margin-bottom: 4px; color: var(--text-secondary); font-size: 0.9rem; }
.empty-state span { font-size: 0.78rem; }
.modal-overlay { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 23, 42, 0.58); backdrop-filter: blur(5px); animation: modalFadeIn 0.18s ease; }
.modal-overlay[hidden] { display: none; }
.modal-content { width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 26px; border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 17px; background: #fff; box-shadow: var(--shadow-lg); animation: modalSlideIn 0.22s ease; }
.modal-small { max-width: 420px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--border-light); }
.modal-kicker { display: block; margin-bottom: 4px; color: var(--primary); font-size: 0.67rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.modal-header h2 { margin: 0; color: var(--text); font-size: 1.2rem; font-weight: 800; }
.modal-close { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: none; border-radius: 8px; background: #f1f5f9; color: var(--text-muted); cursor: pointer; transition: all 0.2s ease; }
.modal-close:hover { background: #e2e8f0; color: var(--text); }
.modal-description, .modal-message { margin: 0 0 20px; color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6; }
.danger-heading { display: flex; align-items: center; gap: 12px; }
.danger-icon { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 11px; background: var(--danger-soft); color: var(--danger); }
.danger-heading .modal-kicker { color: var(--danger); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.btn-cancelar, .btn-guardar, .btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 17px; border-radius: 9px; font-family: inherit; font-size: 0.83rem; font-weight: 800; cursor: pointer; transition: all 0.2s ease; }
.modal-actions .btn-cancelar { border: 1px solid var(--border); background: #f8fafc; color: var(--text-secondary); }
.modal-actions .btn-cancelar:hover { background: #f1f5f9; }
.modal-actions .btn-guardar { border: none; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 5px 14px rgba(77, 89, 255, 0.22); }
.modal-actions .btn-guardar:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(77, 89, 255, 0.30); }
.btn-danger { border: none; background: var(--danger); color: #fff; box-shadow: 0 5px 14px rgba(225, 29, 72, 0.22); }
.btn-danger:hover { background: #be123c; transform: translateY(-1px); }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 1100px) { .pos-layout { flex-direction: column; } .form-side { width: 100%; flex-basis: auto; position: static; } }
@media (max-width: 768px) { .pos-tabs-container { padding: 10px 14px 0; } .pos-tab { padding: 10px 14px; font-size: 0.8rem; } .pos-layout { padding: 14px; gap: 14px; } .table-header-actions { align-items: flex-start; flex-direction: column; padding: 18px; } .table-actions { width: 100%; } .table-actions > * { flex: 1; } .form-row { flex-direction: column; gap: 0; } }
@media (max-width: 520px) { .pos-tab span { display: none; } .pos-tab { justify-content: center; width: 44px; padding: 11px; } .pos-layout { padding: 10px; } .form-side { padding: 18px; } .table-title { font-size: 1.05rem; } .modal-overlay { padding: 10px; } .modal-content { padding: 20px; max-height: calc(100vh - 20px); } .modal-actions { flex-direction: column-reverse; } .modal-actions button { width: 100%; } }

/* =========================================
   ARREGLO DE BOTONES DE SUCURSAL EN EL HEADER
========================================= */
.header-nav { display: flex; gap: 8px; align-items: center; }
.header-nav .headnav { color: rgba(255, 255, 255, 0.75) !important; font-size: 0.95rem; font-weight: 600; padding: 6px 14px; border-radius: 8px; text-decoration: none; transition: all 0.2s ease; }
.header-nav .headnav:hover { color: #ffffff !important; background: rgba(255, 255, 255, 0.15); }
.header-nav .headnav.active { color: #168526 !important; background: #ffffff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* ==========================================================================
   NUEVO MÓDULO PROGRAMADOR (DASHBOARD) - AISLADO Y CORREGIDO
   ========================================================================== */
.pg-dashboard-wrapper {
    display: flex;
    height: calc(100vh - 60px); /* Ocupa exactamente el espacio debajo del header */
    width: calc(100% + 40px);   /* Compensa el padding del main-content */
    margin-left: -20px;         /* Rompe el margen izquierdo */
    margin-top: -20px;          /* Rompe el margen superior */
    background-color: #f4f7f6;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1e293b;
}

.pg-sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    flex-shrink: 0;
    height: 100%;
}

.pg-logo {
    padding: 0 24px;
    margin-bottom: 30px;
    font-size: 1.5rem;
    font-weight: 900;
    color: #168526;
    letter-spacing: 1px;
}

.pg-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.pg-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.pg-menu li a:hover {
    background: #f8fafc;
    color: #168526;
}

.pg-menu li a.active {
    background: #eaf7ed;
    color: #168526;
    border-left: 3px solid #168526;
}

.pg-menu li a .material-icons {
    font-size: 20px;
}

.pg-main {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
    box-sizing: border-box;
    height: 100%;
    background-color: #f4f7f6;
}

.pg-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.pg-header h1 {
    margin: 0 0 5px 0;
    font-size: 1.8rem;
    color: #1e293b;
    font-weight: 800;
}

.pg-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.pg-filters {
    display: flex;
    gap: 12px;
}

.pg-filter-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    min-width: 150px;
}

.pg-filter-box span {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.pg-filter-box input, .pg-filter-box select {
    border: none;
    outline: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    background: transparent;
    margin-top: 4px;
    cursor: pointer;
}

.pg-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.pg-btn-brand {
    background: #168526;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s ease;
    box-shadow: 0 4px 10px rgba(22, 133, 38, 0.2);
}

.pg-btn-brand:hover {
    background: #116a20;
    transform: translateY(-1px);
}

.pg-btn-sec {
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s ease;
}

.pg-btn-sec:hover {
    background: #f8fafc;
}

.pg-table-container {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow-x: auto;
    margin-bottom: 60px;
}

.pg-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.pg-table th {
    background: #f8fafc;
    padding: 16px 24px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.pg-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
    vertical-align: middle;
}

.pg-table tr:last-child td {
    border-bottom: none;
}

.pg-table tr:hover td {
    background: #f8fafc;
}

.pg-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #168526;
    cursor: pointer;
}

.pg-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pg-badge.published {
    background: #dcfce7;
    color: #166534;
}

.pg-badge.pending {
    background: #fef3c7;
    color: #b45309;
}

.pg-bulk-bar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 24px;
    transition: bottom 0.3s ease;
    z-index: 1000;
    border: 1px solid #e2e8f0;
}

.pg-bulk-bar.active {
    bottom: 30px;
}

.bulk-count {
    font-weight: 800;
    font-size: 0.95rem;
    color: #168526;
    white-space: nowrap;
}

.pg-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.pg-modal-overlay[hidden] {
    display: none !important;
}

.pg-modal-box {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.pg-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #e2e8f0; }
.pg-modal-header h2 { margin: 0; font-size: 1.2rem; color: #1e293b; }
.pg-modal-body { padding: 24px; overflow-y: auto; }
.pg-modal-footer { padding: 16px 24px; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end; gap: 12px; background: #f8fafc; border-radius: 0 0 12px 12px; }

@media (max-width: 1024px) {
    .pg-dashboard-wrapper {
        flex-direction: column;
        height: auto;
        width: 100%;
        margin: 0;
    }
    .pg-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 10px;
    }
    .pg-menu {
        display: flex;
        overflow-x: auto;
    }
    .pg-menu li a {
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        padding: 10px 16px;
    }
    .pg-menu li a.active {
        border-left: none;
        border-bottom: 3px solid #168526;
    }
    .pg-main {
        padding: 20px;
    }
    .pg-header {
        flex-direction: column;
        gap: 20px;
    }
}


.pg-sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    flex-shrink: 0;
    height: 100%;
}

.pg-logo {
    padding: 0 24px;
    margin-bottom: 30px;
    font-size: 1.5rem;
    font-weight: 900;
    color: #168526;
    letter-spacing: 1px;
}

.pg-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.pg-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.pg-menu li a:hover {
    background: #f8fafc;
    color: #168526;
}

.pg-menu li a.active {
    background: #eaf7ed;
    color: #168526;
    border-left: 3px solid #168526;
}

.pg-menu li a .material-icons {
    font-size: 20px;
}

.pg-main {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
    box-sizing: border-box;
    height: 100%;
    background-color: #f4f7f6;
}

.pg-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.pg-header h1 {
    margin: 0 0 5px 0;
    font-size: 1.8rem;
    color: #1e293b;
    font-weight: 800;
}

.pg-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.pg-filters {
    display: flex;
    gap: 12px;
}

.pg-filter-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    min-width: 150px;
}

.pg-filter-box span {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.pg-filter-box input, .pg-filter-box select {
    border: none;
    outline: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    background: transparent;
    margin-top: 4px;
    cursor: pointer;
}

.pg-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.pg-btn-brand {
    background: #168526;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s ease;
    box-shadow: 0 4px 10px rgba(22, 133, 38, 0.2);
}

.pg-btn-brand:hover {
    background: #116a20;
    transform: translateY(-1px);
}

.pg-btn-sec {
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s ease;
}

.pg-btn-sec:hover {
    background: #f8fafc;
}

.pg-table-container {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow-x: auto;
    margin-bottom: 60px;
}

.pg-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.pg-table th {
    background: #f8fafc;
    padding: 16px 24px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.pg-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
    vertical-align: middle;
}

.pg-table tr:last-child td {
    border-bottom: none;
}

.pg-table tr:hover td {
    background: #f8fafc;
}

.pg-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #168526;
    cursor: pointer;
}

.pg-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pg-badge.published {
    background: #dcfce7;
    color: #166534;
}

.pg-badge.pending {
    background: #fef3c7;
    color: #b45309;
}

.pg-bulk-bar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 24px;
    transition: bottom 0.3s ease;
    z-index: 1000;
    border: 1px solid #e2e8f0;
}

.pg-bulk-bar.active {
    bottom: 30px;
}

.pg-bulk-count {
    font-weight: 800;
    font-size: 0.95rem;
    color: #168526;
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .pg-dashboard-wrapper {
        flex-direction: column;
        height: auto;
        width: 100%;
        margin: 0;
    }
    .pg-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 10px;
    }
    .pg-menu {
        display: flex;
        overflow-x: auto;
    }
    .pg-menu li a {
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        padding: 10px 16px;
    }
    .pg-menu li a.active {
        border-left: none;
        border-bottom: 3px solid #168526;
    }
    .pg-main {
        padding: 20px;
    }
    .pg-header {
        flex-direction: column;
        gap: 20px;
    }
}