:root {
    --bg-main: #0E1117;
    --bg-panel: #161B22;
    --bg-elevated: #1C2128;
    --bg-soft: #111827;

    --border-color: #2A2F36;
    --border-soft: rgba(255, 255, 255, 0.06);

    --text-primary: #E6EDF3;
    --text-secondary: #8B949E;
    --text-muted: #94A3B8;

    --color-primary: #3FA36B;
    --color-primary-hover: #2E7D57;
    --color-success: #3FA36B;
    --color-warning: #D29922;
    --color-danger: #F85149;
    --color-info: #60A5FA;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.24);
    --shadow-strong: 0 14px 34px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* ============================= */
/* ELEMENTOS BASE */
/* ============================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    margin-top: 0;
}

p {
    color: var(--text-primary);
}

a {
    color: inherit;
}

input,
select,
textarea,
button {
    font: inherit;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="email"],
select,
textarea {
    height: 40px;
    width: 100%;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-soft);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
    min-height: 100px;
    padding: 10px 12px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(63, 163, 107, 0.9);
    box-shadow: 0 0 0 3px rgba(63, 163, 107, 0.16);
}

input[type="checkbox"] {
    accent-color: var(--color-primary);
}

button {
    border: 1px solid transparent;
    border-radius: 8px;
    min-height: 38px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ============================= */
/* LAYOUT PRINCIPAL */
/* ============================= */

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

.main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: var(--spacing-xl);
    overflow-y: auto;
    overflow-x: hidden;
}

/* ============================= */
/* SIDEBAR */
/* ============================= */

.sidebar {
    width: 228px;
    flex: 0 0 228px;
    background: linear-gradient(180deg, var(--bg-panel) 0%, #131A23 100%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg) var(--spacing-md);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.28);
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-logo {
    width: 100%;
    max-width: 170px;
    height: auto;
    display: block;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    margin-bottom: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: 0.2s ease;
    min-height: 44px;
}

.sidebar nav a:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    transform: translateX(3px);
}

.sidebar nav a.active {
    background: rgba(63, 163, 107, 0.18);
    color: #ffffff;
    border: 1px solid rgba(63, 163, 107, 0.34);
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.10);
    margin: 16px 0;
}

.sidebar nav a span {
    width: 22px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-right: 6px;
}

.logout-btn {
    margin-top: auto;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
}

.logout-btn:hover {
    background: rgba(248, 81, 73, 0.18);
    border-color: rgba(248, 81, 73, 0.5);
    color: white;
}

/* ============================= */
/* TOPBAR */
/* ============================= */

.topbar {
    height: 72px;
    background: linear-gradient(90deg, var(--bg-panel) 0%, rgba(22, 27, 34, 0.94) 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-xl);
    gap: 16px;
}

.topbar-left {
    min-width: 0;
}

.topbar-left h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(63, 163, 107, 0.12);
    color: var(--color-success);
    border: 1px solid rgba(63, 163, 107, 0.28);
    font-size: 0.95rem;
    font-weight: 600;
}

/* ============================= */
/* SECCIONES */
/* ============================= */

.section {
    display: none;
}

.section.active {
    display: block;
}

.section h2 {
    margin-bottom: 18px;
    font-size: 1.2rem;
}

/* ============================= */
/* DASHBOARD */
/* ============================= */

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 320px 320px;
    grid-template-rows: auto auto;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-lg);
    width: 100%;
}

.dashboard-layout h2,
.dashboard-layout h3 {
    margin-top: 0;
}

.dashboard-metrics {
    grid-column: 1;
    grid-row: 1 / 3;
    min-width: 0;
}

.dashboard-alerts {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

.dashboard-activity {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
}

.dashboard-working {
    grid-column: 3;
    grid-row: 1 / 3;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    max-height: 420px;
    overflow-y: auto;
    min-width: 0;
}

#dashboardStats {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

.stat-card {
    background: linear-gradient(145deg, var(--bg-panel), var(--bg-elevated));
    border: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    transition: 0.25s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.stat-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-primary);
    opacity: 0.7;
}

.stat-card.success::after {
    background: var(--color-success);
}

.stat-card.warning::after {
    background: var(--color-warning);
}

.stat-card.danger::after {
    background: var(--color-danger);
}

.stat-card:hover {
    border-color: rgba(63, 163, 107, 0.55);
    box-shadow: var(--shadow-strong);
}

.stat-card h3 {
    margin: 0 0 var(--spacing-sm);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.stat-card p {
    margin: 0;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 1px;
}

.stat-card.clickable {
    cursor: pointer;
}

/* ============================= */
/* CONTENEDORES COMUNES */
/* ============================= */

.card,
.auditoria-card,
#moduloInformes .card {
    background: linear-gradient(180deg, rgba(28, 33, 40, 0.98) 0%, rgba(22, 27, 34, 0.98) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.card {
    padding: 20px;
}

.page-card {
    background: linear-gradient(180deg, rgba(28, 33, 40, 0.98) 0%, rgba(22, 27, 34, 0.98) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

/* ============================= */
/* TABLAS */
/* ============================= */

.table-wrapper {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

table,
.tabla {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    margin-top: var(--spacing-md);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

th,
td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

th {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

tbody tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

td .acciones-tabla,
td .table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================= */
/* FORMULARIOS Y FILTROS */
/* ============================= */

.form-group {
    margin-bottom: 15px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
}

.form-inline,
.form-row,
.logs-filtros,
.logs-search,
.row,
.row-botones {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.logs-search {
    margin-bottom: 10px;
}

.logs-filtros {
    margin-bottom: 12px;
}

.form-inline input[type="text"],
.form-inline input[type="number"],
.form-inline input[type="date"],
.form-inline select,
.logs-search input,
.logs-filtros input,
.logs-filtros select,
.row input,
.row select {
    width: auto;
    min-width: 140px;
}

.form-inline label,
.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
    min-height: 40px;
}

.form-error,
.mensaje-error {
    color: var(--color-danger);
    font-size: 13px;
}

.mensaje-info {
    color: var(--color-info);
    font-size: 13px;
}

/* ============================= */
/* BOTONES */
/* ============================= */

.btn-primary,
#btnNuevoEmpleado,
#btnNuevoTipoAusencia,
#moduloInformes button,
.login-btn,
.password-card button {
    background: var(--color-primary);
    border: 1px solid transparent;
    color: white;
}

.btn-primary:hover,
#btnNuevoEmpleado:hover,
#btnNuevoTipoAusencia:hover,
#moduloInformes button:hover,
.login-btn:hover,
.password-card button:hover {
    background: var(--color-primary-hover);
}

.btn-secondary {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
}

.btn-sm {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.88rem;
}

.btn-incidencia {
    background: rgba(210, 153, 34, 0.18);
    border: 1px solid rgba(210, 153, 34, 0.4);
    color: #f8d778;
    padding: 8px 12px;
    border-radius: 8px;
}

.btn-incidencia:hover {
    background: rgba(210, 153, 34, 0.28);
}

/* Botones usados por tabla */
.btn-ver,
.btn-editar,
.btn-toggle,
.btn-reset {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
}

.btn-ver,
.btn-editar {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-ver:hover,
.btn-editar:hover {
    background: var(--bg-elevated);
}

.btn-toggle {
    background: rgba(63, 163, 107, 0.18);
    border: 1px solid rgba(63, 163, 107, 0.36);
    color: #D7F5E2;
}

.btn-toggle:hover {
    background: rgba(63, 163, 107, 0.28);
}

.btn-reset {
    background: rgba(210, 153, 34, 0.16);
    border: 1px solid rgba(210, 153, 34, 0.35);
    color: #F0D58B;
}

.btn-reset:hover {
    background: rgba(210, 153, 34, 0.26);
}

/* ============================= */
/* EMPLEADOS */
/* ============================= */

.empleados-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.empleados-contador {
    font-weight: 600;
    font-size: 14px;
}

.limite-alcanzado {
    color: var(--color-danger);
}

/* ============================= */
/* SWITCH */
/* ============================= */

.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    background-color: #374151;
    border-radius: 20px;
    inset: 0;
    transition: 0.3s;
}

.slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background-color: var(--color-success);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ============================= */
/* MODALES */
/* ============================= */

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-panel) 100%);
    width: 420px;
    max-width: 100%;
    border-radius: 14px;
    padding: 22px;
    color: white;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.42);
    border: 1px solid var(--border-color);
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    min-height: auto;
    padding: 0;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer,
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ============================= */
/* BADGES */
/* ============================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    font-size: 11px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset;
}

.badge-danger {
    background: rgba(248, 81, 73, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(248, 81, 73, 0.4);
}

.badge-warning {
    background: rgba(210, 153, 34, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(210, 153, 34, 0.4);
}

.badge-primary {
    background: rgba(63, 163, 107, 0.15);
    color: var(--color-primary);
    border: 1px solid rgba(63, 163, 107, 0.4);
}

.badge-success {
    background: rgba(63, 163, 107, 0.2);
    color: #dff7e8;
    border: 1px solid rgba(63, 163, 107, 0.4);
}

.badge-secondary {
    background: #374151;
    color: #fff;
}

.badge-activa {
    background: rgba(63, 163, 107, 0.18);
    color: #dff7e8;
    border: 1px solid rgba(63, 163, 107, 0.38);
}

.badge-inactiva {
    background: rgba(148, 163, 184, 0.14);
    color: #c7d2de;
    border: 1px solid rgba(148, 163, 184, 0.28);
}

.badge-jornada {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(248, 81, 73, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(248, 81, 73, 0.4);
}

.fichaje-alerta-geo-alta {
    background: rgba(239, 68, 68, 0.14);
}

.fichaje-alerta-geo-media {
    background: rgba(245, 158, 11, 0.14);
}

.fichaje-alerta-geo {
    background: rgba(148, 163, 184, 0.12);
}

/* ============================= */
/* LOGIN */
/* ============================= */

.login-wrapper {
    display: flex;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top, #0f172a, #020617);
    padding: 24px;
}

.login-card {
    width: 380px;
    max-width: 100%;
    background: #1e293b;
    padding: 40px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 40px rgba(63, 163, 107, 0.12);
    animation: fadeIn 0.6s ease;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    text-align: center;
}

.login-brand-logo {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    margin-bottom: 16px;
}

.login-subtitle {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #94a3b8;
}

.login-btn {
    width: 100%;
    padding: 12px;
    min-height: 44px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

/* ============================= */
/* INCIDENCIAS */
/* ============================= */

#incidenciasSection h2 {
    margin-bottom: var(--spacing-lg);
}

#modalCerrarJornada .modal-content {
    border-left: 4px solid var(--color-warning);
}

#modalCerrarJornada p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 4px 0;
}

#horaSalidaManual {
    width: 100%;
}

/* ============================= */
/* FICHAJES / TIMELINE */
/* ============================= */

td.evento {
    font-weight: 500;
}

td.hora {
    font-family: monospace;
    font-size: 14px;
}

.timeline-row td {
    padding: 8px 12px 16px 12px;
    overflow-x: auto;
}

.timeline-jornada {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.95;
    min-width: 720px;
}

.timeline-bar {
    position: relative;
    flex: 1;
    min-width: 420px;
    height: 4px;
    background: #2b3a55;
    margin: 0 10px;
    border-radius: 999px;
}

.timeline-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: #60A5FA;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.45);
}

.timeline-start,
.timeline-end {
    position: absolute;
    top: -3px;
    width: 10px;
    height: 10px;
    background: #60A5FA;
    border-radius: 50%;
}

.timeline-start {
    left: -1px;
}

.timeline-end {
    right: -1px;
}

.timeline-hora {
    font-size: 12px;
    color: #9aa4b2;
    font-family: monospace;
    white-space: nowrap;
}

.timeline-total {
    font-size: 12px;
    color: #9aa4b2;
    margin-top: 4px;
}

.timeline-pausa {
    position: absolute;
    top: -6px;
    transform: translateX(-50%);
    font-size: 14px;
    color: #f59e0b;
}

/* ============================= */
/* TRABAJANDO AHORA */
/* ============================= */

.trabajador-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 14px;
}

.trabajador-nombre {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trabajador-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
}

.trabajando-ahora-vacio {
    opacity: 0.6;
}

/* ============================= */
/* AUDITORÍA */
/* ============================= */

.auditoria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.auditoria-card {
    padding: 20px;
}

.ok {
    color: #2ea043;
    font-weight: bold;
}

.error {
    color: #f85149;
    font-weight: bold;
}

/* ============================= */
/* LOGS */
/* ============================= */

.logs-integridad {
    margin: 10px 0 16px;
    font-weight: 600;
}

#tabla-logs {
    width: 100%;
    min-width: 1250px;
    border-collapse: collapse;
    table-layout: fixed;
}

#tabla-logs th,
#tabla-logs td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    word-break: break-word;
}

#tabla-logs th {
    background: rgba(255, 255, 255, 0.04);
    color: #e5e7eb;
    font-weight: 600;
}

#tabla-logs tbody tr {
    transition: background 0.15s ease;
    cursor: pointer;
    background: #111827;
    color: #e5e7eb;
}

#tabla-logs tbody tr:nth-child(even) {
    background: #0f172a;
}

#tabla-logs tbody tr:hover {
    background: #1f2937;
}

#tabla-logs tr td {
    border-left: none !important;
    box-shadow: none !important;
    outline: none !important;
}

#tabla-logs th:nth-child(1),
#tabla-logs td:nth-child(1) {
    width: 180px;
}

#tabla-logs th:nth-child(2),
#tabla-logs td:nth-child(2) {
    width: 110px;
}

#tabla-logs th:nth-child(3),
#tabla-logs td:nth-child(3) {
    width: 205px;
}

#tabla-logs th:nth-child(4),
#tabla-logs td:nth-child(4) {
    width: 190px;
}

#tabla-logs th:nth-child(5),
#tabla-logs td:nth-child(5) {
    width: 60px;
    text-align: center;
}

#tabla-logs th:nth-child(6),
#tabla-logs td:nth-child(6) {
    width: 320px;
}

#tabla-logs th:nth-child(7),
#tabla-logs td:nth-child(7) {
    width: 110px;
}

#tabla-logs th:nth-child(8),
#tabla-logs td:nth-child(8) {
    width: 110px;
}

#tabla-logs tr.log-login {
    background: rgba(59, 130, 246, 0.06);
}

#tabla-logs tr.log-login_fallido {
    background: rgba(239, 68, 68, 0.08);
}

#tabla-logs tr.log-logout {
    background: rgba(148, 163, 184, 0.06);
}

#tabla-logs tr.log-refresh_token {
    background: rgba(125, 211, 252, 0.06);
}

#tabla-logs tr.log-fichaje_entrada,
#tabla-logs tr.log-fichaje_salida,
#tabla-logs tr.log-fichaje_pausa,
#tabla-logs tr.log-fichaje_ausencia_inicio,
#tabla-logs tr.log-fichaje_ausencia_fin {
    background: rgba(16, 185, 129, 0.05);
}

#tabla-logs tr.log-tipo_ausencia_creado,
#tabla-logs tr.log-tipo_ausencia_editado,
#tabla-logs tr.log-tipo_ausencia_activado,
#tabla-logs tr.log-tipo_ausencia_desactivado {
    background: rgba(168, 85, 247, 0.06);
}

#detalleLog {
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 60vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 8px;
}

/* ============================= */
/* INFORMES */
/* ============================= */

#moduloInformes .card {
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 0 20px rgba(63, 163, 107, 0.08);
}

#moduloInformes h3 {
    margin-bottom: 15px;
    color: #fff;
}

#moduloInformes .row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#moduloInformes select,
#moduloInformes input {
    padding: 0 12px;
    background: #0f172a;
    border: 1px solid #334155;
    color: #fff;
    border-radius: 8px;
    min-height: 40px;
}

#moduloInformes button {
    min-height: 40px;
    padding: 10px 18px;
    border-radius: 8px;
}

.informe-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.resumen-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 12px;
}

.resumen-card h4 {
    margin: 0;
    font-size: 12px;
    color: #9aa4b2;
    font-weight: 500;
}

.resumen-card p {
    margin: 3px 0 0 0;
    font-size: 18px;
    font-weight: 600;
    color: #e6edf3;
}

#moduloInformes .row-botones {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
    flex-wrap: wrap;
}

#moduloInformes .row-botones button {
    width: auto;
    min-width: 150px;
    height: 40px;
}

#previewInforme {
    margin-top: 0;
    min-width: 0;
}

.informe-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.informe-filtros {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.informe-preview {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 15px;
    min-width: 0;
    max-height: 70vh;
    overflow: auto;
}

.informe-preview table,
#previewInforme table {
    width: 100%;
    min-width: 720px;
    margin-top: 0;
}

/* ============================= */
/* CAMBIO DE CONTRASEÑA */
/* ============================= */

.password-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    padding: 24px;
}

.password-card {
    background: #1e293b;
    padding: 40px;
    border-radius: 12px;
    width: 420px;
    max-width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    text-align: center;
    border: 1px solid var(--border-color);
}

.password-card h2 {
    color: #fff;
    margin-bottom: 10px;
}

.password-info {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 25px;
}

.password-card input {
    width: 100%;
    margin-bottom: 12px;
}

.password-card button {
    width: 100%;
    padding: 12px;
}

.error {
    margin-top: 10px;
    color: #ef4444;
    font-size: 13px;
}

/* ============================= */
/* TIPOS DE AUSENCIA / TABLAS */
/* ============================= */

.acciones-tabla {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================= */
/* ANIMACIONES */
/* ============================= */

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

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

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-6px); }
    100% { transform: translateX(0); }
}

/* ============================= */
/* RESPONSIVE */
/* ============================= */

@media (max-width: 1280px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .dashboard-metrics,
    .dashboard-alerts,
    .dashboard-activity,
    .dashboard-working {
        grid-column: auto;
        grid-row: auto;
    }

    .dashboard-working {
        max-height: none;
    }
}

@media (max-width: 1024px) {
    .informe-layout {
        grid-template-columns: 1fr;
    }

    .informe-preview {
        max-height: none;
    }
}

@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        width: 100%;
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .topbar {
        height: auto;
        min-height: 72px;
        padding: 14px 18px;
    }

    .content {
        padding: 20px;
    }

    .sidebar nav a:hover {
        transform: none;
    }
}

@media (max-width: 640px) {
    .content {
        padding: 16px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .empleados-header,
    .form-inline,
    .form-row,
    .logs-filtros,
    .row,
    .row-botones {
        flex-direction: column;
        align-items: stretch;
    }

    .form-inline input[type="text"],
    .form-inline input[type="number"],
    .form-inline input[type="date"],
    .form-inline select,
    .logs-search input,
    .logs-filtros input,
    .logs-filtros select,
    .row input,
    .row select {
        width: 100%;
        min-width: 0;
    }

    .modal-content {
        padding: 18px;
    }

    .login-card,
    .password-card {
        padding: 28px 22px;
    }
}

.toolbar-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    color: var(--text-primary);
}

.checkbox-inline input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.paginacion {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* ============================= */
/* TOASTS */
/* ============================= */

.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 280px;
    max-width: 420px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-panel) 100%);
    color: var(--text-primary);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    pointer-events: auto;
    animation: toastIn 0.22s ease;
}

.toast-success {
    border-color: rgba(63, 163, 107, 0.45);
}

.toast-error {
    border-color: rgba(248, 81, 73, 0.45);
}

.toast-info {
    border-color: rgba(96, 165, 250, 0.40);
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    min-height: auto;
    padding: 0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-primary);
    transform: none;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-8px) translateX(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

/* ============================= */
/* INFORMES PRO */
/* ============================= */

.informe-card-principal {
    padding: 22px;
}

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

.informe-card-header h3 {
    margin: 0 0 6px 0;
}

.informe-card-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.informe-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.informe-filtros {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
}

.informe-botones {
    margin-top: 4px;
}

.informe-msg {
    min-height: 18px;
    margin-top: 4px;
}

.informe-preview-wrapper {
    min-width: 0;
}

.informe-preview-placeholder {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    background: #0f172a;
    border: 1px dashed #334155;
    border-radius: 12px;
    padding: 24px;
}

.informe-preview-placeholder h4 {
    margin: 0;
    font-size: 1rem;
}

.informe-preview-placeholder p {
    margin: 0;
    max-width: 420px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.informe-preview-icon {
    font-size: 2rem;
    opacity: 0.9;
}

.informe-preview {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 18px;
    min-width: 0;
    max-height: 72vh;
    overflow: auto;
}

.informe-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.informe-preview-title h3 {
    margin: 0 0 6px 0;
    font-size: 1.1rem;
}

.informe-preview-title p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.informe-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.informe-meta-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 12px 14px;
}

.informe-meta-item .label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.informe-meta-item .value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.informe-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.resumen-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 12px 14px;
}

.resumen-card h4 {
    margin: 0;
    font-size: 12px;
    color: #9aa4b2;
    font-weight: 500;
}

.resumen-card p {
    margin: 5px 0 0 0;
    font-size: 20px;
    font-weight: 700;
    color: #e6edf3;
}

.informe-tabla-wrapper {
    overflow-x: auto;
}

.informe-tabla-wrapper table {
    margin-top: 0;
    min-width: 720px;
}

.informe-empresa-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: end;
}

.informe-empresa-filtros .form-group {
    min-width: 180px;
    margin-bottom: 0;
}

.informe-empresa-accion {
    min-width: 240px;
}

.dashboard-alert {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    font-weight: 600;
    line-height: 1.4;
}

.dashboard-alert.success {
    background: rgba(63, 163, 107, 0.12);
    border-color: rgba(63, 163, 107, 0.22);
    color: #dff7e8;
}

.dashboard-alert.danger {
    background: rgba(248, 81, 73, 0.12);
    border-color: rgba(248, 81, 73, 0.22);
    color: #ffd5d2;
}

@media (max-width: 1024px) {
    .informe-layout {
        grid-template-columns: 1fr;
    }

    .informe-preview {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .informe-empresa-filtros {
        flex-direction: column;
        align-items: stretch;
    }

    .informe-empresa-filtros .form-group,
    .informe-empresa-accion {
        min-width: 0;
        width: 100%;
    }

    .informe-preview-header {
        flex-direction: column;
    }
}


/* ============================= */
/* AUSENCIAS Y VACACIONES - CALENDARIO RRHH */
/* ============================= */

.calendario-rrhh-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
    margin-bottom: 14px;
}

.calendario-rrhh-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 10px;
}

.calendario-rrhh-kpi {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px 14px;
}

.calendario-rrhh-kpi-label {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.calendario-rrhh-kpi strong {
    display: block;
    font-size: 22px;
    color: var(--text-primary);
}

.calendario-rrhh-leyenda {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
}

.calendario-rrhh-leyenda-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
}

.calendario-rrhh-leyenda-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.ausencia-dot-vacaciones {
    background: #60A5FA;
}

.ausencia-dot-baja_medica {
    background: #22C55E;
}

.ausencia-dot-permiso_retribuido {
    background: #A78BFA;
}

.ausencia-dot-permiso_no_retribuido {
    background: #FB923C;
}

.ausencia-dot-ausencia_no_justificada {
    background: #EF4444;
}

.calendario-rrhh-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(118px, 1fr));
    gap: 8px;
    margin-top: 12px;
    min-width: 920px;
}

.calendario-rrhh-dia-semana {
    font-weight: 700;
    font-size: 12px;
    text-align: center;
    color: var(--text-secondary);
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.calendario-rrhh-dia {
    min-height: 126px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 9px;
    background: rgba(255,255,255,0.025);
    overflow: hidden;
    position: relative;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.calendario-rrhh-dia:hover {
    border-color: rgba(63, 163, 107, 0.5);
    background: rgba(255,255,255,0.045);
    transform: translateY(-1px);
}

.calendario-rrhh-dia.fuera-mes {
    opacity: 0.45;
}

.calendario-rrhh-dia.fin-semana {
    background: rgba(148, 163, 184, 0.08);
}

.calendario-rrhh-dia.hoy {
    border-color: var(--color-info);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.18) inset;
}

.calendario-rrhh-dia.con-eventos {
    background: linear-gradient(180deg, rgba(28, 33, 40, 0.98) 0%, rgba(15, 23, 42, 0.96) 100%);
}

.calendario-rrhh-dia.alta-ocupacion::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: var(--color-warning);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(210, 153, 34, 0.6);
}

.calendario-rrhh-dia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
    gap: 6px;
}

.calendario-rrhh-numero {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.calendario-rrhh-dia-badges {
    display: flex;
    align-items: center;
    gap: 4px;
}

.calendario-rrhh-mini-badge,
.calendario-rrhh-contador {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    font-size: 10px;
    font-weight: 800;
}

.calendario-rrhh-mini-badge {
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.calendario-rrhh-contador {
    background: rgba(63, 163, 107, 0.18);
    color: #D7F5E2;
    border: 1px solid rgba(63, 163, 107, 0.32);
}

.calendario-rrhh-eventos {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.calendario-rrhh-evento {
    min-height: 28px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 5px 7px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
    cursor: pointer;
    color: #0f172a;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: none;
}

.calendario-rrhh-evento:hover {
    transform: none;
    filter: brightness(1.06);
}

.calendario-rrhh-evento-icono {
    flex: 0 0 auto;
}

.calendario-rrhh-evento-texto {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ausencia-evento-vacaciones {
    background: #DBEAFE;
    border-color: #93C5FD;
}

.ausencia-evento-baja_medica {
    background: #DCFCE7;
    border-color: #86EFAC;
}

.ausencia-evento-permiso_retribuido {
    background: #EDE9FE;
    border-color: #C4B5FD;
}

.ausencia-evento-permiso_no_retribuido {
    background: #FFEDD5;
    border-color: #FDBA74;
}

.ausencia-evento-asuntos_propios,
.ausencia-evento-ausencia_justificada,
.ausencia-evento-formacion,
.ausencia-evento-otro {
    background: #E0F2FE;
    border-color: #7DD3FC;
}

.ausencia-evento-ausencia_no_justificada {
    background: #FECACA;
    border-color: #FCA5A5;
}

.calendario-rrhh-evento.estado-pendiente {
    opacity: 0.82;
    border-style: dashed;
}

.calendario-rrhh-evento.estado-rechazada,
.calendario-rrhh-evento.estado-cancelada {
    opacity: 0.52;
    filter: grayscale(0.35);
}

.calendario-rrhh-ver-mas {
    width: 100%;
    margin-top: 5px;
    min-height: 24px;
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    background: rgba(255,255,255,0.025);
    color: var(--text-secondary);
    font-size: 11px;
    transform: none;
}

.calendario-rrhh-ver-mas:hover {
    background: rgba(255,255,255,0.05);
    transform: none;
    color: var(--text-primary);
}

.ausencia-tipo-chip,
.ausencia-estado-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 800;
    border: 1px solid rgba(255,255,255,0.10);
}

.ausencia-tipo-chip {
    background: rgba(96, 165, 250, 0.12);
    color: #DDEBFF;
}

.ausencia-tipo-vacaciones {
    background: rgba(96, 165, 250, 0.16);
    color: #BFDBFE;
}

.ausencia-tipo-baja_medica {
    background: rgba(34, 197, 94, 0.14);
    color: #BBF7D0;
}

.ausencia-tipo-permiso_retribuido {
    background: rgba(167, 139, 250, 0.16);
    color: #DDD6FE;
}

.ausencia-tipo-permiso_no_retribuido {
    background: rgba(251, 146, 60, 0.16);
    color: #FED7AA;
}

.ausencia-tipo-ausencia_no_justificada {
    background: rgba(239, 68, 68, 0.16);
    color: #FECACA;
}

.ausencia-estado-badge.estado-pendiente {
    background: rgba(210, 153, 34, 0.16);
    color: #F0D58B;
}

.ausencia-estado-badge.estado-aprobada {
    background: rgba(63, 163, 107, 0.18);
    color: #D7F5E2;
}

.ausencia-estado-badge.estado-rechazada {
    background: rgba(248, 81, 73, 0.16);
    color: #FECACA;
}

.ausencia-estado-badge.estado-cancelada {
    background: rgba(148, 163, 184, 0.14);
    color: #CBD5E1;
}

@media (max-width: 1100px) {
    #calendarioAusenciasGrid {
        overflow-x: auto;
        padding-bottom: 4px;
    }
}

/* Ausencias reales fichadas desde kiosco en calendario RRHH */
.ausencia-dot-kiosco_ausencia {
    background: #F97316;
}

.calendario-rrhh-evento.origen-kiosco {
    background: rgba(249, 115, 22, 0.22);
    border-color: rgba(251, 146, 60, 0.75);
    color: #FED7AA;
    border-style: dashed;
}

.calendario-rrhh-evento.origen-kiosco.estado-abierta {
    background: rgba(248, 81, 73, 0.20);
    border-color: rgba(248, 81, 73, 0.75);
    color: #FECACA;
}

.calendario-rrhh-evento.origen-kiosco::after {
    content: "K";
    margin-left: auto;
    font-size: 9px;
    font-weight: 900;
    color: rgba(255,255,255,0.72);
}

.ausencia-evento-kiosco_ausencia {
    background: rgba(249, 115, 22, 0.22);
    border-color: rgba(251, 146, 60, 0.75);
}

/* ============================= */
/* CONFIGURACIÓN RRHH */
/* ============================= */

.config-rrhh-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 20px;
    align-items: start;
}

.config-rrhh-card,
.config-rrhh-info {
    margin-top: 12px;
}

.config-rrhh-header {
    margin-bottom: 18px;
}

.field-help {
    margin: 7px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.config-switch-row {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(255,255,255,0.025);
    cursor: pointer;
}

.config-switch-row strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.config-switch-row small {
    display: block;
    color: var(--text-secondary);
    line-height: 1.4;
}

.config-rrhh-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.config-rrhh-info-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.config-rrhh-info-list div {
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,0.025);
}

.config-rrhh-info-list strong {
    display: block;
    margin-bottom: 4px;
}

.config-rrhh-info-list p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

@media (max-width: 1100px) {
    .config-rrhh-layout {
        grid-template-columns: 1fr;
    }
}



/* ============================= */
/* DASHBOARD V4.1 LIMPIO - SAAS */
/* ============================= */

#dashboardSection.dashboard-v4-section {
    max-width: 1680px;
    margin: 0 auto;
}

#dashboardSection .dashboard-v4-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

#dashboardSection .dashboard-v4-header h2 {
    margin: 0 0 4px;
    font-size: 1.25rem;
}

#dashboardSection .dashboard-v4-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

#dashboardSection .dashboard-v4-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 340px !important;
    grid-template-areas:
        "kpis kpis"
        "actions actions"
        "main side" !important;
    gap: 14px !important;
    align-items: start !important;
    width: 100%;
}

#dashboardSection .dashboard-v4-kpis {
    grid-area: kpis;
    display: grid !important;
    grid-template-columns: repeat(6, minmax(150px, 1fr)) !important;
    gap: 10px !important;
    min-width: 0;
}

#dashboardSection .dashboard-v4-actions-panel {
    grid-area: actions;
}

#dashboardSection .dashboard-v4-main {
    grid-area: main;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    min-width: 0;
}

#dashboardSection .dashboard-v4-side {
    grid-area: side;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px;
    min-width: 0;
}

#dashboardSection .dashboard-v4-panel {
    background: linear-gradient(180deg, rgba(28,33,40,0.98) 0%, rgba(22,27,34,0.98) 100%);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px;
    box-shadow: var(--shadow-soft);
    min-width: 0;
    overflow: hidden;
}

#dashboardSection .dashboard-v4-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

#dashboardSection .dashboard-v4-panel-header.compact {
    align-items: center;
}

#dashboardSection .dashboard-v4-panel-header h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

#dashboardSection .dashboard-v4-panel-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

#dashboardSection .dashboard-v4-kpi {
    width: 100%;
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-align: left;
    color: var(--text-primary);
    background: linear-gradient(145deg, var(--bg-panel), var(--bg-elevated));
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--color-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    transform: none;
}

#dashboardSection .dashboard-v4-kpi:hover {
    transform: translateY(-1px);
    border-color: rgba(63, 163, 107, 0.55);
}

#dashboardSection .dashboard-v4-kpi.primary { border-left-color: var(--color-info); }
#dashboardSection .dashboard-v4-kpi.success { border-left-color: var(--color-success); }
#dashboardSection .dashboard-v4-kpi.warning { border-left-color: var(--color-warning); }
#dashboardSection .dashboard-v4-kpi.danger { border-left-color: var(--color-danger); }

#dashboardSection .dashboard-v4-kpi-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.055);
    border: 1px solid var(--border-soft);
    font-size: 16px;
}

#dashboardSection .dashboard-v4-kpi-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#dashboardSection .dashboard-v4-kpi-title {
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#dashboardSection .dashboard-v4-kpi strong {
    font-size: 25px;
    line-height: 1;
    color: var(--text-primary);
}

#dashboardSection .dashboard-v4-kpi small {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#dashboardSection .dashboard-v4-actions-panel {
    padding: 12px 14px;
}

#dashboardSection .dashboard-v4-actions-panel .dashboard-v4-panel-header {
    margin-bottom: 10px;
}

#dashboardSection .dashboard-v4-actions-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 10px;
}

#dashboardSection .dashboard-v4-action {
    min-height: 42px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    transform: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.035);
}

#dashboardSection .dashboard-v4-action:hover {
    transform: translateY(-1px);
}

#dashboardSection .dashboard-v4-action.success { background: rgba(63,163,107,0.13); border-color: rgba(63,163,107,0.35); color: #D7F5E2; }
#dashboardSection .dashboard-v4-action.purple { background: rgba(168,85,247,0.13); border-color: rgba(168,85,247,0.35); color: #E9D5FF; }
#dashboardSection .dashboard-v4-action.info { background: rgba(96,165,250,0.13); border-color: rgba(96,165,250,0.35); color: #DBEAFE; }
#dashboardSection .dashboard-v4-action.warning { background: rgba(210,153,34,0.14); border-color: rgba(210,153,34,0.36); color: #FDE68A; }
#dashboardSection .dashboard-v4-action.primary { background: rgba(59,130,246,0.13); border-color: rgba(59,130,246,0.35); color: #BFDBFE; }

#dashboardSection .dashboard-v4-rrhh-grid,
#dashboardSection .dashboard-v4-operational-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

#dashboardSection .dashboard-v4-operational-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

#dashboardSection .dashboard-v4-mini-panel,
#dashboardSection .dashboard-v4-operational-item {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px;
    background: rgba(17,24,39,0.72);
    min-width: 0;
}

#dashboardSection .dashboard-v4-mini-panel h4,
#dashboardSection .dashboard-v4-operational-item span {
    display: block;
    margin: 0 0 8px;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 800;
}

#dashboardSection .dashboard-v4-operational-item strong {
    display: block;
    font-size: 26px;
    line-height: 1;
    margin-bottom: 6px;
}

#dashboardSection .dashboard-v4-operational-item small {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.3;
}

#dashboardSection .dashboard-v4-operational-item.primary strong { color: var(--color-info); }
#dashboardSection .dashboard-v4-operational-item.success strong { color: var(--color-success); }
#dashboardSection .dashboard-v4-operational-item.warning strong { color: var(--color-warning); }
#dashboardSection .dashboard-v4-operational-item.danger strong { color: var(--color-danger); }
#dashboardSection .dashboard-v4-operational-item.muted strong { color: var(--text-muted); }

#dashboardSection .dashboard-v4-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#dashboardSection .dashboard-v4-list-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(0,0,0,0.16);
    border: 1px solid rgba(255,255,255,0.045);
    color: var(--text-primary);
    text-align: left;
    transform: none;
}

#dashboardSection .dashboard-v4-list-item strong {
    display: block;
    font-size: 13px;
    margin-bottom: 3px;
}

#dashboardSection .dashboard-v4-list-item small,
#dashboardSection .dashboard-v4-empty {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.3;
}

#dashboardSection .dashboard-v4-empty {
    padding: 8px 0;
}

#dashboardSection .dashboard-v4-alert {
    width: 100%;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    margin-bottom: 9px;
    border-radius: 11px;
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,0.035);
    color: var(--text-primary);
    text-align: left;
    transform: none;
}

#dashboardSection .dashboard-v4-alert:last-child {
    margin-bottom: 0;
}

#dashboardSection .dashboard-v4-alert.warning { border-color: rgba(210,153,34,0.45); background: rgba(210,153,34,0.10); }
#dashboardSection .dashboard-v4-alert.danger { border-color: rgba(248,81,73,0.45); background: rgba(248,81,73,0.11); }
#dashboardSection .dashboard-v4-alert.success { border-color: rgba(63,163,107,0.35); background: rgba(63,163,107,0.10); }

#dashboardSection .dashboard-v4-alert-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.055);
}

#dashboardSection .dashboard-v4-alert-body strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#dashboardSection .dashboard-v4-alert-body small {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#dashboardSection .dashboard-v4-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(63,163,107,0.18);
    color: #D7F5E2;
    font-weight: 800;
}

#dashboardSection .dashboard-v4-working #trabajandoAhora {
    max-height: 290px;
    overflow-y: auto;
    padding-right: 2px;
}

#dashboardSection .dashboard-v4-worker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

#dashboardSection .dashboard-v4-worker:last-child {
    border-bottom: none;
}

#dashboardSection .dashboard-v4-worker strong {
    font-size: 13px;
}

#dashboardSection .dashboard-v4-worker small {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

#dashboardSection .dashboard-v4-more-workers {
    width: 100%;
    margin-top: 8px;
    min-height: 34px;
    border-radius: 9px;
    background: rgba(96,165,250,0.12);
    border: 1px solid rgba(96,165,250,0.32);
    color: #BFDBFE;
    transform: none;
}

#dashboardSection .trabajando-ahora-vacio {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

@media (max-width: 1450px) {
    #dashboardSection .dashboard-v4-layout {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "kpis"
            "actions"
            "main"
            "side" !important;
    }

    #dashboardSection .dashboard-v4-side {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 1200px) {
    #dashboardSection .dashboard-v4-kpis {
        grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
    }

    #dashboardSection .dashboard-v4-actions-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }
}

@media (max-width: 900px) {
    #dashboardSection .dashboard-v4-kpis,
    #dashboardSection .dashboard-v4-actions-grid,
    #dashboardSection .dashboard-v4-rrhh-grid,
    #dashboardSection .dashboard-v4-operational-grid,
    #dashboardSection .dashboard-v4-side {
        grid-template-columns: 1fr !important;
    }
}


/* ============================= */
/* PAUSAS */
/* ============================= */

#pausasSection .table-wrapper {
    margin-top: 16px;
}

.modal-content-wide {
    width: 520px;
}

.pausa-switch-row {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
}

.pausa-version-warning {
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(210, 153, 34, 0.42);
    background: rgba(210, 153, 34, 0.12);
    color: #f8d778;
    font-size: 13px;
    line-height: 1.45;
}

.tabla-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 22px 14px;
}


/* ============================= */
/* AUSENCIAS PLANIFICADAS - UX PRO */
/* ============================= */

.modal-subtitle {
    margin: 4px 0 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.modal-content-wide {
    width: min(920px, calc(100vw - 40px));
}

.ausencia-modal-content {
    max-height: calc(100vh - 42px);
    display: flex;
    flex-direction: column;
}

.ausencia-modal-header {
    align-items: flex-start;
}

.ausencia-modal-body {
    overflow-y: auto;
    padding-right: 4px;
}

.ausencia-modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) 320px;
    gap: 18px;
    align-items: start;
}

.ausencia-form-panel,
.ausencia-assistant-panel {
    min-width: 0;
}

.ausencia-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ausencia-assistant-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ausencia-info-card,
.ausencia-preview-card,
.ausencia-rules-card,
.ausencia-confirm-detail {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(255,255,255,0.025);
    padding: 14px;
}

.ausencia-info-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ausencia-info-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(63, 163, 107, 0.14);
    border: 1px solid rgba(63, 163, 107, 0.24);
    flex: 0 0 auto;
}

.ausencia-info-card strong,
.ausencia-preview-card strong,
.ausencia-rules-card h4 {
    display: block;
    margin: 0 0 6px 0;
    color: var(--text-primary);
}

.ausencia-info-card p,
.ausencia-preview-card span,
.ausencia-rules-card li {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.ausencia-preview-card.warning {
    border-color: rgba(210, 153, 34, 0.45);
    background: rgba(210, 153, 34, 0.10);
}

.ausencia-rules-card ul {
    margin: 0;
    padding-left: 18px;
}

.ausencia-rules-card li + li {
    margin-top: 6px;
}

.ausencia-dia-detalle-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ausencia-dia-detalle-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.025);
}

.ausencia-dia-detalle-icono {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    flex: 0 0 auto;
}

.ausencia-dia-detalle-main {
    min-width: 0;
}

.ausencia-dia-detalle-main strong,
.ausencia-dia-detalle-main small {
    display: block;
    line-height: 1.45;
}

.ausencia-dia-detalle-main small {
    color: var(--text-secondary);
    margin-top: 3px;
}

.ausencia-confirm-content {
    width: min(520px, calc(100vw - 40px));
}

.ausencia-confirm-detail {
    white-space: pre-wrap;
    color: var(--text-secondary);
    line-height: 1.45;
}

@media (max-width: 900px) {
    .ausencia-modal-grid {
        grid-template-columns: 1fr;
    }
}

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

/* ============================= */
/* EMPLEADOS - VISUAL ADMIN */
/* ============================= */

#empleadosContador {
    width: 100%;
}

.empleados-resumen-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(145px, 1fr));
    gap: 0;
    align-items: stretch;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.82) 0%, rgba(15, 23, 42, 0.72) 100%);
    overflow: hidden;
    min-width: min(100%, 720px);
}

.empleados-resumen-kpi {
    min-height: 78px;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-right: 1px solid var(--border-soft);
}

.empleados-resumen-kpi:last-child {
    border-right: none;
}

.empleados-resumen-kpi strong {
    display: block;
    font-size: 24px;
    line-height: 1;
    color: var(--text-primary);
}

.empleados-resumen-kpi span {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.35;
}

.empleados-resumen-kpi.principal strong {
    display: inline;
    font-size: 18px;
    margin-right: 4px;
}

.empleados-resumen-kpi.principal span:not(.empleados-resumen-icon) {
    color: var(--text-primary);
    font-weight: 700;
}

.empleados-resumen-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.24);
    font-size: 19px !important;
}

.empleados-resumen-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 999px;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.045);
}

.empleados-resumen-kpi.success strong,
.empleados-resumen-kpi.success .empleados-resumen-dot {
    color: var(--color-success);
    background: var(--color-success);
}

.empleados-resumen-kpi.info strong,
.empleados-resumen-kpi.info .empleados-resumen-dot {
    color: var(--color-info);
    background: var(--color-info);
}

.empleados-resumen-kpi.danger strong,
.empleados-resumen-kpi.danger .empleados-resumen-dot {
    color: var(--color-danger);
    background: var(--color-danger);
}

.empleados-resumen-kpi.muted strong,
.empleados-resumen-kpi.muted .empleados-resumen-dot {
    color: var(--text-muted);
    background: var(--text-muted);
}

.empleados-nombre-cell {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.empleados-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.95), rgba(79, 70, 229, 0.95));
    color: white;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.03em;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.empleados-id-pill,
.empleados-jornada-badge,
.empleados-estado-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.empleados-id-pill {
    min-width: 42px;
    padding: 5px 9px;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.10);
}

.empleados-jornada-badge {
    padding: 6px 11px;
    font-size: 13px;
    color: #BFDBFE;
    background: rgba(96, 165, 250, 0.14);
    border-color: rgba(96, 165, 250, 0.30);
    font-variant-numeric: tabular-nums;
}

.empleados-estado-cell {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.empleados-estado-badge {
    gap: 7px;
    padding: 6px 11px;
    font-size: 12px;
}

.empleados-estado-badge.success {
    color: #86EFAC;
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.36);
}

.empleados-estado-badge.muted {
    color: #CBD5E1;
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.26);
}

.empleados-estado-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 999px;
}

.empleados-estado-badge.success .empleados-estado-dot {
    background: var(--color-success);
}

.empleados-estado-badge.muted .empleados-estado-dot {
    background: var(--text-muted);
}

@media (max-width: 980px) {
    .empleados-resumen-kpis {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .empleados-resumen-kpi:nth-child(2n) {
        border-right: none;
    }
}

@media (max-width: 620px) {
    .empleados-resumen-kpis {
        grid-template-columns: 1fr;
    }

    .empleados-resumen-kpi {
        border-right: none;
        border-bottom: 1px solid var(--border-soft);
    }

    .empleados-resumen-kpi:last-child {
        border-bottom: none;
    }

    .empleados-estado-cell {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================= */
/* INFORMES - VISUAL PRO */
/* ============================= */

.informes-pro-section {
    max-width: 1680px;
    margin: 0 auto;
}

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

.informes-pro-header h2 {
    margin-bottom: 6px;
}

.informes-pro-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.informes-pro-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid var(--border-soft);
}

.informes-pro-badge.success {
    color: #86EFAC;
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.34);
}

.informes-pro-badge.info {
    color: #BFDBFE;
    background: rgba(96, 165, 250, 0.14);
    border-color: rgba(96, 165, 250, 0.34);
}

.informes-pro-badge.warning {
    color: #FDE68A;
    background: rgba(210, 153, 34, 0.14);
    border-color: rgba(210, 153, 34, 0.34);
}

.informes-pro-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

#moduloInformes .informes-pro-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    margin-bottom: 0;
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.10), transparent 34%),
        linear-gradient(180deg, rgba(28, 33, 40, 0.98) 0%, rgba(22, 27, 34, 0.98) 100%);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

#moduloInformes .informes-pro-card.rrhh {
    background:
        radial-gradient(circle at top right, rgba(63, 163, 107, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(28, 33, 40, 0.98) 0%, rgba(22, 27, 34, 0.98) 100%);
}

.informes-pro-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: rgba(96, 165, 250, 0.72);
}

.informes-pro-card.rrhh::before {
    background: rgba(63, 163, 107, 0.72);
}

.informes-pro-card-header {
    margin-bottom: 18px;
}

.informes-pro-title {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.informes-pro-title h3 {
    margin: 0 0 5px;
}

.informes-pro-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    border: 1px solid var(--border-soft);
}

.informes-pro-icon.normativa {
    background: rgba(96, 165, 250, 0.14);
    border-color: rgba(96, 165, 250, 0.30);
}

.informes-pro-icon.gestion {
    background: rgba(167, 139, 250, 0.14);
    border-color: rgba(167, 139, 250, 0.30);
}

.informes-pro-icon.rrhh {
    background: rgba(63, 163, 107, 0.14);
    border-color: rgba(63, 163, 107, 0.30);
}

.informes-pro-two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

.informes-pro-block {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: rgba(17, 24, 39, 0.58);
}

.informes-pro-block.destacado {
    background: rgba(63, 163, 107, 0.08);
    border-color: rgba(63, 163, 107, 0.24);
}

.informes-pro-block-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}

.informes-pro-block-title strong {
    color: var(--text-primary);
    font-size: 15px;
}

.informes-pro-block-title span {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

.informes-pro-fields {
    display: grid;
    grid-template-columns: minmax(180px, 1.15fr) minmax(135px, 0.8fr) minmax(135px, 0.8fr);
    gap: 12px;
    align-items: end;
}

.informes-pro-fields.compact {
    grid-template-columns: minmax(160px, 1fr) minmax(120px, 0.7fr);
}

#moduloInformes .informes-pro-fields .form-group {
    min-width: 0;
    margin-bottom: 0;
}

#moduloInformes .informes-pro-fields select,
#moduloInformes .informes-pro-fields input {
    width: 100%;
    min-width: 0;
    height: 42px;
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(96, 165, 250, 0.22);
}

#moduloInformes .informes-pro-fields select:focus,
#moduloInformes .informes-pro-fields input:focus {
    border-color: rgba(63, 163, 107, 0.75);
}

.informes-pro-action {
    margin-top: 14px;
    width: auto;
    min-width: 190px;
}

.informes-pro-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

#moduloInformes .informes-pro-action.secondary {
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.30);
    color: #DBEAFE;
}

#moduloInformes .informes-pro-action.secondary:hover {
    background: rgba(96, 165, 250, 0.20);
}

.informes-pro-hint {
    min-height: 72px;
    padding: 13px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid var(--border-soft);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.informes-pro-hint strong {
    color: var(--text-primary);
}

.informes-pro-msg {
    min-height: 18px;
    margin-top: 14px;
}

@media (max-width: 1180px) {
    .informes-pro-two-columns {
        grid-template-columns: 1fr;
    }

    .informes-pro-fields,
    .informes-pro-fields.compact {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

@media (max-width: 720px) {
    .informes-pro-header {
        flex-direction: column;
    }

    .informes-pro-badges {
        justify-content: flex-start;
    }

    .informes-pro-title {
        flex-direction: column;
    }

    .informes-pro-fields,
    .informes-pro-fields.compact {
        grid-template-columns: 1fr;
    }

    .informes-pro-action,
    .informes-pro-actions-row button {
        width: 100%;
    }
}

/* ============================= */
/* AJUSTE VISUAL RRHH EMPRESA */
/* ============================= */

#moduloInformes .informes-pro-card.rrhh {
    background:
        radial-gradient(circle at top right, rgba(63, 163, 107, 0.06), transparent 34%),
        linear-gradient(180deg, rgba(28, 33, 40, 0.98) 0%, rgba(22, 27, 34, 0.98) 100%);
}

.informes-pro-block.destacado {
    background: rgba(15, 23, 42, 0.62);
    border-color: rgba(148, 163, 184, 0.18);
}

.informes-pro-hint {
    background: rgba(2, 6, 23, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

#moduloInformes .informes-pro-action.secondary {
    background: rgba(96, 165, 250, 0.10);
    border: 1px solid rgba(96, 165, 250, 0.24);
    color: #DBEAFE;
}

#moduloInformes .informes-pro-action.secondary:hover {
    background: rgba(96, 165, 250, 0.18);
}

/* ============================= */
/* FICHAJES - VISUAL PRO */
/* ============================= */

.fichajes-pro-section {
    max-width: 1680px;
    margin: 0 auto;
}

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

.fichajes-pro-header h2 {
    margin-bottom: 6px;
}

.fichajes-pro-panel {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.10), transparent 34%),
        linear-gradient(180deg, rgba(28, 33, 40, 0.98) 0%, rgba(22, 27, 34, 0.98) 100%);
    border-color: rgba(148, 163, 184, 0.16);
}

.fichajes-pro-panel::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: rgba(96, 165, 250, 0.72);
}

.fichajes-pro-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.fichajes-pro-toolbar h3 {
    margin-bottom: 6px;
}

.fichajes-pro-actions {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.fichajes-date-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.fichajes-date-control input {
    min-width: 190px;
    height: 42px;
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(96, 165, 250, 0.22);
}

.fichajes-resumen-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(145px, 1fr));
    gap: 0;
    align-items: stretch;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.82) 0%, rgba(15, 23, 42, 0.72) 100%);
    overflow: hidden;
}

.fichajes-kpi {
    min-height: 84px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 13px;
    border-right: 1px solid var(--border-soft);
}

.fichajes-kpi:last-child {
    border-right: none;
}

.fichajes-kpi-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-soft);
    font-size: 18px;
    font-weight: 900;
}

.fichajes-kpi strong {
    display: block;
    font-size: 25px;
    line-height: 1;
    color: var(--text-primary);
}

.fichajes-kpi span {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.35;
}

.fichajes-kpi.success strong,
.fichajes-kpi.success .fichajes-kpi-icon {
    color: var(--color-success);
    border-color: rgba(63, 163, 107, 0.32);
    background: rgba(63, 163, 107, 0.12);
}

.fichajes-kpi.warning strong,
.fichajes-kpi.warning .fichajes-kpi-icon {
    color: var(--color-warning);
    border-color: rgba(210, 153, 34, 0.32);
    background: rgba(210, 153, 34, 0.12);
}

.fichajes-kpi.info strong,
.fichajes-kpi.info .fichajes-kpi-icon {
    color: var(--color-info);
    border-color: rgba(96, 165, 250, 0.32);
    background: rgba(96, 165, 250, 0.12);
}

.fichajes-kpi.orange strong,
.fichajes-kpi.orange .fichajes-kpi-icon {
    color: #FB923C;
    border-color: rgba(251, 146, 60, 0.32);
    background: rgba(251, 146, 60, 0.12);
}

.fichajes-kpi.danger strong,
.fichajes-kpi.danger .fichajes-kpi-icon {
    color: var(--color-danger);
    border-color: rgba(248, 81, 73, 0.32);
    background: rgba(248, 81, 73, 0.12);
}

.fichajes-kpi.muted strong,
.fichajes-kpi.muted .fichajes-kpi-icon {
    color: var(--text-muted);
    border-color: rgba(148, 163, 184, 0.24);
    background: rgba(148, 163, 184, 0.10);
}

.fichajes-pro-table-card {
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
}

.fichajes-pro-table {
    margin-top: 0;
    border: none;
    border-radius: 0;
}

.fichajes-pro-table th {
    padding: 15px 18px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    font-size: 13px;
}

.fichajes-pro-table td {
    padding: 13px 18px;
    vertical-align: middle;
}

.fichajes-pro-table .fichaje-row {
    background: rgba(15, 23, 42, 0.26);
    transition: background 0.16s ease;
}

.fichajes-pro-table .fichaje-row:hover td {
    background: rgba(255, 255, 255, 0.025);
}

.fichajes-pro-table .fichaje-alerta-geo-alta,
.fichajes-pro-table .fichaje-alerta-geo-media,
.fichajes-pro-table .fichaje-alerta-geo {
    background: rgba(15, 23, 42, 0.26) !important;
}

.fichajes-pro-table .fichaje-alerta-geo-alta td:first-child {
    box-shadow: inset 3px 0 0 rgba(248, 81, 73, 0.65);
}

.fichajes-pro-table .fichaje-alerta-geo-media td:first-child {
    box-shadow: inset 3px 0 0 rgba(210, 153, 34, 0.65);
}

.fichajes-empleado-cell {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.fichajes-empleado-cell strong {
    display: block;
    color: var(--text-primary);
}

.fichajes-empleado-cell small {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 2px;
}

.fichajes-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(63, 163, 107, 0.32), rgba(96, 165, 250, 0.18));
    color: #D7F5E2;
    border: 1px solid rgba(63, 163, 107, 0.38);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.fichajes-tipo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.fichajes-tipo-icon {
    font-size: 16px;
    line-height: 1;
}

.fichajes-tipo.success .fichajes-tipo-icon {
    color: var(--color-success);
}

.fichajes-tipo.info .fichajes-tipo-icon {
    color: var(--color-info);
}

.fichajes-tipo.warning .fichajes-tipo-icon {
    color: var(--color-warning);
}

.fichajes-tipo.orange .fichajes-tipo-icon {
    color: #FB923C;
}

.fichajes-tipo.purple .fichajes-tipo-icon {
    color: #A78BFA;
}

.fichajes-tipo.neutral {
    color: var(--text-muted);
}

.fichajes-hora {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 800;
    color: var(--text-primary);
    font-size: 14px;
}

.fichajes-badges {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    align-items: center;
}

.fichajes-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.10);
    white-space: nowrap;
}

.fichajes-chip.success {
    color: #D7F5E2;
    background: rgba(63, 163, 107, 0.14);
    border-color: rgba(63, 163, 107, 0.34);
}

.fichajes-chip.info {
    color: #DBEAFE;
    background: rgba(96, 165, 250, 0.13);
    border-color: rgba(96, 165, 250, 0.30);
}

.fichajes-chip.warning {
    color: #FDE68A;
    background: rgba(210, 153, 34, 0.13);
    border-color: rgba(210, 153, 34, 0.30);
}

.fichajes-chip.danger {
    color: #FCA5A5;
    background: rgba(248, 81, 73, 0.11);
    border-color: rgba(248, 81, 73, 0.32);
}

.fichajes-chip.neutral {
    color: #CBD5E1;
    background: rgba(148, 163, 184, 0.10);
    border-color: rgba(148, 163, 184, 0.22);
}

.fichajes-pro-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 15px 18px;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.018);
}

.fichajes-info-icon {
    color: var(--color-info);
    font-weight: 900;
}

@media (max-width: 1280px) {
    .fichajes-resumen-kpis {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .fichajes-kpi:nth-child(3n) {
        border-right: none;
    }
}

@media (max-width: 820px) {
    .fichajes-pro-toolbar {
        flex-direction: column;
    }

    .fichajes-pro-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .fichajes-date-control,
    .fichajes-date-control input,
    #btnActualizarFichajes {
        width: 100%;
    }

    .fichajes-resumen-kpis {
        grid-template-columns: 1fr;
    }

    .fichajes-kpi {
        border-right: none;
        border-bottom: 1px solid var(--border-soft);
    }

    .fichajes-kpi:last-child {
        border-bottom: none;
    }
}


/* ========================================================= */
/* CONSOLIDACIÓN VISUAL ADMIN 10/10 - BASE COMPARTIDA        */
/* ========================================================= */

.module-section {
    animation: fadeIn 0.22s ease;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: var(--spacing-lg);
}

.module-header h2 {
    margin: 0 0 6px 0;
    font-size: 1.35rem;
    line-height: 1.2;
}

.module-panel {
    margin-bottom: var(--spacing-lg);
}

.module-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.module-toolbar h3 {
    margin: 0 0 6px 0;
}

.module-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.module-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.module-table-card {
    padding: 0;
    overflow: hidden;
}

.module-table-card table {
    margin-top: 0;
    border: none;
    border-radius: 0;
}

.module-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 23, 42, 0.32);
    flex-wrap: wrap;
}

.module-empty-state {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 42px 24px;
    background:
        radial-gradient(circle at top, rgba(63, 163, 107, 0.10), transparent 36%),
        rgba(15, 23, 42, 0.30);
}

.module-empty-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 999px;
    color: #dff7e8;
    background: rgba(63, 163, 107, 0.18);
    border: 1px solid rgba(63, 163, 107, 0.38);
    font-size: 1.45rem;
    font-weight: 800;
}

.module-empty-state h3 {
    margin: 0 0 8px 0;
}

.module-empty-state p {
    max-width: 560px;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
}

.module-kpi-card,
.incidencias-kpi-card,
.logs-kpi-card,
.auditoria-kpi-card,
.festivos-kpi-card,
.vacaciones-saldos-kpi {
    position: relative;
    overflow: hidden;
    min-height: 112px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid var(--border-soft);
}

.module-kpi-card::before,
.incidencias-kpi-card::before,
.logs-kpi-card::before,
.auditoria-kpi-card::before,
.festivos-kpi-card::before,
.vacaciones-saldos-kpi::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--text-secondary);
    opacity: 0.85;
}

.module-kpi-card > span,
.incidencias-kpi-card > span,
.logs-kpi-card > span,
.auditoria-kpi-card > span,
.festivos-kpi-card > span,
.vacaciones-saldos-kpi > span:not(.vacaciones-saldos-kpi-icon):not(.vacaciones-saldos-dot) {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.module-kpi-card strong,
.incidencias-kpi-card strong,
.logs-kpi-card strong,
.auditoria-kpi-card strong,
.festivos-kpi-card strong,
.vacaciones-saldos-kpi strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.9rem;
    line-height: 1.05;
}

.module-kpi-card small,
.incidencias-kpi-card small,
.logs-kpi-card small,
.auditoria-kpi-card small,
.festivos-kpi-card small,
.vacaciones-saldos-kpi small,
.vacaciones-saldos-kpi div span {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.35;
}

.module-kpi-card.success::before,
.incidencias-kpi-card.success::before,
.logs-kpi-card.success::before,
.auditoria-kpi-card.success::before,
.festivos-kpi-card.success::before,
.vacaciones-saldos-kpi.ok::before,
.vacaciones-saldos-kpi.success::before {
    background: var(--color-success);
}

.module-kpi-card.warning::before,
.incidencias-kpi-card.warning::before,
.logs-kpi-card.warning::before,
.auditoria-kpi-card.warning::before,
.festivos-kpi-card.warning::before,
.vacaciones-saldos-kpi.warning::before {
    background: var(--color-warning);
}

.module-kpi-card.danger::before,
.incidencias-kpi-card.danger::before,
.logs-kpi-card.danger::before,
.auditoria-kpi-card.danger::before,
.festivos-kpi-card.danger::before,
.vacaciones-saldos-kpi.danger::before {
    background: var(--color-danger);
}

.module-kpi-card.info::before,
.incidencias-kpi-card.info::before,
.logs-kpi-card.info::before,
.auditoria-kpi-card.info::before,
.festivos-kpi-card.info::before,
.festivos-kpi-card.primary::before,
.vacaciones-saldos-kpi.metodo::before,
.vacaciones-saldos-kpi.principal::before {
    background: var(--color-info);
}

.logs-kpi-card.primary::before,
.logs-kpi-card.admin::before,
.auditoria-kpi-card.primary::before {
    background: #A78BFA;
}

/* ============================= */
/* INCIDENCIAS CONSOLIDADAS */
/* ============================= */

.incidencias-pro-table-card {
    padding: 0;
}

#tabla-incidencias th,
#tabla-incidencias td {
    vertical-align: middle;
}

#tabla-incidencias th:last-child,
#tabla-incidencias td:last-child {
    width: 180px;
    text-align: right;
}

.incidencia-empleado-cell,
.incidencia-fecha-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.incidencia-empleado-cell strong,
.incidencia-fecha-cell > span:first-child {
    color: var(--text-primary);
    font-weight: 700;
}

.incidencia-empleado-cell span {
    color: var(--text-secondary);
    font-size: 12px;
}

/* ============================= */
/* FESTIVOS CONSOLIDADOS */
/* ============================= */

.festivos-resumen-kpis {
    margin-top: 16px;
}

.festivos-table-card {
    margin-top: var(--spacing-lg);
}

.festivo-fecha-cell,
.festivo-descripcion-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.festivo-fecha-cell strong,
.festivo-descripcion-cell strong {
    color: var(--text-primary);
    font-weight: 700;
}

.festivo-fecha-cell span,
.festivo-descripcion-cell span {
    color: var(--text-secondary);
    font-size: 12px;
}

.festivos-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

#tabla-festivos th,
#tabla-festivos td {
    vertical-align: middle;
}

#tabla-festivos th:last-child,
#tabla-festivos td:last-child {
    width: 310px;
    text-align: right;
}

/* ============================= */
/* VACACIONES SALDOS CONSOLIDADOS */
/* ============================= */

.vacaciones-saldos-resumen {
    margin-top: 16px;
}

.vacaciones-saldos-kpis {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.vacaciones-saldos-kpi {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vacaciones-saldos-kpi.metodo {
    display: block;
}

.vacaciones-saldos-kpi-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.30);
}

.vacaciones-saldos-dot,
.vacaciones-saldo-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 999px;
    background: var(--text-secondary);
}

.vacaciones-saldos-kpi.ok .vacaciones-saldos-dot,
.vacaciones-saldo-badge.success .vacaciones-saldo-dot {
    background: var(--color-success);
}

.vacaciones-saldos-kpi.warning .vacaciones-saldos-dot,
.vacaciones-saldo-badge.warning .vacaciones-saldo-dot {
    background: var(--color-warning);
}

.vacaciones-saldos-kpi.danger .vacaciones-saldos-dot,
.vacaciones-saldo-badge.danger .vacaciones-saldo-dot {
    background: var(--color-danger);
}

.vacaciones-saldos-table-card {
    margin-top: var(--spacing-lg);
}

.vacaciones-empleado-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vacaciones-avatar {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.14);
    border: 1px solid rgba(96, 165, 250, 0.32);
    color: #dbeafe;
    font-size: 12px;
    font-weight: 800;
}

.vacaciones-saldo-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 800;
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,0.04);
}

.vacaciones-saldo-badge.success {
    color: #dff7e8;
    background: rgba(63, 163, 107, 0.14);
    border-color: rgba(63, 163, 107, 0.34);
}

.vacaciones-saldo-badge.warning {
    color: #ffe8a3;
    background: rgba(210, 153, 34, 0.14);
    border-color: rgba(210, 153, 34, 0.34);
}

.vacaciones-saldo-badge.danger {
    color: #ffd6d3;
    background: rgba(248, 81, 73, 0.14);
    border-color: rgba(248, 81, 73, 0.34);
}

/* ============================= */
/* LOGS CONSOLIDADOS */
/* ============================= */

.logs-pro-panel {
    margin-bottom: var(--spacing-lg);
}

.logs-resumen-kpis {
    margin-top: 16px;
}

.logs-filter-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.logs-filter-panel input,
.logs-filter-panel select {
    width: auto;
    min-width: 160px;
}

.logs-filter-panel #logSearch {
    min-width: 240px;
}

.logs-integridad-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    margin: 0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
}

.logs-integridad-pill.success {
    color: #dff7e8;
    background: rgba(63, 163, 107, 0.14);
    border-color: rgba(63, 163, 107, 0.34);
}

.logs-integridad-pill.danger {
    color: #ffd6d3;
    background: rgba(248, 81, 73, 0.14);
    border-color: rgba(248, 81, 73, 0.34);
}

.logs-integridad-pill.muted {
    color: var(--text-secondary);
}

.logs-table-card {
    overflow: hidden;
}

#tabla-logs {
    min-width: 1200px;
    margin-top: 0;
    border: none;
    border-radius: 0;
}

.logs-date-cell,
.logs-user-cell,
.logs-detail-cell {
    vertical-align: middle;
}

.logs-date-cell span,
.logs-user-cell strong,
.logs-detail-cell span {
    display: block;
}

.logs-date-cell small {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.logs-detail-cell span {
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-action-badge,
.log-entity-badge,
.log-origin-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
}

.log-action-badge.success,
.log-origin-badge.kiosco {
    color: #dff7e8;
    background: rgba(63, 163, 107, 0.14);
    border-color: rgba(63, 163, 107, 0.34);
}

.log-action-badge.warning {
    color: #ffe8a3;
    background: rgba(210, 153, 34, 0.14);
    border-color: rgba(210, 153, 34, 0.34);
}

.log-action-badge.danger {
    color: #ffd6d3;
    background: rgba(248, 81, 73, 0.14);
    border-color: rgba(248, 81, 73, 0.34);
}

.log-action-badge.info,
.log-origin-badge.admin {
    color: #dbeafe;
    background: rgba(96, 165, 250, 0.14);
    border-color: rgba(96, 165, 250, 0.34);
}

.log-action-badge.admin {
    color: #ede9fe;
    background: rgba(168, 85, 247, 0.14);
    border-color: rgba(168, 85, 247, 0.34);
}

.logs-muted {
    color: var(--text-secondary);
}

.logs-mono-cell {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

.logs-table-message,
.auditoria-table-message {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.logs-table-message.error,
.auditoria-table-message.error {
    color: var(--color-danger);
}

.detalle-log-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.detalle-log-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-soft);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

#detalleLog {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
}

/* ============================= */
/* AUDITORÍA CONSOLIDADA */
/* ============================= */

.auditoria-pro-kpis,
.auditoria-inconsistencias-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.auditoria-timeline {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid var(--border-soft);
}

.auditoria-timeline-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
}

.auditoria-timeline-item > span {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 999px;
    background: var(--text-secondary);
}

.auditoria-timeline-item.success > span {
    background: var(--color-success);
}

.auditoria-timeline-item.warning > span {
    background: var(--color-warning);
}

.auditoria-timeline-item.danger > span {
    background: var(--color-danger);
}

.auditoria-timeline-item.info > span {
    background: var(--color-info);
}

.auditoria-timeline-item strong {
    display: block;
    margin-bottom: 4px;
}

.auditoria-timeline-item p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.auditoria-inconsistencias-panel {
    margin-top: var(--spacing-lg);
}

.auditoria-table-wrapper {
    margin-top: 16px;
}

.auditoria-id-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #dbeafe;
    background: rgba(96, 165, 250, 0.14);
    border: 1px solid rgba(96, 165, 250, 0.34);
    font-weight: 800;
}

.auditoria-inconsistencia-row code {
    font-size: 12px;
    color: #cbd5e1;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: 4px 6px;
}

.auditoria-empty-error .module-empty-icon,
.auditoria-empty-icon {
    color: #ffd6d3;
    background: rgba(248, 81, 73, 0.14);
    border-color: rgba(248, 81, 73, 0.34);
}

/* ============================= */
/* RESPONSIVE CONSOLIDADO */
/* ============================= */

@media (max-width: 900px) {
    .module-header,
    .module-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .module-actions {
        justify-content: flex-start;
    }

    .logs-filter-panel input,
    .logs-filter-panel select,
    .logs-filter-panel #logSearch {
        width: 100%;
        min-width: 0;
    }

    .module-table-footer {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .module-kpi-grid,
    .vacaciones-saldos-kpis,
    .auditoria-pro-kpis,
    .auditoria-inconsistencias-resumen {
        grid-template-columns: 1fr;
    }

    #tabla-festivos th:last-child,
    #tabla-festivos td:last-child,
    #tabla-incidencias th:last-child,
    #tabla-incidencias td:last-child {
        text-align: left;
    }

    .festivos-actions {
        justify-content: flex-start;
    }
}

.btn-danger-soft {
    background: rgba(248, 81, 73, 0.14);
    border: 1px solid rgba(248, 81, 73, 0.38);
    color: #ffd6d3;
}
.btn-danger-soft:hover {
    background: rgba(248, 81, 73, 0.24);
}

/* ============================= */
/* EVIDENCIA NORMATIVA */
/* ============================= */

.auditoria-evidencia-card {
    margin-top: var(--spacing-lg);
}

.auditoria-evidencia-resumen {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 16px;
}

.auditoria-summary-pill,
.auditoria-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
}

.auditoria-summary-pill.success,
.auditoria-status-badge.success {
    color: #dff7e8;
    background: rgba(63, 163, 107, 0.14);
    border-color: rgba(63, 163, 107, 0.34);
}

.auditoria-summary-pill.warning,
.auditoria-status-badge.warning {
    color: #ffe8a3;
    background: rgba(210, 153, 34, 0.14);
    border-color: rgba(210, 153, 34, 0.34);
}

.auditoria-summary-pill.danger,
.auditoria-status-badge.danger {
    color: #ffd6d3;
    background: rgba(248, 81, 73, 0.14);
    border-color: rgba(248, 81, 73, 0.34);
}

.auditoria-summary-pill.info,
.auditoria-status-badge.info {
    color: #dbeafe;
    background: rgba(96, 165, 250, 0.14);
    border-color: rgba(96, 165, 250, 0.34);
}

.auditoria-checkpoint-row code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-primary);
}

#tabla-checkpoints {
    min-width: 1040px;
}


/* ============================= */
/* AUDITORÍA - EVIDENCIA NORMATIVA DEFENDIBLE */
/* ============================= */

.auditoria-evidencia-banner {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 14px;
    background: rgba(96, 165, 250, 0.08);
}

.auditoria-evidencia-banner.success {
    border-color: rgba(63, 163, 107, 0.38);
    background: rgba(63, 163, 107, 0.10);
}

.auditoria-evidencia-banner.warning {
    border-color: rgba(210, 153, 34, 0.42);
    background: rgba(210, 153, 34, 0.10);
}

.auditoria-evidencia-banner strong {
    display: block;
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 4px;
}

.auditoria-evidencia-banner p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.45;
}

.auditoria-evidencia-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.auditoria-evidencia-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-soft);
    color: var(--text-secondary);
    line-height: 1.45;
}

.auditoria-evidencia-legend strong {
    color: var(--text-primary);
}

.auditoria-table code {
    display: inline-block;
    max-width: 260px;
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: 3px 6px;
}

@media (max-width: 1200px) {
    .auditoria-evidencia-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .auditoria-evidencia-kpis {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================
   AJUSTE FINO UI - TABLA LOGS / AUDITORÍA
   Mantiene la tabla alineada, evita desbordes y compacta badges.
   ========================================================== */
.logs-pro-table-card {
    overflow: hidden;
}

.logs-pro-table-card .logs-table-header {
    gap: 12px;
    align-items: flex-start;
}

.logs-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 10px;
}

#tabla-logs {
    width: 100% !important;
    min-width: 980px !important;
    table-layout: fixed !important;
    margin-top: 0 !important;
    border: none !important;
    border-collapse: collapse !important;
}

#tabla-logs th,
#tabla-logs td {
    padding: 14px 12px !important;
    vertical-align: middle !important;
    overflow: hidden;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

#tabla-logs th {
    white-space: nowrap;
}

#tabla-logs th:nth-child(1),
#tabla-logs td:nth-child(1) {
    width: 140px !important;
}

#tabla-logs th:nth-child(2),
#tabla-logs td:nth-child(2) {
    width: 210px !important;
}

#tabla-logs th:nth-child(3),
#tabla-logs td:nth-child(3) {
    width: 110px !important;
}

#tabla-logs th:nth-child(4),
#tabla-logs td:nth-child(4) {
    width: 120px !important;
}

#tabla-logs th:nth-child(5),
#tabla-logs td:nth-child(5) {
    width: 72px !important;
    text-align: center !important;
}

#tabla-logs th:nth-child(6),
#tabla-logs td:nth-child(6) {
    width: auto !important;
}

#tabla-logs th:nth-child(7),
#tabla-logs td:nth-child(7) {
    width: 150px !important;
}

.logs-date-cell span,
.logs-date-cell small,
.logs-user-cell strong,
.logs-detail-cell span,
.logs-origin-cell .log-origin-badge {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logs-user-cell strong {
    font-weight: 800;
}

.logs-date-cell small {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.logs-detail-cell span {
    width: 100%;
    max-width: none !important;
    line-height: 1.45;
}

.logs-mono-cell {
    text-align: center !important;
    font-size: 12px;
    color: #e5e7eb;
}

.log-action-badge,
.log-entity-badge,
.log-origin-badge {
    max-width: 100%;
    min-height: 24px !important;
    padding: 3px 8px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.log-origin-badge {
    display: inline-block !important;
    max-width: 128px !important;
}

.log-entity-badge {
    max-width: 98px !important;
}

#tabla-logs tbody tr {
    min-height: 64px;
}

#tabla-logs tbody tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

@media (max-width: 1200px) {
    #tabla-logs {
        min-width: 1040px !important;
    }
}

/* ============================= */
/* AUDITORÍA - DIAGNÓSTICO FICHAJES */
/* ============================= */

.auditoria-diagnostico-panel {
    margin-top: 18px;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(248, 81, 73, 0.34);
    background: rgba(248, 81, 73, 0.08);
}

.auditoria-diagnostico-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.auditoria-diagnostico-header strong {
    color: var(--text-primary);
    font-size: 15px;
}

.auditoria-diagnostico-header span,
.auditoria-diagnostico-note {
    color: var(--text-secondary);
    font-size: 13px;
}

.auditoria-diagnostico-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.auditoria-diagnostico-grid > div {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auditoria-diagnostico-grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
}

.auditoria-diagnostico-grid strong {
    color: var(--text-primary);
    font-size: 14px;
}

.auditoria-diagnostico-list {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.auditoria-diagnostico-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
}

.auditoria-diagnostico-list strong {
    color: var(--text-primary);
}

.auditoria-diagnostico-list span {
    color: var(--text-secondary);
}

@media (max-width: 1100px) {
    .auditoria-diagnostico-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .auditoria-diagnostico-grid {
        grid-template-columns: 1fr;
    }

    .auditoria-diagnostico-list li {
        flex-direction: column;
    }
}

/* Auditoría - revisión administrativa de incidencias */
.auditoria-revision-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.auditoria-revision-badge.pendiente {
    color: #92400e;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.auditoria-revision-badge.revisada {
    color: #166534;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
}

.auditoria-inconsistencia-row small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
}

.btn-mini-primary,
.btn-mini-secondary {
    border: 0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.btn-mini-primary {
    background: #0f766e;
    color: #ffffff;
}

.btn-mini-secondary {
    background: #e2e8f0;
    color: #334155;
}

.modal-auditoria-revision {
    max-width: 620px;
}

.auditoria-revision-resumen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
}

.modal-auditoria-revision label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    font-weight: 700;
    color: #334155;
}

.modal-auditoria-revision .input-full {
    width: 100%;
}

@media (max-width: 720px) {
    .auditoria-revision-resumen {
        grid-template-columns: 1fr;
    }
}


/* ======================================================
   Revisión integrada de inconsistencias de auditoría
====================================================== */

.audit-review-cell {
    min-width: 115px;
}

.audit-review-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.audit-review-cell small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted, #9ca3af);
    font-size: 0.72rem;
}

.audit-review-ok {
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.audit-review-pending {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.audit-chip-success {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
}

.btn-mini-primary,
.btn-mini-secondary {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    padding: 0.38rem 0.65rem;
    font-weight: 800;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-mini-primary {
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
}

.btn-mini-primary:hover {
    background: rgba(59, 130, 246, 0.28);
}

.btn-mini-secondary {
    background: rgba(15, 23, 42, 0.65);
    color: #cbd5e1;
}

.btn-mini-secondary:hover {
    background: rgba(30, 41, 59, 0.95);
}



/* ======================================================
   Resumen superior de revisión administrativa
====================================================== */

.audit-chip-success {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
}

.audit-chip-neutral {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.35);
}


/* Auditoría UX 1.0 - expediente técnico/documental */
.auditoria-kpis-ux .auditoria-kpi-card {
    min-height: 118px;
}

.auditoria-verificaciones-card {
    margin-top: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.58);
    overflow: hidden;
}

.auditoria-verificacion-row {
    display: grid;
    grid-template-columns: 18px 250px 1fr;
    gap: 14px;
    align-items: center;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.10);
}

.auditoria-verificacion-row:last-child {
    border-bottom: none;
}

.auditoria-verificacion-row > span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.auditoria-verificacion-row.success > span { background: #45c486; }
.auditoria-verificacion-row.warning > span { background: #f5c451; }
.auditoria-verificacion-row.danger > span { background: #ff5c5c; }
.auditoria-verificacion-row.info > span { background: #60a5fa; }

.auditoria-verificacion-row strong {
    color: #f8fafc;
}

.auditoria-verificacion-row p {
    margin: 0;
    color: #b6c2d2;
    line-height: 1.4;
}

.auditoria-inconsistencia-row {
    cursor: pointer;
}

.auditoria-inconsistencia-row.selected,
.auditoria-inconsistencia-row:hover {
    background: rgba(59, 130, 246, 0.08);
}

.auditoria-muted {
    color: #94a3b8;
    font-size: 0.86rem;
}

.auditoria-revision-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auditoria-revision-cell strong {
    color: #dbeafe;
    font-size: 0.86rem;
}

.auditoria-revision-cell small {
    color: #94a3b8;
}

.auditoria-detail-panel {
    margin-top: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(17, 24, 39, 0.72));
    padding: 16px;
}

.auditoria-detail-empty {
    padding: 18px;
    color: #94a3b8;
}

.auditoria-detail-empty strong {
    display: block;
    color: #f8fafc;
    margin-bottom: 4px;
}

.auditoria-detail-empty p {
    margin: 0;
}

.auditoria-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.auditoria-detail-header h3 {
    margin: 0 0 4px 0;
    color: #f8fafc;
}

.auditoria-detail-header p {
    margin: 0;
    color: #9fb0c6;
}

.auditoria-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.35fr 1.25fr 1fr;
    gap: 14px;
}

.auditoria-detail-card {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    padding: 14px;
    background: rgba(2, 6, 23, 0.32);
}

.auditoria-detail-card h4 {
    margin: 0 0 12px 0;
    color: #f8fafc;
    font-size: 0.98rem;
}

.auditoria-detail-kv {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    margin-bottom: 9px;
    align-items: start;
}

.auditoria-detail-kv span {
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.78rem;
}

.auditoria-detail-kv strong {
    color: #e5eefc;
    font-size: 0.86rem;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.auditoria-detail-text,
.auditoria-detail-note {
    color: #b6c2d2;
    line-height: 1.45;
    margin: 0 0 12px 0;
}

.auditoria-detail-note {
    color: #82b4f8;
    font-size: 0.85rem;
    margin-top: 12px;
}

.auditoria-hash-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.audit-hash-box {
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.68);
}

.audit-hash-box span {
    display: block;
    margin-bottom: 8px;
    font-size: 0.78rem;
    font-weight: 800;
}

.audit-hash-box code {
    color: #f8fafc;
    background: transparent;
    padding: 0;
}

.audit-hash-box.danger {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.16);
}

.audit-hash-box.danger span { color: #fca5a5; }

.audit-hash-box.success {
    border-color: rgba(74, 222, 128, 0.28);
    background: rgba(20, 83, 45, 0.16);
}

.audit-hash-box.success span { color: #86efac; }

.auditoria-revision-readonly {
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.auditoria-revision-readonly > strong {
    color: #f8fafc;
    display: block;
    margin-bottom: 10px;
}

@media (max-width: 1200px) {
    .auditoria-detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 800px) {
    .auditoria-verificacion-row,
    .auditoria-detail-grid,
    .auditoria-hash-compare {
        grid-template-columns: 1fr;
    }

    .auditoria-detail-kv {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* Auditoría UX Iteración 1.1 */
.auditoria-collapsed {
  display: none !important;
}

.auditoria-detail-action {
  margin-top: 12px;
  width: fit-content;
}

/* Auditoría UX Iteración 1.2 - documentación integrada */
.auditoria-detail-card-form .input-full {
  width: 100%;
  margin-top: 6px;
  margin-bottom: 10px;
}

.auditoria-inline-label {
  display: block;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #9fb2c8;
}

.auditoria-inline-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 14px;
}

.auditoria-revision-readonly.compact {
  margin-top: 10px;
  margin-bottom: 4px;
}
