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

:root {
    --primary: #6366F1; /* Modern Indigo */
    --primary-hover: #4F46E5;
    --secondary: #F59E0B;
    --secondary-hover: #D97706;
    --accent: #10B981;
    --background: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --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;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    display: grid;
    grid-template-columns: 230px 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-left p {
    font-size: 14px;
    opacity: 0.9;
}

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

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
}

.user-role {
    font-size: 13px;
    opacity: 0.8;
}

.btn-danger {
    background: #EF4444;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #DC2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ── Left Sidebar Navigation ── */
.nav {
    background: var(--gray-800);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-right: 1px solid var(--gray-700);
    grid-column: 1;
    grid-row: 1 / span 999;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

/* Sidebar branding block */
.nav::before {
    content: 'IECC';
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    padding: 24px 20px 8px;
    line-height: 1;
}
.nav::after {
    content: 'HELP DESK CENTER';
    display: block;
    font-size: 10px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--gray-700);
    margin-bottom: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    background: transparent;
    border: none;
    border-radius: 0;
    transition: all 0.18s;
    box-shadow: none;
    white-space: nowrap;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
    border-color: transparent;
    transform: none;
    box-shadow: none;
    border-left-color: rgba(255,255,255,0.3);
}

.nav-item.active {
    color: #fff;
    background: rgba(124,58,237,0.35);
    border-color: transparent;
    border-left-color: #a78bfa;
    box-shadow: none;
    font-weight: 600;
}

.nav-item span {
    font-size: 17px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.container {
    grid-column: 2;
    grid-row: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    animation: fadeIn 0.5s ease-out;
    width: 100%;
}

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

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

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

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

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--gray-100);
}

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

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

.card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    gap: 8px;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background-color: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
}

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

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
}

.stat-card.blue {
    border-left: 4px solid var(--info);
}

.stat-card.yellow {
    border-left: 4px solid var(--warning);
}

.stat-card.purple {
    border-left: 4px solid var(--primary);
}

.stat-card.green {
    border-left: 4px solid var(--success);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.stat-label {
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 500;
}

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

.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.staff-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.staff-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 25px -5px rgba(124, 58, 237, 0.15);
}

.staff-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.staff-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 3px solid white;
    outline: 2px solid var(--primary);
}

.staff-avatar-img.large {
    width: 48px;
    height: 48px;
    margin: 0;
    border-width: 2px;
}

.staff-avatar.large {
    margin: 0;
}

.staff-name {
    font-weight: 600;
    font-size: 18px;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.staff-email {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 16px;
}

.staff-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.staff-stat-value {
    font-weight: 700;
    font-size: 18px;
    color: var(--gray-800);
}

.staff-stat-label {
    font-size: 12px;
    color: var(--gray-500);
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s;
}

.task-card:hover {
    border-color: var(--primary);
    background-color: #FDFBFF;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.task-id {
    font-weight: 700;
    color: var(--primary);
}

.badge {
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.pending {
    background: #fee2e2;
    color: #991b1b;
}

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

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

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

.revenue-card {
    background: linear-gradient(135deg, var(--primary) 0%, #A855F7 40%, #F59E0B 100%);
    color: white;
    padding: 24px 32px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px -5px rgba(124, 58, 237, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.revenue-card h3 {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 4px;
}

.revenue-card::after {
    content: '⏱️';
    font-size: 48px;
    opacity: 0.5;
}

.revenue-amount {
    font-size: 48px;
    font-weight: 800;
    margin-top: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--gray-100);
    color: var(--gray-600);
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.action-btn.delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Progress bar */
.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F9FAFB 0%, #E5E7EB 100%);
    background-image: radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.1) 0px, transparent 50%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.login-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary);
    transform: rotate(-5deg);
    transition: transform 0.3s;
}

.login-card:hover .login-icon {
    transform: rotate(0deg) scale(1.05);
}

.login-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), #4C1D95);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--gray-500);
    font-size: 15px;
}

.login-form {
    text-align: left;
}

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

.login-form label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.login-form input {
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.track-link {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--gray-100);
}

.track-link p {
    color: var(--gray-500);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FEE2E2;
}

.alert-success {
    background-color: #ECFDF5;
    color: #065F46;
    border: 1px solid #D1FAE5;
}

/* Enhanced Buttons */
.btn {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 24px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6D28D9);
    box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.3), 0 2px 4px -1px rgba(124, 58, 237, 0.15);
}

.btn-primary:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    border: 2px solid var(--gray-200);
    color: var(--gray-600);
    background: transparent;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(124, 58, 237, 0.05);
}

/* Settings Page Styles */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.settings-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.settings-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.settings-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.settings-input-group input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
}

.settings-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.settings-list {
    list-style: none;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.settings-item:hover {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.02);
}

.settings-item-name {
    font-weight: 500;
    color: var(--gray-700);
}

/* Password Form Styles */
.password-form {
    max-width: 600px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.password-form .form-group {
    margin-bottom: 0;
}

.password-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.password-form .form-group input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.password-form .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Card Styles */
.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.card-header {
    margin-bottom: 20px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

/* Search and Filter Styles */
.search-filter {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
}

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

.search-box .search-icon {
    position: absolute;
    left: 16px;
    font-size: 16px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.filter-select {
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 14px;
    background: white;
    min-width: 140px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Table Styles */
table,
.table {
    width: 100%;
    border-collapse: collapse;
}

.table-container {
    overflow-x: auto;
}

.table thead {
    background: var(--gray-100);
}

.table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(124, 58, 237, 0.02);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge.pending {
    background: #FEF3C7;
    color: #92400E;
}

.badge.assigned {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge.in-progress {
    background: #E0E7FF;
    color: #3730A3;
}

.badge.completed {
    background: #D1FAE5;
    color: #065F46;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 16px;
}

.action-btn:hover {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.05);
}

.action-btn.delete:hover {
    border-color: #EF4444;
    background: #FEE2E2;
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Alert Styles */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
}

/* Form Group */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* ══════════════════════════════════════════════
   LAYOUT: Left sidebar via CSS Grid.
   No wrapper div needed — each element is
   assigned to its grid cell by class name.
══════════════════════════════════════════════ */

html {
    height: 100%;
    scroll-behavior: smooth;
}

/* 2-column grid: 230px sidebar | remaining content */
body {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 230px 1fr;
    grid-template-rows: auto 1fr;
}

/* ── Sidebar: column 1, all rows ── */
.nav {
    grid-column: 1;
    grid-row: 1 / span 999;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

/* ── Header: column 2, row 1 ── */
.header {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

/* ── Main content: column 2, row 2 ── */
.container {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: 0;
}

/* Pages with own full-page layout (track, login) */
.track-page,
.login-page {
    grid-column: 1 / -1;  /* span all columns */
    grid-row: 1 / -1;
    min-height: 100vh;
}

/* Cards — prevent overflow */
.card, .stat-card, .staff-card, .task-card {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Tables always scroll horizontally */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Modals scroll internally if tall */
.modal {
    max-height: 90vh;
    overflow-y: auto;
}
.modal-overlay {
    align-items: flex-start;
    padding-top: 40px;
}

/* Grids wrap gracefully */
.staff-grid    { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.settings-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.form-row      { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.filter-form, .search-filter { flex-wrap: wrap; }

/* ── Mobile: stack vertically, nav becomes top bar ── */
@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
    }
    .nav {
        grid-column: 1;
        grid-row: 1;
        height: auto;
        position: static;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav::before, .nav::after { display: none; }
    .nav-item {
        padding: 10px 14px;
        font-size: 12px;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .nav-item.active {
        border-left-color: transparent;
        border-bottom-color: #a78bfa;
        background: rgba(124,58,237,0.25);
    }
    .header { grid-column: 1; grid-row: 2; flex-wrap: wrap; gap: 12px; padding: 16px 20px; }
    .container { grid-column: 1; grid-row: 3; padding: 16px; }
    .card { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
    .staff-grid { grid-template-columns: 1fr; }
    .form-row   { grid-template-columns: 1fr; }
    .modal { max-width: calc(100vw - 32px); margin: 16px; }
    .card-header { flex-wrap: wrap; gap: 12px; }
}