/* ============================================
   ATTENDPRO — Sistema de Control de Asistencia
   assets/css/style.css
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #e0e7ff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --purple: #8b5cf6;
    --sidebar-w: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-text: #e2e8f0;
    --sidebar-muted: #cbd5e1;
    --sidebar-heading: #e2e8f0;
    --sidebar-active: #6366f1;
    --sidebar-active-text: #ffffff;
    --topbar-h: 64px;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12);
    --font: 'Sora', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.2s ease;
}

html[data-theme="classic-gold"] {
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --purple: #7c3aed;
    --sidebar-bg: #0f2f6b;
    --sidebar-text: #eff6ff;
    --sidebar-muted: #dbeafe;
    --sidebar-heading: #ffffff;
    --sidebar-active: #2563eb;
    --sidebar-active-text: #ffffff;
    --bg: #eaf2ff;
    --card-bg: #ffffff;
    --text: #172554;
    --text-muted: #475569;
    --border: #bfdbfe;
    --bs-primary: #1d4ed8;
    --bs-primary-rgb: 29, 78, 216;
}

html[data-theme="deep-space"] {
    --primary: #15803d;
    --primary-dark: #166534;
    --primary-light: #dcfce7;
    --purple: #0d9488;
    --sidebar-bg: #083b24;
    --sidebar-text: #f0fdf4;
    --sidebar-muted: #dcfce7;
    --sidebar-heading: #ffffff;
    --sidebar-active: #16a34a;
    --sidebar-active-text: #ffffff;
    --bg: #ecfdf3;
    --card-bg: #ffffff;
    --text: #14532d;
    --text-muted: #4b5563;
    --border: #bbf7d0;
    --bs-primary: #15803d;
    --bs-primary-rgb: 21, 128, 61;
}

html[data-theme="midnight-ember"] {
    --primary: #ea580c;
    --primary-dark: #c2410c;
    --primary-light: #ffedd5;
    --purple: #db2777;
    --sidebar-bg: #5f1f0c;
    --sidebar-text: #fff7ed;
    --sidebar-muted: #ffedd5;
    --sidebar-heading: #ffffff;
    --sidebar-active: #ea580c;
    --sidebar-active-text: #ffffff;
    --bg: #fff7ed;
    --card-bg: #ffffff;
    --text: #431407;
    --text-muted: #78716c;
    --border: #fed7aa;
    --bs-primary: #ea580c;
    --bs-primary-rgb: 234, 88, 12;
}

html[data-theme="slate-cyan"] {
    --primary: #0891b2;
    --primary-dark: #0e7490;
    --primary-light: #cffafe;
    --purple: #14b8a6;
    --sidebar-bg: #0f465a;
    --sidebar-text: #ecfeff;
    --sidebar-muted: #cffafe;
    --sidebar-heading: #ffffff;
    --sidebar-active: #0891b2;
    --sidebar-active-text: #ffffff;
    --bg: #ecfeff;
    --card-bg: #ffffff;
    --text: #083344;
    --text-muted: #475569;
    --border: #bae6fd;
    --bs-primary: #0891b2;
    --bs-primary-rgb: 8, 145, 178;
}

html[data-theme="carbon-gold"] {
    --primary: #d97706;
    --primary-dark: #b45309;
    --primary-light: #fef3c7;
    --purple: #334155;
    --sidebar-bg: #1f2937;
    --sidebar-text: #ffffff;
    --sidebar-muted: #f1f5f9;
    --sidebar-heading: #ffffff;
    --sidebar-active: #d97706;
    --sidebar-active-text: #ffffff;
    --bg: #fffbeb;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-muted: #4b5563;
    --border: #fde68a;
    --bs-primary: #d97706;
    --bs-primary-rgb: 217, 119, 6;
}

html[data-theme="indigo-pro"] {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #ede9fe;
    --purple: #8b5cf6;
    --sidebar-bg: #2e1065;
    --sidebar-text: #faf5ff;
    --sidebar-muted: #ede9fe;
    --sidebar-heading: #ffffff;
    --sidebar-active: #7c3aed;
    --sidebar-active-text: #ffffff;
    --bg: #f5f3ff;
    --card-bg: #ffffff;
    --text: #2e1065;
    --text-muted: #6b7280;
    --border: #ddd6fe;
    --bs-primary: #7c3aed;
    --bs-primary-rgb: 124, 58, 237;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ======= SIDEBAR ======= */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    overflow: hidden;
}

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

.brand-icon {
    width: 42px;
    height: 42px;
    background: var(--sidebar-active);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: block;
    letter-spacing: -0.3px;
}

.brand-sub {
    font-size: 11px;
    color: var(--sidebar-muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

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

.nav-section-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--sidebar-heading);
    opacity: 0.72;
    padding: 12px 8px 6px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    margin-bottom: 2px;
}

.sidebar-nav .nav-link i {
    font-size: 17px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    color: inherit;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-active-text);
    box-shadow: 0 8px 18px rgba(var(--bs-primary-rgb), 0.34);
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 16px;
    flex-shrink: 0;
}

.admin-name {
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-role {
    font-size: 11px;
    color: var(--sidebar-muted);
    font-weight: 600;
    display: block;
    text-transform: capitalize;
}

.btn-logout {
    color: var(--sidebar-text);
    font-size: 18px;
    text-decoration: none;
    padding: 6px;
    border-radius: 8px;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-logout:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

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

.topbar {
    height: var(--topbar-h);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 var(--border);
}

.sidebar-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg);
    color: var(--text);
}

.topbar-title h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.topbar-right {
    margin-left: auto;
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    align-items: flex-end;
    column-gap: 14px;
}

.topbar-school-year {
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 7px 12px;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.22);
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(var(--bs-primary-rgb), 0.10);
}

.topbar-school-year i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
}

.topbar-school-year span {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    line-height: 1;
    text-transform: uppercase;
}

.topbar-school-year strong {
    display: block;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
}

.live-clock {
    grid-column: 2;
    grid-row: 1;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 500;
    color: var(--primary);
}

.live-date {
    grid-column: 2;
    grid-row: 2;
    font-size: 11px;
    color: var(--text-muted);
}

.login-welcome-modal {
    border: 0;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.welcome-school-year {
    display: grid;
    gap: 4px;
    padding: 16px;
    border-radius: 14px;
    background: var(--primary-light);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.22);
}

.welcome-school-year span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.welcome-school-year strong {
    color: var(--text);
    font-size: 28px;
    line-height: 1;
    font-family: var(--font-mono);
}

.welcome-school-year small {
    color: var(--primary-dark);
    font-weight: 700;
}

.page-content {
    padding: 24px;
    flex: 1;
}

/* ======= CARDS ======= */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 15px;
}

.card-body {
    padding: 20px;
}

/* ======= STAT CARDS ======= */
.stat-card {
    --stat-main: var(--bs-orange);
    --stat-side: rgba(202, 90, 0, 0.88);
    --stat-icon-width: 80px;
    background: var(--stat-main) !important;
    border: 0 !important;
    border-radius: 10px;
    min-height: 126px;
    padding: 18px calc(var(--stat-icon-width) + 12px) 16px 16px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.16);
}

.stat-icon {
    position: absolute;
    inset: 0 0 0 auto;
    width: var(--stat-icon-width);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--stat-side);
    color: rgba(255, 255, 255, 0.76);
    font-size: 36px;
    line-height: 1;
}

.stat-icon i {
    display: block;
    line-height: 1;
}

.stat-info {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.stat-value {
    font-size: clamp(32px, 3vw, 40px);
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    font-family: var(--font-sans);
}

.stat-label {
    font-size: clamp(11px, 1vw, 13px);
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1.2;
    margin-top: 8px;
    text-transform: uppercase;
    hyphens: none;
    overflow-wrap: normal;
    word-break: normal;
}

.stat-note {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: clamp(10px, 0.95vw, 12px);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.94);
    line-height: 1.25;
    margin-top: 14px;
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
}

.stat-note i {
    font-size: 12px;
    flex-shrink: 0;
    line-height: 1.2;
    margin-top: 1px;
}

.stat-note span {
    display: block;
    min-width: 0;
    max-width: 100%;
    line-height: inherit;
    overflow-wrap: normal;
    word-break: normal;
}

.stat-card-orange {
    --stat-main: var(--bs-orange);
    --stat-side: rgba(202, 90, 0, 0.88);
}

.stat-card-green {
    --stat-main: var(--bs-success);
    --stat-side: rgba(var(--bs-success-rgb), 0.78);
}

.stat-card-blue {
    --stat-main: var(--bs-primary);
    --stat-side: rgba(var(--bs-primary-rgb), 0.78);
}

.stat-card-red {
    --stat-main: var(--bs-danger);
    --stat-side: rgba(var(--bs-danger-rgb), 0.78);
}

.dashboard-stat-card {
    height: 132px;
    min-height: 132px;
}

.dashboard-stat-card .stat-info {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: center;
}

.dashboard-stat-card .stat-note {
    margin-top: 12px;
}

.stat-card-bs-primary {
    --stat-main: var(--bs-primary);
    --stat-side: rgba(var(--bs-primary-rgb), 0.78);
}

.stat-card-bs-success {
    --stat-main: var(--bs-success);
    --stat-side: rgba(var(--bs-success-rgb), 0.78);
}

.stat-card-bs-warning {
    --stat-main: var(--bs-warning);
    --stat-side: rgba(var(--bs-warning-rgb), 0.82);
}

.stat-card-bs-danger {
    --stat-main: var(--bs-danger);
    --stat-side: rgba(var(--bs-danger-rgb), 0.78);
}

.stat-card-bs-info {
    --stat-main: var(--bs-info);
    --stat-side: rgba(var(--bs-info-rgb), 0.82);
}

.stat-card-bs-secondary {
    --stat-main: var(--bs-secondary);
    --stat-side: rgba(var(--bs-secondary-rgb), 0.78);
}

.stat-card-bs-warning .stat-value,
.stat-card-bs-warning .stat-label,
.stat-card-bs-warning .stat-note,
.stat-card-bs-warning .stat-icon,
.stat-card-bs-info .stat-value,
.stat-card-bs-info .stat-label,
.stat-card-bs-info .stat-note,
.stat-card-bs-info .stat-icon {
    color: #212529;
}

.stat-card-report {
    --stat-icon-width: 64px;
    min-height: 122px;
    padding: 16px calc(var(--stat-icon-width) + 12px) 14px 16px;
}

.stat-card-report .stat-value {
    font-size: clamp(30px, 2.35vw, 40px);
    white-space: nowrap;
}

.stat-card-report .stat-label {
    font-size: clamp(10px, 0.85vw, 12px);
    letter-spacing: 1.2px;
    line-height: 1.15;
    max-width: 9.5rem;
}

.stat-card-report .stat-note {
    font-size: 11px;
    margin-top: 10px;
}

.stat-card-report .stat-icon {
    font-size: 31px;
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .stat-card {
        --stat-icon-width: 70px;
        min-height: 118px;
        padding-left: 14px;
    }

    .dashboard-stat-card {
        height: 128px;
        min-height: 128px;
    }

    .stat-icon {
        font-size: 32px;
    }

    .stat-label {
        letter-spacing: 1.35px;
    }

    .stat-note {
        gap: 4px;
        line-height: 1.18;
        margin-top: 12px;
    }
}

@media (min-width: 1400px) {
    .stat-card-report .stat-label {
        max-width: 10.5rem;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .stat-card {
        --stat-icon-width: 62px;
        min-height: 112px;
        padding: 15px calc(var(--stat-icon-width) + 10px) 14px 14px;
    }

    .dashboard-stat-card {
        height: 128px;
        min-height: 128px;
    }

    .stat-icon {
        font-size: 28px;
    }

    .stat-label {
        letter-spacing: 1px;
        line-height: 1.12;
    }

    .stat-note {
        gap: 4px;
        line-height: 1.14;
        margin-top: 10px;
    }
}

/* ======= BADGES ======= */
.badge {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-present {
    background: #d1fae5;
    color: #065f46;
}

.badge-late {
    background: #fef3c7;
    color: #92400e;
}

.badge-absent {
    background: #fee2e2;
    color: #7f1d1d;
}

.badge-excused {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-holiday {
    background: #ede9fe;
    color: #5b21b6;
}

/* ======= BUTTONS ======= */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
    border-radius: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-success {
    border-radius: 8px;
    font-weight: 500;
}

.btn-danger {
    border-radius: 8px;
    font-weight: 500;
}

.btn-warning {
    border-radius: 8px;
    font-weight: 500;
}

.btn-outline-primary {
    border-radius: 8px;
    font-weight: 500;
    color: var(--primary);
    border-color: var(--primary);
}

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

/* ======= CHECKIN WIDGET ======= */
.checkin-widget {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    border-radius: 20px;
    padding: 40px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.checkin-widget::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    pointer-events: none;
}

.checkin-clock {
    font-family: var(--font-mono);
    font-size: 56px;
    font-weight: 700;
    text-align: center;
    letter-spacing: -2px;
    color: #fff;
    text-shadow: 0 0 40px rgba(99, 102, 241, 0.5);
    white-space: nowrap;
}

.checkin-date-display {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-top: 4px;
}

.checkin-form {
    margin-top: 24px;
}

.checkin-input {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
    font-family: var(--font-mono) !important;
    letter-spacing: 2px !important;
    text-align: center !important;
}

.checkin-input::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

.checkin-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

.btn-checkin {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
}

.btn-checkin:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-checkout {
    background: var(--success) !important;
}

.btn-checkout:hover {
    background: #059669 !important;
}

/* ======= TABLES ======= */
.table {
    font-size: 14px;
}

.table thead th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    background: var(--bg);
    padding: 12px 16px;
}

.table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
}

/* ======= FORMS ======= */
.form-control,
.form-select {
    border-radius: 8px;
    border-color: var(--border);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

/* ======= ALERTS ======= */
.alert {
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background: #fee2e2;
    color: #7f1d1d;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

/* ======= SIDEBAR COLLAPSED ======= */
.sidebar-collapsed .sidebar {
    width: 68px;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .brand-sub,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .sidebar-nav .nav-link span,
.sidebar-collapsed .admin-details {
    display: none;
}

.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 10px;
}

.sidebar-collapsed .sidebar-footer {
    justify-content: center;
}

.sidebar-collapsed .admin-info {
    gap: 0;
}

.sidebar-collapsed .main-content {
    margin-left: 68px;
}

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

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

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

    .page-content {
        padding: 16px;
    }

    .checkin-clock {
        font-size: 36px;
    }

    .checkin-widget {
        padding: 24px;
    }
}

/* ======= LOGIN PAGE ======= */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--sidebar-bg, #0f2f6b) 0%, var(--primary, #1d4ed8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border, #bfdbfe);
    border-radius: 20px;
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-icon {
    width: 64px;
    height: 64px;
    background: var(--primary, #1d4ed8);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    margin: 0 auto 14px;
    box-shadow: 0 8px 24px rgba(var(--bs-primary-rgb), 0.25);
}

.login-title {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--primary, #1d4ed8);
    margin: 0;
}

.login-sub {
    font-size: 13px;
    color: var(--text-muted, #475569);
    margin-top: 4px;
    line-height: 1.4;
}

.login-card .form-label {
    color: var(--text, #172554);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
}

.login-card .form-control {
    background: #ffffff !important;
    border: 1.5px solid var(--border, #bfdbfe) !important;
    color: var(--text, #172554) !important;
    padding: 9px 14px;
    font-size: 14px;
    border-radius: 8px !important;
}

.login-card .form-control::placeholder {
    color: var(--text-muted, #475569) !important;
    opacity: 0.6;
}

.login-card .form-control:focus {
    border-color: var(--primary, #1d4ed8) !important;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.12) !important;
    background: #ffffff !important;
}

.login-card .input-group-text {
    background-color: #ffffff !important;
    border: 1.5px solid var(--border, #bfdbfe) !important;
    color: var(--text-muted, #475569) !important;
}

.divider-pufe {
    border: none;
    height: 1px;
    background: var(--border, #bfdbfe);
    margin: 20px 0;
}

.btn-login {
    background: var(--primary, #1d4ed8);
    border: none;
    color: #fff;
    padding: 10px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-login:hover {
    background: var(--primary-dark, #1e40af);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.25);
    color: #ffffff;
}

/* ======= CHART CONTAINERS ======= */
.chart-container {
    position: relative;
}

/* ======= PROGRESS BARS ======= */
.attendance-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    overflow: hidden;
}

.attendance-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ======= EMPLOYEE CARD ======= */
.employee-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.employee-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.employee-card .avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 12px;
}

.employee-card .emp-name {
    font-weight: 600;
    font-size: 15px;
    margin: 0;
}

.employee-card .emp-dept {
    font-size: 13px;
    color: var(--text-muted);
}

.employee-card .emp-code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 6px;
    color: var(--primary);
}

/* ======= MISC ======= */
.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.section-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

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

.section-card-header h5 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.section-card-body {
    padding: 20px;
}

.dashboard-panel {
    height: 300px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-bottom-panel {
    height: 320px;
}

.dashboard-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.dashboard-bottom-panel .dashboard-panel-body {
    overflow: hidden;
}

.dashboard-scroll-list {
    max-height: 225px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

.dashboard-scroll-list-flush {
    max-height: 100%;
    padding-right: 0;
}

.dashboard-scroll-list::-webkit-scrollbar {
    width: 6px;
}

.dashboard-scroll-list::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-scroll-list::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 999px;
}

.dashboard-scroll-list:hover::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.55);
}

.dashboard-empty-state {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dashboard-donut-chart {
    height: 220px;
    min-height: 220px;
}

.dashboard-panel-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.dashboard-attendance-row {
    margin-bottom: 15px;
}

.dashboard-attendance-row:last-child {
    margin-bottom: 0;
}

/* ======= THEME PICKER ======= */
.theme-picker {
    display: grid;
    gap: 8px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    padding: 10px 12px;
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

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

.theme-option.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

.theme-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-swatches {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.theme-swatches span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.theme-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

/* Colors for avatars */
.color-0 {
    background: #6366f1;
}

.color-1 {
    background: #10b981;
}

.color-2 {
    background: #f59e0b;
}

.color-3 {
    background: #ef4444;
}

.color-4 {
    background: #8b5cf6;
}

.color-5 {
    background: #3b82f6;
}

.color-6 {
    background: #ec4899;
}

.color-7 {
    background: #14b8a6;
}

/* ======= MOBILE SIDEBAR FIX ======= */
@media (max-width: 768px) {
    .topbar {
        z-index: 1100;
    }

    .sidebar {
        z-index: 1200;
    }

    .sidebar-toggle {
        position: relative;
        z-index: 1300;
        pointer-events: auto;
    }
}

/* =====================================================
   AJUSTES RESPONSIVE GENERALES — MODO CELULAR COMPLETO
   ===================================================== */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

img, svg, canvas, video {
    max-width: 100%;
}

.table-responsive,
.dataTables_wrapper,
.dataTables_scroll,
.dataTables_scrollBody {
    width: 100% !important;
    max-width: 100% !important;
}

.dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper .row {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding: 8px 0;
}

.table td,
.table th {
    white-space: nowrap;
}

.modal-dialog {
    max-width: calc(100% - 1rem);
}

.employee-photo-preview,
#photoPreview,
#previewFoto,
#addPhotoPreview,
#editPhotoPreview {
    width: 192px !important;
    height: 192px !important;
    max-width: 192px !important;
    max-height: 192px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

@media (max-width: 768px) {
    body {
        display: block;
        min-width: 0;
    }

    body.mobile-sidebar-open {
        overflow: hidden;
    }

    .sidebar {
        width: min(82vw, 280px);
        max-width: 280px;
        box-shadow: 20px 0 40px rgba(15, 23, 42, 0.25);
    }

    .sidebar.show::after {
        content: '';
        position: fixed;
        inset: 0;
        left: 100%;
        width: 100vw;
        background: rgba(15, 23, 42, 0.35);
        pointer-events: none;
    }

    .main-content {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }

    .topbar {
        height: auto;
        min-height: 58px;
        padding: 10px 12px;
        gap: 10px;
        position: sticky;
        top: 0;
    }

    .topbar-title {
        min-width: 0;
        flex: 1;
    }

    .topbar-title h4 {
        font-size: 15px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-right {
        display: none;
    }

    .sidebar-toggle {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        background: #fff;
    }

    .page-content {
        padding: 12px;
        width: 100%;
        max-width: 100%;
    }

    .page-header,
    .section-card-header {
        display: flex;
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .page-header h2 {
        font-size: 18px;
        line-height: 1.25;
    }

    .page-header p {
        font-size: 13px;
    }

    .page-header .btn,
    .section-card-header .btn,
    .section-card-header .form-select,
    .section-card-header .form-control {
        width: 100%;
    }

    .section-card,
    .card,
    .stat-card,
    .employee-card {
        border-radius: 10px;
    }

    .dashboard-panel {
        height: auto;
        min-height: 260px;
    }

    .dashboard-bottom-panel {
        height: auto;
    }

    .dashboard-panel-body {
        overflow: visible;
    }

    .dashboard-scroll-list {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .section-card-body,
    .card-body {
        padding: 14px;
    }

    .card-header,
    .section-card-header {
        padding: 14px;
    }

    .stat-card {
        --stat-icon-width: 68px;
        min-height: 112px;
        padding: 16px calc(var(--stat-icon-width) + 10px) 14px 16px;
    }

    .dashboard-stat-card {
        height: 124px;
        min-height: 124px;
    }

    .stat-icon {
        font-size: 30px;
    }

    .stat-value {
        font-size: 34px;
    }

    .stat-label {
        font-size: 12px;
        letter-spacing: 1.4px;
    }

    .stat-note {
        font-size: 11px;
        margin-top: 12px;
    }

    .checkin-widget {
        padding: 18px;
        border-radius: 14px;
    }

    .checkin-clock {
        font-size: clamp(28px, 10vw, 38px);
        letter-spacing: -1px;
    }

    .checkin-input {
        font-size: 16px !important;
        letter-spacing: 1px !important;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 42px;
    }

    .modal-dialog {
        margin: .5rem auto;
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 0 !important;
    }

    .dataTables_wrapper .row > div {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        text-align: left !important;
    }

    .dataTables_wrapper .dataTables_filter label,
    .dataTables_wrapper .dataTables_length label {
        width: 100%;
        display: block;
    }

    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        width: 100% !important;
        margin: 6px 0 0 0 !important;
    }

    .dataTables_wrapper .dataTables_paginate {
        overflow-x: auto;
        white-space: nowrap;
        text-align: left !important;
    }

    .chart-container {
        min-height: 260px;
    }
}

@media (max-width: 576px) {
    .row {
        --bs-gutter-x: .75rem;
        --bs-gutter-y: .75rem;
    }

    .login-card {
        margin: 12px;
        padding: 30px 18px;
        max-width: calc(100% - 24px);
    }

    .login-logo h1 {
        font-size: 22px;
    }

    .table {
        font-size: 13px;
    }

    .table thead th,
    .table td {
        padding: 10px 12px;
    }

    .badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    .employee-photo-preview,
    #photoPreview,
    #previewFoto,
    #addPhotoPreview,
    #editPhotoPreview {
        width: 192px !important;
        height: 192px !important;
    }

    .col-6 {
        flex: 0 0 auto;
        width: 100%;
    }
}


/* DataTables: botones de exportación y ocultar columnas */
.dataTables_wrapper .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dataTables_wrapper .dt-buttons .btn {
    border-radius: 10px;
    font-weight: 600;
}

div.dt-button-collection {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .18);
}

@media (max-width: 768px) {
    .dataTables_wrapper .dt-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 10px;
    }

    .dataTables_wrapper .dt-buttons .btn {
        width: 100%;
        min-height: 40px;
        font-size: 12px;
        padding-left: 8px;
        padding-right: 8px;
    }
}

@media (max-width: 420px) {
    .dataTables_wrapper .dt-buttons {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   CORRECCIÓN GLOBAL: DESBORDAMIENTO EN CELULAR + INPUTS VISIBLES
   ========================================================= */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.main-content,
.page-content,
.section-card,
.section-card-body,
.card,
.card-body {
    min-width: 0;
    max-width: 100%;
}

.table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.dataTables_wrapper .row {
    --bs-gutter-x: .75rem;
    width: 100%;
    max-width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    max-width: 100%;
}

.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    margin: 0;
}

.dataTables_wrapper .dataTables_filter input {
    min-width: 0;
    width: 100% !important;
    max-width: 240px;
}

.dataTables_wrapper .dataTables_length select {
    min-width: 76px;
}

.dataTables_scroll,
.dataTables_scrollHead,
.dataTables_scrollBody {
    max-width: 100% !important;
}

.dataTables_scrollBody {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100% !important;
}

/* Bordes visibles para todos los campos de texto del proyecto */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="file"],
select,
textarea,
.form-control,
.form-select {
    border: 2px solid #64748b !important;
    border-radius: 10px !important;
    background-color: #fff !important;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 .22rem rgba(99, 102, 241, .22) !important;
    outline: none !important;
}

@media (max-width: 768px) {
    .topbar,
    .page-content {
        width: 100%;
        max-width: 100%;
    }

    .section-card {
        overflow: hidden;
    }

    .dataTables_wrapper .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-bottom: 10px;
    }

    .dataTables_wrapper .dt-buttons {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0 0 10px 0;
    }

    .dataTables_wrapper .dt-buttons .btn,
    .dataTables_wrapper .dt-button {
        width: 100% !important;
        max-width: 100%;
        white-space: normal !important;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dataTables_wrapper .dataTables_filter label,
    .dataTables_wrapper .dataTables_length label {
        justify-content: flex-start;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        max-width: 100% !important;
        display: block;
        margin-left: 0 !important;
    }

    .dataTables_wrapper .dataTables_length select {
        max-width: 120px;
    }

    .dataTables_wrapper .dataTables_paginate .pagination {
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
    }
}

@media (max-width: 420px) {
    .dataTables_wrapper .dt-buttons {
        grid-template-columns: 1fr;
    }
}

/* ===== PREMIUM UI: FOTO DE EMPLEADO ===== */
.premium-photo-box {
    padding: 10px 0 18px;
}

.premium-avatar {
    width: 2in;
    height: 2in;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    background-size: cover;
    background-position: center;
    border: 4px solid #fff;
    outline: 3px solid var(--primary);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
    transition: transform .2s ease, box-shadow .2s ease, outline-color .2s ease;
}

.premium-avatar:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .24);
    outline-color: var(--success);
}

.premium-avatar.photo-loaded {
    outline-color: var(--success);
}

.premium-avatar-initials {
    color: #fff;
    font-size: 54px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1;
    text-shadow: 0 3px 12px rgba(0, 0, 0, .18);
}

.premium-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .62);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    opacity: 0;
    transition: opacity .2s ease;
    font-weight: 700;
}

.premium-avatar-overlay i {
    font-size: 28px;
}

.premium-avatar-overlay small {
    font-size: 12px;
}

.premium-avatar:hover .premium-avatar-overlay {
    opacity: 1;
}

.premium-file-wrap {
    max-width: 360px;
}

@media (max-width: 576px) {
    .premium-avatar {
        width: 168px;
        height: 168px;
    }

    .premium-avatar-initials {
        font-size: 46px;
    }

    .premium-file-wrap {
        max-width: 100%;
    }
}


/* ===== AJUSTE BOTONES DATATABLES: COLUMNAS VISIBLE ===== */
.dataTables_wrapper .dt-buttons .buttons-colvis-visible,
.dataTables_wrapper .dt-buttons .buttons-colvis,
.dataTables_wrapper .dt-buttons .buttons-collection {
    min-width: 130px !important;
    color: #fff !important;
    background: #6c757d !important;
    border-color: #6c757d !important;
    opacity: 1 !important;
    text-indent: 0 !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.dataTables_wrapper .dt-buttons .buttons-colvis-visible span,
.dataTables_wrapper .dt-buttons .buttons-colvis span,
.dataTables_wrapper .dt-buttons .buttons-collection span {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #fff !important;
}

#todayAttendanceTable_wrapper .dt-buttons {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
}

#todayAttendanceTable_wrapper .dt-buttons .btn {
    min-height: 40px;
}

@media (max-width: 768px) {
    #todayAttendanceTable_wrapper .dt-buttons {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .dataTables_wrapper .dt-buttons .buttons-colvis-visible,
    .dataTables_wrapper .dt-buttons .buttons-colvis,
    .dataTables_wrapper .dt-buttons .buttons-collection {
        min-width: 0 !important;
        width: 100% !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}



/* ===== MODALES MÁS COMPACTOS EN TODO EL PROYECTO ===== */
.modal-dialog {
    max-width: 640px !important;
    margin: 1.25rem auto !important;
}

.modal-dialog.modal-lg,
.modal-dialog.modal-xl {
    max-width: 720px !important;
}

.modal-content {
    border-radius: 14px !important;
}

.modal-header,
.modal-footer {
    padding: 0.75rem 1rem !important;
}

.modal-body {
    padding: 1rem !important;
}

.modal-body .form-control,
.modal-body .form-select {
    min-height: 38px !important;
    padding: 0.45rem 0.75rem !important;
}

@media (max-width: 768px) {
    .modal-dialog,
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        max-width: calc(100% - 24px) !important;
        margin: 0.75rem auto !important;
    }

    .modal-body {
        max-height: calc(100vh - 150px);
        overflow-y: auto;
    }
}

/* ===== TABLA PRINCIPAL: OCULTAR EXCEL SOLO EN REGISTROS DE HOY ===== */
.registros-hoy-card .buttons-excel,
#tablaPrincipal_wrapper .buttons-excel,
#todayTable_wrapper .buttons-excel,
#registrosHoyTable_wrapper .buttons-excel,
#registros-hoy-table_wrapper .buttons-excel,
#attendanceTodayTable_wrapper .buttons-excel {
    display: none !important;
}



/* ===== MODALES GRANDES EN TODO EL PROYECTO ===== */
.modal-dialog {
    max-width: 900px !important;
    margin: 1.75rem auto !important;
}

.modal-dialog.modal-lg,
.modal-dialog.modal-xl {
    max-width: 1100px !important;
}

.modal-body {
    padding: 1.5rem !important;
}

@media (max-width: 768px) {
    .modal-dialog,
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        max-width: calc(100% - 16px) !important;
        margin: 0.5rem auto !important;
    }

    .modal-body {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* ===== ELIMINAR EXCEL SOLO DE LA TABLA PRINCIPAL ===== */
#todayAttendanceTable_wrapper .buttons-excel,
table[data-table-type="today-records"] ~ .buttons-excel,
.registros-hoy-card .buttons-excel {
    display: none !important;
}



/* ===== TOOLBAR ELITE DATATABLES ===== */
.dt-toolbar-elite {
    width: 100%;
    padding: 0.75rem 0.85rem;
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid #e5eaf3;
    border-radius: 14px;
}

.dt-toolbar-left,
.dt-toolbar-center,
.dt-toolbar-right {
    min-width: 0;
}

.dt-buttons {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.dt-buttons .btn,
.dt-button {
    border-radius: 10px !important;
    font-weight: 700 !important;
    padding: 0.48rem 0.75rem !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

.dataTables_length {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.dataTables_length label {
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
    font-weight: 600;
    color: #334155;
}

.dt-elite-length-select,
.dataTables_length select {
    width: auto !important;
    min-width: 76px !important;
    height: 38px !important;
    border: 2px solid #64748b !important;
    border-radius: 11px !important;
    padding: 0.25rem 2rem 0.25rem 0.65rem !important;
    background-color: #fff !important;
}

.dataTables_filter {
    margin: 0 !important;
}

.dt-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.dataTables_filter label {
    margin: 0 !important;
    font-weight: 700;
    color: #334155;
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem;
    white-space: nowrap;
}

.dt-elite-search-input,
.dataTables_filter input {
    width: 240px !important;
    height: 40px !important;
    padding-left: 2.25rem !important;
    padding-right: 2.15rem !important;
    border: 2px solid #64748b !important;
    border-radius: 12px !important;
    outline: none !important;
    background: #fff !important;
    transition: all 0.2s ease-in-out;
}

.dt-elite-search-input:focus,
.dataTables_filter input:focus {
    border-color: #635bff !important;
    box-shadow: 0 0 0 0.22rem rgba(99, 91, 255, 0.16) !important;
}

.dt-search-icon {
    position: absolute;
    left: 72px;
    color: #64748b;
    z-index: 2;
    pointer-events: none;
}

.dt-clear-search {
    position: absolute;
    right: 8px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.dt-clear-search.show {
    display: flex;
}

.dt-clear-search:hover {
    background: #cbd5e1;
}

/* Tabla principal: mantener solo Columnas */
#todayAttendanceTable_wrapper .buttons-excel,
#todayAttendanceTable_wrapper .buttons-pdf,
#todayAttendanceTable_wrapper .buttons-print,
.registros-hoy-card .buttons-excel,
.registros-hoy-card .buttons-pdf,
.registros-hoy-card .buttons-print {
    display: none !important;
}

/* Responsive toolbar elite */
@media (max-width: 992px) {
    .dt-toolbar-elite {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .dt-toolbar-left,
    .dt-toolbar-center,
    .dt-toolbar-right {
        width: 100%;
        justify-content: center;
    }

    .dt-buttons {
        justify-content: center;
    }

    .dataTables_length,
    .dataTables_filter,
    .dataTables_length label,
    .dataTables_filter label {
        justify-content: center;
    }

    .dt-search-box {
        width: 100%;
        justify-content: center;
    }

    .dt-elite-search-input,
    .dataTables_filter input {
        width: min(100%, 360px) !important;
    }

    .dt-search-icon {
        left: calc(50% - 164px);
    }
}

@media (max-width: 420px) {
    .dt-toolbar-elite {
        padding: 0.65rem;
    }

    .dataTables_length label,
    .dataTables_filter label {
        flex-wrap: nowrap;
        font-size: 0.92rem;
    }

    .dt-search-icon {
        left: 18px;
    }

    .dt-search-box,
    .dataTables_filter label {
        width: 100%;
    }

    .dt-elite-search-input,
    .dataTables_filter input {
        width: 100% !important;
    }
}



/* ===== BUSCADOR PRO MAX - CORRECCIÓN GLOBAL ===== */
.dataTables_filter.dt-pro-filter-ready {
    margin: 0 !important;
}

.dataTables_filter.dt-pro-filter-ready label,
.dt-pro-search-label {
    font-size: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    width: auto !important;
}

.dt-pro-search-wrap {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    width: 280px !important;
    max-width: 100% !important;
}

.dt-pro-search-input,
.dataTables_filter.dt-pro-filter-ready input[type="search"] {
    width: 100% !important;
    height: 42px !important;
    padding: 0.55rem 2.35rem 0.55rem 2.45rem !important;
    border: 2px solid #64748b !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}

.dt-pro-search-input:focus,
.dataTables_filter.dt-pro-filter-ready input[type="search"]:focus {
    border-color: #635bff !important;
    box-shadow: 0 0 0 0.22rem rgba(99, 91, 255, 0.16) !important;
}

.dt-pro-search-icon {
    position: absolute !important;
    left: 13px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #64748b !important;
    font-size: 1rem !important;
    z-index: 3 !important;
    pointer-events: none !important;
}

.dt-pro-clear {
    position: absolute !important;
    right: 9px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 26px !important;
    height: 26px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #e2e8f0 !important;
    color: #334155 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 12px !important;
    z-index: 4 !important;
    padding: 0 !important;
}

.dt-pro-clear.show {
    display: inline-flex !important;
}

.dt-pro-clear:hover {
    background: #cbd5e1 !important;
}

/* Anula reglas viejas del toolbar elite que movían el icono */
.dt-search-icon,
.dt-clear-search {
    display: none !important;
}

/* Responsive */
@media (max-width: 992px) {
    .dt-pro-search-wrap {
        width: min(100%, 360px) !important;
    }

    .dataTables_filter.dt-pro-filter-ready,
    .dataTables_filter.dt-pro-filter-ready label {
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (max-width: 420px) {
    .dt-pro-search-wrap {
        width: 100% !important;
    }
}



/* ===== FIX GLOBAL: MOSTRAR REGISTROS ALINEADO EN CELULAR ===== */
.dataTables_length {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.dataTables_length label,
.dt-length-pro-label {
    width: auto !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    flex-wrap: nowrap !important;
    text-align: center !important;
}

.dataTables_length select {
    display: inline-block !important;
    width: auto !important;
    min-width: 76px !important;
    max-width: 90px !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
}

.dt-toolbar-center {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
}

/* Corrige Bootstrap/DataTables cuando parte el texto en columnas */
.dataTables_length label > * {
    flex: 0 0 auto !important;
}

@media (max-width: 992px) {
    .dt-toolbar-center,
    .dataTables_length {
        width: 100% !important;
        justify-content: center !important;
    }

    .dataTables_length label,
    .dt-length-pro-label {
        font-size: 0.96rem !important;
        gap: 0.45rem !important;
    }
}

@media (max-width: 420px) {
    .dataTables_length label,
    .dt-length-pro-label {
        font-size: 0.92rem !important;
        gap: 0.35rem !important;
    }

    .dataTables_length select {
        min-width: 70px !important;
    }
}

/* ============================================
   Alineación de Tablas
   ============================================ */

/* Centrado del contenido en todas las tablas */
.table th,
.table td {
    text-align: center;
    vertical-align: middle;
}

/* Forzar que todos los encabezados (headers) estén centrados */
.table th {
    text-align: center !important;
}

/* Dejar hacia la izquierda la columna Empleado (solo celdas de datos) */
.table td.col-empleado {
    text-align: left !important;
}

/* Quitar fondo oscuro de gráficos Highcharts en pantalla completa */
.highcharts-fullscreen-container,
.highcharts-fullscreen-container:fullscreen,
.highcharts-fullscreen-container::backdrop,
.highcharts-container,
.highcharts-container:fullscreen,
.highcharts-container::backdrop,
.highcharts-container:-webkit-full-screen,
.highcharts-container:-moz-full-screen,
.highcharts-container:-ms-fullscreen,
*:fullscreen,
*:-webkit-full-screen,
*:-moz-full-screen,
*:-ms-fullscreen,
::backdrop,
*:fullscreen::backdrop,
*::backdrop {
    background: #ffffff !important;
    background-color: #ffffff !important;
}


