:root {
    --primary: #2c3e50;
    --primary-dark: #1a252f;
    --primary-light: #3d566e;
    --secondary: #5a9140;
    --secondary-dark: #477232;
    --secondary-light: #6faf52;
    --bg: #f4f6f9;
    --white: #ffffff;
    --text: #333333;
    --text-light: #6c757d;
    --border: #dee2e6;
    --success: #5a9140;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --sidebar-w: 260px;
    --topbar-h: 60px;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--secondary); }

/* ===================== SIDEBAR ===================== */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 18px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
}

.sidebar-logo {
    max-height: 45px;
    margin-bottom: 6px;
}

.sidebar-brand {
    display: block;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: var(--secondary-light);
}

.sidebar-toggle {
    display: none;
    position: absolute;
    top: 15px; right: 15px;
    background: none; border: none;
    color: #fff; font-size: 20px; cursor: pointer;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-avatar { font-size: 36px; opacity: 0.9; }
.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 13px; }
.user-role { font-size: 11px; opacity: 0.8; color: #8fce6e; }

.sidebar-menu {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background: rgba(90,145,64,0.2);
    color: #fff;
    border-left: 3px solid var(--secondary);
    padding-left: 21px;
}

.sidebar-menu li a i { width: 20px; text-align: center; }

.menu-divider {
    padding: 15px 24px 5px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.5;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(220,53,69,0.2);
    border: 1px solid rgba(220,53,69,0.3);
    border-radius: var(--radius);
    color: #ff8a8a;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    justify-content: center;
}

.btn-logout:hover {
    background: var(--danger);
    color: #fff;
}

/* ===================== MAIN CONTENT ===================== */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 25px;
    gap: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.hamburger {
    display: none;
    background: none; border: none;
    font-size: 20px; color: var(--text);
    cursor: pointer;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    flex: 1;
}

.topbar-right { display: flex; align-items: center; gap: 15px; }
.topbar-date { font-size: 13px; color: var(--text-light); }

.content-wrapper {
    flex: 1;
    padding: 25px;
}

.main-footer {
    text-align: center;
    padding: 15px;
    font-size: 12px;
    color: var(--text-light);
    border-top: 1px solid var(--border);
}

/* ===================== CARDS ===================== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.card-body { padding: 20px; }

/* ===================== STATS ===================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
    border-left: 4px solid var(--primary);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card.accent { border-left-color: var(--secondary); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    background: rgba(44,62,80,0.1);
    color: var(--primary);
}

.stat-card.accent .stat-icon { background: rgba(90,145,64,0.12); color: var(--secondary); }
.stat-card.success .stat-icon { background: rgba(90,145,64,0.12); color: var(--success); }
.stat-card.warning .stat-icon { background: rgba(255,193,7,0.15); color: #e6a800; }
.stat-card.danger .stat-icon { background: rgba(220,53,69,0.1); color: var(--danger); }

.stat-info h3 { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-info p { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ===================== TABLES ===================== */
.table-responsive { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    background: var(--primary);
    color: #fff;
    padding: 12px 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    white-space: nowrap;
}

table tbody td {
    padding: 11px 15px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}

table tbody tr:hover { background: rgba(44,62,80,0.03); }
table tbody tr:last-child td { border-bottom: none; }

/* ===================== BADGES ===================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-incapacidad { background: #fff3cd; color: #856404; }
.badge-vacaciones { background: #d4edda; color: #155724; }
.badge-retiro { background: #f8d7da; color: #721c24; }
.badge-calamidad { background: #e2d5f1; color: #4a1a8a; }
.badge-pasa_independiente { background: #d1ecf1; color: #0c5460; }
.badge-nuevo_ingreso { background: #cce5ff; color: #004085; }
.badge-comision { background: #fde2c8; color: #8a4b08; }
.badge-cambio_salario { background: #d6e4ff; color: #1a3d8f; }
.badge-licencia_maternidad { background: #ffd9ec; color: #97114f; }
.badge-licencia_paternidad { background: #cdeee6; color: #0e6b57; }
.badge-permiso_remunerado { background: #e3f2c8; color: #4a6b1a; }
.badge-permiso_no_remunerado { background: #e4e5e7; color: #41464b; }
.badge-suspension_contrato { background: #ffe0cc; color: #9a4a02; }
.badge-traslado_entidad { background: #cfeef8; color: #0b5b70; }
.badge-cambio_sede { background: #e8e1f7; color: #4b2e83; }
.badge-cambio_cargo { background: #e6ddfb; color: #4b2a99; }
.badge-embargo_judicial { background: #f6c9ce; color: #6e1620; }
.badge-horas_extras { background: #fff0b3; color: #7a5c00; }
.badge-success { background: var(--success); color: #fff; }
.badge-warning { background: var(--warning); color: #333; }
.badge-danger { background: var(--danger); color: #fff; }

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary { background: var(--secondary); color: #fff; }
.btn-primary:hover { background: var(--secondary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #477232; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c82333; color: #fff; }
.btn-warning { background: var(--warning); color: #333; }
.btn-warning:hover { background: #e0a800; color: #333; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 6px 10px; }
.btn-group { display: flex; gap: 6px; }

/* ===================== FORMS ===================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(90,145,64,0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236c757d'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 35px;
}

textarea.form-control { min-height: 80px; resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

/* ===================== ALERTS ===================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    position: relative;
}

.alert-close {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    font-size: 18px; cursor: pointer;
    opacity: 0.6;
    color: inherit;
}

.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.alert-error { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--warning); }
.alert-info { background: #d1ecf1; color: #0c5460; border-left: 4px solid var(--info); }

/* ===================== BREADCRUMB ===================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-light);
}

.breadcrumb a { color: var(--secondary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .current { color: var(--text); font-weight: 500; }
.breadcrumb i { font-size: 10px; }

/* ===================== MODAL ===================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.modal-close {
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    color: var(--text-light);
}

.modal-body { padding: 22px; }
.modal-footer {
    padding: 15px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===================== EMPTY STATE ===================== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}

.empty-state i { font-size: 48px; opacity: 0.3; margin-bottom: 15px; }
.empty-state h3 { font-size: 16px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 13px; margin-bottom: 15px; }

/* ===================== LOGIN ===================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 45px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-card .login-logo {
    max-height: 55px;
    margin-bottom: 12px;
}

.login-card h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.login-card .login-subtitle {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.login-card .form-group { text-align: left; }

.login-card .form-control {
    padding: 12px 14px;
    font-size: 14px;
}

.login-card .btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    justify-content: center;
    margin-top: 5px;
}

.login-card .login-footer {
    margin-top: 25px;
    font-size: 11px;
    color: var(--text-light);
}

/* ===================== FILTER BAR ===================== */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-bar .form-control { width: auto; min-width: 200px; }

.search-input {
    position: relative;
}

.search-input input {
    padding-left: 38px;
}

.search-input i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-toggle { display: block; }
    .hamburger { display: block; }

    .main-content { margin-left: 0; }

    .content-wrapper { padding: 15px; }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .form-row { grid-template-columns: 1fr; }

    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .form-control { min-width: 100%; }

    .modal { width: 95%; }

    .login-card { margin: 15px; padding: 30px 25px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .btn-group { flex-direction: column; }
}

/* ===================== UTILS ===================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 10px; }
.w-100 { width: 100%; }

/* ===================== NOTIFICATION BELL ===================== */
.notif-bell {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}
.notif-bell:hover { background: var(--bg); }
.notif-bell > i { font-size: 18px; color: var(--text-light); }

.notif-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}

@keyframes notifPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}
.notif-pulse { animation: notifPulse 0.5s ease 2; }

.notif-panel {
    display: none;
    position: absolute;
    top: 100%; right: 0;
    width: 340px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    overflow: hidden;
    border: 1px solid var(--border);
}
.notif-panel.active { display: block; }

.notif-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.notif-mark-all { font-size: 11px; color: var(--secondary); }

.notif-panel-body {
    max-height: 350px;
    overflow-y: auto;
}

.notif-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    text-decoration: none;
    color: var(--text);
}
.notif-item:hover { background: var(--bg); color: var(--text); }
.notif-unread { background: rgba(90,145,64,0.06); border-left: 3px solid var(--secondary); }
.notif-title { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.notif-msg { font-size: 12px; color: var(--text-light); margin-bottom: 3px; }
.notif-time { font-size: 11px; color: var(--text-light); }
.notif-empty { padding: 24px 16px; text-align: center; color: var(--text-light); font-size: 13px; }
.notif-hint { background: linear-gradient(180deg, rgba(90,145,64,0.05), rgba(90,145,64,0.00)); }
.notif-loading { padding: 20px; text-align: center; color: var(--text-light); font-size: 13px; }

/* Un puntico de estado para no leídas (sin cambiar la salida del backend). */
.notif-unread { position: relative; }
.notif-unread::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 0 4px rgba(90,145,64,0.14);
}
.notif-title { line-height: 1.25; }
.notif-msg { line-height: 1.35; }

/* ===================== FILE UPLOAD ===================== */
.file-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}
.file-input-wrapper input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    cursor: pointer;
    background: var(--bg);
}
.file-current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-light);
}
.file-current a { color: var(--secondary); }

/* ===================== ESTADO BADGES ===================== */
.badge-estado-aprobada { background: #d4edda; color: #155724; }
.badge-estado-rechazada { background: #f8d7da; color: #721c24; }
.badge-estado-correccion { background: #e2d5f1; color: #4a1a8a; }
.badge-estado-notificada { background: #cce5ff; color: #004085; }
.badge-estado-pendiente { background: #fff3cd; color: #856404; }

/* ===== Tabla de empleados con todos los campos (panel interno y portal) ===== */
.tabla-empleados-contenedor { max-width: 100%; }
.tabla-empleados { font-size: 12px; }
.tabla-empleados th, .tabla-empleados td { white-space: nowrap; padding: 9px 12px; }
.tabla-empleados td { font-size: 12px; }
/* El nombre queda fijo a la izquierda al desplazar la tabla hacia los lados. */
/* Acciones (primera columna) y nombre quedan fijos a la izquierda al desplazar la tabla. */
.tabla-empleados .col-acciones { position: sticky; left: 0; z-index: 1; background: #fff; width: var(--ancho-acciones); min-width: var(--ancho-acciones); max-width: var(--ancho-acciones); box-sizing: border-box; }
.tabla-empleados .col-fija { position: sticky; left: var(--ancho-acciones, 0px); z-index: 1; background: #fff; box-shadow: 2px 0 0 var(--border); }
.tabla-empleados thead .col-fija, .tabla-empleados thead .col-acciones { z-index: 2; background: var(--primary); }
.tabla-empleados tbody tr:hover .col-fija, .tabla-empleados tbody tr:hover .col-acciones { background: #f7f8f9; }
.tabla-empleados .fila-inactiva .col-acciones { opacity: 1; }
.tabla-empleados .texto-largo { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.tabla-empleados .vacio { color: var(--text-light); }
.tabla-empleados .fila-inactiva td { opacity: 0.55; }
.tabla-empleados .fila-inactiva .col-fija { opacity: 1; color: var(--text-light); }
.form-seccion { font-size: 14px; color: var(--primary); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.tabla-empleados-ayuda { font-size: 12px; color: var(--text-light); margin: 0 0 8px; }

/* ===== Avisos del navegador ===== */
.btn-avisos {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px;
    border-radius: 18px; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .2px;
    background: var(--secondary); color: #fff; box-shadow: 0 2px 6px rgba(90,145,64,.25);
    transition: background .2s, box-shadow .2s, transform .1s;
}
.btn-avisos i { font-size: 13px; }
.btn-avisos:hover { background: var(--secondary-dark); box-shadow: 0 3px 10px rgba(90,145,64,.35); }
.btn-avisos:active { transform: scale(.97); }
.btn-avisos:focus-visible { outline: 2px solid var(--secondary-light); outline-offset: 2px; }
/* Activos: verde suave con un punto de estado. */
.btn-avisos.activos { background: rgba(90,145,64,.10); color: var(--secondary-dark); border-color: rgba(90,145,64,.30); box-shadow: none; }
.btn-avisos.activos:hover { background: rgba(90,145,64,.18); }
.btn-avisos.activos::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--secondary); box-shadow: 0 0 0 3px rgba(90,145,64,.18); }
/* Bloqueados: rojo suave. */
.btn-avisos.bloqueados { background: rgba(220,53,69,.08); color: var(--danger); border-color: rgba(220,53,69,.30); box-shadow: none; }
.btn-avisos.bloqueados:hover { background: rgba(220,53,69,.14); }
#avisosPantalla { position: fixed; right: 20px; bottom: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.aviso-pantalla { position: relative; background: #fff; border-left: 5px solid #5a9140; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.18);
    padding: 12px 36px 12px 14px; font-size: 13px; color: #333; cursor: pointer; animation: avisoEntra .3s ease; }
.aviso-pantalla strong { display: block; color: var(--primary); margin-bottom: 3px; }
.aviso-cerrar { position: absolute; top: 6px; right: 8px; background: none; border: 0; font-size: 18px; color: #999; cursor: pointer; }
@keyframes avisoEntra { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 768px) { .btn-avisos span { display: none; } }

/* ===== Seleccionadores con buscador (Tom Select) con el aspecto de .form-control ===== */
.ts-wrapper.form-control { padding: 0; border: none; background: none; box-shadow: none; height: auto; }
.ts-wrapper .ts-control {
    border: 1px solid var(--border); border-radius: 8px; padding: 9px 34px 9px 14px; min-height: 41px;
    font-family: 'Poppins', sans-serif; font-size: 13px; color: var(--text); background: var(--white); box-shadow: none;
}
.ts-wrapper.single .ts-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236c757d'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 20px; cursor: pointer; }
.ts-wrapper.single .ts-control::after { display: none; }
.ts-wrapper.focus .ts-control { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(90,145,64,0.15); }
.ts-wrapper .ts-control input { font-family: 'Poppins', sans-serif; font-size: 13px; color: var(--text); }
.ts-wrapper .ts-control input::placeholder { color: var(--text-light); }
.ts-dropdown { z-index: 3500; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
    font-family: 'Poppins', sans-serif; font-size: 13px; margin-top: 4px; overflow: hidden; }
.ts-dropdown .ts-dropdown-content { max-height: 320px; }
.ts-dropdown .option { padding: 8px 14px; }
.ts-dropdown .active { background: rgba(90,145,64,.12); color: var(--secondary-dark); }
.ts-dropdown .option.selected { font-weight: 600; }
.ts-dropdown .highlight { background: rgba(255,193,7,.35); border-radius: 2px; }
.ts-dropdown .no-results { padding: 10px 14px; color: var(--text-light); }
/* Mientras la lista está abierta se oculta la opción elegida: el campo queda para escribir la búsqueda. */
.ts-wrapper.single.dropdown-active .ts-control .item { display: none; }
.ts-wrapper.single.dropdown-active .ts-control input { min-width: 100% !important; }

/* ===== Confirmación mensual de novedades (portal) ===== */
.confirmacion-mes { border-left: 5px solid var(--warning); }
.confirmacion-mes.confirmado { border-left-color: var(--secondary); }
.confirmacion-mes .card-body { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.confirmacion-mes h3 { font-size: 15px; color: var(--primary); margin: 0 0 4px; }
.confirmacion-mes p { margin: 0; font-size: 13px; color: var(--text); }
.confirmacion-botones { display: flex; gap: 10px; flex-wrap: wrap; }
.confirmacion-botones form { margin: 0; }
.confirmacion-botones .btn[disabled] { opacity: .45; cursor: not-allowed; }
.estado-confirmacion { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 12px; white-space: nowrap; }
.estado-confirmacion.sin { background: rgba(23,162,184,.12); color: #0c6b7a; }
.estado-confirmacion.con { background: rgba(90,145,64,.12); color: var(--secondary-dark); }
.estado-confirmacion.pendiente { background: rgba(255,193,7,.18); color: #856404; }

/* ===== Eliminación definitiva ===== */
.eliminar-definitivo { border-top: 4px solid var(--danger, #dc3545); max-width: 760px; }
.tabla-resumen-eliminar { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla-resumen-eliminar th { text-align: left; width: 210px; color: var(--text-light); font-weight: 500; padding: 7px 10px 7px 0; background: none; text-transform: none; letter-spacing: 0; }
.tabla-resumen-eliminar td { padding: 7px 0; border-bottom: 1px solid rgba(0,0,0,.06); }
.tabla-resumen-eliminar .texto-suave { color: var(--text-light); }
.form-eliminar-definitivo .form-control { max-width: 360px; }
.form-eliminar-definitivo .btn[disabled] { opacity: .45; cursor: not-allowed; }
/* Detalle de un registro de actividad (datos adicionales) */
.log-detalle summary { cursor: pointer; list-style: none; }
.log-detalle summary::-webkit-details-marker { display: none; }
.log-detalle-ver { color: var(--secondary); font-weight: 600; white-space: nowrap; margin-left: 4px; }
.log-detalle-ocultar { display: none; color: var(--secondary); font-weight: 600; font-size: 11px; }
.log-detalle[open] .log-detalle-ver, .log-detalle[open] .log-resumen { display: none; }
.log-detalle[open] .log-detalle-ocultar { display: inline; }
.log-detalle p { margin: 6px 0; }
.log-detalle dl { display: grid; grid-template-columns: max-content minmax(110px, 1fr); gap: 3px 12px; margin: 0; padding: 8px 10px; background: rgba(0,0,0,.035); border-radius: 6px; font-size: 11px; }
.log-detalle dt { color: var(--text-light); white-space: nowrap; }
.log-detalle dd { margin: 0; font-weight: 500; word-break: break-word; }
/* Confirmación registrada desde el panel interno */
.origen-confirmacion { color: var(--primary); margin-right: 3px; font-size: 12px; }
.nota-confirmacion { color: var(--text-light); font-style: italic; }
.texto-ayuda-confirmacion { color: var(--text-light); font-size: 12px; display: block; margin: 6px 0 14px; }
.opciones-confirmacion { display: flex; gap: 8px; flex-wrap: wrap; }
.opciones-confirmacion label { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 8px 14px; border: 2px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 500; margin: 0; }
.opciones-confirmacion label:has(input:checked) { border-color: var(--secondary); background: rgba(90,145,64,.08); }
.opciones-confirmacion label.deshabilitada { opacity: .45; cursor: not-allowed; }

/* ===== Solicitud de novedades ===== */
.solicitudes-stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.solicitudes-stats a.stat-card { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.solicitudes-stats a.stat-card:hover { transform: translateY(-2px); }
.solicitudes-stats .stat-activa { box-shadow: 0 0 0 2px var(--secondary), var(--shadow); }
.texto-suave { color: var(--text-light); }
.deshabilitado { pointer-events: none; opacity: .45; }
.barra-masiva { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 14px; background: rgba(44,62,80,.04); border-radius: 8px; font-size: 13px; }
.barra-masiva > span { font-weight: 600; color: var(--primary); margin-right: 4px; }
.barra-masiva small { font-size: 11px; }
.contactos-empresa { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 3px; font-size: 11px; color: var(--text-light); }
.contactos-empresa .falta { opacity: .3; }
.contactos-empresa .wa { color: #25d366; }
.contactos-empresa .portal { color: var(--secondary); }
.tabla-solicitudes .envio { font-size: 12px; white-space: nowrap; line-height: 1.7; }
.tabla-solicitudes .envio.ok i { color: var(--primary); }
.tabla-solicitudes .envio.wa i { color: #25d366; }
.tabla-solicitudes .envio.fallo { color: var(--danger); }
.tabla-solicitudes .veces { background: rgba(44,62,80,.1); border-radius: 8px; padding: 0 6px; font-size: 11px; font-weight: 600; }
.detalle-respuesta { font-size: 11px; color: var(--text-light); margin-top: 4px; line-height: 1.5; }
.estado-confirmacion.sin-solicitar { background: rgba(108,117,125,.12); color: #5a6268; }
.modal.modal-ancho { max-width: 1100px; width: 95vw; max-height: 92vh; }
.acciones-planilla { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.aviso-planilla { font-size: 13px; margin-bottom: 10px; min-height: 0; }
.aviso-planilla:empty { display: none; }
.aviso-planilla.ok, .aviso-planilla.info, .aviso-planilla.error { padding: 9px 12px; border-radius: 8px; }
.aviso-planilla.ok { background: rgba(90,145,64,.12); color: var(--secondary-dark); }
.aviso-planilla.info { background: rgba(23,162,184,.1); color: #0c6b7a; }
.aviso-planilla.error { background: rgba(220,53,69,.1); color: #a71d2a; }
.vista-planilla { overflow: auto; max-height: 60vh; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: #fff; }
.masivo-columnas { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.vista-correo { width: 100%; height: 52vh; border: 1px solid var(--border); border-radius: 8px; margin-top: 6px; background: #f4f6f9; }
.lista-envio { list-style: none; margin: 6px 0 0; padding: 0; max-height: 52vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.lista-envio li { padding: 7px 10px; font-size: 12px; border-bottom: 1px solid rgba(0,0,0,.05); display: flex; gap: 8px; align-items: baseline; }
.lista-envio li i { width: 14px; color: var(--text-light); }
.lista-envio li.ok i { color: var(--secondary); }
.lista-envio li.error i, .lista-envio li.error small { color: var(--danger); }
.lista-envio li.enviando { background: rgba(23,162,184,.06); }
@media (max-width: 800px) { .masivo-columnas { grid-template-columns: 1fr; } }
/* Solicitud de novedades: acciones con texto */
.btn-confirmar { background: var(--primary); color: #fff; }
.btn-confirmar:hover { background: #1e2b38; color: #fff; }
.acciones-solicitud { display: flex; flex-wrap: nowrap; gap: 6px; }
.acciones-solicitud .btn { white-space: nowrap; }
.leyenda-acciones { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--text-light); margin: -4px 0 14px; }
.leyenda-acciones .muestra { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; margin-right: 4px; }
.leyenda-acciones .muestra.btn-outline { border: 1px solid var(--border); color: var(--text); }
/* Buscador con autocompletado (data-autocompletar) */
.autocompletar-caja { position: relative; display: flex; flex: 1; max-width: 280px; min-width: 200px; }
.autocompletar-caja .form-control { max-width: none !important; width: 100%; }
.autocompletar-lista { position: absolute; top: calc(100% + 4px); left: 0; right: 0; min-width: 300px; z-index: 3600; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 320px; overflow-y: auto; display: none; }
.autocompletar-lista.abierta { display: block; }
.autocompletar-lista .opcion { padding: 8px 12px; cursor: pointer; font-size: 13px; line-height: 1.35; }
.autocompletar-lista .opcion small { display: block; color: var(--text-light); font-size: 11px; }
.autocompletar-lista .opcion.activa, .autocompletar-lista .opcion:hover { background: rgba(90,145,64,.12); color: var(--secondary-dark); }
.autocompletar-lista .opcion mark { background: rgba(255,193,7,.35); color: inherit; padding: 0; }
.autocompletar-lista .vacia { padding: 10px 12px; font-size: 12px; color: var(--text-light); }
.barra-masiva .btn-activo { border-color: var(--secondary); color: var(--secondary-dark); background: rgba(90,145,64,.1); }
/* Envío por día de trazabilidad (Descargar Excel) */
.traza-filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tabla-traza td { vertical-align: middle; }
.traza-lista { color: var(--secondary-dark); font-weight: 600; font-size: 12px; }
.traza-falta { color: #856404; font-size: 12px; }
/* Novedad que viene de un mes anterior y sigue vigente en el mes que se está viendo */
.badge-en-curso { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: rgba(23,162,184,.12); color: #0c6b7a; white-space: nowrap; }
/* Horas extras masivas */
.filtros-horas-masivas { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tabla-horas-masivas td { vertical-align: middle; }
.tabla-horas-masivas .form-control { padding: 6px 10px; font-size: 13px; }
.tabla-horas-masivas tr.fila-marcada td { background: rgba(90,145,64,.07); }
.tabla-horas-masivas tr.fila-ya-registrada td { background: rgba(255,193,7,.08); }
.hm-ya { color: #856404; font-size: 12px; font-weight: 600; }
.badge-cambio_riesgo { background: #fde2cf; color: #8a3b00; }
/* Niveles de riesgo ARL (formulario de novedad "Cambio de Riesgo") */
.tabla-niveles-riesgo { width: 100%; border-collapse: collapse; font-size: 12px; margin: 0 0 16px; }
.tabla-niveles-riesgo th { background: rgba(44,62,80,.08); color: var(--primary); text-align: left; padding: 6px 8px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.tabla-niveles-riesgo td { padding: 6px 8px; border-bottom: 1px solid rgba(0,0,0,.06); }
.badge-horas_extras_nocturnas { background: #e1e4f7; color: #2a3580; }
.badge-otros { background: #ececec; color: #444; }
/* Clientes independientes (no empresa): etiqueta y fila en morado */
.badge-independiente { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: rgba(111,66,193,.14); color: #5a32a3; white-space: nowrap; vertical-align: middle; }
tr.fila-independiente > td { background: rgba(111,66,193,.05); }
tr.fila-independiente > td:first-child { box-shadow: inset 3px 0 0 #6f42c1; }
