/* =====================================================================
   MÓDULO: ASISTENCIA Y RECURSOS HUMANOS (RRHH) - ESTILOS COMPLETOS
======================================================================== */

/* Contenedor general */
.rrhh-app-container {
    padding-bottom: 50px;
}

/* Encabezado del módulo */
.rrhh-header-toolbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    background: var(--card-bg, #ffffff) !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    border-radius: 18px !important;
    padding: 20px 24px !important;
    margin-bottom: 22px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

body.dark-mode .rrhh-header-toolbar {
    background: #18181b !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.rrhh-title-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

.rrhh-icon-badge {
    width: 48px !important;
    height: 48px !important;
    border-radius: 14px !important;
    background: rgba(var(--primary-rgb, 242,129,24), 0.12) !important;
    border: 1px solid rgba(var(--primary-rgb, 242,129,24), 0.25) !important;
    color: var(--primary, #f28118) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 22px !important;
    flex-shrink: 0 !important;
}

.rrhh-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.live-clock-pill {
    background: rgba(0, 0, 0, 0.25) !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
}

/* Tabs */
.rrhh-tab-content {
    display: none;
    animation: fadeInRRHHTab 0.2s ease;
}

.rrhh-tab-content.active {
    display: block;
}

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

/* KPI Cards */
.rrhh-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
    gap: 16px !important;
    margin-bottom: 22px !important;
}

.rrhh-kpi-card {
    background: var(--card-bg, #ffffff) !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    border-radius: 16px !important;
    padding: 18px 20px !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

body.dark-mode .rrhh-kpi-card {
    background: #18181b !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.rrhh-kpi-card .rrhh-kpi-label {
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: var(--text-muted, #64748b) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
}

.rrhh-kpi-card .rrhh-kpi-value {
    font-size: 28px !important;
    font-weight: 800 !important;
    color: var(--text-main, #0f172a) !important;
    line-height: 1.1 !important;
}

body.dark-mode .rrhh-kpi-card .rrhh-kpi-value {
    color: #f8fafc !important;
}

.rrhh-kpi-card .rrhh-kpi-sub {
    font-size: 12px !important;
    color: var(--text-muted, #64748b) !important;
    margin-top: 6px !important;
}

.rrhh-kpi-card.info .rrhh-kpi-value { color: #2563eb !important; }
.rrhh-kpi-card.success .rrhh-kpi-value { color: #16a34a !important; }
.rrhh-kpi-card.warning .rrhh-kpi-value { color: #d97706 !important; }
.rrhh-kpi-card.danger .rrhh-kpi-value { color: #dc2626 !important; }

body.dark-mode .rrhh-kpi-card.info .rrhh-kpi-value { color: #60a5fa !important; }
body.dark-mode .rrhh-kpi-card.success .rrhh-kpi-value { color: #34d399 !important; }
body.dark-mode .rrhh-kpi-card.warning .rrhh-kpi-value { color: #fbbf24 !important; }
body.dark-mode .rrhh-kpi-card.danger .rrhh-kpi-value { color: #f87171 !important; }

/* Contenedores de Tarjetas y Tablas */
.rrhh-card,
.rrhh-app-container .table-responsive {
    background: var(--card-bg, #ffffff) !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    border-radius: 18px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
    overflow-x: auto !important;
    margin-bottom: 22px !important;
}

body.dark-mode .rrhh-card,
body.dark-mode .rrhh-app-container .table-responsive {
    background: #18181b !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.rrhh-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 18px 22px !important;
    border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
}

body.dark-mode .rrhh-card-header {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.rrhh-card-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--text-main, #0f172a) !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
}

body.dark-mode .rrhh-card-title {
    color: #f8fafc !important;
}

/* =====================================================================
   TABLAS ESTILIZADAS PARA RRHH (LIGHT & DARK MODE)
======================================================================== */
.rrhh-app-container table,
.rrhh-app-container .rrhh-table,
.rrhh-app-container .modern-table,
.rrhh-app-container .data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    text-align: left !important;
    margin: 0 !important;
}

.rrhh-app-container table thead,
.rrhh-app-container .rrhh-table thead,
.rrhh-app-container .modern-table thead,
.rrhh-app-container .data-table thead {
    display: table-header-group !important;
    background: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

body.dark-mode .rrhh-app-container table thead,
body.dark-mode .rrhh-app-container .rrhh-table thead,
body.dark-mode .rrhh-app-container .modern-table thead,
body.dark-mode .rrhh-app-container .data-table thead {
    background: #131b2e !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.rrhh-app-container table th,
.rrhh-app-container .rrhh-table th,
.rrhh-app-container .modern-table th,
.rrhh-app-container .data-table th {
    padding: 14px 18px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #64748b !important;
    background: inherit !important;
    border: none !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    display: table-cell !important;
}

body.dark-mode .rrhh-app-container table th,
body.dark-mode .rrhh-app-container .rrhh-table th,
body.dark-mode .rrhh-app-container .modern-table th,
body.dark-mode .rrhh-app-container .data-table th {
    color: #94a3b8 !important;
}

.rrhh-app-container table td,
.rrhh-app-container .rrhh-table td,
.rrhh-app-container .modern-table td,
.rrhh-app-container .data-table td {
    padding: 15px 18px !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
    background: transparent !important;
    display: table-cell !important;
}

body.dark-mode .rrhh-app-container table td,
body.dark-mode .rrhh-app-container .rrhh-table td,
body.dark-mode .rrhh-app-container .modern-table td,
body.dark-mode .rrhh-app-container .data-table td {
    color: #f1f5f9 !important;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

.rrhh-app-container table tbody tr,
.rrhh-app-container .rrhh-table tbody tr,
.rrhh-app-container .modern-table tbody tr,
.rrhh-app-container .data-table tbody tr {
    display: table-row !important;
    transition: background 0.15s ease !important;
}

.rrhh-app-container table tbody tr::after,
.rrhh-app-container .rrhh-table tbody tr::after,
.rrhh-app-container .modern-table tbody tr::after,
.rrhh-app-container .data-table tbody tr::after {
    display: none !important;
    content: none !important;
}

.rrhh-app-container table tbody tr:hover td,
.rrhh-app-container .rrhh-table tbody tr:hover td,
.rrhh-app-container .modern-table tbody tr:hover td,
.rrhh-app-container .data-table tbody tr:hover td {
    background: rgba(0, 0, 0, 0.02) !important;
}

body.dark-mode .rrhh-app-container table tbody tr:hover td,
body.dark-mode .rrhh-app-container .rrhh-table tbody tr:hover td,
body.dark-mode .rrhh-app-container .modern-table tbody tr:hover td,
body.dark-mode .rrhh-app-container .data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.025) !important;
}

/* Avatar circular de usuario */
.rrhh-avatar-circle {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, var(--primary, #f28118) 0%, #ec4899 100%) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Botones de acción en tabla */
.btn-action-round {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    font-size: 13px !important;
}

.btn-action-round:hover {
    background: rgba(var(--primary-rgb, 242,129,24), 0.15) !important;
    color: var(--primary, #f28118) !important;
    border-color: rgba(var(--primary-rgb, 242,129,24), 0.4) !important;
    transform: translateY(-1px) !important;
}

body.dark-mode .btn-action-round {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

/* Status Pills */
.rrhh-status-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
}

.rrhh-status-pill.success {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important;
}

.rrhh-status-pill.danger {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
}

.rrhh-status-pill.warning {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}

.rrhh-status-pill.secondary {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
}

.rrhh-status-pill.dark {
    background: #e2e8f0 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

body.dark-mode .rrhh-status-pill.success {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

body.dark-mode .rrhh-status-pill.danger {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

body.dark-mode .rrhh-status-pill.warning {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

body.dark-mode .rrhh-status-pill.secondary {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #94a3b8 !important;
    border-color: rgba(148, 163, 184, 0.25) !important;
}

/* Time Badges */
.rrhh-time-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
}

body.dark-mode .rrhh-time-badge {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
}

/* Miniatura de fotos selfies */
.photo-thumb {
    width: 38px !important;
    height: 38px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    border: 1.5px solid #cbd5e1 !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.photo-thumb:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .photo-thumb {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Ficha de Personal - Banner Superior */
.rrhh-sheet-profile-card {
    background: var(--card-bg, #ffffff) !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    border-radius: 18px !important;
    padding: 22px 26px !important;
    margin-bottom: 22px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

body.dark-mode .rrhh-sheet-profile-card {
    background: #18181b !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Botonera de tipo de marcación en el Widget */
.punch-action-selector-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
}

.punch-action-selector-btn {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    border: 2px solid #e2e8f0 !important;
    color: #64748b !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
}

body.dark-mode .punch-action-selector-btn {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
}

.punch-action-selector-btn:hover {
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.dark-mode .punch-action-selector-btn:hover {
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.punch-action-selector-btn.active[data-type="entrada"] {
    background: #dcfce7 !important;
    border-color: #16a34a !important;
    color: #15803d !important;
}

.punch-action-selector-btn.active[data-type="inicio_refrigerio"] {
    background: #fef3c7 !important;
    border-color: #d97706 !important;
    color: #b45309 !important;
}

.punch-action-selector-btn.active[data-type="fin_refrigerio"] {
    background: #dbeafe !important;
    border-color: #2563eb !important;
    color: #1d4ed8 !important;
}

.punch-action-selector-btn.active[data-type="salida"] {
    background: #fee2e2 !important;
    border-color: #dc2626 !important;
    color: #b91c1c !important;
}

body.dark-mode .punch-action-selector-btn.active[data-type="entrada"] {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: #10b981 !important;
    color: #34d399 !important;
}

body.dark-mode .punch-action-selector-btn.active[data-type="inicio_refrigerio"] {
    background: rgba(245, 158, 11, 0.2) !important;
    border-color: #f59e0b !important;
    color: #fbbf24 !important;
}

body.dark-mode .punch-action-selector-btn.active[data-type="fin_refrigerio"] {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: #3b82f6 !important;
    color: #60a5fa !important;
}

body.dark-mode .punch-action-selector-btn.active[data-type="salida"] {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #f87171 !important;
}

/* Inputs de configuración y formularios */
#cfgHRDefaultTolerance, #cfgHRRateMinute, #cfgHRAbsenceDay,
#editEmployeeHRForm input, #editEmployeeHRForm select,
#addHRPaymentForm input, #addHRPaymentForm select, #addHRPaymentForm textarea,
#addHRDeductionForm input, #addHRDeductionForm select, #addHRDeductionForm textarea {
    padding: 10px 14px !important;
    border-radius: 10px !important;
    border: 1.5px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 13.5px !important;
    outline: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}

body.dark-mode #cfgHRDefaultTolerance, body.dark-mode #cfgHRRateMinute, body.dark-mode #cfgHRAbsenceDay,
body.dark-mode #editEmployeeHRForm input, body.dark-mode #editEmployeeHRForm select,
body.dark-mode #addHRPaymentForm input, body.dark-mode #addHRPaymentForm select, body.dark-mode #addHRPaymentForm textarea,
body.dark-mode #addHRDeductionForm input, body.dark-mode #addHRDeductionForm select, body.dark-mode #addHRDeductionForm textarea {
    background: #18181b !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f1f5f9 !important;
}


/* Filtros y Buscadores de RRHH */
#rrhhWorkersSearchInput, #rrhhWorkersRoleFilter, #rrhhWorkersStatusFilter, #rrhhSheetWorkerSelect, #rrhhSheetMonthSelect {
    border-radius: 10px !important;
    border: 1.5px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 13px !important;
    padding: 10px 14px !important;
    outline: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03) !important;
}

body.dark-mode #rrhhWorkersSearchInput, 
body.dark-mode #rrhhWorkersRoleFilter, 
body.dark-mode #rrhhWorkersStatusFilter, 
body.dark-mode #rrhhSheetWorkerSelect, 
body.dark-mode #rrhhSheetMonthSelect {
    background: #18181b !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f1f5f9 !important;
}
