:root {
    /* Colors — Light Theme Defaults */
    --bg-base: #eef2f8;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-hover: rgba(241, 245, 251, 0.95);
    --bg-modal: rgba(255, 255, 255, 0.98);
    
    --text-main: #1f2c44;
    --text-muted: #566480;
    
    --accent-primary: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.15);
    
    --border-subtle: rgba(30, 60, 110, 0.12);
    --border-active: rgba(37, 99, 235, 0.4);
    
    /* Status Colors */
    --status-low: #00e676;
    --status-low-bg: rgba(0, 230, 118, 0.1);
    --status-mod: #ffd600;
    --status-mod-bg: rgba(255, 214, 0, 0.1);
    --status-high: #ff9100;
    --status-high-bg: rgba(255, 145, 0, 0.1);
    --status-crit: #ff1744;
    --status-crit-bg: rgba(255, 23, 68, 0.1);
    
    /* Dimensions */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 12px;
    
    /* Transitions */
    --transition-speed: 0.3s;
}

[data-theme="dark"], html[data-theme="dark"] {
    --bg-base: #0a0f1e;
    --bg-surface: rgba(16, 22, 46, 0.65);
    --bg-surface-hover: rgba(26, 34, 69, 0.85);
    --bg-modal: rgba(6, 9, 19, 0.95);
    
    --text-main: #ffffff;
    --text-muted: #8a99ad;
    
    --accent-primary: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.3);
    
    --border-subtle: rgba(0, 212, 255, 0.15);
    --border-active: rgba(0, 212, 255, 0.5);
}

[data-theme="light"], html[data-theme="light"] {
    --bg-base: #eef2f8;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-hover: rgba(241, 245, 251, 0.95);
    --bg-modal: rgba(255, 255, 255, 0.98);
    
    --text-main: #1f2c44;
    --text-muted: #566480;
    
    --accent-primary: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.15);
    
    --border-subtle: rgba(30, 60, 110, 0.12);
    --border-active: rgba(37, 99, 235, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    overflow-x: hidden;
    font-size: 14px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-main);
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Utility */
.text-accent { color: var(--accent-primary); }
.text-muted { color: var(--text-muted); }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* Buttons */
.btn {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    outline: none;
}
.btn:hover {
    background: var(--accent-primary);
    color: var(--bg-base);
    box-shadow: 0 0 15px var(--accent-glow);
}
.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-base);
}
.btn-primary:hover {
    background: #00e6ff;
    box-shadow: 0 0 20px rgba(0, 230, 255, 0.5);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    color: var(--text-main);
    transition: border-color var(--transition-speed);
}
.form-input:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* ================= LOGIN PAGE ================= */
#login-page,
#signup-page {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 2rem 1.25rem 3rem;
    background: radial-gradient(circle at center, #111a3a 0%, var(--bg-base) 100%);
    z-index: 1000;
    cursor: default;
}
#login-page .login-card,
#signup-page .login-card {
    margin: auto;
    flex-shrink: 0;
}
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
}
.signup-card {
    max-width: 440px;
}
.auth-switch {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.auth-switch a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}
.auth-switch a:hover {
    text-decoration: underline;
}
.auth-error {
    color: var(--status-crit);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}
.auth-success {
    color: var(--status-low);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}
.auth-signup-btn {
    margin-top: 0.75rem;
}
#login-page .form-input,
#signup-page .form-input,
#login-page textarea,
#signup-page textarea {
    cursor: text;
    caret-color: var(--accent-primary);
}
#login-page .btn,
#signup-page .btn,
#login-page .cred-chip {
    cursor: pointer;
}
#login-page select.form-input,
#signup-page select.form-input {
    cursor: pointer;
}
.login-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.75rem;
    padding-top: 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}
.login-scroll-hint i {
    color: var(--accent-primary);
    animation: loginScrollBounce 1.8s ease-in-out infinite;
}
@keyframes loginScrollBounce {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(6px); opacity: 1; }
}
.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.login-logo i {
    font-size: 3rem;
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
    margin-bottom: 1rem;
}
.demo-credentials {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}
.cred-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.cred-chip {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.cred-chip:hover {
    background: rgba(255,255,255,0.15);
}
#login-error {
    color: var(--status-crit);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

/* ================= APP LAYOUT ================= */
#app-container {
    display: none; /* shown as grid via .is-visible (see JS) */
    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;
}

#app-container.is-visible {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: 1fr;
}

/* Sidebar */
.sidebar {
    grid-column: 1;
    grid-row: 1;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-subtle);
    z-index: 50;
    box-sizing: border-box;
    overflow: hidden;
}
.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    gap: 0.75rem;
}
.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.nav-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-speed);
    cursor: pointer;
    border-left: 3px solid transparent;
}
.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    background: rgba(0, 212, 255, 0.05);
    border-left-color: var(--accent-primary);
}
.nav-item i { width: 20px; text-align: center; }
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex; align-items: center; justify-content: center;
    color: var(--bg-base);
    font-weight: 700;
}

/* Main Area */
.main-content {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

/* Header */
.header {
    flex-shrink: 0;
    height: var(--header-height);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
}
.header-left .hospital-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.header-user {
    text-align: right;
    line-height: 1.35;
}
.header-user .user-name {
    font-weight: 600;
    font-size: 0.95rem;
}
.header-user .user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: capitalize;
}
.risk-progress-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    margin: 1rem 0 0.5rem;
    overflow: hidden;
}
.risk-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background-color 0.5s ease;
}
.clock {
    font-variant-numeric: tabular-nums;
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: var(--accent-primary);
}
.alert-bell {
    position: relative;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-speed);
}
.alert-bell:hover { color: var(--text-main); }
.alert-badge {
    position: absolute;
    top: -5px; right: -8px;
    background: var(--status-crit);
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    border-radius: 10px;
    padding: 2px 5px;
    min-width: 18px;
    text-align: center;
}

/* View Management */
.view {
    display: none;
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}
.view.active { display: block; animation: fadeIn 0.4s ease; }

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

/* ================= DASHBOARD VIEW ================= */
/* Stats Ribbon */
.stats-ribbon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    background: rgba(255,255,255,0.05);
}
.stat-info .value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}
.stat-info .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
}
@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Bed Grid */
.beds-container h2 { margin-bottom: 1rem; }
.bed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.bed-card {
    padding: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}
.bed-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-active);
}
.bed-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.bed-id {
    background: rgba(255,255,255,0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}
.patient-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Risk Circle */
.risk-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.risk-score-wrapper {
    position: relative;
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}
.risk-score-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    border: 3px solid currentColor;
    opacity: 0.3;
}
/* Color classes for JS to add */
.risk-low { color: var(--status-low); }
.risk-low .risk-score-wrapper::before { border-color: var(--status-low); opacity: 1; border-top-color: transparent;}

.risk-mod { color: var(--status-mod); }
.risk-mod .risk-score-wrapper::before { border-color: var(--status-mod); opacity: 1; border-top-color: transparent; border-right-color: transparent;}

.risk-high { color: var(--status-high); }
.risk-high .risk-score-wrapper::before { border-color: var(--status-high); opacity: 1; border-bottom-color: transparent;}

.risk-crit { color: var(--status-crit); animation: pulseCrit 2s infinite; }
.risk-crit .risk-score-wrapper::before { border-color: var(--status-crit); opacity: 1;}

@keyframes pulseCrit {
    0% { box-shadow: 0 0 0 0 rgba(255, 23, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 23, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 23, 68, 0); }
}

.risk-details { flex: 1; }
.risk-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.bed-empty {
    border: 1px dashed var(--text-muted);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    min-height: 180px;
}
.bed-empty i { font-size: 2rem; margin-bottom: 1rem; opacity: 0.5; }

/* Alert Feed */
.alert-feed-container {
    display: flex; flex-direction: column;
    height: 100%;
}
.alert-feed {
    flex: 1;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    padding-right: 0.5rem;
}
.alert-item {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid;
    background: rgba(0,0,0,0.2);
    animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.alert-time { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.alert-msg { font-size: 0.9rem; line-height: 1.4; }
.alert-low { border-color: var(--status-low); background: var(--status-low-bg); }
.alert-mod { border-color: var(--status-mod); background: var(--status-mod-bg); }
.alert-high { border-color: var(--status-high); background: var(--status-high-bg); }
.alert-crit { border-color: var(--status-crit); background: var(--status-crit-bg); }

/* ================= MODAL ================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-content {
    width: 90%; max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 0;
    background: var(--bg-modal);
    border-radius: 16px;
}
.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex; justify-content: space-between; align-items: center;
}
.close-modal {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.5rem; cursor: pointer; transition: color 0.2s;
}
.close-modal:hover { color: var(--text-main); }

.modal-body { padding: 2rem; }

.patient-banner {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
}
.patient-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--accent-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: var(--accent-primary);
}
.patient-info h2 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.patient-demographics { display: flex; gap: 1rem; color: var(--text-muted); font-size: 0.9rem;}

/* Vitals Grid */
.vitals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.vital-card {
    padding: 1.25rem 1rem;
    text-align: center;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s;
}
.vital-card.flash { background: rgba(0,212,255,0.2); border-color: var(--accent-primary); }
.vital-icon { color: var(--text-muted); margin-bottom: 0.5rem; font-size: 1.2rem; }
.vital-value { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.25rem; font-variant-numeric: tabular-nums;}
.vital-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.vital-unit { font-size: 0.9rem; font-weight: normal; color: var(--text-muted); }

/* Heartbeat anim */
.fa-heart.beating { animation: heartbeat 1s infinite; color: var(--status-crit); }
@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.2); }
    30% { transform: scale(1); }
    45% { transform: scale(1.2); }
    60% { transform: scale(1); }
}

.ai-analysis-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
@media (max-width: 768px) {
    .ai-analysis-panel { grid-template-columns: 1fr; }
}
.ai-score-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 2rem; background: rgba(0,0,0,0.2); border-radius: 12px; text-align: center;
}
.big-score {
    font-size: 4rem; font-weight: 700; line-height: 1; margin: 1rem 0;
}
.factors-list {
    padding-left: 1.5rem; margin-top: 1rem;
}
.factors-list li { margin-bottom: 0.5rem; color: rgba(255,255,255,0.8); }

/* ================= NLP VIEW ================= */
.nlp-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: calc(100vh - 150px);
}
@media (max-width: 992px) {
    .nlp-container { grid-template-columns: 1fr; height: auto; }
}
.nlp-editor {
    display: flex; flex-direction: column; height: 100%;
}
.textarea-wrapper {
    flex: 1; margin: 1rem 0;
}
#clinical-note {
    width: 100%; height: 100%; min-height: 300px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.6;
    resize: none;
}
#clinical-note:focus { outline: none; border-color: var(--accent-primary); }

.nlp-results {
    padding: 2rem;
    display: flex; flex-direction: column;
}
.entity-chips {
    display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem;
}
.entity-chip {
    padding: 0.25rem 0.75rem; border-radius: 16px; font-size: 0.85rem; font-weight: 500;
}
.ent-med { background: rgba(156, 39, 176, 0.2); border: 1px solid #9c27b0; color: #e1bee7; }
.ent-diag { background: rgba(244, 67, 54, 0.2); border: 1px solid #f44336; color: #ffcdd2; }
.ent-vital { background: rgba(33, 150, 243, 0.2); border: 1px solid #2196f3; color: #bbdefb; }
.ent-proc { background: rgba(76, 175, 80, 0.2); border: 1px solid #4caf50; color: #c8e6c9; }

.code-suggestion {
    background: rgba(0,0,0,0.3); padding: 1.5rem; border-radius: 8px; margin-top: 2rem;
    border-left: 4px solid var(--accent-primary);
}
.icd-code {
    font-size: 2rem; font-family: monospace; color: var(--accent-primary); font-weight: bold;
}

#nlp-loader { display: none; text-align: center; padding: 2rem; }
.spinner {
    width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.1);
    border-left-color: var(--accent-primary); border-radius: 50%;
    animation: spin 1s linear infinite; margin: 0 auto 1rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= ANALYTICS VIEW ================= */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}
.chart-card {
    padding: 1.5rem;
    min-height: 350px;
    display: flex; flex-direction: column;
}
.chart-wrapper {
    flex: 1; position: relative; margin-top: 1rem;
}
.chart-full { grid-column: 1 / -1; }
@media (max-width: 992px) {
    .charts-grid { grid-template-columns: 1fr; }
    .chart-full { grid-column: 1; }

    #app-container.is-visible {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .sidebar {
        grid-column: 1;
        grid-row: 1;
        position: relative;
        width: 100%;
        min-width: 0;
        height: auto;
        max-height: none;
    }
    .main-content {
        grid-column: 1;
        grid-row: 2;
        height: auto;
        min-height: calc(100vh - 200px);
    }
}

/* ================= ADMIN TABLE & BADGES ================= */
.admin-table th, .admin-table td {
    padding: 1rem;
    vertical-align: middle;
}
.admin-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color var(--transition-speed);
}
.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.role-badge.doctor {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}
.role-badge.nurse {
    background: rgba(255, 214, 0, 0.1);
    border: 1px solid var(--status-mod);
    color: var(--status-mod);
}
.role-badge.admin {
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid var(--status-crit);
    color: var(--status-crit);
}
.btn-approve {
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid var(--status-low);
    color: var(--status-low);
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}
.btn-approve:hover {
    background: var(--status-low);
    color: var(--bg-base);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}
.btn-reject {
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid var(--status-crit);
    color: var(--status-crit);
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}
.btn-reject:hover {
    background: var(--status-crit);
    color: var(--text-main);
    box-shadow: 0 0 10px rgba(255, 23, 68, 0.4);
}

.topbtn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    transition: 0.2s;
    margin-right: 12px;
}
.topbtn:hover {
    background: var(--bg-surface);
    transform: translateY(-1px);
}

[data-theme="light"] #login-page,
[data-theme="light"] #signup-page {
    background: radial-gradient(circle at center, #ffffff 0%, var(--bg-base) 100%) !important;
}

[data-theme="light"] .sidebar-brand span {
    color: var(--primary) !important;
}


