/* --- Responsive Web Designer Pro: High-Fidelity Admin Theme --- */

:root {
    /* Color Palette - Luminous SaaS Theme */
    --primary: #6366f1;
    /* Electric Indigo */
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;

    --secondary: #64748b;

    --success: #34d399;
    /* Radiant Emerald */
    --success-bg: #d1fae5;

    --error: #f87171;
    /* Bright Coral */
    --error-bg: #fee2e2;

    --warning: #fbbf24;
    /* Electric Amber */
    --warning-bg: #fef3c7;

    /* Backgrounds */
    --bg-body: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.9);

    /* Typography */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing & Borders */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    --border-color: #e2e8f0;

    /* Effects (The "WOW" Factor) */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    --bg-secondary: #f8fafc;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #312e81;
    --secondary: #94a3b8;
    --success: #10b981;
    --success-bg: #064e3b;
    --error: #ef4444;
    --error-bg: #7f1d1d;
    --warning: #f59e0b;
    --warning-bg: #78350f;
    --bg-body: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --bg-glass: rgba(30, 41, 59, 0.9);
    --bg-secondary: #334155;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -2px rgb(0 0 0 / 0.4);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

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

html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    max-width: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

img {
    max-width: 100%;
    display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

/* --- 2. Components --- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    border: none;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    background-image: none;
    /* Reset incase of conflicts */
    color: white;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.4);
}

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

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.btn-delete,
.btn-danger {
    background-color: var(--error-bg);
    color: var(--error);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-delete:hover,
.btn-danger:hover {
    background-color: #fee2e2;
    transform: translateY(-1px);
}

.btn-edit {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-edit:hover {
    background-color: #c7d2fe;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.message.success {
    background-color: var(--success-bg);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.message.error {
    background-color: var(--error-bg);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Inputs */
.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    padding-right: 2.5rem;
    /* Space for the eye icon */
}

.input-wrapper .input-icon+input {
    padding-left: 3rem !important;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

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

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    max-width: 100%;
    word-break: break-word;
    overflow: hidden;
    /* Prevent child breakout */
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-glass);
}

/* --- 3. Login Page Layout --- */
.admin-login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    position: relative;
    overflow: hidden;
}

/* Decorative background circle */
.admin-login-body::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0) 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    z-index: 0;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    border-radius: 24px;
    background: white;
    box-shadow: var(--shadow-xl, 0 20px 25px -5px rgb(0 0 0 / 0.1));
    position: relative;
    z-index: 10;
    text-align: center;
}

.login-card .logo {
    height: 48px;
    margin: 0 auto 1.5rem;
}

.login-card h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.login-card p.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* --- 4. Dashboard Layout (Holy Grail) --- */
.admin-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* Sidebar / Header */
.admin-header {
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    padding: 0 var(--spacing-lg);
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-title-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-titles {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.company-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin: 0;
    letter-spacing: -0.03em;
    text-transform: capitalize;
}

.page-subtitle {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
}



.admin-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

#themeToggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

#themeToggle:hover {
    color: var(--primary);
}


@media (max-width: 600px) {
    .admin-logo {
        height: 36px;
    }
}

/* Navigation Píldoras */
.main-nav {
    display: flex;
    gap: 0.25rem;
}

.main-nav a {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-nav a:hover {
    background-color: var(--bg-body);
    color: var(--primary);
}

.main-nav a.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Main Content Area */
.admin-main {
    padding: var(--spacing-xl);
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
    /* Guard against overflow */
}

/* Responsive Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.dashboard-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    transition: var(--transition-fast);
}

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

.dashboard-card .icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1.25rem;
}

.dashboard-card .icon.total {
    background: #eff6ff;
    color: #3b82f6;
}

.dashboard-card .icon.in {
    background: #ecfdf5;
    color: #10b981;
}

.dashboard-card .icon.out {
    background: #fef2f2;
    color: #ef4444;
}

.dashboard-card .info h3 {
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.dashboard-card .info p {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-mono);
}

/* Tables */
.full-width-table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    /* Scroll horizontal en móviles */
}

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

.employee-table th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--secondary);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.employee-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.employee-table tr:last-child td {
    border-bottom: none;
}


/* Status Badges */
.status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-dentro,
.status-in {
    background: var(--success-bg);
    color: #065f46;
}

.status-fuera,
.status-out {
    background: var(--error-bg);
    color: #991b1b;
}

.status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: currentColor;
}

/* Mobile Adjustments */
@media (max-width: 992px) {
    .admin-header {
        height: auto;
        padding: 0.75rem var(--spacing-md);
        display: grid;
        grid-template-columns: 1fr auto auto;
        align-items: center;
        gap: 0.5rem;
    }

    .header-title-group {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .header-title-group h1 {
        font-size: 1rem;
        font-weight: 700;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1000;
        background: var(--bg-sidebar);
        flex-direction: column;
        padding: 1rem;
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-xl);
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            transform: translateY(-10px);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav a {
        padding: 1rem;
        border-radius: var(--radius-md);
        margin-bottom: 0.25rem;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--primary-light);
        color: var(--primary);
        border-radius: 10px;
        cursor: pointer;
    }

    #themeToggle {
        margin-right: 0 !important;
    }

    .admin-main {
        padding: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .header-title-group h1 {
        display: none;
        /* Only logo on extra small */
    }

    .dash-card-premium {
        padding: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

/* Responsive Tables Enhanced */
@media (max-width: 768px) {
    .full-width-table-container {
        border: none;
        background: transparent;
        box-shadow: none;
    }

    .employee-table,
    .employee-table thead,
    .employee-table tbody,
    .employee-table th,
    .employee-table td,
    .employee-table tr {
        display: block;
    }

    .employee-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .employee-table tr {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-xl);
        margin-bottom: 1.5rem;
        padding: 1.25rem;
        box-shadow: var(--shadow-md);
        position: relative;
        overflow: hidden;
    }

    .employee-table tr::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--primary);
    }

    .employee-table td {
        border: none;
        border-bottom: 1px solid var(--divider);
        position: relative;
        padding-left: 45% !important;
        text-align: right;
        min-height: 3rem;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding-right: 0 !important;
    }

    .employee-table td:last-child {
        border-bottom: 0;
        margin-top: 0.5rem;
        padding-left: 0 !important;
        justify-content: center;
    }

    .employee-table td:before {
        position: absolute;
        top: 50%;
        left: 0;
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        transform: translateY(-50%);
        content: attr(data-label);
        font-weight: 800;
        text-align: left;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .employee-table td:last-child:before {
        display: none;
    }

    .status {
        margin-left: auto;
    }
}

/* --- 5. Specific Page Layouts --- */
.employees-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-xl);
    align-items: start;
}

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

.form-column {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 90px;
}

/* --- 6. Settings Page Styles --- */
.current-logo-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.current-logo-preview {
    max-width: 200px;
    max-height: 100px;
    display: block;
    margin-top: 1rem;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.schedule-table th,
.schedule-table td {
    border: 1px solid var(--border-color);
    padding: 1rem;
    text-align: left;
}

.schedule-table th {
    background-color: #f8fafc;
    font-weight: 600;
}

.schedule-table td:nth-child(2) {
    text-align: center;
}

.schedule-table input[type="time"] {
    width: 100%;
    min-width: 100px;
}

.schedule-table input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary);
}

/* --- 7. Reports Page Styles --- */
.report-page-container {
    display: grid;
    gap: var(--spacing-xl);
}

.report-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    align-items: end;
}

.report-results h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-main);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.summary-cards .card {
    text-align: center;
    padding: 1.5rem;
}

.summary-cards .card strong {
    display: block;
    font-size: 2rem;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* Footer Link Hover */
footer a:hover {
    color: var(--primary) !important;
}

footer a:hover i {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.report-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.location-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    transition: transform var(--transition-fast);
}

.location-button:hover:not(:disabled) {
    transform: scale(1.2);
}

.location-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Map Modal */
.map-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.map-modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}

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

.map-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

#map-container {
    height: 400px;
    width: 100%;
}

/* --- 8. Mass Clocking Page Styles --- */
.mass-clocking-container {
    display: flex;
    gap: var(--spacing-xl);
    align-items: flex-start;
}

@media (max-width: 900px) {
    .mass-clocking-container {
        flex-direction: column;
    }
}

.form-container {
    flex: 1;
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.schedule-display {
    flex: 1;
    background-color: #f8fafc;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.schedule-table-mini {
    width: 100%;
    border-collapse: collapse;
}

.schedule-table-mini th,
.schedule-table-mini td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0.5rem;
    text-align: left;
}

.schedule-table-mini th {
    background-color: transparent;
    font-weight: 600;
    color: var(--secondary);
}

.status-active {
    color: var(--success);
    font-weight: 600;
}

.status-inactive {
    color: var(--error);
    font-weight: 600;
}

/* --- 10. Settings & UI Components --- */
.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all var(--transition-fast);
    font-family: var(--font-main);
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Switch UI */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .4s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

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

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

/* Form Controls in Cards */
.settings-tab-content .card {
    padding: 2rem;
    animation: fadeIn 0.4s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setting-input {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

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

/* --- 11. Employee Profile Styles --- */
.profile-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .profile-header-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

.profile-title-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.profile-user-info h2 {
    font-size: 2rem;
    margin: 0;
    line-height: 1.1;
}

.profile-badges {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-role {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-pin {
    background: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .badge-pin {
    background: #334155;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card-premium {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.stat-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card-premium .bg-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.05;
    transform: rotate(-15deg);
}

.stat-card-premium .card-content {
    position: relative;
    z-index: 1;
}

.stat-card-premium .label {
    display: block;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.stat-card-premium .value {
    display: block;
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.stat-card-premium .trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.stat-pblue {
    border-left: 4px solid #3b82f6;
}

.stat-pgreen {
    border-left: 4px solid #10b981;
}

.stat-porange {
    border-left: 4px solid #f59e0b;
}

.stat-ppurple {
    border-left: 4px solid #8b5cf6;
}

.history-card {
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.history-card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.punch-list-table {
    width: 100%;
    border-collapse: collapse;
}

.punch-list-table th {
    text-align: left;
    padding: 1.25rem 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-secondary);
    letter-spacing: 0.05em;
}

.punch-list-table td {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.punch-list-table tr:hover td {
    background-color: var(--bg-secondary);
}

.punch-type-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.punch-type-in {
    background: var(--success-bg);
    color: var(--success);
}

.punch-type-out {
    background: var(--error-bg);
    color: var(--error);
}

.punch-time-cell {
    display: flex;
    flex-direction: column;
}

.punch-time-cell .date {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- 8. Electric Profile Styles --- */
.profile-header-container {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(to right, var(--bg-card), var(--primary-light));
}

[data-theme="dark"] .profile-header-container {
    background: linear-gradient(to right, var(--bg-card), #312e81);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
}

.profile-title-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.profile-user-info h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    color: var(--text-main);
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-actions {
    display: flex;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .profile-header-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-title-section {
        flex-direction: column;
    }

    .profile-badges {
        justify-content: center;
    }

    .profile-actions {
        width: 100%;
        flex-direction: column;
    }

    .profile-actions .btn {
        width: 100%;
        justify-content: center;
    }
}


.stat-card-premium {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.stat-card-premium:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.stat-card-premium.stat-pblue {
    border-bottom: 4px solid #6366f1;
}

.stat-card-premium.stat-pgreen {
    border-bottom: 4px solid #34d399;
}

.stat-card-premium.stat-porange {
    border-bottom: 4px solid #fbbf24;
}

.stat-card-premium.stat-ppurple {
    border-bottom: 4px solid #a855f7;
}

/* Status Badges */
.badge-status-in,
.badge-status-out {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-status-in {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-status-out {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-status-in .dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

.badge-status-out .dot {
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
}

.pulse .dot {
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}


.bg-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.05;
    transform: rotate(-15deg);
}

.trend {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
}

.punch-time-cell .hour {
    font-weight: 700;
    color: var(--text-main);
}

/* --- 9. Electric Dashboard Styles --- */
.dash-card-premium {
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    color: white;
    border: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.dash-card-premium:hover {
    transform: translateY(-8px);
}

.dash-card-premium .icon-container {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}

.dash-card-premium .info-group h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0 0 0.15rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-card-premium .info-group p {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
}

/* Gradients */
.card-electric-blue {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.card-electric-green {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 10px 20px -5px rgba(52, 211, 153, 0.4);
}

.card-electric-amber {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 10px 20px -5px rgba(251, 191, 36, 0.4);
}

/* Alerts Section */
.alerts-container {
    display: grid;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.alert-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid transparent;
    box-shadow: var(--shadow-sm);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-card.warning {
    border-left-color: var(--error);
    background: var(--error-bg);
}

.alert-card.info {
    border-left-color: var(--primary);
    background: var(--primary-light);
}

.alert-card i {
    font-size: 1.25rem;
}

.alert-card .alert-content b {
    display: block;
    font-size: 1rem;
}

.alert-card .alert-content span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- 12. Electric Settings Components --- */
.company-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    flex: 1;
}

.company-form-grid .full-width {
    grid-column: span 2;
}

.setting-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.setting-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.setting-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    outline: none;
}

.tab-btn {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Premium Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

input:checked+.slider::after {
    content: 'ON';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
}

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


/* --- 11. Electric Navigation & Header --- */
.main-nav a {
    position: relative;
    padding: 0.6rem 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
    overflow: hidden;
}

.main-nav a i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.main-nav a:hover i {
    transform: translateY(-2px);
}

.main-nav a.active {
    color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 0 8px var(--primary);
}

.nav-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--error);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 800;
    border: 2px solid var(--bg-sidebar);
    box-shadow: 0 2px 4px rgba(248, 113, 113, 0.4);
}


/* --- 10. Electric Employee Styles --- */
.employee-avatar-identicon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}

.badge-electric {
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-electric-indigo {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-electric-amber {
    background: #fef3c7;
    color: #d97706;
}

.badge-electric-emerald {
    background: #d1fae5;
    color: #059669;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-wrapper input {
    padding-left: 2.75rem !important;
}

/* --- 13. Grid & Layout Polish --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}


.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

/* Glassmorphism utility */
.glass-effect {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .glass-effect {
    background: rgba(30, 41, 59, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Quick Fix for spacing on mobile */
@media (max-width: 600px) {
    .admin-main {
        padding: 1rem;
    }

    .card {
        padding: 1.25rem;
    }

    .welcome-header h2 {
        font-size: 1.5rem !important;
    }
}

/* --- 14. Premium Login Styles --- */
.admin-login-body {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

[data-theme="dark"] .admin-login-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    border-radius: 24px;
    box-shadow:
        0 20px 40px -10px rgba(79, 70, 229, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .login-card {
    background: rgba(30, 41, 59, 0.8);
    box-shadow:
        0 20px 40px -10px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.login-card:hover {
    transform: translateY(-5px);
}

.login-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 1rem 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.login-card .subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.input-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    margin-left: 0.25rem;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    /* Increased to 3.5rem to fix overlap */
    /* Space for icon */
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--bg-body);
    color: var(--text-main);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
}

.input-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s;
}

.form-input:focus+.input-icon,
.form-input:focus~.input-icon {
    color: var(--primary);
}

.toggle-password {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
}

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

/* Premium Button Style */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    margin-top: 2rem;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
}

.btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px -1px rgba(79, 70, 229, 0.2);
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.footer-link:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.alert {
    background: var(--error-bg);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    text-align: left;
}

/* Force padding to prevent icon overlap */
.login-card .input-group .form-input {
    padding-left: 3.5rem !important;
}

/* --- Validated Settings Styles --- */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 992px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .branding-section {
        order: -1;
        margin-bottom: 2rem;
    }
}

.branding-section {
    background: var(--bg-body);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-align: center;
}

.switch-group {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-body);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.switch-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.tabs-nav {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0 !important;
    gap: 0.5rem !important;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--bg-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.settings-tab-content {
    padding-top: 1.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Profile & Dashboard Refactor --- */
.profile-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.profile-title-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.profile-user-info h2 {
    margin: 0 0 0.25rem 0;
    color: var(--text-main);
}

.profile-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.split-layout-2-1 {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 992px) {
    .split-layout-2-1 {
        grid-template-columns: 1fr;
    }

    .profile-header-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-title-section {
        flex-direction: column;
    }
}

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

.chart-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .chart-grid-2 {
        grid-template-columns: 1fr;
    }
}

.map-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.map-modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 700px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.map-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-body);
}

.map-container-box {
    height: 400px;
    width: 100%;
}

/* --- Employee Management --- */
.employees-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.employee-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease-out forwards;
}

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

.employee-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--text-muted);
}

.employee-card[data-role='admin']::before {
    background: var(--electric-emerald);
}

.employee-card[data-role='manager']::before {
    background: var(--electric-amber);
}

.employee-card[data-role='employee']::before {
    background: var(--primary);
}

.employee-avatar-large {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--bg-body);
    color: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border: 3px solid var(--bg-body);
    box-shadow: var(--shadow-sm);
}

.employee-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.employee-pin {
    background: var(--bg-body);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    letter-spacing: 1px;
}

.employee-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    margin-top: auto;
}

.employee-actions .btn {
    flex: 1;
    padding: 0.5rem;
    justify-content: center;
}

.toolbar-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.search-group {
    display: flex;
    align-items: center;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    flex: 1;
    min-width: 250px;
}

.search-group input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    margin-left: 0.5rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Reports & Legal --- */
.report-page-container {
    animation: fadeIn 0.3s ease;
}

.report-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.report-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.report-filter-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
}

.report-quick-filters {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.export-card {
    background: linear-gradient(to right, #f8fafc, #ffffff);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.export-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Legal Report */
.legal-report-wrapper {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 1000px;
    margin: 0 auto;
    color: black;
    border: 1px solid #eee;
    box-shadow: var(--shadow-lg);
}

.legal-report-container {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.4;
}

.legal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #000;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.official-seal {
    display: flex;
    gap: 20px;
    align-items: center;
}

.print-logo {
    height: 60px;
    filter: grayscale(1) contrast(1.5);
}

.report-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    color: #000;
}

.law-reference {
    font-size: 0.8rem;
    margin: 5px 0 0 0;
    color: #444;
}

.company-official-info {
    text-align: right;
}

.company-name-bold {
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0;
}

.company-detail {
    font-size: 0.85rem;
    margin: 2px 0 0 0;
    color: #333;
}

.employee-data-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.data-item {
    border: 1px solid #ccc;
    padding: 10px;
    background: #fcfcfc;
}

.data-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.data-value {
    font-size: 0.95rem;
    font-weight: 700;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.legal-table th,
.legal-table td {
    border: 1px solid #000;
    padding: 6px 4px;
    text-align: center;
}

.legal-table th {
    background: #f3f4f6;
    font-weight: 800;
    text-transform: uppercase;
}

.day-cell {
    background: #f9fafb;
    font-weight: 700;
}

.day-cell .num {
    font-size: 0.9rem;
}

.day-cell .name {
    font-size: 0.6rem;
    color: #555;
    display: block;
}

.weekend-row {
    background: #f1f5f9;
}

.total-cell {
    font-weight: 800;
}

.summary-row {
    background: #e5e7eb;
    font-weight: 800;
}

.signatures-area {
    margin-top: 50px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.signature-box {
    text-align: center;
}

.signature-line {
    height: 80px;
    border-bottom: 1px solid #000;
    margin-bottom: 10px;
}

.signature-label {
    font-weight: 800;
    font-size: 0.75rem;
    margin: 0;
    text-transform: uppercase;
}

.footer-legal-notice {
    margin-top: 40px;
    font-size: 0.65rem;
    color: #555;
    line-height: 1.5;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

@media print {
    @page {
        size: A4;
        margin: 1cm;
    }

    body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .no-print,
    header,
    nav,
    footer,
    .menu-toggle,
    #themeToggle,
    .admin-sidebar {
        display: none !important;
    }

    .legal-report-wrapper {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        box-shadow: none !important;
    }

    .admin-main,
    .admin-container {
        padding: 0 !important;
        margin: 0 !important;
    }

    .legal-table th {
        background: #eee !important;
        -webkit-print-color-adjust: exact;
    }

    .weekend-row {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
    }

    .summary-row {
        background: #ddd !important;
        -webkit-print-color-adjust: exact;
    }
}

/* --- Notifications --- */
.alerts-container-flex {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert-card {
    display: flex;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.alert-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.alert-card.warning {
    border-left: 4px solid var(--warning);
    background: #fffbf0;
}

.alert-card.info {
    border-left: 4px solid var(--info);
    background: #f0f9ff;
}

.alert-icon {
    font-size: 1.25rem;
    margin-right: 1rem;
    margin-top: 0.25rem;
}

.alert-card.warning .alert-icon {
    color: var(--warning);
}

.alert-card.info .alert-icon {
    color: var(--info);
}

.alert-content {
    flex: 1;
}

.alert-title {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.alert-message {
    margin: 0 0 0.75rem 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.alert-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.alert-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}