/* ==========================================================================
   Glass Dashboard V21 Design System (Sky Blue & White Theme)
   Ultra-Modern Frosted Glassmorphism Architecture with Ambient Light Mesh
   ========================================================================== */

:root {
    /* Primary Healthcare Sky Blue & White Palette */
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --primary-light: #f0f9ff;
    --primary-subtle: #e0f2fe;
    --primary-border: #bae6fd;
    --primary-focus: rgba(14, 165, 233, 0.25);
    
    --secondary: #0ea5e9;
    --secondary-light: #f8fafc;
    --sky-accent: #38bdf8;
    
    --success: #10b981;
    --success-light: #ecfdf5;
    
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    
    --danger: #ef4444;
    --danger-light: #fef2f2;
    
    --purple: #8b5cf6;
    --purple-light: #f5f3ff;
    
    --dark: #0f172a;
    --gray-800: #1e293b;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    --white: #ffffff;
    
    /* Layout Dimensions */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius-sm: 8px;
    --border-radius: 14px;
    --border-radius-lg: 18px;
    --border-radius-xl: 22px;
    
    /* V21 Glassmorphism Tokens */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-bg-hover: rgba(255, 255, 255, 0.85);
    --glass-bg-solid: rgba(255, 255, 255, 0.92);
    --glass-bg-subtle: rgba(240, 249, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.85);
    --glass-border-subtle: rgba(186, 230, 253, 0.55);
    --glass-blur: blur(16px) saturate(180%);
    --glass-blur-heavy: blur(24px) saturate(190%);
    
    --glass-shadow-sm: 0 4px 16px 0 rgba(14, 165, 233, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    --glass-shadow-md: 0 10px 30px -4px rgba(14, 165, 233, 0.1), 0 2px 6px -1px rgba(0, 0, 0, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    --glass-shadow-lg: 0 18px 42px -6px rgba(14, 165, 233, 0.18), 0 6px 14px -3px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff;
    --glass-shadow-modal: 0 25px 65px -10px rgba(14, 165, 233, 0.25), 0 10px 20px -5px rgba(0, 0, 0, 0.05), inset 0 1px 0 #ffffff;
}

/* ==========================================================================
   V21 Ambient Background Layer & Moving Lighting Mesh
   ========================================================================== */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f7ff;
    color: var(--gray-800);
    margin: 0;
    padding: 0;
    position: relative;
    min-height: 100vh;
}

/* Ambient Floating Glowing Mesh Layer */
.glass-v21-ambient-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background: 
        radial-gradient(circle at 10% 15%, rgba(56, 189, 248, 0.22) 0%, rgba(240, 249, 255, 0.05) 45%, transparent 70%),
        radial-gradient(circle at 88% 18%, rgba(2, 132, 199, 0.15) 0%, rgba(186, 230, 253, 0.18) 40%, transparent 65%),
        radial-gradient(circle at 25% 82%, rgba(14, 165, 233, 0.16) 0%, rgba(224, 242, 254, 0.25) 45%, transparent 70%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.8) 0%, rgba(240, 249, 255, 0.4) 40%, transparent 65%);
}

.glass-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(65px);
    opacity: 0.65;
    pointer-events: none;
    animation: glassOrbFloat 14s ease-in-out infinite alternate;
}

.glass-orb-1 {
    width: 450px;
    height: 450px;
    top: -80px;
    left: -60px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, rgba(186, 230, 253, 0.1) 70%, transparent 100%);
    animation-duration: 16s;
}

.glass-orb-2 {
    width: 520px;
    height: 520px;
    top: 15%;
    right: -120px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, rgba(224, 242, 254, 0.15) 65%, transparent 100%);
    animation-duration: 20s;
    animation-delay: -3s;
}

.glass-orb-3 {
    width: 480px;
    height: 480px;
    bottom: -80px;
    left: 20%;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.2) 0%, rgba(186, 230, 253, 0.2) 60%, transparent 100%);
    animation-duration: 18s;
    animation-delay: -6s;
}

.glass-orb-4 {
    width: 400px;
    height: 400px;
    bottom: 20%;
    right: 15%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(240, 249, 255, 0.4) 60%, transparent 100%);
    animation-duration: 22s;
    animation-delay: -9s;
}

@keyframes glassOrbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, -25px) scale(1.08);
    }
    100% {
        transform: translate(-20px, 20px) scale(0.96);
    }
}

/* ==========================================================================
   Layout Architecture
   ========================================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Glass Sidebar Navigation */
.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(240, 249, 255, 0.68) 45%, rgba(255, 255, 255, 0.8) 100%) !important;
    backdrop-filter: blur(28px) saturate(210%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(210%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.92) !important;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 
        6px 0 32px rgba(14, 165, 233, 0.12),
        inset -1px 0 0 0 rgba(255, 255, 255, 0.98),
        inset 1px 0 0 0 rgba(255, 255, 255, 0.8) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    overflow: hidden;
}

/* Ambient glass lighting sheen at sidebar top */
.app-sidebar::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -60px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.32) 0%, rgba(186, 230, 253, 0.12) 50%, transparent 75%);
    filter: blur(35px);
    pointer-events: none;
    z-index: 0;
}

/* Dynamic Cursor Glass Spotlight (Moves smoothly with cursor coordinates) */
.sidebar-spotlight {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(300px circle at var(--sidebar-mouse-x, -500px) var(--sidebar-mouse-y, -500px), rgba(56, 189, 248, 0.28) 0%, rgba(14, 165, 233, 0.1) 45%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.app-sidebar:hover .sidebar-spotlight {
    opacity: 1;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.88) !important;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary-dark);
    text-decoration: none;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.84) 0%, rgba(224, 242, 254, 0.55) 100%) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.05);
    position: relative;
    z-index: 3;
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.75rem;
    overflow-y: auto;
    position: relative;
    z-index: 2;
}

/* Dynamic Magnetic Sliding Glass Hover Capsule */
.sidebar-glass-indicator {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    height: 42px;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(224, 242, 254, 0.82) 100%);
    backdrop-filter: blur(16px) saturate(190%);
    -webkit-backdrop-filter: blur(16px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.98);
    box-shadow: 
        0 8px 24px -3px rgba(14, 165, 233, 0.28),
        0 2px 6px -1px rgba(2, 132, 199, 0.12),
        inset 0 1px 0 0 #ffffff;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transform: scale(0.97);
    transition: 
        top 0.24s cubic-bezier(0.2, 0.9, 0.25, 1.05),
        height 0.18s ease,
        transform 0.24s cubic-bezier(0.2, 0.9, 0.25, 1.05),
        opacity 0.22s ease;
}

.sidebar-glass-indicator.visible {
    opacity: 1;
    transform: scale(1);
}

.sidebar-glass-indicator::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3.5px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.6);
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 700;
    color: var(--gray-400);
    padding: 0.75rem 1rem 0.35rem;
    position: relative;
    z-index: 2;
}

.sidebar-link {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    border-radius: var(--border-radius-sm);
    color: var(--gray-600);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 0.25rem;
    gap: 0.85rem;
    border: 1px solid transparent;
    overflow: hidden;
    transition: 
        color 0.22s ease,
        transform 0.26s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.24s ease,
        border-color 0.24s ease,
        box-shadow 0.24s ease;
}

/* Moving glass light beam reflection */
.sidebar-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 80%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.65) 50%, transparent 100%);
    transform: skewX(-25deg);
    transition: left 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 3;
}

.sidebar-link:hover::after {
    left: 150%;
}

.sidebar-link:hover {
    color: var(--primary-dark) !important;
    transform: translateX(4px);
}

.sidebar-link i {
    font-size: 1.15rem;
    color: var(--gray-500);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.22s ease;
}

.sidebar-link:hover i {
    transform: scale(1.15);
    color: var(--primary);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.14), rgba(14, 165, 233, 0.22)) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    color: var(--primary) !important;
    font-weight: 700;
    border-left: 3.5px solid var(--primary) !important;
    border-color: rgba(186, 230, 253, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 16px rgba(14, 165, 233, 0.14) !important;
}

.sidebar-link.active i {
    color: var(--primary);
    filter: drop-shadow(0 2px 6px rgba(14, 165, 233, 0.35));
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.9) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(224, 242, 254, 0.58) 100%) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 -4px 15px -4px rgba(14, 165, 233, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    position: relative;
    z-index: 3;
}

.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    z-index: 1;
}

/* Glass Header Bar */
.app-header {
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur-heavy);
    -webkit-backdrop-filter: var(--glass-blur-heavy);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 20px 0 rgba(14, 165, 233, 0.06);
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4) 30%, rgba(56, 189, 248, 0.4) 70%, transparent);
}

.header-greeting h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-800);
}

.header-greeting small {
    color: var(--gray-500);
    font-size: 0.82rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.app-content {
    padding: 2rem;
    flex: 1;
}

/* ==========================================================================
   V21 Glass Cards & Panels
   ========================================================================== */
.card-hospital {
    background: var(--glass-bg) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border-radius: var(--border-radius) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow-md) !important;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease !important;
}

/* Top Specular Shine Highlight */
.card-hospital::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 1) 30%, rgba(255, 255, 255, 1) 70%, transparent);
    pointer-events: none;
    z-index: 2;
}

.card-hospital:hover {
    transform: translateY(-4px) !important;
    box-shadow: var(--glass-shadow-lg) !important;
    border-color: rgba(186, 230, 253, 0.95) !important;
}

.card-hospital-header {
    padding: 1.2rem 1.5rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(240, 249, 255, 0.6) 100%) !important;
    border-bottom: 1px solid var(--glass-border-subtle) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(8px);
}

.card-hospital-header h5 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-hospital-body {
    padding: 1.5rem;
}

/* ==========================================================================
   V21 Glass Stat Metric Cards
   ========================================================================== */
.stat-card {
    background: var(--glass-bg) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border-radius: var(--border-radius) !important;
    padding: 1.4rem;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow-md) !important;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease !important;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95) 40%, rgba(255, 255, 255, 0.95) 60%, transparent);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.01) !important;
    box-shadow: var(--glass-shadow-lg) !important;
    border-color: rgba(186, 230, 253, 0.95) !important;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4.5px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.stat-card.green::after { background: var(--success); box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
.stat-card.blue::after { background: var(--primary); box-shadow: 0 0 10px rgba(14, 165, 233, 0.4); }
.stat-card.orange::after { background: var(--warning); box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
.stat-card.purple::after { background: var(--purple); box-shadow: 0 0 10px rgba(139, 92, 246, 0.4); }

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card:hover .stat-icon {
    transform: scale(1.12) rotate(4deg);
}

.stat-card.green .stat-icon { background: rgba(209, 250, 229, 0.85); color: var(--success); }
.stat-card.blue .stat-icon { background: rgba(224, 242, 254, 0.85); color: var(--primary); }
.stat-card.orange .stat-icon { background: rgba(254, 243, 199, 0.85); color: var(--warning); }
.stat-card.purple .stat-icon { background: rgba(243, 232, 255, 0.85); color: var(--purple); }

.stat-content {
    flex: 1;
}

.stat-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: capitalize;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   V21 Glass Workflow Stepper
   ========================================================================== */
.workflow-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.25rem 1.75rem;
    margin-bottom: 1.75rem;
    position: relative;
    box-shadow: var(--glass-shadow-sm);
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.stepper-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid var(--gray-300);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.stepper-step.completed .stepper-circle {
    background: linear-gradient(135deg, #059669, #10b981);
    border-color: #059669;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.stepper-step.active .stepper-circle {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    border-color: #0284c7;
    color: white;
    box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.25), 0 4px 14px rgba(14, 165, 233, 0.4);
    animation: pulseGlow 2.5s infinite;
}

.stepper-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 0.15rem;
}

.stepper-desc {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.stepper-step.active .stepper-title {
    color: var(--primary);
}

.stepper-line {
    position: absolute;
    top: 35px;
    left: 8%;
    right: 8%;
    height: 3px;
    background: rgba(186, 230, 253, 0.6);
    z-index: 1;
}

/* ==========================================================================
   V21 Glass Tables
   ========================================================================== */
.table-hospital {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

.table-hospital th {
    background: rgba(240, 249, 255, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.95rem 1rem;
    border-bottom: 1.5px solid var(--glass-border-subtle);
}

.table-hospital td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid rgba(186, 230, 253, 0.35);
    vertical-align: middle;
    font-size: 0.88rem;
    color: var(--gray-700);
    background: transparent;
    transition: background-color 0.18s ease;
}

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

.table-hospital tbody tr:hover td {
    background-color: rgba(224, 242, 254, 0.55) !important;
    backdrop-filter: blur(4px);
}

/* Status Badges */
.badge-status {
    padding: 0.35rem 0.75rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.badge-checked-in { background: rgba(220, 252, 231, 0.85); color: #15803d; }
.badge-in-progress { background: rgba(224, 242, 254, 0.85); color: #0369a1; }
.badge-completed { background: rgba(209, 250, 229, 0.85); color: #065f46; }
.badge-scheduled { background: rgba(254, 243, 199, 0.85); color: #92400e; }
.badge-cancelled { background: rgba(254, 226, 226, 0.85); color: #b91c1c; }
.badge-out-of-stock { background: rgba(254, 226, 226, 0.85); color: #b91c1c; }
.badge-low-stock { background: rgba(254, 243, 199, 0.85); color: #92400e; }

/* Avatar circles */
.avatar-initials {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
   V21 Glass Buttons & Action Controls
   ========================================================================== */
.btn-primary-teal {
    background: linear-gradient(135deg, #0d9488, #14b8a6) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    padding: 0.55rem 1.25rem;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-primary-teal:hover {
    background: linear-gradient(135deg, #0f766e, #0d9488) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(20, 184, 166, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.btn-primary-blue {
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    padding: 0.55rem 1.25rem;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-primary-blue:hover {
    background: linear-gradient(135deg, #0369a1, #0284c7) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
}

.btn-primary-emerald {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    padding: 0.55rem 1.25rem;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-primary-emerald:hover {
    background: linear-gradient(135deg, #047857, #059669) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.btn-primary {
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: linear-gradient(135deg, #0369a1, #0284c7) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
}

.btn-outline-primary {
    color: #0284c7 !important;
    border: 1px solid rgba(186, 230, 253, 0.9) !important;
    background: rgba(255, 255, 255, 0.65) !important;
    backdrop-filter: blur(8px) !important;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.08), inset 0 1px 0 #ffffff !important;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
}

.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

/* ==========================================================================
   V21 Glass Form Inputs & Controls
   ========================================================================== */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(186, 230, 253, 0.85) !important;
    border-radius: 10px !important;
    color: var(--gray-800) !important;
    box-shadow: inset 0 1px 2px rgba(14, 165, 233, 0.04) !important;
    transition: all 0.22s ease !important;
}

.form-control:focus, .form-select:focus {
    background: #ffffff !important;
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 0.25rem rgba(14, 165, 233, 0.22), 0 4px 16px rgba(14, 165, 233, 0.12) !important;
}

.input-group-text {
    background: rgba(240, 249, 255, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(186, 230, 253, 0.85) !important;
    color: var(--primary-dark) !important;
}

/* ==========================================================================
   V21 Glass Modals & Dropdowns
   ========================================================================== */
.modal {
    z-index: 1065 !important;
}

.modal-backdrop {
    z-index: 1055 !important;
    background-color: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

.modal-dialog {
    z-index: 1070 !important;
    pointer-events: auto !important;
}

.modal-content {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: var(--glass-blur-heavy) !important;
    -webkit-backdrop-filter: var(--glass-blur-heavy) !important;
    border: 1px solid rgba(255, 255, 255, 0.95) !important;
    border-radius: var(--border-radius-xl) !important;
    box-shadow: var(--glass-shadow-modal) !important;
    pointer-events: auto !important;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 1) 30%, rgba(255, 255, 255, 1) 70%, transparent);
    pointer-events: none;
}

.modal-header.bg-primary {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.96), rgba(14, 165, 233, 0.96)) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.modal input, .modal select, .modal textarea, .modal button {
    pointer-events: auto !important;
}

.dropdown-menu {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: 0 16px 36px rgba(14, 165, 233, 0.16) !important;
}

/* ==========================================================================
   Prescription Vitals Grid & Stepper Elements
   ========================================================================== */
.vitals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    background: rgba(240, 249, 255, 0.65) !important;
    backdrop-filter: blur(10px) !important;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border-subtle);
    margin-bottom: 1.5rem;
    box-shadow: var(--glass-shadow-sm);
}

.vital-input-box {
    display: flex;
    flex-direction: column;
}

.vital-input-box label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.3rem;
}

.vital-input-box input {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid var(--primary-border);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
    box-shadow: inset 0 1px 2px rgba(14, 165, 233, 0.05);
}

.dosage-frequency-pills {
    display: flex;
    gap: 0.4rem;
}

.dosage-frequency-pills input {
    width: 38px;
    text-align: center;
    border: 1px solid var(--primary-border);
    border-radius: 6px;
    font-weight: 700;
    padding: 0.35rem 0;
    background: rgba(255, 255, 255, 0.9) !important;
}

/* ==========================================================================
   Bootstrap Tab & Pill Polish
   ========================================================================== */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    border-radius: 30px;
}

.nav-tabs .nav-link.active {
    color: #0284c7 !important;
    border-bottom: 2.5px solid #0284c7 !important;
    background: transparent;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    border-color: #0284c7 !important;
    box-shadow: 0 3px 10px rgba(14, 165, 233, 0.28) !important;
}

.text-primary {
    color: #0284c7 !important;
}

.bg-primary {
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    color: #ffffff !important;
}

.bg-primary-subtle {
    background-color: rgba(224, 242, 254, 0.8) !important;
    color: #0369a1 !important;
    border: 1px solid rgba(186, 230, 253, 0.6);
}

.border-primary {
    border-color: #0284c7 !important;
}

/* ==========================================================================
   Animations & Micro-Interactions
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes floatSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.45);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(14, 165, 233, 0);
    }
}

.sidebar-brand-icon, .brand-icon-box {
    animation: floatSlow 4s ease-in-out infinite;
}

/* ==========================================================================
   Comprehensive Responsive Architecture (Mobile, Tablet, Desktop)
   ========================================================================== */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.table-responsive {
    position: relative;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius-sm);
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.6);
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(186, 230, 253, 0.85);
    border-radius: 4px;
}

.custom-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.custom-pills .nav-item {
    flex-shrink: 0;
}

/* Tablet & Mobile (<= 991.98px) */
@media (max-width: 991.98px) {
    .app-sidebar {
        width: 280px;
        max-width: 85vw;
        transform: translateX(-100%);
        z-index: 1050;
        box-shadow: none;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    }

    .app-sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(14, 165, 233, 0.25);
    }

    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .app-header {
        padding: 0.6rem 1.25rem;
        height: auto;
        min-height: 64px;
    }

    .app-content {
        padding: 1.25rem 1rem !important;
    }

    .header-greeting h4 {
        font-size: 1.05rem;
    }
}

/* Mobile Breakpoint (<= 767.98px) */
@media (max-width: 767.98px) {
    .app-header {
        padding: 0.5rem 0.75rem;
        min-height: 58px;
        gap: 0.5rem;
    }

    .app-content {
        padding: 1rem 0.65rem !important;
    }

    .header-greeting h4 {
        font-size: 0.95rem;
    }

    .header-greeting small {
        font-size: 0.75rem;
    }

    .header-actions {
        gap: 0.35rem;
    }

    .header-actions a, .header-actions button {
        padding: 0.35rem 0.65rem;
        font-size: 0.8rem;
    }

    .stat-card {
        padding: 1rem;
        gap: 0.85rem;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        border-radius: 10px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-title {
        font-size: 0.75rem;
    }

    .workflow-stepper {
        overflow-x: auto;
        justify-content: flex-start;
        gap: 1.25rem;
        padding: 1rem;
        -webkit-overflow-scrolling: touch;
    }

    .stepper-step {
        flex: 0 0 85px;
        min-width: 85px;
    }

    .stepper-circle {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .stepper-line {
        display: none;
    }

    .card-hospital-header {
        padding: 0.85rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-hospital-body {
        padding: 1rem;
    }

    .table-hospital th, 
    .table-hospital td {
        padding: 0.65rem 0.75rem;
        font-size: 0.85rem;
    }

    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
}

/* Extra Small Mobile (<= 575.98px) */
@media (max-width: 575.98px) {
    .header-actions span {
        display: none;
    }

    .header-actions a i, .header-actions button i {
        margin: 0 !important;
    }

    .header-actions a, .header-actions button {
        padding: 0.45rem 0.6rem;
    }

    .vitals-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
    }

    .vital-input-box label {
        font-size: 0.7rem;
    }

    .vital-input-box input {
        font-size: 0.82rem;
        padding: 0.35rem 0.5rem;
    }

    .dosage-frequency-pills {
        gap: 0.25rem;
    }

    .dosage-frequency-pills input {
        width: 30px;
        padding: 0.2rem 0;
        font-size: 0.8rem;
    }
}

/* Print Styles */
@media print {
    .glass-v21-ambient-layer,
    .app-sidebar, 
    .app-header, 
    .btn-no-print {
        display: none !important;
    }
    .app-main {
        margin-left: 0 !important;
    }
    .app-content {
        padding: 0 !important;
    }
    .card-hospital {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
}

/* Accessibility Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
