/* ============================================================
   UC HEALTH TOOLS — MASTER DESIGN SYSTEM
   uc-theme.css  |  All tools link this file
   
   Variable naming convention: HCOR/Call-Schedule style (--bg-body, etc.)
   Drug Monitor aliases are provided at the bottom so OHH/index.html
   needs no find-and-replace on its CSS variable references.
   ============================================================ */

/* ── Google Fonts (each tool still loads this in <head>) ───────────────── */

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
    /* Brand */
    --brand:          #8B1E3A;
    --brand-light:    #A8284A;
    --brand-dark:     #6B1530;
    --brand-glow:     rgba(139,30,58,0.25);

    /* Backgrounds */
    --bg-body:        #f0f2f5;
    --bg-surface:     #ffffff;
    --bg-surface-2:   #f7f8fa;
    --bg-nav:         #1a1d23;
    --bg-nav-hover:   #262a33;
    --bg-nav-active:  var(--brand);

    /* Text */
    --text-primary:   #1a1d23;
    --text-secondary: #5f6577;
    --text-muted:     #9ca3b4;
    --text-nav:       #9ca3b4;
    --text-nav-active:#ffffff;

    /* Borders */
    --border:         #e2e5eb;
    --border-light:   #eef0f4;

    /* Shadows */
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.06);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:      0 12px 40px rgba(0,0,0,0.12);
    --shadow-glow:    0 0 24px var(--brand-glow);

    /* Semantic colours */
    --success:        #16a34a;
    --success-bg:     #dcfce7;
    --warning:        #ca8a04;
    --warning-bg:     #fef9c3;
    --danger:         #dc2626;
    --danger-bg:      #fee2e2;
    --info:           #0891b2;
    --info-bg:        #e0f2fe;

    /* Radius */
    --radius-sm:      6px;
    --radius-md:      10px;
    --radius-lg:      16px;
    --radius-xl:      24px;

    /* Transitions */
    --transition:     0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* ── OHH / Drug Monitor aliases (backwards-compat) ── */
    --bg:             var(--bg-body);
    --surface:        var(--bg-surface);
    --surface-2:      var(--bg-surface-2);
    --nav:            var(--bg-nav);
    --nav-hover:      var(--bg-nav-hover);
    --text:           var(--text-primary);
    --text-2:         var(--text-secondary);
    --text-3:         var(--text-muted);
    --warn:           var(--warning);
    --warn-bg:        var(--warning-bg);
    --r1:             var(--radius-sm);
    --r2:             var(--radius-md);
    --r3:             var(--radius-lg);
    --shadow:         var(--shadow-md);
    --glow:           var(--shadow-glow);
}

[data-theme="dark"] {
    --bg-body:        #0f1117;
    --bg-surface:     #1a1d23;
    --bg-surface-2:   #22262f;
    --bg-nav:         #0a0c10;
    --bg-nav-hover:   #1a1d23;
    --text-primary:   #e8eaf0;
    --text-secondary: #9ca3b4;
    --text-muted:     #5f6577;
    --border:         #2d3140;
    --border-light:   #22262f;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.2);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg:      0 12px 40px rgba(0,0,0,0.4);
    --success-bg:     #052e16;
    --warning-bg:     #422006;
    --danger-bg:      #450a0a;
    --info-bg:        #0c2a33;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 0.88em;
    background: var(--bg-surface-2);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.hidden { display: none !important; }

/* ============================================================
   SIDEBAR LAYOUT
   ============================================================ */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--bg-nav);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-brand {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.35em;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.sidebar-brand h1 span { color: var(--brand-light); }

.sidebar-brand p {
    font-size: 0.72em;
    color: var(--text-nav);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.nav-section {
    padding: 16px 12px 4px;
    font-size: 0.68em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

/* Works with both <ul>/<li> and plain <div> nav items */
.nav-items { list-style: none; padding: 0 8px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    margin-bottom: 2px;
    border-radius: var(--radius-md);
    color: var(--text-nav);
    cursor: pointer;
    font-size: 0.88em;
    font-weight: 500;
    transition: all var(--transition);
    user-select: none;
    list-style: none;
    /* Allow override for tighter-fit tools */
}

.nav-item:hover { background: var(--bg-nav-hover); color: #fff; }
.nav-item.active {
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow-glow);
    font-weight: 600;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-icon { font-size: 1.1em; width: 22px; text-align: center; }

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.user-bar {
    padding: 10px 8px 6px;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: auto;
}

.user-email {
    color: var(--text-muted);
    font-size: 0.76em;
    font-weight: 600;
    word-break: break-all;
    margin-bottom: 8px;
    padding: 0 6px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-nav);
    font-size: 0.85em;
    font-weight: 500;
    transition: all var(--transition);
}

.theme-toggle:hover { background: var(--bg-nav-hover); color: #fff; }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main {
    margin-left: 260px;
    flex: 1;
    padding: 32px;
    min-height: 100vh;
    transition: margin var(--transition);
}

.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}

.page-header { margin-bottom: 28px; }

.page-header h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.75em;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.page-header p {
    color: var(--text-secondary);
    margin-top: 6px;
    font-size: 0.93em;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }
.card + .card { margin-top: 20px; }

.card-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title .icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    flex-shrink: 0;
}

/* Alias used by Drug Monitor */
.title { font-weight: 700; font-size: 1.04em; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.subtitle { color: var(--text-secondary); font-size: 0.86em; margin-top: -10px; margin-bottom: 16px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card, .stat {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.4s ease both;
}

.stat-card:nth-child(2), .stat:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3), .stat:nth-child(3) { animation-delay: 0.10s; }
.stat-card:nth-child(4), .stat:nth-child(4) { animation-delay: 0.15s; }

.stat-label, .stat .k {
    font-size: 0.78em;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.stat-value, .stat .v {
    font-family: 'Sora', sans-serif;
    font-size: 1.9em;
    font-weight: 800;
    color: var(--brand);
    margin-top: 4px;
    letter-spacing: -0.02em;
}

.stat-sub {
    font-size: 0.82em;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary, .primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 8px var(--brand-glow);
}
.btn-primary:hover, .primary:hover {
    background: var(--brand-light);
    box-shadow: 0 4px 16px var(--brand-glow);
}

.btn-secondary, .secondary {
    background: var(--bg-surface-2);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover, .secondary:hover { background: var(--border-light); }

.btn-success, .success { background: var(--success); color: #fff; }
.btn-success:hover, .success:hover { opacity: 0.9; }

.btn-danger, .danger { background: var(--danger); color: #fff; }
.btn-danger:hover, .danger:hover { opacity: 0.9; }

.btn-warning, .warn-btn { background: #b45309; color: #fff; }
.btn-warning:hover, .warn-btn:hover { background: #92400e; }

.btn-sm, .sm { padding: 7px 14px; font-size: 0.82em; }
.btn-full { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label, .label {
    display: block;
    font-size: 0.8em;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input, .form-select,
input[type="text"]:not(.tag-picker-input),
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.92em;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-input:focus, .form-select:focus,
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

textarea { min-height: 90px; resize: vertical; }

/* Password eye toggle */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1em;
    padding: 4px;
    width: auto;
    line-height: 1;
}
.pw-eye:hover { color: var(--text-primary); }

/* Toggle row (checkbox + label) */
.toggle-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.toggle-row input[type="checkbox"] { width: auto; }

/* Toggle switch */
.toggle-switch { position: relative; width: 44px; height: 24px; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-slider {
    position: absolute; inset: 0;
    background: var(--border);
    border-radius: 12px;
    transition: all var(--transition);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px; left: 3px;
    transition: all var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider::before { left: 23px; }

/* Inline input (small, no full-width) */
.inline-input {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9em;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: all var(--transition);
}
.inline-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 700;
    white-space: nowrap;
}

.badge-success, .ok  { background: var(--success-bg); color: var(--success); }
.badge-warning, .warn{ background: var(--warning-bg); color: var(--warning); }
.badge-danger,  .bad { background: var(--danger-bg);  color: var(--danger);  }
.badge-info         { background: var(--info-bg);    color: var(--info);    }

/* Larger pill variant used in Drug Monitor sidebar */
.pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78em;
    font-weight: 700;
    background: rgba(202,138,4,.18);
    color: #fde68a;
}
.pill.ok { background: rgba(22,163,74,.18); color: #c9f9d6; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap, .table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

table { width: 100%; border-collapse: collapse; font-size: 0.9em; }

th {
    background: var(--bg-surface-2);
    color: var(--text-secondary);
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 1;
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-surface-2); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--success);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    font-size: 0.9em;
    font-weight: 500;
    max-width: 360px;
    pointer-events: all;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}

.toast.error { border-left-color: var(--danger); }

@keyframes toastIn  { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:none; } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateY(-10px); } }

/* ============================================================
   UPLOAD / DROP ZONE
   ============================================================ */
.upload-zone, .import-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    background: var(--bg-surface-2);
    transition: all var(--transition);
}

.upload-zone:hover, .upload-zone.drag-over,
.import-zone:hover, .import-zone.drag-over {
    border-color: var(--brand);
    background: rgba(139,30,58,0.04);
    border-style: solid;
}

.upload-zone .icon { font-size: 2.8em; margin-bottom: 12px; }
.upload-zone h3 { font-size: 1.1em; margin-bottom: 4px; }

/* ============================================================
   AUTH OVERLAYS (injected by uc-auth.js)
   ============================================================ */
.uca-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uca-overlay.uca-modal-bg {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.uca-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.uca-box h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.5em;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.uca-sub {
    color: var(--text-secondary);
    font-size: 0.88em;
    margin-bottom: 28px;
}

.uca-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.uca-brand-icon {
    width: 44px;
    height: 44px;
    background: var(--brand);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3em;
    flex-shrink: 0;
}

.uca-brand-name {
    font-family: 'Sora', sans-serif;
    font-size: 1.05em;
    font-weight: 800;
    color: var(--text-primary);
}

.uca-brand-sub {
    font-size: 0.78em;
    color: var(--text-secondary);
    margin-top: 1px;
}

.uca-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.86em;
    font-weight: 600;
    margin-bottom: 16px;
    display: none;
}
.uca-error.visible { display: block; }

.uca-small-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 0.82em;
    color: var(--brand);
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
}
.uca-small-link:hover { text-decoration: underline; }

.uca-help {
    font-size: 0.82em;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-top: 8px;
}

.uca-gate-status {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 12px;
    text-align: center;
}

/* Timeout banner */
.uca-timeout-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--warning);
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 0.88em;
    font-weight: 700;
    z-index: 8999;
    display: none;
    animation: fadeIn 0.3s ease;
}

/* Loading spinner overlay */
.uca-loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    z-index: 8500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.uca-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.uca-loading-text {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
}

/* ============================================================
   SUPERUSER SECTION
   ============================================================ */
.superuser-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(139,30,58,.1), rgba(109,23,45,.05));
    border: 1.5px solid rgba(139,30,58,.25);
    border-radius: var(--radius-md);
    margin: 24px 0 16px;
}

.superuser-crown {
    width: 32px;
    height: 32px;
    background: var(--brand);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    flex-shrink: 0;
}

.superuser-section-header .su-title { font-weight: 700; font-size: 0.95em; color: var(--brand); }
.superuser-section-header .su-sub   { font-size: 0.78em; color: var(--text-muted); margin-top: 2px; }

#superuserLockCard {
    background: var(--bg-surface-2);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    color: var(--text-muted);
    font-size: 0.88em;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================================
   USER MANAGEMENT TABLE
   ============================================================ */
.user-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) 120px auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    margin-bottom: 8px;
    font-size: 0.88em;
    transition: border-color var(--transition);
}

.user-row:hover { border-color: var(--brand-light); }

.user-email-cell { font-weight: 600; word-break: break-all; }
.user-uid-cell   { font-size: 0.73em; color: var(--text-muted); font-family: monospace; word-break: break-all; margin-top: 2px; }

.user-badge-admin {
    background: rgba(139,30,58,.12);
    color: var(--brand);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.75em;
    font-weight: 700;
    white-space: nowrap;
}

.user-badge-user {
    background: var(--bg-surface-2);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.75em;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid var(--border);
}

.user-badge-superuser {
    background: rgba(139,30,58,.2);
    color: var(--brand-dark);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.75em;
    font-weight: 700;
    white-space: nowrap;
}

.user-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ============================================================
   CONFIRM MODAL (shared across tools)
   ============================================================ */
.uca-modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
}

.uca-modal-box h3 {
    font-family: 'Sora', sans-serif;
    font-size: 1.15em;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.uca-modal-body { font-size: 0.9em; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }
.uca-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   SECTION LABELS & MISC
   ============================================================ */
.section-label {
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 16px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.empty {
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 34px 20px;
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-surface-2);
    font-size: 0.9em;
}

.help { color: var(--text-muted); font-size: 0.82em; line-height: 1.55; margin-top: 4px; }

/* ── Admin row / med row layouts (Drug Monitor) ── */
.admin-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface-2); margin-top: 12px; }
.med-row   { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface-2); margin-top: 12px; }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-sm      { font-size: 0.85em; }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-brand   { color: var(--brand); }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.mb-4         { margin-bottom: 4px; }
.mb-8         { margin-bottom: 8px; }
.mb-12        { margin-bottom: 12px; }
.mb-16        { margin-bottom: 16px; }
.mb-24        { margin-bottom: 24px; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.flex         { display: flex; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.grid-2       { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ============================================================
   MOBILE HEADER (HCOR / Call Schedule)
   ============================================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--bg-nav);
    z-index: 99;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.mobile-header h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.1em;
    color: #fff;
    font-weight: 800;
}

.mobile-header h1 span { color: var(--brand-light); }

.hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4em;
    cursor: pointer;
    padding: 8px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .mobile-header { display: flex; }
    .main { margin-left: 0; padding: 72px 16px 24px; }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .uca-box { padding: 28px 20px; margin: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .btn-group { flex-direction: column; }
}
