:root{
    --elite-bg:#f3f6fa;
    --elite-surface:#ffffff;
    --elite-surface-soft:#f8fafc;
    --elite-sidebar:#162033;
    --elite-sidebar-active:#24324a;
    --elite-sidebar-border:#2b3950;
    --elite-border:#dce4ee;
    --elite-border-strong:#c8d3e0;
    --elite-text:#172033;
    --elite-muted:#64748b;
    --elite-primary:#2563eb;
    --elite-primary-soft:#eff6ff;
    --elite-success:#16a34a;
    --elite-success-soft:#ecfdf3;
    --elite-warning:#d97706;
    --elite-warning-soft:#fff7ed;
    --elite-danger:#dc2626;
    --elite-danger-soft:#fef2f2;
    --elite-info:#0284c7;
    --elite-info-soft:#f0f9ff;
    --elite-technical:#7c3aed;
    --elite-technical-soft:#f5f3ff;
    --elite-shadow:0 8px 24px rgba(15,23,42,.06);
    --elite-shadow-hover:0 14px 34px rgba(15,23,42,.10);
}

*{box-sizing:border-box}
html,body{min-height:100%}
body{
    margin:0;
    background:var(--elite-bg);
    color:var(--elite-text);
    font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
    font-size:.94rem;
    -webkit-font-smoothing:antialiased;
}

.app-shell{min-height:100vh}
.sidebar{
    position:fixed;
    inset:0 auto 0 0;
    width:260px;
    background:var(--elite-sidebar);
    border-right:1px solid var(--elite-sidebar-border);
    z-index:1020;
    color:#e8eef7;
}
.brand{
    height:74px;
    display:flex;
    align-items:center;
    gap:12px;
    padding:0 22px;
    border-bottom:1px solid var(--elite-sidebar-border);
}
.brand-mark{
    width:38px;
    height:38px;
    border-radius:11px;
    background:linear-gradient(135deg,#38bdf8,#2563eb);
    display:grid;
    place-items:center;
    color:#fff;
    font-weight:900;
    box-shadow:0 8px 20px rgba(37,99,235,.28);
}
.brand-title{font-weight:800;letter-spacing:.04em;color:#fff}
.brand-sub{font-size:.72rem;color:#9db0c8;letter-spacing:.16em}
.nav-elite{padding:18px 12px}
.nav-elite hr{border-color:var(--elite-sidebar-border)!important;opacity:1}
.nav-elite a{
    color:#c0cee0;
    text-decoration:none;
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px 14px;
    border-radius:10px;
    margin-bottom:5px;
    transition:background-color .18s ease,color .18s ease,transform .18s ease;
}
.nav-elite a:hover{background:#1d2a40;color:#fff;transform:translateX(2px)}
.nav-elite a.active{
    background:var(--elite-sidebar-active);
    color:#fff;
    box-shadow:inset 3px 0 0 #38bdf8;
}
.nav-elite a i{width:18px;text-align:center;color:#8fc5ff}

.main{margin-left:260px;min-height:100vh}
.topbar{
    height:74px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 28px;
    border-bottom:1px solid var(--elite-border);
    background:rgba(255,255,255,.94);
    box-shadow:0 1px 5px rgba(15,23,42,.05);
    backdrop-filter:blur(10px);
    position:sticky;
    top:0;
    z-index:1010;
}
.content{padding:28px}
.section-title{font-weight:750;color:#0f172a;letter-spacing:-.015em}
.small-muted{font-size:.82rem;color:var(--elite-muted)}

.elite-card{
    background:var(--elite-surface);
    border:1px solid var(--elite-border);
    border-radius:14px;
    box-shadow:var(--elite-shadow);
}
.metric{
    padding:20px;
    position:relative;
    overflow:hidden;
    transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.metric:hover{transform:translateY(-2px);box-shadow:var(--elite-shadow-hover);border-color:var(--elite-border-strong)}
.metric::before{
    content:"";
    position:absolute;
    inset:0 auto 0 0;
    width:4px;
    background:#94a3b8;
}
.metric:nth-child(1)::before{background:var(--elite-success)}
.metric-label{color:#52657b;font-size:.75rem;text-transform:uppercase;letter-spacing:.09em;font-weight:700}
.metric i{color:#64748b;font-size:1.05rem}
.metric-value{font-size:2rem;line-height:1.1;font-weight:800;margin-top:10px;color:#0f172a}
.metric-foot{font-size:.8rem;color:var(--elite-muted);margin-top:8px}

.status-dot{width:9px;height:9px;border-radius:50%;display:inline-block;vertical-align:middle}
.status-online{background:var(--elite-success);box-shadow:0 0 0 4px rgba(22,163,74,.12)}
.status-offline{background:var(--elite-danger);box-shadow:0 0 0 4px rgba(220,38,38,.10)}

.table-dark-elite{
    --bs-table-bg:transparent;
    --bs-table-color:var(--elite-text);
    --bs-table-border-color:#e7edf4;
    --bs-table-hover-bg:#f8fafc;
    --bs-table-hover-color:var(--elite-text);
    margin-bottom:0;
}
.table-dark-elite th{
    color:#52657b;
    background:#f8fafc;
    font-size:.72rem;
    text-transform:uppercase;
    letter-spacing:.075em;
    font-weight:750;
    border-bottom:1px solid var(--elite-border-strong);
    white-space:nowrap;
}
.table-dark-elite td{padding-top:.9rem;padding-bottom:.9rem;vertical-align:middle}
.table-dark-elite tbody tr{transition:background-color .15s ease}
.table-dark-elite tbody tr:hover{background:#f8fafc}

.badge-prioridad{
    border:1px solid transparent;
    border-radius:999px;
    font-size:.69rem;
    padding:.38rem .58rem;
    text-transform:uppercase;
    letter-spacing:.04em;
    font-weight:750;
}
.priority-critica{color:#991b1b;background:#fee2e2;border-color:#fecaca}
.priority-alta{color:#9a3412;background:#ffedd5;border-color:#fed7aa}
.priority-media{color:#92400e;background:#fef3c7;border-color:#fde68a}
.priority-baja{color:#1d4ed8;background:#dbeafe;border-color:#bfdbfe}
.priority-tecnica{color:#6d28d9;background:#ede9fe;border-color:#ddd6fe}
.priority-informativa{color:#0369a1;background:#e0f2fe;border-color:#bae6fd}

.btn-elite{
    background:linear-gradient(135deg,#2563eb,#0284c7);
    border:0;
    color:#fff;
    font-weight:750;
    box-shadow:0 8px 18px rgba(37,99,235,.20);
}
.btn-elite:hover,.btn-elite:focus{color:#fff;background:linear-gradient(135deg,#1d4ed8,#0369a1)}
.btn-outline-light{--bs-btn-color:#334155;--bs-btn-border-color:#cbd5e1;--bs-btn-hover-bg:#f1f5f9;--bs-btn-hover-color:#0f172a;--bs-btn-hover-border-color:#94a3b8}
.border-secondary{border-color:var(--elite-border)!important}

.form-control,.form-select{
    background:#fff;
    border-color:#cbd5e1;
    color:var(--elite-text);
    border-radius:10px;
}
.form-control:focus,.form-select:focus{
    background:#fff;
    border-color:#60a5fa;
    color:var(--elite-text);
    box-shadow:0 0 0 .2rem rgba(37,99,235,.12);
}
.form-control::placeholder{color:#94a3b8}

.login-page{
    min-height:100vh;
    background:
        radial-gradient(circle at 10% 10%,rgba(37,99,235,.12),transparent 28%),
        radial-gradient(circle at 90% 85%,rgba(14,165,233,.10),transparent 28%),
        #eef3f8;
    display:grid;
    place-items:center;
    padding:24px;
}
.login-card{width:min(430px,92vw);padding:34px;background:#fff}
.login-card .brand-mark{width:46px;height:46px}

.operational-state{
    display:inline-flex;
    align-items:center;
    gap:.55rem;
    padding:.65rem .9rem;
    border:1px solid #bbf7d0;
    border-radius:999px;
    color:#166534;
    background:var(--elite-success-soft);
    box-shadow:none;
}
.panel-section-title{font-weight:750;color:#172033}

@media(max-width:1199px){.content{padding:22px}}
@media(max-width:991px){
    .sidebar{transform:translateX(-100%)}
    .main{margin-left:0}
    .content{padding:18px}
    .topbar{padding:0 18px}
}

/* Module: Operadores */
.operator-avatar{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:#e8f1ff;color:#1d4ed8;font-weight:800;border:1px solid #cfe0fb;flex:0 0 auto}
.operator-status{display:inline-flex;align-items:center;gap:.5rem;padding:.38rem .65rem;border-radius:999px;font-size:.75rem;font-weight:700;border:1px solid transparent;white-space:nowrap}
.operator-status .status-dot{width:8px;height:8px;box-shadow:none}
.status-disponible{color:#166534;background:#ecfdf3;border-color:#bbf7d0}.status-disponible .status-dot{background:#16a34a}
.status-en_atencion{color:#1d4ed8;background:#eff6ff;border-color:#bfdbfe}.status-en_atencion .status-dot{background:#2563eb}
.status-pausa{color:#92400e;background:#fffbeb;border-color:#fde68a}.status-pausa .status-dot{background:#f59e0b}
.status-desconectado{color:#475569;background:#f1f5f9;border-color:#cbd5e1}.status-desconectado .status-dot{background:#64748b}
.modal-content{border:1px solid var(--elite-border);border-radius:14px;box-shadow:0 24px 70px rgba(15,23,42,.18)}

/* Operadores v1.4.2: turno y estado en tiempo real */
.topbar-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:.8rem;
    min-width:0;
}
.operator-runtime{
    display:flex;
    align-items:center;
    gap:.55rem;
    padding-right:.75rem;
    border-right:1px solid var(--elite-border);
}
.operator-workload,
.shift-runtime{
    display:flex;
    align-items:center;
    gap:.4rem;
    min-height:34px;
    padding:.4rem .65rem;
    border:1px solid var(--elite-border);
    border-radius:9px;
    background:#f8fafc;
    color:#334155;
    font-size:.78rem;
    font-weight:700;
    white-space:nowrap;
}
.operator-workload i,
.shift-runtime i{color:#64748b}
.operator-status.dropdown-toggle{
    appearance:none;
    cursor:pointer;
    min-height:34px;
}
.operator-status.dropdown-toggle::after{margin-left:.45rem}
.operator-status-menu{
    min-width:245px;
    padding:.5rem;
    border:1px solid var(--elite-border);
    border-radius:12px;
    box-shadow:0 18px 45px rgba(15,23,42,.14);
}
.operator-status-menu .dropdown-item{
    border:0;
    border-radius:8px;
    padding:.65rem .75rem;
    background:transparent;
}
.operator-status-menu .dropdown-item:hover{background:#f1f5f9}
.user-summary{min-width:118px}

.operator-console-card{
    display:grid;
    grid-template-columns:minmax(220px,1.15fr) minmax(360px,1.5fr) auto;
    align-items:center;
    gap:1.25rem;
    padding:1rem 1.15rem;
}
.operator-console-main{
    display:flex;
    align-items:center;
    gap:.8rem;
    min-width:0;
}
.operator-avatar-lg{width:48px;height:48px;border-radius:14px}
.operator-console-title{font-weight:800;color:#0f172a}
.operator-console-metrics{
    display:grid;
    grid-template-columns:repeat(3,minmax(100px,1fr));
    gap:.75rem;
}
.operator-console-metric{
    min-width:0;
    padding-left:.85rem;
    border-left:1px solid var(--elite-border);
}
.operator-console-metric>span{
    display:block;
    margin-bottom:.25rem;
    color:var(--elite-muted);
    font-size:.7rem;
    font-weight:750;
    letter-spacing:.065em;
    text-transform:uppercase;
}
.operator-console-metric>strong:not(.operator-status){
    color:#172033;
    font-size:.95rem;
}
.operator-console-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    flex-wrap:wrap;
    gap:.45rem;
}
.operator-console-actions form{margin:0}

@media(max-width:1399px){
    .operator-console-card{grid-template-columns:1fr 1.45fr}
    .operator-console-actions{grid-column:1/-1;justify-content:flex-start;border-top:1px solid var(--elite-border);padding-top:.85rem}
}
@media(max-width:1199px){
    .operator-runtime{padding-right:.5rem}
    .operator-console-card{grid-template-columns:1fr}
    .operator-console-metrics{border-top:1px solid var(--elite-border);padding-top:.85rem}
    .operator-console-actions{grid-column:auto}
}
@media(max-width:767px){
    .topbar{height:auto;min-height:74px;padding-top:.65rem;padding-bottom:.65rem}
    .topbar-actions{gap:.45rem}
    .operator-runtime{border-right:0;padding-right:0}
    .operator-console-metrics{grid-template-columns:1fr}
    .operator-console-metric{border-left:0;border-top:1px solid var(--elite-border);padding:.65rem 0 0}
    .operator-console-metric:first-child{border-top:0;padding-top:0}
}
