﻿/* ============================================================
   ظ…ظ†طµط© ط§ظ„طھط¯ط±ظٹط¨ ط§ظ„طھط¹ط§ظˆظ†ظٹ â€” t3awni.css
   ظ†ط¸ط§ظ… ط§ظ„طھطµظ…ظٹظ… ط§ظ„ظ…ظˆط­ط¯ (Design System)
   ظ…ط³طھظˆط­ظ‰ ظ…ظ† v.0.4 | ط®ط· Cairo | ط£ظ„ظˆط§ظ† ط§ظ„طھظٹظ„ ظˆط§ظ„ط£ط®ط¶ط±
   ============================================================ */

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

/* ============================================================
   1. CSS Variables â€” Design Tokens
   ============================================================ */
:root {
    /* ط§ظ„ط£ظ„ظˆط§ظ† ط§ظ„ط£ط³ط§ط³ظٹط© */
    --primary:          #2e7d32;
    --secondary:        #004d53;
    --accent:           #006d77;
    --accent-light:     #00695c;

    /* ط§ظ„ط®ظ„ظپظٹط§طھ */
    --bg:               #f8fafc;
    --bg-alt:           #f0f2f5;
    --card-bg:          #ffffff;
    --sidebar-bg:       #004d53;
    --footer-bg:        #00363a;
    --nav-bg:           #004d53;

    /* ط§ظ„ط£ظ„ظˆط§ظ† ط§ظ„ظˆط¸ظٹظپظٹط© */
    --success-bg:       #d1fae5;
    --success-text:     #065f46;
    --success-border:   #10b981;
    --danger-bg:        #fee2e2;
    --danger-text:      #991b1b;
    --danger-border:    #ef4444;
    --warning-bg:       #fef3c7;
    --warning-text:     #92400e;
    --warning-border:   #f59e0b;
    --info-bg:          #e0f2fe;
    --info-text:        #0369a1;
    --info-border:      #3b82f6;

    /* ط§ظ„ظ†طµظˆطµ */
    --text:             #0f172a;
    --text-muted:       #666666;
    --text-light:       #999999;

    /* ط§ظ„طھط¯ط±ط¬ط§طھ */
    --gradient-hero:    linear-gradient(135deg, #004d53 0%, #00695c 100%);
    --gradient-btn:     linear-gradient(135deg, #004d53 0%, #006d77 100%);
    --gradient-sidebar: linear-gradient(180deg, #004d53 0%, #00363a 100%);
    --gradient-card-hover: linear-gradient(135deg, #ffffff 0%, #e8f5e9 100%);

    /* ط§ظ„ط¸ظ„ط§ظ„ */
    --shadow-sm:        0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:        0 4px 10px rgba(0,0,0,0.05);
    --shadow-lg:        0 10px 25px rgba(0,0,0,0.05);
    --shadow-xl:        0 20px 40px rgba(0,0,0,0.1);
    --shadow-hover:     0 12px 24px rgba(0,77,83,0.15), 0 6px 12px rgba(0,77,83,0.1);

    /* ط§ظ„ط­ظˆط§ظپ ط§ظ„ظ…ط³طھط¯ظٹط±ط© */
    --radius-xs:        4px;
    --radius-sm:        8px;
    --radius-md:        12px;
    --radius-lg:        16px;
    --radius-xl:        20px;
    --radius-2xl:       30px;
    --radius-full:      50%;

    /* ط§ظ„ط§ظ†طھظ‚ط§ظ„ط§طھ */
    --transition:       all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast:  all 0.2s ease;

    /* ط§ظ„ط®ط·ظˆط· */
    --font:             'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* ط£ط¨ط¹ط§ط¯ ط§ظ„ظ€ Layout */
    --sidebar-width:    260px;
    --topbar-height:    64px;
    --container-max:    1200px;
}

/* ============================================================
   2. Reset & Base Styles
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    overflow-x: hidden;
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    direction: rtl;
    text-align: right;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul, ol { list-style: none; }

img { max-width: 100%; display: block; }

/* ============================================================
   3. Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

.text-muted       { color: var(--text-muted); }
.text-primary     { color: var(--primary); }
.text-secondary   { color: var(--secondary); }
.text-accent      { color: var(--accent); }
.text-white       { color: #ffffff; }

/* ============================================================
   4. Container & Grid
   ============================================================ */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

/* ============================================================
   5. Landing Page â€” Hero Section
   ============================================================ */
.hero {
    background: var(--gradient-hero);
    padding: 4rem 1.5rem 6rem;
    text-align: center;
    border-bottom-left-radius: var(--radius-2xl);
    border-bottom-right-radius: var(--radius-2xl);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.hero-brand img {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-sm);
    background: #ffffff;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.85);
    max-width: 600px;
    margin: 0 auto 0.5rem;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

/* ============================================================
   6. Portal Cards (Landing Page)
   ============================================================ */
.portals-section {
    margin-top: -4rem;
    padding: 0 1.5rem 3rem;
    position: relative;
    z-index: 10;
}

.portal-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--gradient-btn);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    background: var(--gradient-card-hover);
}

.portal-card:hover::before {
    transform: scaleX(1);
}

.portal-icon-wrapper {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-full);
    background: #e0f2f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.portal-card:hover .portal-icon-wrapper {
    background: #b2dfdb;
    transform: scale(1.1) rotate(5deg);
}

.portal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--secondary);
}

.portal-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
    flex: 1;
}

.portal-badge {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.25rem;
}

.portal-footer {
    margin-top: 0.5rem;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
}

.portal-card:hover .portal-footer {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   7. Login Page
   ============================================================ */
.login-page {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.login-hero {
    background: var(--gradient-hero);
    padding: 2.5rem 1.5rem 5rem;
    text-align: center;
    border-bottom-left-radius: var(--radius-2xl);
    border-bottom-right-radius: var(--radius-2xl);
    position: relative;
    overflow: hidden;
}

.login-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-hero-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
    margin-bottom: 0.5rem;
}

.login-hero-brand img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-xs) ;
    background: #fff;
    padding: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.login-hero-brand span {
    font-size: 1.15rem;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
}

.login-portal-label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.75);
    position: relative;
    z-index: 1;
}

.login-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1.5rem;
    margin-top: -3rem;
    position: relative;
    z-index: 10;
}

.login-box {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.login-box-header {
    padding: 1.75rem 2rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-portal-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: #e0f2f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.login-box-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.15rem;
}

.login-box-header p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.login-box-body {
    overflow-x: hidden;
    padding: 1.75rem 2rem;
}

.login-box-footer {
    padding: 1.25rem 2rem;
    background: var(--bg);
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.login-back-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition-fast);
}

.login-back-link:hover { color: var(--accent); }

/* ============================================================
   8. Form Styles
   ============================================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--text);
    direction: rtl;
    text-align: right;
    transition: var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.1);
}

.form-control::placeholder { color: #bbb; }

.form-control.is-invalid {
    border-color: var(--danger-border);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-group {
    position: relative;
}

.input-group .input-icon {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.input-group .form-control {
    padding-right: 2.75rem;
}

/* ============================================================
   9. Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-xs);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-btn);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,77,83,0.25);
}

.btn-primary:hover {
    box-shadow: 0 8px 20px rgba(0,77,83,0.35);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-primary:active { transform: translateY(0); }

.btn-block { width: 100%; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--secondary);
    color: var(--secondary);
}

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

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220,38,38,0.25);
}

.btn-success {
    background: linear-gradient(135deg, #065f46, #10b981);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16,185,129,0.25);
}

/* ============================================================
   10. Alerts & Flash Messages
   ============================================================ */
.alert {
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: var(--danger-border);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-border);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info-text);
    border-color: var(--info-border);
}

/* ============================================================
   11. Status Badges
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-xl);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success  { background: var(--success-bg); color: var(--success-text); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger-text);  }
.badge-warning  { background: var(--warning-bg); color: var(--warning-text); }
.badge-info     { background: var(--info-bg);    color: var(--info-text);    }
.badge-muted    { background: #f1f5f9;            color: #64748b;             }

/* ============================================================
   12. App Layout (Sidebar + Main)
   ============================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    width: var(--sidebar-width);
    background: var(--gradient-sidebar);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-xs);
    background: #fff;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.sidebar-brand-role {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.6);
    margin-top: 0.1rem;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.05);
    margin: 0.75rem 0.75rem 0;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 0.5rem 0.25rem;
    margin-top: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 6px;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.1);
    color: #ffffff;
}

.sidebar-link.active {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    bottom: 25%;
    width: 3px;
    background: #4dd0e1;
    border-radius: 3px 0 0 3px;
}

.sidebar-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* Main Content Area */
.main-content {
    margin-right: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-body {
    overflow-x: hidden;
    flex: 1;
    padding: 1.75rem;
}

/* ============================================================
   13. Page Header
   ============================================================ */
.page-header {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    border-right: 4px solid var(--secondary);
}

.page-header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.2rem;
}

.page-header-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================================
   14. Stat Cards
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
}

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

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

.stat-icon-teal    { background: #e0f7fa; color: var(--accent); }
.stat-icon-green   { background: var(--success-bg); color: var(--primary); }
.stat-icon-red     { background: var(--danger-bg);  color: #dc2626; }
.stat-icon-amber   { background: var(--warning-bg); color: #d97706; }
.stat-icon-blue    { background: var(--info-bg);    color: #2563eb; }

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ============================================================
   15. Data Tables
   ============================================================ */
.table-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.03);
}

.table-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.table-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: #f8fafc;
}

.data-table th {
    padding: 0.85rem 1.25rem;
    text-align: right;
    font-weight: 700;
    color: var(--secondary);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #f8fafc;
}

.data-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

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

.cell-main  { font-weight: 600; color: var(--text); }
.cell-sub   { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ============================================================
   16. Modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.modal-close:hover { background: #f1f5f9; color: var(--text); }

.modal-body    { padding: 1.5rem 1.75rem; }
.modal-footer  {
    padding: 1rem 1.75rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
}

/* ============================================================
   17. Landing Page Footer
   ============================================================ */
.landing-footer {
    background: var(--footer-bg);
    color: rgba(255,255,255,0.65);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
}

.landing-footer a {
    color: #90e0ef;
    font-weight: 600;
}

.landing-footer a:hover { color: #ffffff; }

/* ============================================================
   18. Responsive
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .mobile-overlay.active { display: block; }

    .topbar-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: none;
        background: var(--bg);
        border-radius: var(--radius-xs);
        cursor: pointer;
        font-size: 1.1rem;
        color: var(--secondary);
    }

    .portal-grid {
        grid-template-columns: 1fr;
    }

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

    .page-body {
    overflow-x: hidden; padding: 1rem; }

    .hero { padding: 3rem 1rem 5rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-box-body {
    overflow-x: hidden; padding: 1.25rem 1.25rem; }
}

/* ============================================================
   19. Utility Classes
   ============================================================ */
.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-1        { gap: 0.5rem; }
.gap-2        { gap: 1rem; }
.gap-3        { gap: 1.5rem; }
.mt-1         { margin-top: 0.5rem; }
.mt-2         { margin-top: 1rem; }
.mt-3         { margin-top: 1.5rem; }
.mb-1         { margin-bottom: 0.5rem; }
.mb-2         { margin-bottom: 1rem; }
.mb-3         { margin-bottom: 1.5rem; }
.p-0          { padding: 0; }
.w-100        { width: 100%; }
.text-center  { text-align: center; }
.fw-bold      { font-weight: 700; }
.small        { font-size: 0.85rem; }

/* Error page styles */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    text-align: center;
    padding: 2rem;
}

.error-box {
    max-width: 480px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    box-shadow: var(--shadow-xl);
}

.error-code {
    font-size: 4rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.error-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}


