/* =====================================================
   School Management System - Main Stylesheet
   RTL Arabic - Professional Design
   ===================================================== */

:root {
    --primary: #1a3a5c;
    --primary-light: #2563a8;
    --primary-dark: #0f2340;
    --accent: #e8a020;
    --accent-light: #f5bc50;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg: #f0f4f8;
    --surface: #ffffff;
    --surface2: #f8fafc;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --sidebar-w: 270px;
    --topbar-h: 64px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow: 0 4px 16px rgba(0,0,0,.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --font: 'Cairo', 'Tajawal', sans-serif;
    --transition: 0.25s ease;
}

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

html { font-size: 14px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    position: fixed;
    right: 0; top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--primary-dark);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.school-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px; height: 44px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: white;
    flex-shrink: 0;
}

.school-info { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.school-name { color: white; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.system-name { color: rgba(255,255,255,.5); font-size: 11px; }

.year-badge {
    margin: 12px 16px;
    background: rgba(232,160,32,.15);
    border: 1px solid rgba(232,160,32,.3);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex; align-items: center; gap: 8px;
    color: var(--accent-light);
    font-size: 12px; font-weight: 600;
}

.sidebar-menu {
    padding: 8px 0;
    flex: 1;
}

.menu-section { margin-bottom: 4px; }

.menu-label {
    display: block;
    padding: 12px 20px 4px;
    color: rgba(255,255,255,.35);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}

.menu-item:hover {
    color: white;
    background: rgba(255,255,255,.07);
}

.menu-item.active {
    color: white;
    background: rgba(255,255,255,.1);
    font-weight: 600;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 2px 0 0 2px;
}

.menu-item i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
}

.user-avatar {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.7); font-size: 14px;
    flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }
.user-name { display: block; color: white; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255,255,255,.45); font-size: 11px; }

.btn-logout {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.5); font-size: 14px;
    border-radius: 6px;
    transition: all var(--transition);
    text-decoration: none;
    flex-shrink: 0;
}
.btn-logout:hover { background: rgba(239,68,68,.2); color: #ef4444; }

/* =====================================================
   MAIN LAYOUT
   ===================================================== */
.main-wrapper {
    margin-right: var(--sidebar-w);
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: margin var(--transition);
}

.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
    background: none; border: none;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.sidebar-toggle:hover { background: var(--bg); color: var(--primary); }

.topbar-title {
    flex: 1;
    font-size: 16px; font-weight: 700;
    color: var(--primary);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.notif-btn {
    position: relative;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 16px;
    text-decoration: none;
    transition: all var(--transition);
}
.notif-btn:hover { background: var(--bg); color: var(--primary); }

.notif-badge {
    position: absolute; top: 4px; left: 4px;
    background: var(--danger);
    color: white; font-size: 9px; font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 8px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
}

.topbar-user {
    font-size: 13px; font-weight: 600;
    color: var(--text);
    display: flex; align-items: center; gap: 6px;
}

.page-content {
    padding: 24px;
    flex: 1;
}

/* =====================================================
   CARDS & PANELS
   ===================================================== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 15px; font-weight: 700;
    color: var(--primary);
    display: flex; align-items: center; gap: 8px;
}

.card-title i { color: var(--accent); }
.card-body { padding: 20px; }

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
    transition: all var(--transition);
    text-decoration: none; color: inherit;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: white; flex-shrink: 0;
}
.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-icon.green { background: linear-gradient(135deg, #10b981, #047857); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat-icon.teal { background: linear-gradient(135deg, #14b8a6, #0f766e); }

.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-change { font-size: 11px; margin-top: 6px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* =====================================================
   TABLES
   ===================================================== */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
    background: var(--surface2);
    padding: 12px 14px;
    text-align: right;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: .02em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

tbody tr { transition: background var(--transition); border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--surface2); }
tbody tr:last-child { border-bottom: none; }

tbody td {
    padding: 12px 14px;
    color: var(--text);
    vertical-align: middle;
}

.table-actions { display: flex; align-items: center; gap: 6px; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px; font-weight: 600;
    cursor: pointer; border: none;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-light); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-warning { background: var(--warning); color: white; }
.btn-info { background: var(--info); color: white; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--surface2); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* =====================================================
   FORMS
   ===================================================== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.form-group label .required { color: var(--danger); margin-right: 2px; }

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--transition);
    outline: none;
}
.form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,168,.1); }
.form-control::placeholder { color: var(--text-light); }

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

.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-left: none; }
.input-group-text {
    padding: 9px 12px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted); font-size: 13px;
    display: flex; align-items: center;
}

.form-actions {
    display: flex; align-items: center; gap: 10px;
    margin-top: 20px; padding-top: 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* =====================================================
   BADGES & STATUS
   ===================================================== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px; font-weight: 700;
}
.badge-success { background: rgba(16,185,129,.1); color: #065f46; }
.badge-danger { background: rgba(239,68,68,.1); color: #991b1b; }
.badge-warning { background: rgba(245,158,11,.1); color: #92400e; }
.badge-info { background: rgba(59,130,246,.1); color: #1e40af; }
.badge-secondary { background: var(--surface2); color: var(--text-muted); }
.badge-primary { background: rgba(26,58,92,.1); color: var(--primary); }

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}

.page-title {
    font-size: 22px; font-weight: 800;
    color: var(--primary);
    display: flex; align-items: center; gap: 10px;
}
.page-title i { color: var(--accent); }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-light); }

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; pointer-events: none;
    transition: opacity var(--transition);
}
.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(.95);
    transition: transform var(--transition);
}
.modal-overlay.show .modal { transform: scale(1); }

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

.modal-title { font-size: 16px; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.modal-title i { color: var(--accent); }
.modal-close { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--text-muted); padding: 4px; border-radius: 4px; transition: all var(--transition); }
.modal-close:hover { background: var(--bg); color: var(--danger); }
.modal-body { padding: 20px; }

/* =====================================================
   ALERTS
   ===================================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px;
}
.alert-success { background: rgba(16,185,129,.1); color: #065f46; border: 1px solid rgba(16,185,129,.2); }
.alert-danger { background: rgba(239,68,68,.1); color: #991b1b; border: 1px solid rgba(239,68,68,.2); }
.alert-warning { background: rgba(245,158,11,.1); color: #92400e; border: 1px solid rgba(245,158,11,.2); }
.alert-info { background: rgba(59,130,246,.1); color: #1e40af; border: 1px solid rgba(59,130,246,.2); }

/* =====================================================
   SEARCH & FILTERS
   ===================================================== */
.filters-bar {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px; flex-wrap: wrap;
}

.search-box {
    position: relative; flex: 1; min-width: 200px;
}
.search-box i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input { padding-right: 36px; }

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 16px;
}
.page-link {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    text-decoration: none; color: var(--text-muted);
    border: 1.5px solid var(--border);
    transition: all var(--transition);
}
.page-link:hover, .page-link.active { background: var(--primary); color: white; border-color: var(--primary); }

/* =====================================================
   DASHBOARD SPECIFIC
   ===================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.chart-placeholder {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    height: 200px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light); font-size: 13px;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-wrapper { margin: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
    :root { --sidebar-w: 0px; }
    .sidebar { transform: translateX(100%); --sidebar-w: 270px; }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-right: 0; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-grid-3 { grid-template-columns: 1fr; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .col-span-2 { grid-column: span 1; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .page-content { padding: 16px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; }
}

/* =====================================================
   UTILITIES
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-3 { margin-top: 12px; }
.p-0 { padding: 0; }
.w-100 { width: 100%; }

/* Login Page */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo { margin-bottom: 24px; }
.login-logo .logo-icon { width: 70px; height: 70px; font-size: 30px; margin: 0 auto 12px; border-radius: var(--radius); }
.login-logo h1 { font-size: 20px; font-weight: 800; color: var(--primary); }
.login-logo p { color: var(--text-muted); font-size: 13px; }
.login-card .form-group { text-align: right; margin-bottom: 16px; }
.login-card .btn { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }

/* =====================================================
   ADDITIONAL COMPONENTS
   ===================================================== */

/* Progress Bar */
.progress-bar-wrap { height: 8px; background: #e9ecef; border-radius: 10px; overflow: hidden; display: inline-block; width: 80px; vertical-align: middle; margin-left: 5px; }
.progress-bar { height: 100%; border-radius: 10px; transition: width 0.4s ease; }

/* Info List */
.info-list { display: flex; flex-direction: column; gap: 10px; }
.info-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.info-item:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-size: 13px; min-width: 120px; }

/* Stats Grid 4 */
.stats-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.stats-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
@media(max-width:768px) { .stats-grid-4,.stats-grid-3 { grid-template-columns: 1fr 1fr; } }

/* Avatar Large */
.avatar-lg { width: 80px; height: 80px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; margin: 0 auto 12px; }

/* Employee Photo */
.employee-photo { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; display: block; }

/* Row Colors */
.row-danger td { background: #fff5f5 !important; }
.row-warning td { background: #fff9e6 !important; }

/* Table Footer */
.table-footer td { background: #f0f4f8; font-weight: 700; }

/* Filter Bar */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar .form-control { width: auto; min-width: 140px; }

/* Search Bar */
.search-bar { display: flex; gap: 10px; align-items: center; }
.search-bar .form-control { flex: 1; }

/* Table Info */
.table-info { color: var(--text-muted); font-size: 13px; margin-bottom: 10px; }

/* Form Card */
.form-card .card { margin-bottom: 20px; }

/* Form Actions */
.form-actions { display: flex; gap: 10px; padding: 20px 0; }

/* Required */
.required { color: var(--danger); }

/* Full width grid */
.form-group.full-width { grid-column: 1 / -1; }

/* Row layout */
.row { display: flex; gap: 20px; flex-wrap: wrap; }
.col-md-4 { flex: 0 0 33.33%; max-width: 33.33%; }
.col-md-5 { flex: 0 0 41.66%; max-width: 41.66%; }
.col-md-7 { flex: 0 0 58.33%; max-width: 58.33%; }
.col-md-8 { flex: 0 0 66.66%; max-width: 66.66%; }
@media(max-width:768px) { .col-md-4,.col-md-5,.col-md-7,.col-md-8 { flex: 0 0 100%; max-width: 100%; } }

/* Btn Group */
.btn-group { display: flex; gap: 6px; }

/* Table Responsive */
.table-responsive { overflow-x: auto; }

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 15px; flex-wrap: wrap; }
.page-btn { padding: 6px 12px; border-radius: 5px; text-decoration: none; background: #f0f4f8; color: var(--text); border: 1px solid var(--border); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Bg Colors */
.bg-blue { background: var(--primary) !important; }
.bg-green { background: var(--success) !important; }
.bg-red { background: var(--danger) !important; }
.bg-purple { background: #7c3aed !important; }
.bg-orange { background: #f59e0b !important; }
.text-primary { color: var(--primary) !important; }

/* Modal Overlay */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1050; }
.modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); }
.modal-content { position: relative; background: #fff; border-radius: var(--radius-lg); max-width: 600px; width: 90%; margin: 40px auto; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-start; }

/* Print */
@media print {
    .no-print, .sidebar, .topbar, .btn, .filter-bar { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    .print-header { display: block !important; }
    .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
}

/* Alert Variants */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border-right: 4px solid; }
.alert-success { background: #e8f5e9; border-color: var(--success); color: #2e7d32; }
.alert-danger { background: #fff5f5; border-color: var(--danger); color: #c62828; }
.alert-warning { background: #fff9e6; border-color: var(--warning); color: #7c4e00; }
.alert-info { background: #e8f4fd; border-color: #17a2b8; color: #0c5460; }

/* Btn Outline */
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); padding: 7px 16px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; }
.btn-outline:hover { background: var(--surface2); }

/* Badge Colors */
.badge-primary { background: var(--primary); color: #fff; }
.badge-secondary { background: #6c757d; color: #fff; }
.badge-success { background: var(--success); color: #fff; }
.badge-danger { background: var(--danger); color: #fff; }
.badge-warning { background: var(--warning); color: #fff; }
.badge-info { background: #17a2b8; color: #fff; }

/* Form Grid */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:768px) { .form-grid { grid-template-columns: 1fr; } }

/* mt-2 */
.mt-2 { margin-top: 8px; }

/* Stat Card Primary */
.stat-card-primary .stat-value { color: var(--primary); }

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

/* report toggle tabs override */
.form-grid-cols-2 { grid-template-columns: 1fr 1fr; }
