@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

:root {
    --primary: #0b4f6c;
    --primary-light: #1f6e8c;
    --primary-lighter: #e8f0fa;
    --accent: #1b8c8c;
    --accent-light: #d9ecf2;
    --danger: #b13e2d;
    --danger-light: #fde7e4;
    --warning: #9e6d0b;
    --warning-light: #fff1d6;
    --success: #1d6b4c;
    --success-light: #dff0e8;
    --gold: #b8860b;
    --gold-light: #fff8e1;
    --purple: #6b4a9e;
    --purple-light: #f0ebff;
    --teal: #0e6b68;
    --teal-light: #e0f5f3;
    --surface: #ffffff;
    --bg: #f3f6fc;
    --border: #e2ebf6;
    --text: #0b2b3f;
    --text-secondary: #4f6f8c;
    --text-muted: #6f8aa8;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --shadow-sm: 0 2px 8px rgba(0, 20, 40, 0.04);
    --shadow-md: 0 6px 16px rgba(0, 20, 40, 0.05);
    --shadow-lg: 0 12px 32px rgba(0, 20, 40, 0.08);
    --z-header:  100;
    --z-modal:   5000;
    --z-toast:   6000;
    --z-tooltip: 7000;
}

body { background: var(--bg); display: flex; flex-direction: column; min-height: 100vh; color: var(--text); -webkit-font-smoothing: antialiased; }
.container { max-width: 1440px; margin: 0 auto; padding: 0 24px; width: 100%; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdddec; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #b0c8e0; }

/* ============ LOGIN ============ */
.login-screen { min-height: 100vh; background: linear-gradient(135deg, #0b2b3f 0%, #0b4f6c 50%, #1b8c8c 100%); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-container { width: 100%; max-width: 460px; background: var(--surface); border-radius: var(--radius-xl); box-shadow: 0 32px 64px rgba(0, 0, 0, 0.35); overflow: hidden; }
.login-header { background: linear-gradient(135deg, #0b4f6c, #1b8c8c); padding: 32px; text-align: center; color: white; }
.login-logo { width: 68px; height: 68px; background: rgba(255, 255, 255, 0.15); border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 16px; border: 2px solid rgba(255, 255, 255, 0.2); }
.login-header h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.login-header p { font-size: 13px; opacity: 0.9; font-weight: 500; }
.login-body { padding: 32px; }
.login-form-group { margin-bottom: 18px; }
.login-form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.login-form-group label i { color: var(--primary-light); margin-right: 6px; }
.login-form-group input { width: 100%; padding: 14px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font-size: 14px; font-weight: 500; color: var(--text); outline: none; background: var(--bg); transition: all 0.15s; font-family: inherit; }
.login-form-group input:focus { background: var(--surface); border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(31, 110, 140, 0.1); }
.login-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; font-size: 12px; font-weight: 500; }
.login-options label { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.login-options a { color: var(--primary-light); text-decoration: none; font-weight: 600; }
.login-btn { width: 100%; padding: 16px; border-radius: 40px; font-weight: 800; font-size: 15px; border: none; display: flex; align-items: center; justify-content: center; gap: 10px; color: white; background: linear-gradient(135deg, var(--primary), #1b8c8c); box-shadow: 0 8px 20px rgba(11, 79, 108, 0.3); cursor: pointer; transition: all 0.2s; font-family: inherit; }
.login-btn:hover { box-shadow: 0 12px 28px rgba(11, 79, 108, 0.4); transform: translateY(-1px); }
.login-footer { padding: 0 32px 28px; text-align: center; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.login-footer i { color: var(--accent); }

/* ============ HEADER ============ */
.main-header { background: var(--surface); box-shadow: 0 1px 0 var(--border); padding: 14px 0; position: sticky; top: 0; z-index: 100; }
.header-flex { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.logo-area { display: flex; align-items: center; gap: 14px; }
.logo-icon { background: linear-gradient(135deg, #0b4f6c, #1b8c8c); color: white; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 14px; font-size: 24px; }
.logo-icon.super-admin { background: linear-gradient(135deg, var(--gold), #d4a017); }
.logo-text h1 { font-size: 21px; font-weight: 800; color: var(--text); letter-spacing: -0.4px; line-height: 1.1; }
.logo-text span { font-size: 12px; font-weight: 500; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.logo-text span i { font-size: 10px; color: var(--success); }
.nav-links { display: flex; gap: 6px; font-weight: 600; font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--text-secondary); display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 30px; transition: all 0.15s; }
.nav-links a.active { color: var(--primary); background: var(--primary-lighter); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.user-profile { display: flex; align-items: center; gap: 10px; background: var(--bg); padding: 5px 16px 5px 6px; border-radius: 40px; border: 1px solid var(--border); }
.user-profile.super-admin-profile { background: var(--gold-light); border-color: #f0dbb0; }
.user-avatar { background: linear-gradient(135deg, #1f6e8c, #1b8c8c); color: white; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.user-avatar.super-admin-avatar { background: linear-gradient(135deg, var(--gold), #d4a017); }
.user-info small { display: block; font-size: 11px; color: var(--text-muted); font-weight: 500; line-height: 1.2; }
.user-info strong { font-size: 13px; color: var(--text); font-weight: 700; line-height: 1.2; }
.logout-btn { background: var(--bg); border: 1px solid var(--border); width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--danger); font-size: 16px; text-decoration: none; transition: all 0.15s; }
.logout-btn:hover { background: var(--danger-light); }

/* ============ LANGUAGE SWITCHER ============ */
.lang-switcher { display: flex; align-items: center; gap: 3px; background: var(--bg); padding: 4px; border-radius: 30px; border: 1px solid var(--border); }
.lang-btn { padding: 5px 10px; border-radius: 30px; font-size: 10px; font-weight: 700; text-decoration: none; color: var(--text-muted); transition: all 0.2s; letter-spacing: 0.3px; }
.lang-btn:hover { color: var(--primary-light); }
.lang-btn.active { background: var(--surface); color: var(--primary); box-shadow: 0 2px 6px rgba(0, 20, 40, 0.08); }

/* ============ PATIENT SEARCH ============ */
.patient-search-wrap { padding: 16px 0 0; }
.patient-search-container { background: var(--surface); border-radius: var(--radius-md); border: 2px solid var(--primary-lighter); padding: 14px 20px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); transition: all 0.2s; flex-wrap: wrap; }
.patient-search-container:focus-within { border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(31, 110, 140, 0.1), var(--shadow-md); }
.search-icon-lg { background: var(--primary-lighter); width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 20px; flex-shrink: 0; }
.search-input-wrap { flex: 1; min-width: 200px; }
.search-input-wrap input { width: 100%; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 15px; font-weight: 500; color: var(--text); outline: none; background: var(--bg); transition: all 0.15s; font-family: inherit; }
.search-input-wrap input:focus { background: var(--surface); border-color: var(--primary-light); }
.search-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.search-filter { padding: 8px 14px; border-radius: 30px; font-size: 12px; font-weight: 600; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.15s; }
.search-filter.active { border-color: var(--primary); background: var(--primary); color: white; font-weight: 700; }
.search-stats { font-size: 12px; color: var(--text-muted); font-weight: 600; white-space: nowrap; padding-left: 8px; border-left: 1px solid var(--border); }
.search-stats strong { color: var(--primary); font-weight: 800; }
.search-results-panel { display: none; background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); margin-top: 16px; overflow: hidden; box-shadow: var(--shadow-md); }
.search-results-panel.active { display: block; }
.search-results-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); background: #fafdff; }
.search-results-header h3 { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; }
.close-search { background: var(--bg); border: 1px solid var(--border); padding: 6px 14px; border-radius: 30px; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; gap: 6px; }

/* ============ DASHBOARD ============ */
.dashboard-container { padding: 24px 0 72px; flex: 1; }
.dash-welcome { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.dash-welcome-left h2 { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.dash-welcome-left p { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.role-tag { background: linear-gradient(135deg, var(--primary-lighter), #f0f7ff); color: var(--primary); padding: 9px 18px; border-radius: 40px; font-size: 12px; font-weight: 700; border: 1px solid #cdddec; display: flex; align-items: center; gap: 8px; }
.role-tag.gold-tag { background: linear-gradient(135deg, var(--gold-light), #fffdf5); color: #8a5a00; border-color: #f0dbb0; }
.gold-icon { color: var(--gold); }

/* ============ STATS ============ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border-radius: var(--radius-md); padding: 20px; border: 1px solid var(--border); display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-sm); transition: all 0.2s; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card.gold-card { border-color: #f0dbb0; background: linear-gradient(135deg, #fffdf5, #fff8e1); }
.stat-icon { background: var(--accent-light); width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--primary); flex-shrink: 0; }
.stat-icon.gold { background: var(--gold-light); color: var(--gold); }
.stat-icon.info { background: var(--primary-lighter); color: var(--primary-light); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }
.stat-icon.teal { background: var(--teal-light); color: var(--teal); }
.stat-info h4 { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-info .value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1; letter-spacing: -0.5px; }
.stat-info small { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; margin-top: 5px; color: var(--accent); }
.stat-info small.gold { color: var(--gold); }

/* ============ TABLES ============ */
.table-section { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.table-section.gold-border { border-color: #f0dbb0; }

.table-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--border); gap: 16px; flex-wrap: wrap; cursor: pointer; user-select: none; position: relative; }
.table-header h3 { font-size: 16px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; margin: 0; flex: 1 1 auto; min-width: 0; }
.table-header .table-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; flex-shrink: 0; align-items: center; }

.table-section.collapsed > :not(.table-header) { display: none; }
.table-section.collapsed .table-header { border-bottom: none; }
.table-section.collapsed .table-header::before { background: var(--primary-lighter); }

.table-header .collapse-icon { font-size: 12px; color: var(--text-muted); transition: transform 0.2s; margin-left: 8px; }
.table-section.collapsed .collapse-icon { transform: rotate(-90deg); }

.table-header::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; transition: background 0.2s; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 14px 24px; background: #fafdff; color: var(--text-muted); font-weight: 600; font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
td { padding: 16px 24px; border-bottom: 1px solid #f0f5fc; color: var(--text); font-weight: 500; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr.gold-row { background: #fffdf5; }
tbody tr.gold-row:hover { background: #fff8e1; }

tbody tr.inactive-row { background: #fafafa; opacity: 0.65; }
tbody tr.inactive-row:hover { opacity: 0.85; background: #f5f5f5; }

.patient-name { display: flex; align-items: center; gap: 12px; }
.patient-avatar { width: 38px; height: 38px; background: linear-gradient(135deg, #cce8ee, #b8dce6); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #0b4f6c; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.patient-avatar.doctor-avatar { background: linear-gradient(135deg, #cce8ee, #b8dce6); color: #0b4f6c; }
.patient-avatar.frontdesk-avatar { background: linear-gradient(135deg, #e8e3d8, #ddd5c4); color: #6b5e4a; }
.patient-name-text strong { display: block; font-size: 14px; color: var(--text); font-weight: 600; }
.patient-name-text small { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.status-badge { background: var(--success-light); color: var(--success); padding: 5px 12px; border-radius: 30px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.status-badge.info { background: var(--primary-lighter); color: var(--primary-light); }
.status-badge.neutral { background: #f1ece9; color: #7a5a4e; }
.status-badge.critical { background: var(--danger-light); color: var(--danger); }
.status-badge.warning { background: var(--warning-light); color: var(--warning); }

.mini-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-action { background: var(--bg); border: 1px solid var(--border); padding: 5px 12px; border-radius: 30px; font-size: 11px; font-weight: 600; color: var(--primary-light); display: flex; align-items: center; gap: 5px; cursor: pointer; transition: all 0.15s; white-space: nowrap; text-decoration: none; }
.mini-action:hover { background: var(--primary-lighter); border-color: #cdddec; }
.mini-action.gold { color: #8a5a00; border-color: #f0dbb0; background: var(--gold-light); }

/* ============ NOTICE ============ */
.notice-bar { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; line-height: 1.5; }
.notice-bar.warning { background: var(--warning-light); color: #6b4a05; border-left: 4px solid var(--warning); }
.notice-bar.info { background: var(--primary-lighter); color: var(--primary); border-left: 4px solid var(--primary-light); }
.notice-bar.gold { background: var(--gold-light); color: #6b4a05; border-left: 4px solid var(--gold); }
.notice-bar i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ============ INFO GRID + CARDS ============ */
.info-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 22px 24px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.card.gold-card { border-color: #f0dbb0; background: linear-gradient(135deg, #fffdf5, #ffffff); }
.card h4 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.card h4 i { color: var(--primary-light); font-size: 15px; }
.card h4 i.gold-icon { color: var(--gold); }

.alert-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f0f5fc; }
.alert-item:last-child { border-bottom: none; padding-bottom: 0; }
.alert-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; background: var(--bg); color: var(--primary-light); }
.alert-icon.danger { background: var(--danger-light); color: var(--danger); }
.alert-icon.warning { background: var(--warning-light); color: var(--warning); }
.alert-icon.success { background: var(--success-light); color: var(--success); }
.alert-icon.gold { background: var(--gold-light); color: var(--gold); }
.alert-icon.teal { background: var(--teal-light); color: var(--teal); }
.alert-content p { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; line-height: 1.3; }
.alert-content small { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.ward-list { display: flex; flex-direction: column; gap: 14px; }
.ward-item { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px solid #f0f5fc; }
.ward-item:last-child { border-bottom: none; padding-bottom: 0; }
.ward-info strong { font-size: 14px; color: var(--text); display: block; margin-bottom: 3px; font-weight: 600; }
.ward-info span { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; font-weight: 500; }
.ward-capacity { background: var(--accent-light); color: var(--primary); padding: 5px 12px; border-radius: 30px; font-weight: 700; font-size: 12px; }
.ward-capacity.gold { background: var(--gold-light); color: #8a5a00; }

/* ============ SYSTEM HEALTH + ALERTS ============ */
.card-header-with-sub { margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.card-header-with-sub h4 { display: flex; align-items: center; gap: 12px; margin: 0; }
.card-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.card-icon.health-icon { background: linear-gradient(135deg, #e8f5e8, #d0ebd4); color: var(--success); }
.card-icon.alerts-icon { background: linear-gradient(135deg, var(--gold-light), #fef3c7); color: var(--gold); }
.card-title { display: block; font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.2; }
.card-subtitle { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); margin-top: 2px; letter-spacing: 0.2px; }

.health-grid { display: flex; flex-direction: column; gap: 14px; }
.health-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: linear-gradient(135deg, #fafdff, #ffffff); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: all 0.15s; }
.health-item:hover { border-color: var(--primary-light); box-shadow: 0 2px 8px rgba(31, 110, 140, 0.06); }
.health-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.health-label { font-size: 13px; font-weight: 700; color: var(--text); }
.health-sub { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.health-visual { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.health-bar { width: 80px; height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; }
.health-bar-fill { height: 100%; border-radius: 4px; }
.health-value { font-size: 12px; font-weight: 800; letter-spacing: 0.3px; }
.health-value--success { color: var(--success); }
.health-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 30px; font-size: 11px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; white-space: nowrap; }
.health-pill--muted { background: #f1ece9; color: #7a5a4e; }
.health-pill--ok { background: var(--success-light); color: var(--success); }
.health-pill--secure { background: linear-gradient(135deg, var(--success-light), #d0ebd4); color: var(--success); }
.health-pill i { font-size: 10px; }

.alerts-feed { display: flex; flex-direction: column; gap: 10px; }
.feed-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: linear-gradient(135deg, #fafdff, #ffffff); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: all 0.15s; position: relative; }
.feed-item:hover { border-color: var(--primary-light); box-shadow: 0 2px 8px rgba(31, 110, 140, 0.06); }
.feed-item::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; }
.feed-item--info::before { background: var(--primary); }
.feed-item--warning::before { background: var(--warning); }
.feed-item--success::before { background: var(--success); }
.feed-item--teal::before { background: var(--teal); }
.feed-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.feed-icon--info { background: var(--primary-lighter); color: var(--primary); }
.feed-icon--warning { background: var(--warning-light); color: var(--warning); }
.feed-icon--success { background: var(--success-light); color: var(--success); }
.feed-icon--teal { background: var(--teal-light); color: var(--teal); }
.feed-body { flex: 1; min-width: 0; padding-top: 2px; }
.feed-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; margin-bottom: 3px; }
.feed-time { font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.2px; }

/* ============ APPROVAL ITEMS ============ */
.approval-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 10px; background: #fafdff; transition: all 0.15s; }
.approval-item:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.approval-item-left { display: flex; align-items: center; gap: 14px; }
.approval-avatar { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: white; background: linear-gradient(135deg, #1f6e8c, #1b8c8c); flex-shrink: 0; }
.approval-avatar.doctor { background: linear-gradient(135deg, #cce8ee, #b8dce6); color: #0b4f6c; }
.approval-avatar.nurse { background: linear-gradient(135deg, #cce8ee, #b8dce6); color: #0b4f6c; }
.approval-avatar.frontdesk { background: linear-gradient(135deg, #e8e3d8, #ddd5c4); color: #6b5e4a; }
.approval-avatar.admin { background: linear-gradient(135deg, var(--gold-light), #f0dbb0); color: #8a5a00; }
.approval-info strong { display: block; font-size: 14px; font-weight: 700; color: var(--text); }
.approval-info span { font-size: 12px; color: var(--text-muted); font-weight: 500; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.approval-info span i { font-size: 11px; }
.approval-actions { display: flex; gap: 8px; }
.btn-approve, .btn-reject { border: none; padding: 9px 18px; border-radius: 30px; font-size: 12px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.15s; font-family: inherit; }
.btn-approve { background: var(--success); color: white; box-shadow: 0 4px 12px rgba(29, 107, 76, 0.25); }
.btn-approve:hover { background: #155236; transform: translateY(-1px); }
.btn-reject { background: var(--danger-light); color: var(--danger); border: 1px solid #f5c6c0; }
.btn-reject:hover { background: #fbd9d4; }
.btn-approve:disabled, .btn-reject:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ============ NEW BADGE ============ */
.badge-new { display: inline-block; padding: 2px 8px; background: linear-gradient(135deg, #1b8c8c, #0e6b68); color: white; font-size: 9px; font-weight: 800; letter-spacing: 0.5px; border-radius: 10px; margin-left: 6px; vertical-align: middle; text-transform: uppercase; }

/* ============ INACTIVE BADGE ============ */
.badge-inactive { display: inline-block; padding: 2px 8px; background: #e8e3d8; color: #6b5e4a; font-size: 9px; font-weight: 800; letter-spacing: 0.5px; border-radius: 10px; margin-left: 6px; vertical-align: middle; text-transform: uppercase; }

/* ============ REFILL BADGE ============ */
.badge-refill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    margin-left: 6px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #854d0e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
    border-radius: 10px;
    text-transform: none;
    border: 1px solid #f0dbb0;
    vertical-align: middle;
    white-space: nowrap;
}
.badge-refill i { font-size: 9px; }

/* ============ FRONT DESK QUICK ACTIONS ============ */
.fd-quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.fd-action { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s; text-align: left; font-family: inherit; box-shadow: var(--shadow-sm); }
.fd-action:hover { border-color: var(--primary-light); box-shadow: 0 8px 20px rgba(11, 79, 108, 0.12); transform: translateY(-2px); }
.fd-action-icon { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, var(--primary-lighter), #f0f7ff); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.fd-icon-walkin { background: linear-gradient(135deg, var(--success-light), #e8f5ec); color: var(--success); }
.fd-icon-referred { background: linear-gradient(135deg, var(--warning-light), #fffaf0); color: var(--warning); }
.fd-icon-schedule { background: linear-gradient(135deg, var(--gold-light), #fff8e1); color: var(--gold); }
.fd-action-text strong { display: block; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.fd-action-text small { font-size: 12px; color: var(--text-muted); font-weight: 500; line-height: 1.3; }

/* ============ BUTTONS ============ */
.btn-primary, .btn-ghost, .btn-add, .btn-remove { border: none; border-radius: var(--radius-sm); font-weight: 700; font-size: 13px; padding: 11px 20px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all 0.15s; font-family: inherit; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #093f57; transform: translateY(-1px); }
.btn-ghost { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: #e8effa; }
.btn-add { background: var(--primary-lighter); color: var(--primary); width: 100%; justify-content: center; margin-top: 8px; }
.btn-remove { background: var(--danger-light); color: var(--danger); padding: 10px 12px; }
.btn-remove:hover { background: #fbd9d4; }

.btn-icon { background: var(--bg); border: 1px solid var(--border); padding: 8px 16px; border-radius: 30px; font-size: 12px; font-weight: 600; color: var(--primary-light); display: flex; align-items: center; gap: 7px; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.btn-icon:hover { background: var(--primary-lighter); border-color: #cdddec; }
.btn-icon.primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-icon.gold { background: var(--gold-light); color: #8a5a00; border-color: #f0dbb0; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font-size: 14px; font-weight: 500; color: var(--text); outline: none; background: var(--bg); transition: all 0.15s; font-family: inherit; resize: vertical; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { background: var(--surface); border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(31, 110, 140, 0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.intake-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-lighter);
    display: flex;
    align-items: center;
    gap: 8px;
}
.intake-section-title i { font-size: 13px; color: var(--primary-light); }

/* ============ MEDICATION ROWS ============ */
.med-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; gap: 10px; margin-bottom: 10px; align-items: center; }
.med-row input { padding: 10px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font-size: 13px; font-weight: 500; outline: none; background: var(--bg); font-family: inherit; }
.med-row input:focus { background: var(--surface); border-color: var(--primary-light); }

/* ============ PATIENT PICKER ============ */
.patient-picker-results { max-height: 220px; overflow-y: auto; margin-top: 8px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.patient-picker-results:empty { display: none; }
.picker-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.picker-row:last-child { border-bottom: none; }
.picker-row:hover { background: var(--primary-lighter); }
.picker-avatar { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #cce8ee, #b8dce6); color: #0b4f6c; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.picker-info strong { display: block; font-size: 13px; font-weight: 700; color: var(--text); }
.picker-info small { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.picker-empty { padding: 14px; font-size: 12px; color: var(--text-muted); text-align: center; }
.patient-picker-selected { margin-top: 8px; padding: 10px 14px; background: var(--success-light); border-radius: var(--radius-sm); font-size: 13px; color: var(--success); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.patient-picker-selected i { font-size: 14px; }
.picker-clear { margin-left: auto; background: transparent; border: none; color: var(--success); cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 12px; }
.picker-clear:hover { background: rgba(0, 0, 0, 0.06); }

/* ============ DOCTOR LIST ============ */
.doctor-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.doctor-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; }
.doctor-row:hover { border-color: var(--primary-light); background: var(--surface); }
.doctor-row.selected { border-color: var(--primary); background: var(--primary-lighter); box-shadow: 0 0 0 3px rgba(31, 110, 140, 0.15); }
.doctor-avatar { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #cce8ee, #b8dce6); color: #0b4f6c; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.doctor-info strong { display: block; font-size: 14px; font-weight: 700; color: var(--text); }
.doctor-info small { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.doctor-check { margin-left: auto; color: var(--border); font-size: 14px; }
.doctor-row.selected .doctor-check { color: var(--primary); }

/* ============ MODALS ============ */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(11, 43, 63, 0.55); backdrop-filter: blur(4px); z-index: 5000; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.modal-backdrop.active { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 32px 64px rgba(0, 0, 0, 0.35); width: 100%; max-width: 560px; animation: modalIn 0.25s ease; }
.modal-lg { max-width: 720px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); background: #fafdff; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.modal-patient { display: flex; align-items: center; gap: 12px; }
.modal-avatar { width: 44px; height: 44px; background: linear-gradient(135deg, #cce8ee, #b8dce6); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #0b4f6c; font-weight: 700; font-size: 15px; }
.modal-patient strong { display: block; font-size: 15px; font-weight: 700; color: var(--text); }
.modal-patient small { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.modal-close { background: var(--bg); border: 1px solid var(--border); width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; }
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body { padding: 24px; max-height: 62vh; overflow-y: auto; }
.modal-lg .modal-body { max-height: 70vh; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: #fafdff; border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap; }

/* ============ TOAST ============ */
.toast { position: fixed; bottom: 32px; right: 32px; background: var(--success); color: white; padding: 16px 24px; border-radius: var(--radius-md); box-shadow: 0 12px 32px rgba(29, 107, 76, 0.35); display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; z-index: 9999; transform: translateY(120%); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); max-width: calc(100vw - 32px); }
.toast.active { transform: translateY(0); }
.toast.gold-toast { background: var(--gold); box-shadow: 0 12px 32px rgba(184, 134, 11, 0.35); }
.toast.error-toast { background: var(--danger); box-shadow: 0 12px 32px rgba(177, 62, 45, 0.35); }
.toast i { font-size: 20px; flex-shrink: 0; }

/* ============ REQUISITION CONFIRM ============ */
.req-confirm { text-align: center; padding: 12px 0; }
.req-confirm-icon { font-size: 52px; color: var(--success); margin-bottom: 12px; }
.req-confirm h3 { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.req-confirm-no { font-family: 'Courier New', monospace; font-size: 16px; font-weight: 700; color: var(--primary); letter-spacing: 0.5px; background: var(--primary-lighter); padding: 8px 16px; border-radius: 8px; display: inline-block; margin: 4px 0 12px; }
.req-confirm-hint { font-size: 13px; color: var(--text-secondary); line-height: 1.5; max-width: 360px; margin: 0 auto; }

/* ============ FOOTER ============ */
.main-footer { border-top: 1px solid var(--border); padding: 20px 0; background: var(--surface); margin-top: auto; }
.footer-flex { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; gap: 16px; font-weight: 500; }
.footer-flex i { color: var(--accent); }
.footer-flex i.gold-icon { color: var(--gold); }
.footer-flex span { display: flex; align-items: center; gap: 6px; }

/* ============ CHART PRINT LINK ============ */
.chart-print-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 30px; background: var(--primary-lighter); color: var(--primary); text-decoration: none; font-size: 12px; font-weight: 700; transition: all 0.15s; }
.chart-print-link:hover { background: #d3e4f5; }
.chart-print-link i { font-size: 11px; }

/* ============ CHART SECTIONS ============ */
.chart-summary { display: flex; flex-wrap: wrap; gap: 16px 24px; padding: 14px 18px; background: var(--primary-lighter); border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 13px; color: var(--primary); line-height: 1.4; }
.chart-summary strong { font-weight: 700; margin-right: 4px; }
.chart-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.chart-section:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.chart-section h4 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.chart-section h4 i { color: var(--primary-light); font-size: 13px; }
.chart-item { padding: 12px 14px; background: #fafdff; border-left: 3px solid var(--primary-lighter); border-radius: 8px; margin-bottom: 10px; }
.chart-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 6px; }
.chart-item-head strong { font-size: 13px; font-weight: 700; color: var(--text); }
.chart-item-head small { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.chart-item p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 4px 0; }
.chart-tag { display: inline-block; padding: 3px 10px; background: var(--primary-lighter); color: var(--primary); border-radius: 20px; font-size: 11px; font-weight: 700; margin: 4px 0; }
.chart-meta { display: block; font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }
.chart-empty { font-size: 13px; color: var(--text-muted); font-style: italic; padding: 8px 0; }

/* ============================================================
   FACILITY MANAGEMENT
   ============================================================ */

.facility-stats-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #fafdff, #ffffff);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.facility-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.facility-stat-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.facility-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.facility-stat-value .status-badge {
    font-size: 11px;
    padding: 4px 10px;
}

/* Clinic admin card */
.facility-admin-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fffdf5, #ffffff);
    border: 1px solid #f0dbb0;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.facility-admin-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* Staff roster */
.staff-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fafdff, #ffffff);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: all 0.15s;
}

.staff-row:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(31, 110, 140, 0.06);
}

.staff-row.inactive-staff {
    opacity: 0.6;
}

.staff-row-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-lighter);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.staff-row-body {
    flex: 1;
    min-width: 0;
}

.staff-row-body strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.staff-row-body small {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.staff-row-status {
    flex-shrink: 0;
}

.staff-row-status .status-badge {
    font-size: 10px;
    padding: 4px 9px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .info-grid { grid-template-columns: 1fr; }
    .fd-quick-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .patient-search-container { flex-direction: column; align-items: flex-start; }
    .search-input-wrap { width: 100%; }
    .lang-switcher { order: -1; }
}

@media (max-width: 680px) {
    .header-flex { flex-direction: column; align-items: flex-start; }
    .stats-grid { grid-template-columns: 1fr; }
    .fd-quick-actions { grid-template-columns: 1fr; }
    th, td { padding: 12px 14px; }
    .table-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .table-header .table-actions { width: 100%; margin-left: 0; }
    .container { padding: 0 16px; }
    .lang-btn { padding: 4px 7px; font-size: 9px; }
    .toast { bottom: 16px; right: 16px; left: 16px; }
    .search-stats { border-left: none; padding-left: 0; }
    .login-body { padding: 24px; }
    .login-header { padding: 24px 24px 20px; }
    .form-row { grid-template-columns: 1fr; }
    .med-row { grid-template-columns: 1fr; }
    .modal { max-width: 100%; }
    .approval-item { flex-direction: column; align-items: flex-start; gap: 12px; }
    .approval-actions { width: 100%; }
    .btn-approve, .btn-reject { flex: 1; justify-content: center; }
    .health-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .health-visual { width: 100%; justify-content: space-between; }
    .health-bar { flex: 1; }
    .facility-stats-strip { grid-template-columns: 1fr; }
    .facility-admin-card { flex-direction: column; align-items: flex-start; }
    .staff-row { flex-wrap: wrap; }
}

/* ============ UTILITY ============ */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary-light); }
.text-gold { color: var(--gold); }
.fw-700 { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-0 { margin-bottom: 0; }
/* ============================================================
   ROLE GROUPS IN MANAGE FACILITY MODAL
   ============================================================ */

.facility-stats-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    padding: 14px;
    background: linear-gradient(135deg, #fafdff, #ffffff);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.facility-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    padding: 4px 2px;
}

.facility-stat-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.facility-stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.facility-stat-value .status-badge {
    font-size: 9px;
    padding: 3px 8px;
}

/* Role group cards */
.role-group {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}

.role-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #fafdff;
    border-bottom: 1px solid var(--border);
}

.role-group-header--primary { background: linear-gradient(135deg, #eef5fc, #f8fbff); border-left: 4px solid var(--primary); }
.role-group-header--teal    { background: linear-gradient(135deg, #e8f7f6, #f5fdfc); border-left: 4px solid var(--teal); }
.role-group-header--gold    { background: linear-gradient(135deg, #fffaf0, #fffdf7); border-left: 4px solid var(--gold); }
.role-group-header--purple  { background: linear-gradient(135deg, #f5f0ff, #fbf8ff); border-left: 4px solid var(--purple); }
.role-group-header--info    { background: linear-gradient(135deg, #eef5fc, #f8fbff); border-left: 4px solid var(--primary-light); }

.role-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.role-group-title i {
    font-size: 14px;
    color: var(--primary-light);
}

.role-group-header--teal   .role-group-title i { color: var(--teal); }
.role-group-header--gold   .role-group-title i { color: var(--gold); }
.role-group-header--purple .role-group-title i { color: var(--purple); }

.role-group-count {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.role-group-number {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.role-group-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Staff rows inside groups */
.role-group .staff-row {
    margin-bottom: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
}

.role-group .staff-row:last-child {
    border-bottom: none;
}

.role-group .staff-row:hover {
    background: #fafdff;
    box-shadow: none;
    border-color: var(--border);
}

/* Responsive — stack to 3 columns, then 2 */
@media (max-width: 900px) {
    .facility-stats-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 500px) {
    .facility-stats-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   ROLE SWITCHER (Super Admin only)
   ============================================================ */

.role-switcher-wrap {
    padding: 16px 0 0;
}

.role-switcher {
    background: linear-gradient(135deg, #fffaf0, #fffdf7);
    border: 1px solid #f0dbb0;
    border-radius: var(--radius-md, 18px);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-switcher-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #8a5a00;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-switcher-label i {
    font-size: 14px;
    color: var(--gold, #b8860b);
}

.role-switcher-label span {
    font-size: 11px;
    font-weight: 500;
    color: #a07929;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 6px;
}

.role-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 30px;
    background: var(--surface, #fff);
    color: var(--text-secondary, #4f6f8c);
    border: 1.5px solid var(--border, #e2ebf6);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.role-btn i {
    font-size: 12px;
    opacity: 0.8;
}

.role-btn:hover {
    border-color: var(--gold, #b8860b);
    background: var(--gold-light, #fff8e1);
    color: #8a5a00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.15);
}

.role-btn.active {
    background: linear-gradient(135deg, var(--gold, #b8860b), #d4a017);
    color: white;
    border-color: var(--gold, #b8860b);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.25);
}

.role-btn.active i {
    opacity: 1;
}

/* Super Admin pill — distinctly gold */
.role-btn.super-admin-btn {
    background: linear-gradient(135deg, #fff8e1, #fffdf7);
    border-color: #f0dbb0;
    color: #8a5a00;
}

.role-btn.super-admin-btn:hover {
    background: linear-gradient(135deg, #fff3c7, #fff8e1);
}

.role-btn.super-admin-btn.active {
    background: linear-gradient(135deg, #b8860b, #d4a017);
    color: white;
    border-color: #b8860b;
}

/* Responsive — stack on small screens */
@media (max-width: 680px) {
    .role-switcher {
        padding: 14px;
    }

    .role-btn {
        flex: 1 1 auto;
        justify-content: center;
        font-size: 11px;
        padding: 8px 12px;
    }
}