/* ==========================================================================
   MEDAD HAYAH - DESIGN SYSTEM & STYLESHEET
   Modern Light Healthcare SaaS Theme (English / LTR)
   ========================================================================== */

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

:root {
    /* Brand Colors derived from official logo */
    --primary-red: #B70F2D;
    --primary-red-hover: #960B24;
    --primary-red-light: #FDF2F4;
    --primary-red-subtle: #FCE8EB;

    --muted-teal: #397C78;
    --muted-teal-hover: #2C6360;
    --muted-teal-light: #F0F7F6;
    --muted-teal-subtle: #E2EFEF;

    --charcoal-dark: #1E293B;
    --charcoal: #293743;
    --charcoal-light: #475569;

    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    --bg-main: #FFFFFF;
    --bg-soft: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-hover: #F1F5F9;

    --border-light: #E2E8F0;
    --border-subtle: #EDF2F7;
    --border-focus: #B70F2D;

    /* Semantic Statuses */
    --status-success: #10B981;
    --status-success-light: #ECFDF5;
    --status-warning: #F59E0B;
    --status-warning-light: #FFFBEB;
    --status-danger: #EF4444;
    --status-danger-light: #FEF2F2;
    --status-info: #0284C7;
    --status-info-light: #F0F9FF;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Shadows & Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 9999px;

    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-soft);
    color: var(--text-primary);
    direction: ltr;
    text-align: left;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--charcoal-dark);
    margin-bottom: 0.75rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* Navigation Bar */
.navbar-medad {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-subtle);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand-logo {
    height: 46px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.navbar-brand-logo:hover {
    transform: scale(1.02);
}

.nav-link {
    font-weight: 500;
    color: var(--charcoal);
    padding: 0.5rem 0.9rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-red);
    background-color: var(--primary-red-light);
    font-weight: 600;
}

/* Buttons */
.btn {
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.25rem;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}

.btn-primary {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: #FFFFFF;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-red-hover);
    border-color: var(--primary-red-hover);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(183, 15, 45, 0.25);
}

.btn-teal {
    background-color: var(--muted-teal);
    border-color: var(--muted-teal);
    color: #FFFFFF;
}

.btn-teal:hover, .btn-teal:focus {
    background-color: var(--muted-teal-hover);
    border-color: var(--muted-teal-hover);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(57, 124, 120, 0.25);
}

.btn-outline-primary {
    color: var(--primary-red);
    border-color: var(--primary-red);
}

.btn-outline-primary:hover {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: #FFFFFF;
}

.btn-outline-teal {
    color: var(--muted-teal);
    border-color: var(--muted-teal);
}

.btn-outline-teal:hover {
    background-color: var(--muted-teal);
    border-color: var(--muted-teal);
    color: #FFFFFF;
}

.btn-light-subtle {
    background-color: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--charcoal);
}

.btn-light-subtle:hover {
    background-color: var(--border-light);
    color: var(--charcoal-dark);
}

.btn-demo-account {
    font-size: 0.76rem !important;
    padding: 0.35rem 0.4rem !important;
    gap: 0.25rem !important;
    font-weight: 500;
    white-space: nowrap;
}

.btn-demo-account i {
    font-size: 0.82rem;
}

/* Card Styling */
.card-medad {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    padding: 4.5rem 0 3.5rem;
    position: relative;
    border-bottom: 1px solid var(--border-light);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-red-light);
    color: var(--primary-red);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(183, 15, 45, 0.15);
}

.hero-title {
    font-size: 2.85rem;
    font-weight: 900;
    color: var(--charcoal-dark);
    line-height: 1.25;
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 620px;
}

/* Blood Type Badges */
.badge-blood {
    font-family: var(--font-sans);
    background-color: var(--primary-red-light);
    color: var(--primary-red);
    border: 1px solid rgba(183, 15, 45, 0.25);
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-blood-teal {
    font-family: var(--font-sans);
    background-color: var(--muted-teal-light);
    color: var(--muted-teal);
    border: 1px solid rgba(57, 124, 120, 0.25);
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
}

/* Urgency Badges */
.badge-urgency-critical {
    background-color: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FCA5A5;
    font-weight: 700;
}

.badge-urgency-high {
    background-color: #FFFBEB;
    color: #D97706;
    border: 1px solid #FCD34D;
    font-weight: 700;
}

.badge-urgency-moderate {
    background-color: #F0F9FF;
    color: #0284C7;
    border: 1px solid #BAE6FD;
    font-weight: 700;
}

/* Status Badges */
.badge-status-active {
    background-color: var(--status-success-light);
    color: var(--status-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status-pending {
    background-color: var(--status-warning-light);
    color: var(--status-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status-completed {
    background-color: #F1F5F9;
    color: #475569;
    border: 1px solid var(--border-light);
}

.badge-status-cancelled {
    background-color: var(--status-danger-light);
    color: var(--status-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Medical Disclaimer Alert Banner */
.alert-medical-disclaimer {
    background-color: #F0F7F6;
    border-left: 4px solid var(--muted-teal);
    border-top: 1px solid #D2E6E4;
    border-bottom: 1px solid #D2E6E4;
    border-right: 1px solid #D2E6E4;
    color: var(--charcoal);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    line-height: 1.6;
}

/* Dashboard Layout (LTR) */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

.dashboard-sidebar {
    width: 280px;
    background: #FFFFFF;
    border-right: 1px solid var(--border-light);
    border-left: none;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.dashboard-content {
    flex: 1;
    padding: 2rem;
    background-color: var(--bg-soft);
    overflow-y: auto;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    padding: 0.5rem 0.75rem;
    margin-top: 1rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--charcoal);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.sidebar-menu-link i {
    font-size: 1.15rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.sidebar-menu-link:hover {
    background-color: var(--bg-hover);
    color: var(--primary-red);
}

.sidebar-menu-link:hover i {
    color: var(--primary-red);
}

.sidebar-menu-link.active {
    background-color: var(--primary-red-light);
    color: var(--primary-red);
    font-weight: 600;
}

.sidebar-menu-link.active i {
    color: var(--primary-red);
}

/* Stat Cards */
.stat-card {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.35rem;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.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-red {
    background-color: var(--primary-red-light);
    color: var(--primary-red);
}

.stat-icon-teal {
    background-color: var(--muted-teal-light);
    color: var(--muted-teal);
}

.stat-icon-amber {
    background-color: #FFFBEB;
    color: #D97706;
}

.stat-icon-blue {
    background-color: #F0F9FF;
    color: #0284C7;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--charcoal-dark);
    line-height: 1.1;
    margin-bottom: 0.2rem;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
}

/* Tables */
.table-medad {
    width: 100%;
    margin-bottom: 0;
    vertical-align: middle;
}

.table-medad th {
    background-color: #F8FAFC;
    color: var(--charcoal);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table-medad td {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 0.92rem;
}

.table-medad tbody tr:hover {
    background-color: #F8FAFC;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.form-control, .form-select {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(183, 15, 45, 0.12);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
}

.empty-state-icon {
    width: 68px;
    height: 68px;
    background-color: var(--bg-hover);
    color: var(--text-muted);
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    margin-bottom: 1.25rem;
}

.empty-state-title {
    font-weight: 700;
    color: var(--charcoal-dark);
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    color: var(--text-secondary);
    max-width: 440px;
    margin: 0 auto 1.5rem;
    font-size: 0.95rem;
}

/* Footer */
.footer-medad {
    background: #FFFFFF;
    border-top: 1px solid var(--border-light);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-academic-notice {
    background-color: #F8FAFC;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2rem;
}

/* Responsive Utilities & Mobile Offcanvas Drawer (Dark Navy Theme - Slide from Left for LTR) */
@media (max-width: 991.98px) {
    .dashboard-container {
        flex-direction: column !important;
    }

    /* Fixed Dark Navy Offcanvas Drawer (Slides from Left) */
    .dashboard-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        width: 300px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        z-index: 9999 !important;
        background-color: #0b1a30 !important; /* Deep dark navy like the reference image */
        color: #e2e8f0 !important;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45) !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow-y: auto !important;
        border: none !important;
        padding: 1.25rem 1rem !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .dashboard-sidebar.sidebar-open {
        transform: translateX(0) !important;
    }

    /* Dark theme text & links for mobile drawer */
    .dashboard-sidebar .sidebar-heading {
        color: #64748b !important;
        font-size: 0.72rem !important;
        letter-spacing: 0.08em !important;
        margin-top: 1.25rem !important;
        padding: 0.4rem 0.6rem !important;
    }

    .dashboard-sidebar .sidebar-menu-link {
        color: #cbd5e1 !important;
        padding: 0.75rem 0.9rem !important;
        border-radius: 8px !important;
        margin-bottom: 0.3rem !important;
        font-size: 0.92rem !important;
    }

    .dashboard-sidebar .sidebar-menu-link i {
        color: #94a3b8 !important;
        font-size: 1.15rem !important;
    }

    .dashboard-sidebar .sidebar-menu-link:hover {
        background-color: rgba(255, 255, 255, 0.08) !important;
        color: #ffffff !important;
    }

    .dashboard-sidebar .sidebar-menu-link:hover i {
        color: #ffffff !important;
    }

    .dashboard-sidebar .sidebar-menu-link.active {
        background-color: rgba(183, 15, 45, 0.25) !important;
        color: #ffffff !important;
        border-left: 3px solid #b70f2d !important;
        font-weight: 600 !important;
    }

    .dashboard-sidebar .sidebar-menu-link.active i {
        color: #ff6b81 !important;
    }

    /* Subtle backdrop behind drawer */
    .sidebar-backdrop {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background-color: rgba(15, 23, 42, 0.6) !important;
        backdrop-filter: blur(3px) !important;
        z-index: 9990 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease !important;
    }

    .sidebar-backdrop.active {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .hero-title {
        font-size: 2.2rem;
    }
}
