/* ============================================================
   INBTEL RRHH - Modern UI v2.0
   Sidebar layout + Inter font + Modern palette
   ============================================================ */

/* ==================== RESET & IMPORTS ==================== */
/* Font Inter loaded via <link> in HTML */

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

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Sidebar - full black */
    --sidebar-bg: #08080A;
    --sidebar-hover: #151518;
    --sidebar-active: rgba(59, 130, 246, 0.15);
    --sidebar-text: #94A3B8;
    --sidebar-text-active: #F8FAFC;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --sidebar-border: #1E1E22;

    /* Topbar */
    --topbar-height: 64px;

    /* Dark theme (default) - Full Black */
    --bg-primary: #000000;
    --bg-secondary: #111113;
    --bg-tertiary: #1A1A1E;
    --bg-hover: #222228;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    --border-color: #2A2A30;
    --primary-color: #3B82F6;
    --primary-hover: #2563EB;
    --primary-light: rgba(59, 130, 246, 0.12);
    --success-color: #10B981;
    --success-light: rgba(16, 185, 129, 0.12);
    --danger-color: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    --warning-color: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.12);
    --info-color: #06B6D4;
    --info-light: rgba(6, 182, 212, 0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.6), 0 4px 8px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.7), 0 8px 16px rgba(0,0,0,0.5);
    --glow-primary: 0 0 20px rgba(59, 130, 246, 0.15);
    --glow-success: 0 0 20px rgba(16, 185, 129, 0.15);
    --glow-danger: 0 0 20px rgba(239, 68, 68, 0.15);
    --gradient-accent: linear-gradient(135deg, #3B82F6, #8B5CF6);
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: #F1F5F9;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F8FAFC;
    --bg-hover: #E2E8F0;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;
    --border-color: #CBD5E1;
    --primary-light: rgba(59, 130, 246, 0.1);
    --success-light: rgba(16, 185, 129, 0.1);
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning-light: rgba(245, 158, 11, 0.1);
    --info-light: rgba(6, 182, 212, 0.1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);
    --glow-primary: 0 0 20px rgba(59, 130, 246, 0.1);
    --glow-success: 0 0 20px rgba(16, 185, 129, 0.1);
    --glow-danger: 0 0 20px rgba(239, 68, 68, 0.1);
}

/* Light theme overrides for glassmorphism cards */
[data-theme="light"] .empleado-card,
[data-theme="light"] .usuario-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .dashboard-card,
[data-theme="light"] .module-card,
[data-theme="light"] .dashboard-section,
[data-theme="light"] .admin-welcome,
[data-theme="light"] .employees-section,
[data-theme="light"] .header,
[data-theme="light"] .employee-card,
[data-theme="light"] .ticket-card,
[data-theme="light"] .evaluacion-card,
[data-theme="light"] .ausencia-card,
[data-theme="light"] .fichaje-card,
[data-theme="light"] .modal-content,
[data-theme="light"] .quick-stat {
    background: #FFFFFF;
    border-color: #CBD5E1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

[data-theme="light"] .empleado-card:hover,
[data-theme="light"] .usuario-card:hover,
[data-theme="light"] .stat-card:hover,
[data-theme="light"] .dashboard-card:hover,
[data-theme="light"] .module-card:hover,
[data-theme="light"] .employee-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.12), 0 4px 8px rgba(0,0,0,0.06);
}

/* Light theme topbar */
[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: #CBD5E1;
}

/* Light theme body gradient */
[data-theme="light"] body {
    background-image: radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 50%),
                      radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
}

/* Light theme title gradient */
[data-theme="light"] .admin-welcome h1,
[data-theme="light"] #adminTitle {
    background: linear-gradient(135deg, #0F172A 0%, #2563EB 80%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

/* Light theme sidebar - claro */
[data-theme="light"] .sidebar {
    background: #FFFFFF;
    border-right-color: #CBD5E1;
}

[data-theme="light"] .sidebar-header {
    border-bottom-color: #E2E8F0;
}

[data-theme="light"] .sidebar-logo {
    filter: none;
}

[data-theme="light"] .sidebar-section-title {
    color: #94A3B8;
}

[data-theme="light"] .sidebar-link {
    color: #475569;
}

[data-theme="light"] .sidebar-link:hover {
    background: #F1F5F9;
    color: #0F172A;
}

[data-theme="light"] .sidebar-link.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.03));
    color: #2563EB;
}

[data-theme="light"] .sidebar-link.active::before {
    background: linear-gradient(180deg, #3B82F6, #2563EB);
}

[data-theme="light"] .sidebar-footer {
    border-top-color: #E2E8F0;
}

[data-theme="light"] .sidebar-user-name {
    color: #0F172A;
}

[data-theme="light"] .sidebar-user-role {
    color: #64748B;
}

[data-theme="light"] .sidebar-footer .sidebar-link {
    color: #EF4444;
}

[data-theme="light"] .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}

/* Light theme fichaje widget */
[data-theme="light"] .cronometro-card {
    background: linear-gradient(145deg, #FFFFFF, #F1F5F9, #FFFFFF);
    border-color: #CBD5E1;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

/* Light theme notification panel */
[data-theme="light"] .notification-panel {
    background: #FFFFFF;
    border-color: #CBD5E1;
}

/* Light theme tables */
[data-theme="light"] table {
    border-color: #CBD5E1;
}

[data-theme="light"] table thead {
    background: linear-gradient(180deg, #F8FAFC, #FFFFFF);
}

[data-theme="light"] table tbody tr:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.04), transparent);
}

[data-theme="light"] table tbody tr:nth-child(even) {
    background: #F8FAFC;
}

/* Light theme forms */
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea,
[data-theme="light"] textarea,
[data-theme="light"] .search-box input,
[data-theme="light"] .filter-select {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

/* Light theme informes sidebar */
[data-theme="light"] .informes-sidebar {
    background: #FFFFFF;
    border-color: #CBD5E1;
}

/* Light theme badges keep their colors */
[data-theme="light"] .status-activo { box-shadow: none; }
[data-theme="light"] .status-inactivo { box-shadow: none; }

/* ==================== BASE ==================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-primary);
    background-image: radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
                      radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[data-theme="light"] body {
    background-image: radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 50%),
                      radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

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

/* ==================== LAYOUT: SIDEBAR + MAIN ==================== */
body:has(.sidebar) {
    overflow-x: hidden;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: var(--transition-slow);
    border-right: 1px solid var(--sidebar-border);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: 65px;
}

.sidebar-logo {
    height: 38px;
    width: auto;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #F8FAFC;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.2); border-radius: 3px; }

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 12px 4px;
    white-space: nowrap;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.06));
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.05);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, #3B82F6, #8B5CF6);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.sidebar-link-icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}

.sidebar-link-text {
    opacity: 1;
    transition: opacity 0.2s;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6, #EC4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #F8FAFC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: #64748B;
    text-transform: capitalize;
}

/* Main content area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width) !important;
    min-height: 100vh;
    transition: margin-left 0.3s;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: rgba(10, 10, 10, 0.9);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.85);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-title {
    display: none;
}

.topbar-breadcrumb {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

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

.topbar-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.topbar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

.sidebar-toggle {
    display: none;
}

/* ==================== OLD NAVBAR - HIDDEN (replaced by sidebar) ==================== */
.navbar {
    display: none !important;
}

/* ==================== CONTAINER / PAGE CONTENT ==================== */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 28px;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 16px;
}

/* Gradiente azul en TODOS los títulos principales de página */
.page-header h2,
.container h1,
.container h2,
.main-content > .container h1,
.main-content > .container h2,
.main-content h1:not(.modal-header h1):not(.modal h1),
.main-content h2:not(.modal-header h2):not(.modal h2):not(.modal-content h2) {
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, #3B82F6 80%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

/* Excluir modales y headers internos del gradiente */
.modal h2, .modal h3,
.modal-header h2, .modal-header h3,
.modal-content h2, .modal-content h3,
.modal-historial h2, .modal-historial h3 {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59,130,246,0.5), var(--glow-primary);
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-tertiary);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 1rem; }

.btn-icon {
    padding: 0.4rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

/* ==================== CARDS ==================== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ==================== SEARCH ==================== */
.search-box { margin-bottom: 24px; }

.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light), var(--glow-primary);
}

.search-box input::placeholder { color: var(--text-tertiary); }

/* ==================== FILTERS ==================== */
.filters-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    min-width: 180px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Filter tabs / pills */
.filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.filter-tab {
    padding: 0.45rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-tab:hover { border-color: var(--primary-color); color: var(--text-primary); }
.filter-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ==================== EMPLEADOS / USUARIOS GRID ==================== */
.empleados-grid, .usuarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    width: 100%;
}

.empleado-card, .usuario-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.empleado-card:hover, .usuario-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.empleado-header, .usuario-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    padding-bottom: 0;
    border-bottom: none;
}

/* Avatar estilo dashboard */
.employee-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.empleado-nombre, .usuario-nombre {
    font-size: 1.1rem;
    font-weight: 600;
}

.empleado-actions, .usuario-actions {
    display: flex;
    gap: 4px;
}

/* Info groups */
.info-group { margin-bottom: 10px; }

.info-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 3px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.info-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    word-break: break-word;
}

/* Credential section */
.credential-section {
    background: var(--bg-tertiary);
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    border: 1px solid var(--border-color);
}

.credential-section h5 {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

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

.password-text {
    font-family: 'JetBrains Mono', Monaco, monospace;
    background: var(--bg-primary);
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-xs);
    flex: 1;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

.masked { letter-spacing: 3px; }

/* ==================== BADGES ==================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.status-activo {
    background: var(--success-light);
    color: var(--success-color);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}

.status-inactivo {
    background: var(--danger-light);
    color: var(--danger-color);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.15);
}

.rol-badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-color);
}

/* Priority badges */
.priority-badge, .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-success, .priority-baja { background: var(--success-light); color: var(--success-color); }
.badge-warning, .priority-media { background: var(--warning-light); color: var(--warning-color); }
.badge-danger, .priority-alta { background: var(--danger-light); color: var(--danger-color); }
.badge-critical, .priority-urgente { background: rgba(239,68,68,0.2); color: #F87171; }
.badge-info { background: var(--info-light); color: var(--info-color); }
.badge-primary { background: var(--primary-light); color: var(--primary-color); }
.badge-neutral { background: var(--bg-tertiary); color: var(--text-secondary); }

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-secondary);
    margin: 3% auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s ease-out;
}

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

.modal-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-secondary), rgba(59, 130, 246, 0.04));
}

.modal-header h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.15rem;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.close {
    color: var(--text-tertiary);
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

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

/* Modal overlay for pages that use it */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.modal-overlay .modal-content {
    margin: 3% auto;
}

/* ==================== FORMS ==================== */
form { padding: 24px 28px; }

.form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type { border-bottom: none; }

.form-section h4 {
    margin-bottom: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.65rem 0.85rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-tertiary);
}

textarea {
    font-family: 'Inter', sans-serif;
    padding: 0.65rem 0.85rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.password-input-wrapper { position: relative; display: flex; }
.password-input { flex: 1; padding-right: 3rem; }

.toggle-password {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    color: var(--text-secondary);
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.login-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-xl), 0 0 40px rgba(59, 130, 246, 0.05);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3B82F6, #8B5CF6, #EC4899);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 160px;
    height: auto;
    margin-bottom: 20px;
}

[data-theme="light"] .login-logo {
    filter: brightness(0) saturate(100%);
    opacity: 0.85;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-box form { padding: 0; }
.login-box .form-group { margin-bottom: 16px; }
.login-box .form-group:last-of-type { margin-bottom: 24px; }
.login-box .btn-block { padding: 0.75rem; font-size: 0.95rem; }

.theme-toggle-text {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-tertiary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle-text:hover { color: var(--text-primary); }

/* ==================== ERROR / SUCCESS MESSAGES ==================== */
.error-message {
    background: var(--danger-light);
    border: 1px solid rgba(239,68,68,0.3);
    color: var(--danger-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.success-message {
    background: var(--success-light);
    border: 1px solid rgba(16,185,129,0.3);
    color: var(--success-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ==================== LOADING / EMPTY STATES ==================== */
.loading {
    text-align: center;
    padding: 48px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-tertiary);
    font-size: 0.95rem;
}

/* ==================== TABLES ==================== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

table {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

table thead {
    background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
}

table th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 700;
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid var(--border-color);
}

table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    color: var(--text-primary);
}

table tbody tr {
    transition: var(--transition);
}

table tbody tr:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.06), transparent);
}

table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

table tbody tr:nth-child(even):hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.02));
}

table td {
    border-bottom-color: rgba(30, 30, 30, 0.8) !important;
}

/* ==================== DASHBOARD CARDS ==================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 130, 246, 0.1);
}

.dashboard-card.card-alert {
    border-color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.card-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.card-content { flex: 1; }

.card-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}

.card-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.dashboard-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-section:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.dashboard-section h3,
.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stats grid (dashboard.html inline) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stat-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 130, 246, 0.1);
}

.stat-card:nth-child(1) { border-left: 3px solid #3B82F6; }
.stat-card:nth-child(2) { border-left: 3px solid #10B981; }
.stat-card:nth-child(3) { border-left: 3px solid #8B5CF6; }
.stat-card:nth-child(4) { border-left: 3px solid #F59E0B; }

.stat-icon {
    font-size: 2.2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
}

.stat-info { flex: 1; }

.stat-number {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

/* ==================== DASHBOARD CONTAINER (dashboard.html) ==================== */
.dashboard-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 28px;
}

.header {
    background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(59, 130, 246, 0.04));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    background: radial-gradient(circle at 100% 50%, rgba(59, 130, 246, 0.06), transparent 70%);
    pointer-events: none;
}

.header h1 {
    margin: 0 0 6px 0;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    letter-spacing: -0.02em;
}

[data-theme="light"] .header h1 {
    background: linear-gradient(135deg, #0F172A, #3B82F6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.header p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

/* ==================== EMPLOYEES SECTION (dashboard) ==================== */
.employees-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.employees-section h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.employee-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
}

.employee-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==================== TICKETS STYLES ==================== */
.ticket-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.ticket-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

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

.ticket-number {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.ticket-estado {
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.estado-pendiente { background: var(--warning-light); color: var(--warning-color); }
.estado-en_proceso { background: var(--primary-light); color: var(--primary-color); }
.estado-resuelto { background: var(--success-light); color: var(--success-color); }
.estado-cerrado { background: var(--bg-tertiary); color: var(--text-tertiary); }

/* ==================== ADMIN PAGE ==================== */
.admin-welcome {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.admin-welcome h1 {
    font-size: 1.8rem;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--primary-color) !important;
}

.admin-welcome p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.module-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.module-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 130, 246, 0.1);
    color: inherit;
}

.module-card:hover .module-icon {
    transform: scale(1.15);
    transition: transform 0.3s;
}

.module-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.module-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.module-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ==================== INFORMES ==================== */
.informes-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    min-height: calc(100vh - 150px);
}

.informes-sidebar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.informes-content {
    padding: 0;
}

.filtros-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: flex-end;
}

.filtro-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filtro-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.filtro-group input,
.filtro-group select {
    padding: 0.55rem 0.85rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
}

.btn-filtrar {
    padding: 0.55rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
}

.btn-filtrar:hover { background: var(--primary-hover); }

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

/* Bar chart items */
.barra-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.barra-label {
    min-width: 120px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.barra-track {
    flex: 1;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.barra-fill {
    height: 100%;
    border-radius: var(--radius-xs);
    transition: width 0.5s ease;
}

.barra-valor {
    min-width: 40px;
    text-align: right;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ==================== FICHAJES ==================== */
.fichaje-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
}

.fichaje-card:hover {
    box-shadow: var(--shadow-md);
}

/* ==================== NOTIFICATIONS ==================== */
.notification-container {
    position: relative;
}

.notification-bell {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 1.15rem;
}

.notification-bell:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.bell-icon { line-height: 1; }

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: notif-pulse 2s ease-in-out infinite;
}

@keyframes notif-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    animation: modalIn 0.2s ease-out;
}

.notification-panel.active { display: flex; }

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

.notification-title {
    font-weight: 700;
    font-size: 0.9rem;
}

.notification-mark-all {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.notification-list {
    overflow-y: auto;
    max-height: 400px;
}

.notification-item {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    gap: 12px;
    transition: var(--transition);
}

.notification-item:hover { background: var(--bg-hover); }
.notification-item.unread { background: var(--primary-light); }
.notification-item.priority-high { border-left: 3px solid var(--danger-color); }

.notification-icon { font-size: 1.3rem; flex-shrink: 0; }

.notification-content { flex: 1; min-width: 0; }

.notification-item-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.notification-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 3px;
}

.notification-empty {
    padding: 32px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ==================== INFO CARDS GRID (dashboard) ==================== */
.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ==================== LOGO ==================== */
.logo-container {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 34px;
    width: auto;
    transition: var(--transition);
}

[data-theme="light"] .logo-img {
    filter: brightness(0) saturate(100%);
    opacity: 0.85;
}

/* ==================== THEME TOGGLE (in topbar) ==================== */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--bg-hover);
}

/* ==================== EVALUACIONES ==================== */
.evaluacion-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
}

.evaluacion-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* ==================== AUSENCIAS ==================== */
.ausencia-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
}

.ausencia-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* ==================== ESTADO INICIAL (informes) ==================== */
.estado-inicial {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    color: var(--text-tertiary);
    text-align: center;
}

.estado-inicial-icono {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ==================== SIDEBAR MOBILE OVERLAY ==================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 190;
    backdrop-filter: blur(2px);
}

/* ==================== HAMBURGER (old - keep for compatibility) ==================== */
.hamburger-btn { display: none !important; }
.hamburger-line { display: none; }

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

/* Tablet */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .informes-container {
        grid-template-columns: 1fr;
    }

    .informes-sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }
}

/* Mobile */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    /* Sidebar hidden by default on mobile */
    .sidebar {
        transform: translateX(-100%);
        z-index: 201;
    }

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

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .sidebar-toggle {
        display: flex !important;
    }

    .topbar {
        padding: 0 16px;
    }

    .container {
        padding: 16px !important;
        max-width: 100% !important;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-header h2 {
        font-size: 1.3rem;
    }

    /* Dashboard */
    .dashboard-container {
        padding: 16px !important;
        max-width: 100% !important;
    }

    .header {
        padding: 20px !important;
        margin-bottom: 20px !important;
    }

    .header h1 {
        font-size: 1.4rem !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .stat-card {
        padding: 18px !important;
    }

    .dashboard-cards {
        grid-template-columns: 1fr !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .employees-section {
        padding: 16px !important;
    }

    .employee-card {
        padding: 12px !important;
    }

    .info-cards-grid {
        grid-template-columns: 1fr !important;
    }

    /* Grids */
    .empleados-grid, .usuarios-grid {
        grid-template-columns: 1fr !important;
    }

    .modules-grid {
        grid-template-columns: 1fr !important;
    }

    /* Modals */
    .modal-content {
        width: 95% !important;
        margin: 2% auto !important;
    }

    .modal-overlay .modal-content {
        width: 95% !important;
        margin: 2% auto !important;
    }

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

    /* Filters */
    .filters-row, .filtros-row {
        flex-direction: column !important;
    }

    .filter-select {
        min-width: 100% !important;
        width: 100% !important;
    }

    .filtro-group {
        width: 100% !important;
    }

    .filtro-group input, .filtro-group select {
        width: 100% !important;
    }

    .btn-filtrar {
        width: 100% !important;
    }

    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .filter-tab {
        flex-shrink: 0;
    }

    /* Informes */
    .informes-container {
        grid-template-columns: 1fr !important;
    }

    .informes-sidebar {
        position: relative !important;
        top: 0 !important;
        max-height: none !important;
    }

    .informes-content {
        padding: 0 !important;
    }

    .resumen-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .barra-item {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .barra-label { min-width: auto !important; }
    .barra-track { width: 100% !important; }
    .barra-valor { text-align: left !important; }

    .estado-inicial {
        padding: 32px 16px !important;
    }

    /* Search */
    .search-box input {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Notifications */
    .notification-panel {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 70vh !important;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    }

    /* Tables */
    table {
        font-size: 0.8rem;
    }

    table th, table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .resumen-cards {
        grid-template-columns: 1fr !important;
    }

    .admin-welcome {
        padding: 20px !important;
    }

    .admin-welcome h1 {
        font-size: 1.3rem !important;
    }

    .login-box {
        padding: 28px 24px;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in { animation: fadeIn 0.3s ease-out; }
.slide-up { animation: slideUp 0.3s ease-out; }

/* ==================== FICHAJE WIDGET PREMIUM ==================== */

/* Contenedor principal - ancho completo (contiene widget + calendario) */
.fichaje-cronometro-main {
    width: 100%;
    text-align: center;
}

/* Sub-elementos del widget (cronómetro, GPS, resumen, fichajes hoy) se centran */
.fichaje-cronometro-main > .cronometro-card,
.fichaje-cronometro-main > .gps-status,
.fichaje-cronometro-main > .resumen-dia,
.fichaje-cronometro-main > .fichajes-lista-hoy,
.fichaje-cronometro-main > .btn-fichar-principal {
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

/* Tarjeta visual para la zona del widget (sin incluir calendario) */
.cronometro-card {
    background: linear-gradient(145deg, rgba(10, 10, 10, 0.8), rgba(20, 10, 40, 0.4), rgba(10, 10, 10, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3), 0 20px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
}

[data-theme="light"] .cronometro-card {
    background: linear-gradient(145deg, #ffffff, #f1f5f9, #ffffff);
    border-color: #e2e8f0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 20px 60px rgba(0,0,0,0.06);
}

/* Cronómetro card - botón + timer */
.cronometro-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

/* Botón circular premium */
.cronometro-icon {
    width: 72px !important;
    height: 72px !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer;
    position: relative;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa) !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4), 0 8px 30px rgba(139, 92, 246, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    animation: pulse-idle 2.5s ease-in-out infinite;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
}

.cronometro-icon:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5), 0 12px 40px rgba(139, 92, 246, 0.35) !important;
}

.cronometro-icon:active {
    transform: scale(0.95) !important;
}

/* Estado activo (cronometrando) */
.cronometro-icon.activo,
.cronometro-icon.en-curso {
    background: linear-gradient(135deg, #ef4444, #f97316) !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4), 0 8px 30px rgba(249, 115, 22, 0.25);
    animation: pulse-active 1.5s ease-in-out infinite;
}

@keyframes pulse-idle {
    0%, 100% { box-shadow: 0 4px 15px rgba(99,102,241,0.4), 0 0 0 0 rgba(99,102,241,0.25); }
    50% { box-shadow: 0 4px 15px rgba(99,102,241,0.4), 0 0 0 16px rgba(99,102,241,0); }
}

@keyframes pulse-active {
    0%, 100% { box-shadow: 0 4px 15px rgba(239,68,68,0.4), 0 0 0 0 rgba(239,68,68,0.2); }
    50% { box-shadow: 0 4px 15px rgba(239,68,68,0.4), 0 0 0 12px rgba(239,68,68,0); }
}

/* Timer display */
.cronometro-info {
    text-align: left;
}

.cronometro-tiempo {
    font-size: 2.4rem !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #f8fafc, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    line-height: 1.1;
}

.cronometro-tiempo.activo,
.cronometro-tiempo.en-curso {
    background: linear-gradient(135deg, #ffffff, #fbbf24) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

[data-theme="light"] .cronometro-tiempo {
    background: linear-gradient(135deg, #0f172a, #475569);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.cronometro-estado {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    animation: fade-pulse 3s ease-in-out infinite;
}

@keyframes fade-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* GPS status badge */
.gps-status {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 auto 20px;
}

/* Resumen del día - fecha grande + info */
.resumen-dia {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .resumen-dia {
    border-top-color: #e2e8f0;
}

.resumen-mes {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #8b5cf6;
    margin-bottom: 4px;
}

.dia-numero,
.resumen-dia .dia-numero {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    line-height: 1.1;
    color: var(--text-primary);
}

.dia-info div:first-child,
#diaNombre {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

#estadoDia {
    font-size: 0.8rem;
    color: #64748b;
}

.resumen-horas .horas-numero {
    font-size: 1.1rem;
    font-weight: 700;
    color: #a78bfa;
    margin-top: 4px;
}

/* Fichajes de hoy */
.fichajes-lista-hoy {
    text-align: center;
    margin-bottom: 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .fichajes-lista-hoy {
    border-top-color: #e2e8f0;
}

.fichajes-lista-hoy h3 {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* Botón oculto de fichar (mantener hidden) */
.btn-fichar-principal {
    display: none;
}

/* Calendario mensual - ancho completo dentro de fichaje-cronometro-main */
.calendario-mensual {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ==================== HISTORIAL DE FICHAJES MODAL ==================== */
.modal-historial {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.modal-historial-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin: 3% auto;
    width: 90%;
    max-width: 700px;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s ease-out;
    overflow: hidden;
}

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

.modal-historial-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.modal-historial-close {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-historial-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-historial-filtros {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.filtro-mes {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filtro-mes label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filtro-mes select {
    padding: 0.5rem 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
}

.modal-historial-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.modal-historial-stats .stat-item {
    background: var(--bg-secondary);
    padding: 18px 16px;
    text-align: center;
}

.modal-historial-stats .stat-valor {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.modal-historial-stats .stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.modal-historial-body {
    padding: 20px 24px;
    max-height: 400px;
    overflow-y: auto;
}

/* Botón ver historial completo */
.btn-ver-historial {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
    float: right;
}

.btn-ver-historial:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

/* ==================== INLINE STYLE OVERRIDES ==================== */
/* Estas páginas tienen <style> inline que compiten - necesitan !important */

/* Forzar contenido a ancho completo con padding lateral */
.dashboard-container,
.fichajes-container,
.informes-container,
.tickets-container,
.ausencias-container,
.evaluaciones-container,
.reclutamiento-container,
.festivos-container,
.auditoria-container,
.container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 28px !important;
    padding-right: 28px !important;
}

/* ==================== PRINT ==================== */
@media print {
    .sidebar, .topbar, .sidebar-overlay { display: none !important; }
    .main-content { margin-left: 0 !important; }
    body { background: white; color: black; }
}
