/* ============================================================
   EMS - Enterprise Management System
   Premium SaaS Dashboard Theme
   Design: Clean, Modern, Professional
   Colors: White(#F8FAFC), Blue(#2563EB), Emerald, Orange, Red
   Version: 2.0
   ============================================================ */

/* === CSS Variables === */
:root {
    /* Primary Colors */
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --primary-bg: #EFF6FF;
    
    /* Secondary Colors */
    --secondary: #64748B;
    --success: #059669;
    --success-light: #D1FAE5;
    --warning: #D97706;
    --warning-light: #FEF3C7;
    --danger: #DC2626;
    --danger-light: #FEE2E2;
    --info: #0284C7;
    --info-light: #E0F2FE;
    --purple: #7C3AED;
    --purple-light: #EDE9FE;
    --pink: #DB2777;
    --pink-light: #FCE7F3;
    --orange: #EA580C;
    --orange-light: #FFF7ED;
    
    /* Gray Scale */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    
    /* Text Colors */
    --text-color: #1E293B;
    --text-muted: #94A3B8;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --card-shadow: 0 1px 3px rgba(0,0,0,0.08);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    /* Sizes */
    --sidebar-width: 260px;
    --header-height: 64px;
    
    /* Transitions */
    --transition: all 0.3s ease;
    
    /* Font */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--gray-50);
    color: var(--gray-700);
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--gray-800);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

/* === Sidebar === */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
    z-index: 1050;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 12px;
}
.sidebar-brand .brand-logo {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}
.sidebar-brand .brand-text {
    flex: 1;
}
.sidebar-brand .brand-text h6 {
    color: white;
    font-size: 1rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.sidebar-brand .brand-text small {
    color: var(--gray-400);
    font-size: 0.7rem;
}

.sidebar-menu {
    padding: 12px 0;
}
.sidebar-menu .menu-label {
    padding: 16px 20px 6px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    font-weight: 600;
}
.sidebar-menu .nav-item {
    position: relative;
}
.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--gray-400);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}
.sidebar-menu .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}
.sidebar-menu .nav-link.active {
    color: white;
    background: rgba(37,99,235,0.15);
    border-left-color: var(--primary);
}
.sidebar-menu .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}
.sidebar-menu .nav-link .badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 20px;
}
.sidebar-menu .nav-link .arrow {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.2s;
}
.sidebar-menu .nav-link[aria-expanded="true"] .arrow {
    transform: rotate(90deg);
}
.sidebar-menu .sub-menu {
    padding-left: 0;
    list-style: none;
    background: rgba(0,0,0,0.15);
}
.sidebar-menu .sub-menu .nav-link {
    padding-left: 55px;
    font-size: 0.8rem;
}

/* === Main Content Area === */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* === Header/Navbar === */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 24px;
    height: var(--header-height);
    display: flex;
    align-items: center;
}
.main-header .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.main-header .sidebar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
}
.main-header .sidebar-toggle:hover { background: var(--gray-200); }
.main-header .header-search {
    position: relative;
    width: 300px;
}
.main-header .header-search input {
    width: 100%;
    padding: 8px 16px 8px 38px;
    border: 1px solid var(--gray-200);
    border-radius: 50px;
    background: var(--gray-100);
    font-size: 0.8rem;
    transition: all 0.2s;
    outline: none;
}
.main-header .header-search input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}
.main-header .header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 0.85rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.header-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    position: relative;
    transition: all 0.2s;
}
.header-btn:hover { background: var(--gray-200); color: var(--gray-800); }
.header-btn .notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

/* === User Dropdown === */
.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
}
.user-dropdown:hover { background: var(--gray-100); }
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}
.user-info { text-align: left; }
.user-info .name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.2;
}
.user-info .role {
    font-size: 0.65rem;
    color: var(--gray-500);
}

/* === Notification Dropdown === */
.notif-dropdown {
    width: 360px;
    max-height: 420px;
    padding: 0;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}
.notif-dropdown .notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-200);
    background: white;
}
.notif-dropdown .notif-header h6 { margin: 0; font-size: 0.9rem; }
.notif-dropdown .notif-body {
    max-height: 320px;
    overflow-y: auto;
}
.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 18px;
    transition: background 0.2s;
    border-bottom: 1px solid var(--gray-100);
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--primary-bg); }

/* Arrived since the admin's last sign-in. Cleared when the bell is opened,
   so a notification is only ever announced as new once. */
.notif-item.is-new {
    background: var(--primary-bg);
    border-left: 3px solid var(--primary, #2563eb);
    padding-left: 15px;
}
.notif-new-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--primary, #2563eb);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    vertical-align: middle;
}
.header-btn .notif-dot.has-new {
    animation: notifPulse 1.6s ease-out infinite;
}
@keyframes notifPulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
/* A reader who prefers no motion still gets the colour and the badge. */
@media (prefers-reduced-motion: reduce) {
    .header-btn .notif-dot.has-new { animation: none; }
}
.notif-item .notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}
.notif-item .notif-content { flex: 1; min-width: 0; }
.notif-item .notif-content .title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}
.notif-item .notif-content .message {
    font-size: 0.75rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item .notif-content .time {
    font-size: 0.65rem;
    color: var(--gray-400);
    margin-top: 2px;
}
.notif-dropdown .notif-footer {
    padding: 10px 18px;
    text-align: center;
    border-top: 1px solid var(--gray-200);
    background: white;
}
.notif-dropdown .notif-footer a {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

/* === Page Content === */
.page-content {
    padding: 24px;
}

/* === Greeting Section === */
.greeting-section {
    background: linear-gradient(135deg, var(--primary) 0%, #1D4ED8 100%);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    color: white;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.greeting-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.greeting-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: 10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
}
.greeting-section h2 {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 4px;
    position: relative;
}
.greeting-section p {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    margin: 0;
    position: relative;
}
.greeting-section .greeting-icon {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 4rem;
    opacity: 0.15;
}

/* === Stat Cards === */
.stat-card {
    position: relative;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: white;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Stat Icon Background - for dashboard cards */
.stat-icon-bg {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    opacity: 0.12;
}

.stat-card .stat-body { position: relative; }
.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
    margin-bottom: 4px;
}
.stat-card .stat-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
}
.stat-card .stat-footer .trend-up { color: var(--success); }
.stat-card .stat-footer .trend-down { color: var(--danger); }
.stat-card .stat-footer .trend-neutral { color: var(--gray-400); }
.stat-card .stat-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

/* Counter Animation for Numbers */
.counter-animate {
    animation: counterPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes counterPop {
    0% { opacity: 0; transform: scale(0.5) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* === Card Component === */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: white;
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    background: white;
    border-bottom: 1px solid var(--gray-100);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header .card-actions {
    display: flex;
    gap: 8px;
}
.card-body { padding: 20px; }

/* Card Accent Variants */
.card-accent-primary { border-left: 4px solid var(--primary); }
.card-accent-success { border-left: 4px solid var(--success); }
.card-accent-warning { border-left: 4px solid var(--warning); }
.card-accent-danger { border-left: 4px solid var(--danger); }
.card-accent-info { border-left: 4px solid var(--info); }
.card-accent-purple { border-left: 4px solid var(--purple); }
.card-accent-pink { border-left: 4px solid var(--pink); }
.card-accent-orange { border-left: 4px solid var(--orange); }

/* Card Hover Variants */
.card-hover-primary:hover { border-color: var(--primary); box-shadow: 0 4px 20px rgba(37,99,235,0.12); }
.card-hover-success:hover { border-color: var(--success); box-shadow: 0 4px 20px rgba(5,150,105,0.12); }
.card-hover-warning:hover { border-color: var(--warning); box-shadow: 0 4px 20px rgba(217,119,6,0.12); }
.card-hover-danger:hover { border-color: var(--danger); box-shadow: 0 4px 20px rgba(220,38,38,0.12); }

/* === Charts === */
.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
}
.chart-container canvas { max-height: 280px; }

/* === Table === */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table {
    margin-bottom: 0;
    font-size: 0.82rem;
}
.table thead th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
.table tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}
.table tbody tr {
    transition: background 0.15s;
}
.table tbody tr:hover { background: var(--gray-50); }
.table .sort-icon { font-size: 0.6rem; margin-left: 4px; opacity: 0.4; cursor: pointer; }
.table .sort-icon.active { opacity: 1; color: var(--primary); }

.dataTables_wrapper .dataTables_filter {
    margin-bottom: 12px;
}
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.8rem;
    outline: none;
    margin-left: 8px;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 0.8rem;
    outline: none;
}
.dataTables_info { font-size: 0.78rem; color: var(--gray-500); }
.dataTables_paginate { margin-top: 8px; }
.dataTables_paginate .paginate_button {
    padding: 4px 12px;
    margin: 0 2px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}
.dataTables_paginate .paginate_button.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.dataTables_paginate .paginate_button:hover:not(.current) {
    background: var(--gray-100);
}

/* === Badges - Complete Set === */
.badge {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Status Badges */
.badge-present { background: var(--success-light); color: #065F46; }
.badge-late { background: var(--warning-light); color: #92400E; }
.badge-absent { background: var(--danger-light); color: #991B1B; }
.badge-half-day { background: var(--info-light); color: #075985; }

/* Leave Badges */
.badge-pending { background: var(--warning-light); color: #92400E; }
.badge-approved { background: var(--success-light); color: #065F46; }
.badge-rejected { background: var(--danger-light); color: #991B1B; }

/* Task Badges */
.badge-completed { background: var(--success-light); color: #065F46; }
.badge-cancelled { background: var(--gray-200); color: var(--gray-600); }
.badge-in-progress { background: var(--info-light); color: #075985; }
.badge-on-hold { background: var(--warning-light); color: #92400E; }

/* Priority Badges */
.badge-urgent { background: var(--danger-light); color: #991B1B; }
.badge-new { background: var(--primary-light); color: var(--primary-dark); }

/* Legacy Badge Classes */
.badge-success { background: var(--success-light); color: #065F46; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-danger { background: var(--danger-light); color: #991B1B; }
.badge-info { background: var(--info-light); color: #075985; }
.badge-purple { background: var(--purple-light); color: #5B21B6; }
.badge-pink { background: var(--pink-light); color: #9D174D; }
.badge-orange { background: var(--orange-light); color: #9A3412; }

/* === Status Indicators === */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot.green { background: var(--success); }
.status-dot.red { background: var(--danger); }
.status-dot.yellow { background: var(--warning); }
.status-dot.blue { background: var(--info); }
.status-dot.gray { background: var(--gray-400); }
.status-dot.purple { background: var(--purple); }

/* === Quick Action Buttons === */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--gray-700);
}
.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--gray-800);
    border-color: transparent;
}
.quick-action-btn i {
    font-size: 1.4rem;
}
.quick-action-btn span {
    font-size: 0.72rem;
    font-weight: 500;
    text-align: center;
}

/* Quick Action Button Colors */
.quick-action-btn.blue { background: var(--primary-light); color: var(--primary); border: 1px solid transparent; }
.quick-action-btn.blue:hover { background: var(--primary); color: white; border-color: var(--primary); }

.quick-action-btn.green { background: var(--success-light); color: var(--success); border: 1px solid transparent; }
.quick-action-btn.green:hover { background: var(--success); color: white; border-color: var(--success); }

.quick-action-btn.purple { background: var(--purple-light); color: var(--purple); border: 1px solid transparent; }
.quick-action-btn.purple:hover { background: var(--purple); color: white; border-color: var(--purple); }

.quick-action-btn.info { background: var(--info-light); color: var(--info); border: 1px solid transparent; }
.quick-action-btn.info:hover { background: var(--info); color: white; border-color: var(--info); }

.quick-action-btn.orange { background: var(--orange-light); color: var(--orange); border: 1px solid transparent; }
.quick-action-btn.orange:hover { background: var(--orange); color: white; border-color: var(--orange); }

.quick-action-btn.pink { background: var(--pink-light); color: var(--pink); border: 1px solid transparent; }
.quick-action-btn.pink:hover { background: var(--pink); color: white; border-color: var(--pink); }

.quick-action-btn.red { background: var(--danger-light); color: var(--danger); border: 1px solid transparent; }
.quick-action-btn.red:hover { background: var(--danger); color: white; border-color: var(--danger); }

/* === Timeline === */
.timeline {
    position: relative;
    padding-left: 28px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--gray-200);
}
.timeline-item {
    position: relative;
    padding-bottom: 16px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item .timeline-dot {
    position: absolute;
    left: -22px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--gray-300);
}
.timeline-item .timeline-dot.blue { background: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.timeline-item .timeline-dot.green { background: var(--success); box-shadow: 0 0 0 2px var(--success-light); }
.timeline-item .timeline-dot.orange { background: var(--warning); box-shadow: 0 0 0 2px var(--warning-light); }
.timeline-item .timeline-dot.red { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-light); }
.timeline-item .timeline-dot.purple { background: var(--purple); box-shadow: 0 0 0 2px var(--purple-light); }
.timeline-item .timeline-dot.pink { background: var(--pink); box-shadow: 0 0 0 2px var(--pink-light); }

.timeline-item .timeline-time {
    font-size: 0.65rem;
    color: var(--gray-400);
    margin-bottom: 2px;
}
.timeline-item .timeline-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}
.timeline-item .timeline-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* === Department Cards === */
.dept-card {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    background: white;
    transition: all 0.3s;
}
.dept-card:hover {
    box-shadow: var(--shadow-md);
    border-color: transparent;
}
.dept-card .dept-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 10px;
}
.dept-card .dept-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}
.dept-card .dept-stat {
    text-align: center;
    flex: 1;
}
.dept-card .dept-stat .num {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
}
.dept-card .dept-stat .label {
    font-size: 0.65rem;
    color: var(--gray-500);
    text-transform: uppercase;
}
.dept-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--gray-100);
    overflow: hidden;
}
.dept-progress .bar {
    height: 100%;
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === Right Sidebar Widgets === */
.right-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 24px);
}
.right-widget {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}
.right-widget .widget-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Widget Birthday */
.widget-birthday {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}
.widget-birthday:last-child { border-bottom: none; }
.widget-birthday .bday-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pink-light);
    color: var(--pink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.widget-birthday .bday-info .name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-800);
}
.widget-birthday .bday-info .dept {
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* Widget Holiday */
.widget-holiday {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}
.widget-holiday:last-child { border-bottom: none; }
.widget-holiday .holiday-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--orange-light);
    color: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.widget-holiday .holiday-info .name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gray-800);
}
.widget-holiday .holiday-info .date {
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* === Calendar Widget === */
.calendar-widget table {
    width: 100%;
    border-collapse: collapse;
}
.calendar-widget th {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--gray-500);
    padding: 6px 2px;
    text-align: center;
    font-weight: 600;
}
.calendar-widget td {
    text-align: center;
    padding: 6px 2px;
    font-size: 0.78rem;
    color: var(--gray-700);
    border-radius: var(--radius-sm);
    cursor: default;
}
.calendar-widget td.today {
    background: var(--primary);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-sm);
}
.calendar-widget td.event {
    color: var(--primary);
    font-weight: 600;
    position: relative;
}
.calendar-widget td.event::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
}
.calendar-widget td.other-month { color: var(--gray-300); }
.calendar-widget .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.calendar-widget .calendar-header h6 { margin: 0; font-size: 0.85rem; }
.calendar-widget .calendar-header button {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.calendar-widget .calendar-header button:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* === Weather Widget === */
.weather-widget {
    text-align: center;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border-color: transparent;
    color: white;
}
.weather-widget .weather-icon { font-size: 2.5rem; margin-bottom: 4px; }
.weather-widget .weather-temp {
    font-size: 2rem;
    font-weight: 700;
    color: white;
}
.weather-widget .weather-desc {
    font-size: 0.85rem;
    opacity: 0.8;
}
.weather-widget .weather-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 8px;
    font-size: 0.75rem;
    opacity: 0.7;
}
.weather-widget .weather-details i { margin-right: 4px; }

/* === Quote Widget === */
.quote-widget {
    background: linear-gradient(135deg, var(--primary) 0%, #1D4ED8 100%);
    border-color: transparent;
    color: white;
}
.quote-widget .quote-icon {
    font-size: 1.5rem;
    opacity: 0.3;
    margin-bottom: 8px;
}
.quote-widget .quote-text {
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.5;
    opacity: 0.95;
}
.quote-widget .quote-author {
    font-size: 0.72rem;
    margin-top: 8px;
    opacity: 0.7;
}

/* === Buttons === */
.btn {
    font-weight: 500;
    font-size: 0.82rem;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-sm { padding: 5px 12px; font-size: 0.75rem; }
.btn-xs { padding: 3px 10px; font-size: 0.7rem; border-radius: 4px; }
.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* === Dropdown Menu === */
.dropdown-menu {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 6px;
    min-width: 180px;
}
.dropdown-menu .dropdown-item {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s;
}
.dropdown-menu .dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}
.dropdown-menu .dropdown-item i { width: 18px; text-align: center; }
.dropdown-divider { margin: 4px 0; border-color: var(--gray-100); }

/* === Modal === */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}
.modal-header {
    border-bottom: 1px solid var(--gray-100);
    padding: 16px 20px;
}
.modal-body { padding: 20px; }
.modal-footer {
    border-top: 1px solid var(--gray-100);
    padding: 14px 20px;
}
.modal-title { font-size: 1rem; font-weight: 600; }

/* === Form Controls === */
.form-control, .form-select {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.82rem;
    transition: all 0.2s;
    background: white;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-label { font-size: 0.82rem; font-weight: 500; color: var(--gray-700); margin-bottom: 4px; }

/* === Loading Skeleton === */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === Animations === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.animate-fade-in { animation: fadeIn 0.5s ease both; }
.animate-fade-up { animation: fadeInUp 0.5s ease both; }
.animate-slide-left { animation: slideInLeft 0.5s ease both; }
.animate-slide-right { animation: slideInRight 0.5s ease both; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* Stagger Animations */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}
.empty-state i {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 16px;
}
.empty-state h6 { color: var(--gray-500); font-size: 0.9rem; }
.empty-state p { color: var(--gray-400); font-size: 0.78rem; }

/* === Export Buttons === */
.export-btn {
    padding: 6px 14px;
    font-size: 0.72rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-600);
}
.export-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* === Page Header with Breadcrumbs === */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.page-header h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-header h4 i { color: var(--primary); }
.breadcrumb {
    background: none;
    padding: 0;
    margin: 4px 0 0;
    font-size: 0.78rem;
}
.breadcrumb-item a { color: var(--gray-500); }
.breadcrumb-item.active { color: var(--gray-700); font-weight: 500; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--gray-300); }

/* === Section Title === */
.section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* === Profile / Employee Card === */
.profile-card {
    text-align: center;
    padding: 32px 20px 24px;
}
.profile-card .profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 16px;
    border: 4px solid white;
    box-shadow: 0 4px 16px rgba(37,99,235,0.15);
}
.profile-card .profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.profile-card .profile-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 2px;
}
.profile-card .profile-role {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}
.profile-card .profile-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.78rem;
    color: var(--gray-500);
}
.profile-card .profile-meta i { margin-right: 4px; }

/* === Detail/Info Row === */
.info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}
.info-row:last-child { border-bottom: none; }
.info-row .info-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-500);
}
.info-row .info-value {
    flex: 1;
    font-size: 0.85rem;
    color: var(--gray-800);
    font-weight: 500;
}

/* === Filter Panel === */
.filter-panel {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
}
.filter-panel .filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
}
.filter-panel .filter-row .filter-group {
    flex: 1;
    min-width: 160px;
}
.filter-panel .filter-row .filter-group label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 4px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* === Search Box === */
.search-box {
    position: relative;
}
.search-box input {
    padding-left: 36px;
    border-radius: 50px;
}
.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

/* === Tabs === */
.nav-tabs {
    border-bottom: 1px solid var(--gray-200);
    gap: 4px;
}
.nav-tabs .nav-link {
    border: none;
    color: var(--gray-500);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all 0.2s;
    position: relative;
}
.nav-tabs .nav-link:hover {
    color: var(--gray-700);
    background: var(--gray-50);
}
.nav-tabs .nav-link.active {
    color: var(--primary);
    background: transparent;
    font-weight: 600;
}
.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}
.nav-tabs .nav-link i { margin-right: 6px; font-size: 0.8rem; }
.tab-content { padding-top: 20px; }

/* === Pills === */
.nav-pills .nav-link {
    color: var(--gray-600);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.2s;
}
.nav-pills .nav-link:hover { background: var(--gray-100); }
.nav-pills .nav-link.active {
    background: var(--primary);
    color: white;
}

/* === Progress Steps / Stepper === */
.steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 32px;
}
.steps::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 30px;
    right: 30px;
    height: 2px;
    background: var(--gray-200);
    z-index: 0;
}
.step {
    text-align: center;
    position: relative;
    z-index: 1;
}
.step .step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0 auto 8px;
    transition: all 0.3s;
}
.step.completed .step-circle { background: var(--success); color: white; }
.step.active .step-circle { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.step .step-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    font-weight: 500;
    max-width: 80px;
    margin: 0 auto;
}
.step.active .step-label { color: var(--primary); font-weight: 600; }
.step.completed .step-label { color: var(--success); }

/* === Kanban Board === */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.kanban-column {
    min-width: 260px;
    max-width: 300px;
    flex: 1;
}
.kanban-column .kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--gray-50);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-weight: 600;
    font-size: 0.82rem;
}
.kanban-column .kanban-header .count {
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
}
.kanban-column .kanban-body {
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 8px;
    min-height: 200px;
}
.kanban-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--gray-200);
}
.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.kanban-card .kanban-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}
.kanban-card .kanban-meta {
    font-size: 0.7rem;
    color: var(--gray-500);
    display: flex;
    gap: 8px;
    align-items: center;
}

/* === Stat Comparison Mini Cards === */
.stat-compact {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: white;
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
}
.stat-compact:hover {
    box-shadow: var(--shadow-md);
    border-color: transparent;
}
.stat-compact .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.stat-compact .stat-info { flex: 1; min-width: 0; }
.stat-compact .stat-info .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}
.stat-compact .stat-info .label {
    font-size: 0.72rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.stat-compact .stat-change {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-align: center;
}
.stat-compact .stat-change.up { background: var(--success-light); color: #065F46; }
.stat-compact .stat-change.down { background: var(--danger-light); color: #991B1B; }

/* === Avatar Sizes === */
.avatar-xs { width: 24px; height: 24px; font-size: 0.6rem; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.7rem; }
.avatar-md { width: 40px; height: 40px; font-size: 0.85rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar-xxl { width: 100px; height: 100px; font-size: 2rem; }

/* === Avatar Group === */
.avatar-group {
    display: flex;
}
.avatar-group .user-avatar,
.avatar-group .avatar-xs,
.avatar-group .avatar-sm {
    border: 2px solid white;
    margin-left: -8px;
}
.avatar-group .user-avatar:first-child,
.avatar-group .avatar-xs:first-child,
.avatar-group .avatar-sm:first-child { margin-left: 0; }
.avatar-group .avatar-more {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    border: 2px solid white;
    margin-left: -8px;
}

/* === File Upload === */
.file-upload {
    position: relative;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--gray-50);
}
.file-upload:hover { border-color: var(--primary); background: var(--primary-bg); }
.file-upload input[type="file"] {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}
.file-upload i {
    font-size: 2.5rem;
    color: var(--gray-300);
    margin-bottom: 12px;
}
.file-upload p {
    font-size: 0.82rem;
    color: var(--gray-500);
    margin: 0;
}
.file-upload p strong { color: var(--primary); }
.file-upload.has-file {
    border-color: var(--success);
    background: var(--success-light);
}

/* === Notice / Alert Card === */
.notice-card {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    background: white;
    margin-bottom: 12px;
    transition: all 0.2s;
    border: 1px solid var(--gray-200);
    border-left-width: 4px;
}
.notice-card:hover { box-shadow: var(--shadow-sm); }
.notice-card .notice-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}
.notice-card .notice-meta {
    font-size: 0.72rem;
    color: var(--gray-500);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.notice-card .notice-desc {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 8px;
}

/* === Attendance Status Grid === */
.attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 6px;
}
.attendance-grid .att-day {
    text-align: center;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
}
.attendance-grid .att-day.present { background: var(--success-light); color: #065F46; }
.attendance-grid .att-day.late { background: var(--warning-light); color: #92400E; }
.attendance-grid .att-day.absent { background: var(--danger-light); color: #991B1B; }
.attendance-grid .att-day.holiday { background: var(--info-light); color: #075985; }
.attendance-grid .att-day.leave { background: var(--purple-light); color: #5B21B6; }
.attendance-grid .att-day .date-num {
    font-size: 0.85rem;
    display: block;
    margin-bottom: 2px;
}

/* === Tooltip Custom === */
.tooltip-custom {
    position: relative;
    cursor: pointer;
}
.tooltip-custom:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 100;
}

/* === List Group Enhancements === */
.list-group-item {
    border-color: var(--gray-100);
    padding: 12px 16px;
}
.list-group-item-action {
    transition: all 0.15s;
}
.list-group-item-action:hover {
    background: var(--gray-50);
}
.list-group-item.active {
    background: var(--primary);
    border-color: var(--primary);
}

/* === Alert Enhancements === */
.alert {
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}
.alert-success { background: var(--success-light); color: #065F46; }
.alert-danger { background: var(--danger-light); color: #991B1B; }
.alert-warning { background: var(--warning-light); color: #92400E; }
.alert-info { background: var(--info-light); color: #075985; }
.alert-dismissible .btn-close { padding: 1rem; }

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast-custom {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 14px 18px;
    min-width: 300px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--primary);
    animation: slideInRight 0.3s ease;
}
.toast-custom.success { border-left-color: var(--success); }
.toast-custom.error { border-left-color: var(--danger); }
.toast-custom.warning { border-left-color: var(--warning); }
.toast-custom .toast-icon { font-size: 1.2rem; }
.toast-custom .toast-content { flex: 1; }
.toast-custom .toast-content .toast-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-800);
}
.toast-custom .toast-content .toast-msg {
    font-size: 0.75rem;
    color: var(--gray-500);
}
.toast-custom .toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
}
.toast-custom .toast-close:hover { color: var(--gray-600); }

/* === Responsive Table Card === */
.table-card .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}
.table-card .table-header h6 { margin: 0; font-size: 0.9rem; }
.table-card .table-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.table-card .table-toolbar .search-box { width: 220px; }

/* === Color Utilities === */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-purple { color: var(--purple) !important; }
.text-pink { color: var(--pink) !important; }
.text-orange { color: var(--orange) !important; }

.bg-soft-primary { background: var(--primary-light) !important; }
.bg-soft-success { background: var(--success-light) !important; }
.bg-soft-warning { background: var(--warning-light) !important; }
.bg-soft-danger { background: var(--danger-light) !important; }
.bg-soft-info { background: var(--info-light) !important; }
.bg-soft-purple { background: var(--purple-light) !important; }
.bg-soft-pink { background: var(--pink-light) !important; }
.bg-soft-orange { background: var(--orange-light) !important; }

/* === Spacing Utilities === */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }

/* === Text Utilities === */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.lh-sm { line-height: 1.3; }

/* === Width Utilities === */
.w-xs { width: 80px; }
.w-sm { width: 120px; }
.w-md { width: 180px; }
.w-lg { width: 260px; }

/* === Min-height for empty states === */
.min-h-200 { min-height: 200px; }
.min-h-300 { min-height: 300px; }

/* === Hover Lift === */
.hover-lift { transition: transform 0.2s, box-shadow 0.2s; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* === Border Radius Utilities === */
.rounded-4 { border-radius: 8px; }
.rounded-5 { border-radius: 12px; }
.rounded-6 { border-radius: 16px; }

/* === Shadow Utilities === */
.shadow-hover { transition: box-shadow 0.2s; }
.shadow-hover:hover { box-shadow: var(--shadow-lg); }

/* === Cursor === */
.cursor-pointer { cursor: pointer; }

/* === Overflow === */
.overflow-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === Print Styles === */
@media print {
    .sidebar, .main-header, .sidebar-toggle, .header-right,
    .quick-actions, .right-sidebar, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd; }
    .greeting-section { background: #f5f5f5 !important; color: #333 !important; }
    .greeting-section h2, .greeting-section p { color: #333 !important; }
    body { font-size: 12px; }
}

/* === Responsive === */
@media (max-width: 1199.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .main-header .sidebar-toggle { display: flex; }
}

@media (max-width: 991.98px) {
    .page-content { padding: 16px; }
    .main-header { padding: 0 16px; }
    .main-header .header-search { width: 200px; }
    .greeting-section { padding: 20px; }
    .greeting-section .greeting-icon { display: none; }
    .notif-dropdown { width: 300px; }
    .quick-actions { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

@media (max-width: 767.98px) {
    .main-header .header-search { display: none; }
    .greeting-section h2 { font-size: 1.1rem; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .quick-actions { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .quick-action-btn { padding: 12px 8px; }
    .quick-action-btn i { font-size: 1.1rem; }
    .quick-action-btn span { font-size: 0.65rem; }
    .right-sidebar { margin-top: 24px; }
    .chart-container { height: 200px; }
}

@media (max-width: 575.98px) {
    .page-content { padding: 12px; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .notif-dropdown { width: calc(100vw - 24px); right: -60px; }
    .quick-action-btn { padding: 10px 6px; font-size: 0.7rem; }
    .quick-action-btn i { font-size: 1rem; }
    .stat-card .stat-value { font-size: 1.2rem; }
    .stat-card .stat-icon-circle { width: 36px; height: 36px; font-size: 1rem; }
    .greeting-section { padding: 16px; }
    .greeting-section h2 { font-size: 1rem; }
    .card-header { padding: 12px 14px; font-size: 0.8rem; }
    .card-body { padding: 12px 14px; }
    .chart-container { height: 180px; }
    .table thead th, .table tbody td { padding: 8px 10px; font-size: 0.7rem; }
    .right-widget { padding: 12px 14px; }
    .widget-birthday .bday-avatar { width: 32px; height: 32px; font-size: 0.7rem; }
    .widget-holiday .holiday-icon { width: 30px; height: 30px; font-size: 0.8rem; }
    .info-row { flex-direction: column; gap: 2px; padding: 8px 0; }
    .info-row .info-label { width: auto; }
    .table-card .table-header { flex-direction: column; align-items: stretch; }
    .table-card .table-toolbar { flex-direction: column; }
    .table-card .table-toolbar .search-box { width: 100%; }
}

/* ============================================================
   DARK MODE SUPPORT
   ============================================================ */
[data-theme="dark"] {
    --gray-50: #0F172A;
    --gray-100: #1E293B;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748B;
    --gray-500: #94A3B8;
    --gray-600: #CBD5E1;
    --gray-700: #E2E8F0;
    --gray-800: #F1F5F9;
    --gray-900: #F8FAFC;
    
    --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.3);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.3);
    
    --text-color: #E2E8F0;
    background: #0F172A;
}

[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .right-widget,
[data-theme="dark"] .dept-card,
[data-theme="dark"] .stat-compact,
[data-theme="dark"] .notice-card,
[data-theme="dark"] .kanban-card {
    background: #1E293B;
    border-color: #334155;
}

[data-theme="dark"] .main-header {
    background: rgba(15, 23, 42, 0.95);
    border-color: #334155;
}

[data-theme="dark"] .greeting-section {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
}

[data-theme="dark"] .quick-action-btn {
    background: #1E293B;
    color: #E2E8F0;
    border-color: #334155;
}

[data-theme="dark"] .table thead th {
    background: #1E293B;
    color: #94A3B8;
    border-color: #334155;
}

[data-theme="dark"] .table tbody td {
    border-color: #334155;
    color: #E2E8F0;
}

[data-theme="dark"] .table tbody tr:hover {
    background: #1E293B;
}

[data-theme="dark"] .stat-card .stat-value,
[data-theme="dark"] .stat-card .stat-label,
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-body {
    color: #E2E8F0;
}

[data-theme="dark"] .stat-card .stat-value {
    color: #F1F5F9;
}

[data-theme="dark"] .card-header {
    border-color: #334155;
}

[data-theme="dark"] .weather-widget {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
}

[data-theme="dark"] .quote-widget {
    background: linear-gradient(135deg, #1D4ED8 0%, #0F172A 100%);
}

[data-theme="dark"] .header-btn {
    background: #1E293B;
    color: #94A3B8;
}

[data-theme="dark"] .header-btn:hover {
    background: #334155;
    color: #E2E8F0;
}

[data-theme="dark"] .user-dropdown:hover {
    background: #1E293B;
}

[data-theme="dark"] .main-header .header-search input {
    background: #1E293B;
    border-color: #334155;
    color: #E2E8F0;
}

[data-theme="dark"] .main-header .header-search input:focus {
    background: #0F172A;
    border-color: var(--primary);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: #1E293B;
    border-color: #334155;
    color: #E2E8F0;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background: #0F172A;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background: #1E293B;
    border-color: #334155;
    color: #E2E8F0;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_filter input:focus {
    background: #0F172A;
}

[data-theme="dark"] .dataTables_info {
    color: #94A3B8;
}

[data-theme="dark"] .dataTables_paginate .paginate_button {
    color: #94A3B8 !important;
    border-color: #334155;
}

[data-theme="dark"] .dataTables_paginate .paginate_button.current {
    background: var(--primary);
    color: white !important;
    border-color: var(--primary);
}

[data-theme="dark"] .dataTables_paginate .paginate_button:hover:not(.current) {
    background: #1E293B;
}

[data-theme="dark"] .filter-panel {
    background: #1E293B;
    border-color: #334155;
}

[data-theme="dark"] .badge-cancelled {
    background: #334155;
    color: #94A3B8;
}

[data-theme="dark"] .stat-compact .stat-info .value {
    color: #F1F5F9;
}

[data-theme="dark"] .dept-card .dept-name {
    color: #F1F5F9;
}

[data-theme="dark"] .dept-card .dept-stat .num {
    color: #F1F5F9;
}

[data-theme="dark"] .profile-card .profile-name {
    color: #F1F5F9;
}

[data-theme="dark"] .profile-card .profile-role {
    color: #94A3B8;
}

[data-theme="dark"] .profile-card .profile-meta {
    color: #94A3B8;
}

[data-theme="dark"] .info-row .info-value {
    color: #E2E8F0;
}

[data-theme="dark"] .info-row {
    border-color: #334155;
}

[data-theme="dark"] .kanban-column .kanban-header {
    background: #1E293B;
}

[data-theme="dark"] .kanban-column .kanban-body {
    background: #1E293B;
}

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

[data-theme="dark"] .timeline-item .timeline-title {
    color: #E2E8F0;
}

[data-theme="dark"] .timeline-item .timeline-desc {
    color: #94A3B8;
}

[data-theme="dark"] .section-title::after {
    background: #334155;
}

[data-theme="dark"] .modal-content {
    background: #1E293B;
    border-color: #334155;
}

[data-theme="dark"] .modal-header {
    border-color: #334155;
}

[data-theme="dark"] .modal-footer {
    border-color: #334155;
}

[data-theme="dark"] .modal-title {
    color: #F1F5F9;
}

[data-theme="dark"] .close {
    color: #94A3B8;
}

[data-theme="dark"] .nav-tabs {
    border-color: #334155;
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: #94A3B8;
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    color: #E2E8F0;
    background: #1E293B;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    color: var(--primary);
}

[data-theme="dark"] .dropdown-menu {
    background: #1E293B;
    border-color: #334155;
}

[data-theme="dark"] .dropdown-menu .dropdown-item {
    color: #E2E8F0;
}

[data-theme="dark"] .dropdown-menu .dropdown-item:hover {
    background: #334155;
    color: #F1F5F9;
}

[data-theme="dark"] .dropdown-divider {
    border-color: #334155;
}

[data-theme="dark"] .list-group-item {
    background: #1E293B;
    border-color: #334155;
    color: #E2E8F0;
}

[data-theme="dark"] .list-group-item-action:hover {
    background: #334155;
}

[data-theme="dark"] .alert {
    color: #E2E8F0;
}

[data-theme="dark"] .alert-success {
    background: #064E3B;
    color: #D1FAE5;
}

[data-theme="dark"] .alert-danger {
    background: #7F1D1D;
    color: #FEE2E2;
}

[data-theme="dark"] .alert-warning {
    background: #78350F;
    color: #FEF3C7;
}

[data-theme="dark"] .alert-info {
    background: #0C4A6E;
    color: #E0F2FE;
}

[data-theme="dark"] .toast-custom {
    background: #1E293B;
    border-color: #334155;
}

[data-theme="dark"] .toast-custom .toast-content .toast-title {
    color: #F1F5F9;
}

[data-theme="dark"] .toast-custom .toast-content .toast-msg {
    color: #94A3B8;
}

[data-theme="dark"] .scrollable-div {
    scrollbar-color: #334155 transparent;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: #334155 !important;
}

/* ============================================================
   Notification Toasts
   ============================================================ */
#adminToastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.admin-notif-toast {
    pointer-events: auto;
    background: #ffffff;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] .admin-notif-toast {
    background: #1e293b;
    color: #f1f5f9;
    border-left-color: #3b82f6;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* === Notification Dropdown Items === */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.notif-item:hover {
    background: var(--gray-50);
}
.notif-item.unread {
    background: #f0f7ff;
}
.notif-item.unread:hover {
    background: #e5f0fe;
}
.notif-item .notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}
.notif-item .notif-content {
    flex: 1;
    min-width: 0;
}
.notif-item .title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}
.notif-item .message {
    font-size: 0.78rem;
    color: var(--gray-600);
    line-height: 1.35;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.notif-item .time {
    font-size: 0.7rem;
    color: var(--gray-400);
}
.notif-new-badge {
    display: inline-block;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}
.notif-section-header {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray-400);
    padding: 8px 16px 4px 16px;
    letter-spacing: 0.5px;
}