@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --primary-50: #EEF2FF;
    --secondary: #10B981;
    --secondary-light: #34D399;
    --accent: #F59E0B;
    --accent-light: #FCD34D;
    --danger: #EF4444;
    --danger-light: #FCA5A5;
    --info: #3B82F6;
    --success: #10B981;
    --warning: #F59E0B;
    --bg-light: #F9FAFB;
    --bg-dark: #111827;
    --bg-card: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --sidebar-bg: #1E1B4B;
    --card-bg: #FFFFFF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #312E81 100%);
    min-height: 100vh;
    width: 260px;
    position: fixed;
    left: 0;
    top: 0;
    transition: var(--transition-slow);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .nav-section-title {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: 70px;
    display: flex;
    align-items: center;
}

.sidebar-logo {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.sidebar-logo i {
    font-size: 1.75rem;
    color: var(--primary-light);
}

.sidebar-nav {
    padding: 16px 0;
    overflow-y: auto;
    max-height: calc(100vh - 70px);
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
    transition: var(--transition);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 9px 18px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
    gap: 10px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1px 0;
    position: relative;
    white-space: nowrap;
    font-size: 0.9rem;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--primary-light);
    border-radius: 0 4px 4px 0;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-text {
    transition: var(--transition);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: var(--transition-slow);
    background: var(--bg-light);
}

.main-content.expanded {
    margin-left: 80px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: white;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 10px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

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

.search-box {
    position: relative;
}

.search-box input {
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 300px;
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--bg-light);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: white;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.notification-btn, .profile-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
    color: var(--text-secondary);
}

.notification-btn:hover, .profile-btn:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

.notification-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 350px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
}

.notification-panel-header .mark-all-btn {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

.notification-panel-header .mark-all-btn:hover {
    text-decoration: underline;
}

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

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text-primary);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--bg-light);
}

.notification-item .notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 6px;
    flex-shrink: 0;
}

.notification-item.is-read .notif-dot {
    background: var(--border);
}

.notification-item .notif-body {
    flex: 1;
    min-width: 0;
}

.notification-item .notif-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-item .notif-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notification-item .priority-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
}

.notification-panel-empty {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.notification-panel-empty i {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: var(--text-tertiary);
}

.notification-panel-footer {
    border-top: 1px solid var(--border);
    padding: 10px;
    text-align: center;
}

.notification-panel-footer a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
}

.notification-panel-footer a:hover {
    text-decoration: underline;
}

.dark-mode .notification-panel {
    background: var(--bg-card);
}

.dark-mode .notification-item:hover {
    background: var(--bg-dark);
}

.dark-mode .notification-item.is-read .notif-dot {
    background: #374151;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 18px;
    transition: var(--transition);
    border: 1px solid transparent;
}

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

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid transparent;
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.blue { background: #DBEAFE; color: #2563EB; }
.stat-icon.green { background: #D1FAE5; color: #059669; }
.stat-icon.yellow { background: #FEF3C7; color: #D97706; }
.stat-icon.red { background: #FEE2E2; color: #DC2626; }
.stat-icon.purple { background: #EDE9FE; color: #7C3AED; }
.stat-icon.pink { background: #FCE7F3; color: #DB2777; }
.stat-icon.gray { background: #E5E7EB; color: #4B5563; }

.stat-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 2px;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
}

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

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

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

tbody tr:hover {
    background: var(--primary-50);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

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

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

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 1px 2px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-sm {
    padding: 7px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: inherit;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    text-transform: capitalize;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-secondary { background: #F3F4F6; color: #374151; }
.badge-primary { background: #EEF2FF; color: #3730A3; }

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: sticky;
    bottom: 0;
    background: white;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

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

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    color: white;
    animation: toastSlideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); color: #1F2937; }
.toast-info { background: var(--info); }

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 50%, #EC4899 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.login-container::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    bottom: -50px;
    left: -50px;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    position: relative;
    z-index: 1;
    animation: loginCardIn 0.5s ease;
}

@keyframes loginCardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.login-header .logo-icon {
    width: 80px;
    height: 80px;
    background: transparent;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0;
    color: white;
    font-size: 1.5rem;
}

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

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

.login-tabs {
    display: flex;
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 24px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
}

.login-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form .input-icon {
    position: relative;
}

.login-form .input-icon > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.login-form .input-icon input {
    padding-left: 38px;
}

.login-form .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.login-form .password-toggle i {
    position: static;
    left: auto;
    transform: none;
    font-size: 1rem;
    line-height: 1;
}

.login-form .input-icon input::-ms-reveal,
.login-form .input-icon input::-ms-clear {
    display: none;
}

.login-form .input-icon input::-webkit-credentials-auto-fill-button,
.login-form .input-icon input::-webkit-contacts-auto-fill-button,
.login-form .input-icon input::-webkit-password-reveal {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
    width: 0;
    height: 0;
}

.login-form .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

.forgot-step .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.forgot-step .password-toggle i {
    position: static;
    left: auto;
    transform: none;
    font-size: 1rem;
    line-height: 1;
}

.forgot-step .input-icon input::-ms-reveal,
.forgot-step .input-icon input::-ms-clear {
    display: none;
}

.forgot-step .input-icon input::-webkit-credentials-auto-fill-button,
.forgot-step .input-icon input::-webkit-contacts-auto-fill-button,
.forgot-step .input-icon input::-webkit-password-reveal {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
    width: 0;
    height: 0;
}

.demo-credentials {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.demo-credentials strong {
    color: var(--text-primary);
}

/* ============================================
   SKELETON LOADERS
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, #E5E7EB 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 20px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    color: var(--border);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 0.9rem;
    max-width: 300px;
    margin: 0 auto;
}

/* ============================================
   PROFILE
   ============================================ */
.profile-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.profile-photo-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.profile-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    min-width: 200px;
    padding: 8px;
    z-index: 1001;
    border: 1px solid var(--border);
    animation: fadeIn 0.2s ease;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    color: var(--text-primary);
    text-decoration: none;
}

.profile-menu-item:hover {
    background: var(--bg-light);
}

.profile-menu-item i {
    width: 16px;
    color: var(--text-secondary);
}

.profile-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.profile-menu-item.danger {
    color: var(--danger);
}

.profile-menu-item.danger i {
    color: var(--danger);
}

/* ============================================
   GRID
   ============================================ */
.grid {
    display: grid;
    gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

/* ============================================
   DIVIDER
   ============================================ */
.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    gap: 16px;
}

.loading-overlay .spinner {
    width: 48px;
    height: 48px;
}

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

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.4s ease;
}

.slide-down {
    animation: slideDown 0.4s ease;
}

.scale-in {
    animation: scaleIn 0.3s ease;
}

/* Staggered 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; }

/* ============================================
   TOOLTIP
   ============================================ */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--text-primary);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.tooltip:hover::after {
    opacity: 1;
    bottom: calc(100% + 8px);
}

/* ============================================
   STATUS INDICATOR
   ============================================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--text-tertiary); }
.status-dot.busy { background: var(--danger); }

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-light);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   DARK MODE
   ============================================ */
.dark-mode {
    --bg-light: #111827;
    --bg-dark: #1F2937;
    --bg-card: #1F2937;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-tertiary: #6B7280;
    --border: #374151;
    --border-light: #4B5563;
    --primary-50: #1E1B4B;
    }

.dark-mode .card,
.dark-mode .stat-card,
.dark-mode .header,
.dark-mode .modal-content,
.dark-mode .profile-menu {
    background: var(--bg-card);
}

.dark-mode th {
    background: var(--bg-dark);
}

.dark-mode .search-box input {
    background: var(--bg-dark);
    border-color: var(--border);
}

.dark-mode .form-control {
    background: var(--bg-dark);
    border-color: var(--border);
    color: var(--text-primary);
}

.dark-mode .login-card {
    background: var(--bg-card);
}

.dark-mode .login-tabs {
    background: var(--bg-dark);
}

.dark-mode .login-tab.active {
    background: var(--bg-card);
}

.dark-mode .demo-credentials {
    background: var(--bg-dark);
}

.dark-mode .modal-header,
.dark-mode .modal-footer {
    background: var(--bg-card);
}

.dark-mode .quick-action-icon {
    background: rgba(255,255,255,0.1) !important;
    color: var(--text-primary) !important;
}

.dark-mode .btn-secondary {
    background: var(--bg-dark);
    border-color: var(--border);
    color: var(--text-primary);
}

.dark-mode .btn-secondary:hover:not(:disabled) {
    background: #374151;
    border-color: var(--border);
}

.dark-mode .stat-icon.blue   { background: #1E3A5F; color: #60A5FA; }
.dark-mode .stat-icon.green  { background: #064E3B; color: #34D399; }
.dark-mode .stat-icon.yellow { background: #78350F; color: #FBBF24; }
.dark-mode .stat-icon.red    { background: #7F1D1D; color: #F87171; }
.dark-mode .stat-icon.purple { background: #4C1D95; color: #A78BFA; }
.dark-mode .stat-icon.pink   { background: #831843; color: #F472B6; }
.dark-mode .stat-icon.gray   { background: #374151; color: #9CA3AF; }

.dark-mode .badge-success { background: #064E3B; color: #34D399; }
.dark-mode .badge-warning { background: #78350F; color: #FBBF24; }
.dark-mode .badge-danger { background: #7F1D1D; color: #F87171; }
.dark-mode .badge-info { background: #1E3A5F; color: #60A5FA; }
.dark-mode .badge-secondary { background: #374151; color: #D1D5DB; }
.dark-mode .badge-primary { background: #312E81; color: #A5B4FC; }

.dark-mode .profile-photo,
.dark-mode .profile-photo-lg,
.dark-mode .profile-photo-wrapper img,
.dark-mode .profile-photo-fallback {
    border-color: var(--border) !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar .nav-text,
    .sidebar-logo span,
    .sidebar .nav-section-title {
        opacity: 1;
        width: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }
    
    .header h2 {
        font-size: 1.05rem !important;
    }
    
    .search-box {
        display: none;
    }
    
    .grid-4,
    .grid-5,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        grid-column: span 1;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .toast {
        min-width: auto;
        max-width: calc(100vw - 40px);
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px;
    }
    
    .login-header h1 {
        font-size: 1.25rem;
    }
    
    .login-header p {
        font-size: 0.8rem;
    }
    
    .login-header .logo-icon {
        width: 50px;
        height: 50px;
        border-radius: 12px;
    }
    
    .header {
        padding: 10px 12px;
    }
    
    .header h2 {
        font-size: 0.95rem !important;
    }
    
    .header-right {
        gap: 8px;
    }
    
    #profileName {
        display: none !important;
    }
    
    .profile-btn .fa-chevron-down {
        display: none !important;
    }
    
    .header-right .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 375px) {
    .login-card {
        padding: 20px;
    }
    
    .login-header {
        margin-bottom: 24px;
    }
    
    .login-form .form-group {
        margin-bottom: 12px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================
   EMPLOYEE DETAIL VIEW (admin)
   ============================================ */
.view-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-50), transparent);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.view-hero .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.view-hero .avatar img { width: 100%; height: 100%; object-fit: cover; }
.view-hero .hero-info { flex: 1; min-width: 200px; }
.view-hero .hero-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.view-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border-light); padding-bottom: 10px; }
.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
}
.detail-card h4 {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px 20px;
}
.detail-row { padding: 6px 0; border-bottom: 1px dashed var(--border-light); }
.detail-grid .detail-row { border-bottom: 1px dashed var(--border-light); }
.detail-row:last-child { border-bottom: none; }
.detail-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); margin-bottom: 2px; }
.detail-value { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); word-break: break-word; }
.req-section-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border-light); }
.req-section-title:first-child { margin-top: 0; }
.danger-zone { border: 1px solid var(--danger); background: rgba(239, 68, 68, 0.04); border-radius: var(--radius); padding: 16px; margin-top: 18px; }
.danger-zone h4 { color: var(--danger); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
