:root {
    --bg-dark: #070913;
    --bg-dark-gray: #0d1127;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-focus: rgba(99, 102, 241, 0.4);
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --secondary: #10b981;
    --secondary-glow: rgba(16, 185, 129, 0.2);
    
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.25);
    --accent-orange: #f59e0b;
    --accent-orange-glow: rgba(245, 158, 11, 0.2);
    
    --text-white: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Vibrant Backdrop Glows */
.glow-bg {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    z-index: -1;
    pointer-events: none;
}

.glow-bg-secondary {
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
    z-index: -1;
    pointer-events: none;
}

/* Navbar glassmorphism */
.navbar {
    background: rgba(7, 9, 19, 0.95);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-white);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.logo-icon {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary));
}

.logo-accent {
    background: linear-gradient(135deg, var(--primary) 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    color: var(--text-white);
    background: var(--glass-bg-hover);
}

.nav-link.active {
    color: var(--text-white);
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-logout {
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: color 0.3s;
    background: none;
    border: none;
    cursor: pointer;
}

.btn-logout:hover {
    color: var(--accent-red);
}

/* Main Container Layout */
.main-content {
    flex: 1;
    max-width: 1300px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Glass Cards */
.card {
    background: rgba(13, 17, 39, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Headings */
h1, h2, h3, h4 {
    font-weight: 700;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #fff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
}

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: rgba(13, 17, 39, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
}

.stat-info h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-info .value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
}

.stat-icon {
    font-size: 2rem;
    color: var(--primary);
    opacity: 0.8;
}

.stat-card.anomaly-card {
    border-color: rgba(239, 68, 68, 0.2);
}

.stat-card.anomaly-card:hover {
    border-color: var(--accent-red);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.15);
}

.stat-card.anomaly-card .stat-icon {
    color: var(--accent-red);
}

/* Forms & UI Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-white);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: var(--glass-bg-hover);
}

.btn-success {
    background: var(--secondary);
    color: #fff;
    box-shadow: 0 4px 15px var(--secondary-glow);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-red-glow);
}

.btn-danger:hover {
    background: #dc2626;
}

/* Tables & Grid Responsiveness */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background: rgba(255, 255, 255, 0.01);
    padding: 0.75rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.custom-table td {
    padding: 0.75rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.88rem;
    color: var(--text-white);
    vertical-align: middle;
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

.grid-sidebar-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
    width: 100%;
}

@media (max-width: 992px) {
    .grid-sidebar-layout {
        grid-template-columns: 1fr;
    }
}

/* Badges and Tags */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge-normal {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

.badge-anomaly {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
    animation: flash-border 2s infinite;
}

.badge-holiday {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.2);
}

.badge-absence {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.2);
}

.badge-manual {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border-color: rgba(139, 92, 246, 0.3);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
}

@keyframes flash-border {
    0% { border-color: rgba(239, 68, 68, 0.2); }
    50% { border-color: rgba(239, 68, 68, 0.6); }
    100% { border-color: rgba(239, 68, 68, 0.2); }
}

/* Anomaly Table Highlighting */
.row-anomaly {
    background: rgba(239, 68, 68, 0.02);
}

.row-anomaly:hover td {
    background: rgba(239, 68, 68, 0.04) !important;
}

/* Alert Boxes */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.2);
}

/* Smart Suggestion UI Block */
.suggestion-box {
    background: rgba(99, 102, 241, 0.08);
    border: 1px dashed var(--primary);
    border-radius: 16px;
    padding: 1.25rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.suggestion-header {
    font-weight: 600;
    color: #a5b4fc;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-text {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.btn-apply-suggestion {
    align-self: flex-start;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-apply-suggestion:hover {
    background: #4f46e5;
}

/* Action Icons and Buttons in tables */
.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.25rem;
}

.btn-icon:hover {
    color: #fff;
}

.btn-icon.edit-icon:hover {
    color: var(--accent-orange);
}

.btn-icon.delete-icon:hover {
    color: var(--accent-red);
}

/* Login Card Spec */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.login-card {
    max-width: 420px;
    width: 100%;
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary);
    filter: drop-shadow(0 0 15px var(--primary));
    margin-bottom: 1rem;
}

/* Footer layout */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 2rem 0;
    background: rgba(7, 9, 19, 0.5);
    margin-top: auto;
}

.footer-container {
    max-width: 1300px;
    margin: 0 auto;
    text-align: center;
    padding: 0 2rem;
}

.footer-container p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-sub {
    font-size: 0.75rem !important;
    color: var(--text-dim) !important;
    margin-top: 0.5rem;
}

/* Calendar Filter Grid */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.filter-bar .form-group {
    margin-bottom: 0;
}

/* Styled Dropdown Option elements to respect theme and be fully legible */
.form-control option {
    background-color: var(--bg-dark-gray);
    color: var(--text-white);
    padding: 10px;
}

/* Floating Toast Notifications (Top Right) */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 420px;
    width: calc(100% - 48px);
    pointer-events: none;
}

.toast-notification {
    pointer-events: auto;
    background: rgba(13, 17, 39, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0.9rem 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: #fff;
    font-size: 0.9rem;
    animation: toast-in 0.35 cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast-notification.toast-success {
    border-left: 4px solid var(--secondary);
}

.toast-notification.toast-danger {
    border-left: 4px solid var(--accent-red);
}

.toast-notification.toast-info {
    border-left: 4px solid var(--primary);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Sub-navigation Layout (Slim Left Sidebar + Main Content) */
.grid-sidebar-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 992px) {
    .grid-sidebar-layout {
        grid-template-columns: 1fr;
    }
}

