/* GLOBAL PREMIUM STYLES */
html, body { height: 100dvh; overflow: hidden; margin: 0; padding: 0; }
body { 
    background-color: #f8fafc; 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    display: flex; flex-direction: column; 
    color: #1e293b;
}

/* --- HUB SPECIFIC STYLES --- */
.ambient-light {
    position: absolute; inset: 0; pointer-events: none; z-index: -1;
    background: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15), transparent 50%),
        radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.15), transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.15), transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(34, 197, 94, 0.15), transparent 50%);
    animation: aurora 20s ease-in-out infinite alternate;
    filter: blur(40px);
}
@keyframes aurora {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.glass-card {
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative; overflow: hidden; cursor: pointer;
}
.glass-card:hover { transform: translateY(-4px); box-shadow: 0 15px 30px -5px rgba(0,0,0,0.08); }

/* Tile Colors */
.tile-cal { background: linear-gradient(145deg, rgba(204, 251, 241, 0.4), rgba(255, 255, 255, 0.6)); }
.tile-bill { background: linear-gradient(145deg, rgba(220, 252, 231, 0.4), rgba(255, 255, 255, 0.6)); }
.tile-pat { background: linear-gradient(145deg, rgba(255, 237, 213, 0.4), rgba(255, 255, 255, 0.6)); }
.tile-scan { background: linear-gradient(145deg, rgba(207, 250, 254, 0.4), rgba(255, 255, 255, 0.6)); }
.tile-ai { background: linear-gradient(145deg, rgba(224, 231, 255, 0.4), rgba(255, 255, 255, 0.6)); }
.tile-inc { background: linear-gradient(145deg, rgba(254, 249, 195, 0.4), rgba(255, 255, 255, 0.6)); }
.tile-chat { background: linear-gradient(145deg, rgba(219, 234, 254, 0.4), rgba(255, 255, 255, 0.6)); }
.tile-work { background: linear-gradient(145deg, rgba(243, 232, 255, 0.4), rgba(255, 255, 255, 0.6)); }
.tile-adm { background: linear-gradient(145deg, rgba(241, 245, 249, 0.4), rgba(255, 255, 255, 0.6)); }

.icon-box { width: 52px; height: 52px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 8px; background: white; transition: 0.3s; }
.glass-card:hover .icon-box { transform: scale(1.1) rotate(-5deg); color: white !important; }

/* Icon Colors */
.tile-cal:hover .icon-cal { background: #0d9488; } .icon-cal { color: #0d9488; }
.tile-bill:hover .icon-bill { background: #16a34a; } .icon-bill { color: #16a34a; }
.tile-pat:hover .icon-pat { background: #ea580c; } .icon-pat { color: #ea580c; }
.tile-scan:hover .icon-scan { background: #0891b2; } .icon-scan { color: #0891b2; }
.tile-ai:hover .icon-ai { background: #6366f1; } .icon-ai { color: #6366f1; }
.tile-inc:hover .icon-inc { background: #ca8a04; } .icon-inc { color: #ca8a04; }
.tile-chat:hover .icon-chat { background: #2563eb; } .icon-chat { color: #2563eb; }
.tile-work:hover .icon-pro { background: #9333ea; } .icon-pro { color: #9333ea; }
.tile-adm:hover .icon-adm { background: #475569; } .icon-adm { color: #475569; }

.profile-card { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(20px); padding: 16px; border-radius: 28px; box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05); border: 1px solid rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: space-between; }
.branch-capsule { background: white; border: 1px solid #e2e8f0; border-radius: 16px; padding: 4px 6px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.branch-select { appearance: none; background: transparent; border: none; font-size: 13px; font-weight: 700; color: #334155; outline: none; width: 100%; cursor: pointer; }

/* --- PREMIUM INPUTS & MODALS --- */
.input-std { width: 100%; padding: 12px 16px; background: #f1f5f9; border: 1px solid transparent; border-radius: 12px; font-size: 14px; font-weight: 500; color: #334155; outline: none; transition: all 0.3s ease; }
.input-std:focus { background: #ffffff; border-color: #0d9488; box-shadow: 0 4px 12px rgba(13, 148, 136, 0.1); }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); z-index: 50; align-items: center; justify-content: center; backdrop-filter: blur(8px); transition: all 0.3s; }
.modal-overlay-high { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); z-index: 60; align-items: center; justify-content: center; backdrop-filter: blur(12px); }

.modal-box { 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(20px);
    width: 95%; max-width: 500px; 
    border-radius: 24px; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); 
    border: 1px solid rgba(255,255,255,0.6);
    display: flex; flex-direction: column; overflow: hidden; 
}
#view-patient-modal .modal-box { height: 90vh; }
#add-patient-modal .modal-box, #presc-modal .modal-box { max-height: 90vh; padding: 24px; overflow-y: auto; }
#case-sheet-modal .modal-box { height: 90vh; padding: 0; } 
#ai-summary-modal .modal-box { max-height: 80vh; padding: 24px; overflow-y: auto; }

.drawer { position: fixed; bottom: 0; left: 0; right: 0; background: white; border-radius: 24px 24px 0 0; padding: 24px; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); z-index: 60; height: 75vh; box-shadow: 0 -10px 40px rgba(0,0,0,0.1); display: flex; flex-direction: column; }
.drawer.open { transform: translateY(0); }

/* Alphabet Bar */
.alpha-scroll { display: flex; overflow-x: auto; gap: 6px; padding: 10px 16px; background: rgba(255,255,255,0.8); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(0,0,0,0.05); -ms-overflow-style: none; scrollbar-width: none; }
.alpha-btn { min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 700; font-size: 12px; color: #94a3b8; background: transparent; transition: all 0.2s; cursor: pointer; flex-shrink: 0; }
.alpha-btn.active { background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%); color: white; box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3); transform: translateY(-2px); }

/* Scanner */
.scanner-frame { background: #0f172a; border-radius: 20px; padding: 20px; border: 1px solid #334155; position: relative; overflow: hidden; box-shadow: inset 0 0 20px rgba(0,0,0,0.5); }
.scanner-frame::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(#1e293b 1px, transparent 1px), linear-gradient(90deg, #1e293b 1px, transparent 1px); background-size: 20px 20px; opacity: 0.3; pointer-events: none; }
.anatomy-svg { height: 240px; transition: all 0.3s ease; filter: drop-shadow(0 0 5px rgba(255,255,255,0.1)); } 
.body-part { cursor: pointer; transition: all 0.2s ease; vector-effect: non-scaling-stroke; }
.mode-bones .body-part { fill: rgba(255, 255, 255, 0.05); stroke: #94a3b8; stroke-width: 1px; }
.mode-bones .body-part:hover { fill: #2dd4bf; stroke: #2dd4bf; filter: drop-shadow(0 0 8px #2dd4bf); }
.mode-muscles .body-part { fill: rgba(239, 68, 68, 0.2); stroke: #b91c1c; stroke-width: 0.5px; }
.mode-muscles .body-part:hover { fill: #ef4444; filter: drop-shadow(0 0 8px #ef4444); }
.body-part.active { fill: #ef4444 !important; stroke: white !important; opacity: 1; filter: drop-shadow(0 0 10px #ef4444); }

.scan-toggle { background: rgba(255,255,255,0.1); border-radius: 99px; padding: 4px; display: flex; width: fit-content; margin: 0 auto 15px auto; border: 1px solid #334155; backdrop-filter: blur(4px); position: relative; z-index: 10; }
.scan-btn { padding: 8px 20px; border-radius: 99px; font-size: 11px; font-weight: 800; color: #94a3b8; text-transform: uppercase; transition: 0.3s; letter-spacing: 0.5px; }
.scan-btn.active { background: #0f766e; color: white; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }

/* Animations & Sync */
#sync-badge { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 600; color: #0f766e; background: rgba(204, 251, 241, 0.8); backdrop-filter: blur(4px); padding: 4px 10px; border-radius: 99px; opacity: 0; transition: opacity 0.3s; pointer-events: none; border: 1px solid rgba(13, 148, 136, 0.2); }
#sync-badge.visible { opacity: 1; }

.ai-loading { animation: shimmer 1.5s infinite linear; background: linear-gradient(to right, #f3f4f6 8%, #e5e7eb 18%, #f3f4f6 33%); background-size: 800px 104px; color: transparent; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: -468px 0 } 100% { background-position: 468px 0 } }

@keyframes ai-pulse { 0% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(168, 85, 247, 0); } 100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); } }
.ai-active { animation: ai-pulse 2s infinite; border-color: #a855f7 !important; color: #a855f7 !important; }

.grad-primary { background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%); }
.grad-purple { background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%); }
.grad-header { background: linear-gradient(to right, #0f766e, #047857); }