/* ConversalX Health — Phase 1 UI */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:    #0077B6;
  --primary-dk: #005A8E;
  --accent:     #0096C7;
  --success:    #2ECC71;
  --warning:    #F39C12;
  --danger:     #E74C3C;
  --light:      #EFF6FF;
  --border:     #D0DCE9;
  --text:       #1B2A3B;
  --muted:      #607080;
  --white:      #ffffff;
  --radius:     8px;
  --shadow:     0 2px 8px rgba(0,80,140,.10);
}

body { font-family: system-ui, -apple-system, sans-serif; font-size: 14px; color: var(--text); background: var(--light); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.site-header { background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); color: var(--white); padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; height: 54px; box-shadow: 0 2px 10px rgba(0,80,140,.18); }
.site-header .brand { font-size: 1rem; font-weight: 700; color: var(--white); letter-spacing: .02em; }
.site-header .header-meta { font-size: 12px; color: rgba(255,255,255,.75); display: flex; align-items: center; gap: 1rem; }
.site-header .header-meta a { color: rgba(255,255,255,.85); }
.site-header .header-meta a:hover { color: var(--white); }

.admin-nav { background: linear-gradient(90deg, var(--primary-dk) 0%, #01497C 100%); padding: 0 1.25rem; display: flex; gap: 0; flex-wrap: wrap; border-bottom: 2px solid rgba(255,255,255,.08); }
.admin-nav a { color: rgba(255,255,255,.68); padding: .45rem .8rem; display: flex; align-items: center; gap: .4rem; border-bottom: 3px solid transparent; text-decoration: none; transition: color .15s, border-color .15s, background .15s; }
.admin-nav a:hover, .admin-nav a.active { color: var(--white); border-bottom-color: #48CAE4; background: rgba(255,255,255,.08); text-decoration: none; }
.nav-icon  { font-size: .95rem; line-height: 1; flex-shrink: 0; }
.nav-texts { display: flex; flex-direction: column; line-height: 1.2; }
.nav-label { font-size: 12px; font-weight: 600; }
.nav-sub   { font-size: 10px; color: rgba(255,255,255,.45); margin-top: 1px; }
.admin-nav a:hover .nav-sub, .admin-nav a.active .nav-sub { color: rgba(255,255,255,.72); }

.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.page-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--primary); }

/* ── Cards ── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.25rem; padding: 1.25rem; transition: box-shadow .15s; }
.card-header { padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; background: var(--light); border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 1rem; }
.card-title { font-size: .95rem; font-weight: 600; color: var(--primary); margin-bottom: .9rem; }
/* Tables inside cards bleed to edges */
.card > .table, .card > form > .table { margin-left: -1.25rem; margin-right: -1.25rem; width: calc(100% + 2.5rem); }

/* ── Stat row ── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
/* .card used directly inside .stat-row also gets stat styling */
.stat-row .card { text-align: center; margin-bottom: 0; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: .2rem; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 12px; color: var(--muted); margin-top: .2rem; }
.stat-card.danger  .stat-value { color: var(--danger); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.success .stat-value { color: var(--success); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--light); text-align: left; padding: .55rem .75rem; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fafb; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; color: var(--text); background: var(--white); line-height: 1.4;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45,143,163,.15); }
input[disabled], select[disabled] { background: var(--light); color: var(--muted); cursor: not-allowed; }
textarea { min-height: 90px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: .25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width:600px){ .form-row { grid-template-columns: 1fr; } }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem 1rem; border: 1px solid transparent; border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; line-height: 1.4; transition: opacity .15s; }
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary   { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-accent    { background: var(--accent);  color: var(--white); border-color: var(--accent); }
.btn-success   { background: var(--success); color: var(--white); border-color: var(--success); }
.btn-danger    { background: var(--danger);  color: var(--white); border-color: var(--danger); }
.btn-warning   { background: var(--warning); color: var(--white); border-color: var(--warning); }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--border); }
.btn-outline:hover { background: var(--light); }
.btn-sm { padding: .3rem .65rem; font-size: 12px; }
.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Badges / Status ── */
.badge { display: inline-block; padding: .2em .55em; border-radius: 3px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.badge-success  { background: #d4edda; color: #155724; }
.badge-warning  { background: #fff3cd; color: #856404; }
.badge-danger   { background: #f8d7da; color: #721c24; }
.badge-info     { background: #cce5ff; color: #004085; }
.badge-muted    { background: #e2e3e5; color: #383d41; }

/* ── Alerts / Flash ── */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 13px; border: 1px solid transparent; }
.alert-success { background: #d4edda; border-color: #c3e6cb; color: #155724; }
.alert-danger  { background: #f8d7da; border-color: #f5c6cb; color: #721c24; }
.alert-warning { background: #fff3cd; border-color: #ffeeba; color: #856404; }
.alert-info    { background: #cce5ff; border-color: #b8daff; color: #004085; }

/* ── Errors ── */
.field-error { font-size: 12px; color: var(--danger); margin-top: .25rem; }
.input-invalid { border-color: var(--danger) !important; }
.input-disabled { background: var(--light) !important; color: var(--muted) !important; cursor: not-allowed; }

/* ── Auth pages ── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--light); }
.auth-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 400px; box-shadow: var(--shadow); }
.auth-box .auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-box .auth-logo span { font-size: 1.15rem; font-weight: 700; color: var(--primary); }
.auth-box h1 { font-size: 1.05rem; text-align: center; margin-bottom: 1.5rem; color: var(--text); font-weight: 600; }

/* ── Chat ── */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 52px); }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .75rem; }
.chat-footer { border-top: 1px solid var(--border); padding: .75rem 1rem; background: var(--white); display: flex; gap: .5rem; }
.chat-footer input { flex: 1; }
.msg { max-width: 78%; padding: .65rem .9rem; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.msg-user { align-self: flex-end; background: var(--primary); color: var(--white); border-bottom-right-radius: 2px; }
.msg-bot  { align-self: flex-start; background: var(--white); border: 1px solid var(--border); border-bottom-left-radius: 2px; }
.msg-citations { font-size: 11px; color: var(--muted); margin-top: .5rem; border-top: 1px solid var(--border); padding-top: .4rem; }
.msg-disclaimer { font-size: 12px; color: var(--warning); margin-top: .4rem; font-style: italic; }
.msg-clarification { font-size: 13px; color: var(--text); margin-top: .35rem; }
.msg-fallback { font-size: 11px; color: var(--muted); margin-top: .3rem; font-style: italic; }
.chat-typing { align-self: flex-start; color: var(--muted); font-size: 13px; font-style: italic; padding: .3rem .5rem; }

/* ── Pagination / misc ── */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-muted   { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.w-100 { width: 100%; }
.meta-refresh-note { font-size: 12px; color: var(--muted); text-align: center; padding: .5rem; }

/* ── Status dot ── */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot-green  { background: var(--success); }
.dot-red    { background: var(--danger); }
.dot-yellow { background: var(--warning); }

/* ── File upload ── */
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 1.5rem; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.upload-area:hover { border-color: var(--accent); color: var(--accent); }
#xlsx-mode-row { display: none; }

/* ── Report hub cards ── */
.report-hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.report-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; display: flex; flex-direction: column; gap: .5rem; }
.report-card:hover { border-color: var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,.14); text-decoration: none; color: var(--text); }
.report-card-icon { font-size: 1.4rem; }
.report-card-title { font-weight: 600; font-size: .9rem; color: var(--primary); }
.report-card-desc { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ── Activity flags chat card ── */
.msg-activity-flags { background: var(--light); border-radius: var(--radius); padding: .75rem; margin-top: .25rem; }
.msg-activity-flags strong { display: block; margin-bottom: .2rem; color: var(--primary); }
.msg-activity-flags .table { margin: .4rem 0 0; font-size: 13px; }

/* ── Follow-up status timeline ── */
.status-timeline { display: flex; gap: 0; align-items: center; flex-wrap: wrap; margin: .75rem 0; }
.status-step { display: flex; align-items: center; gap: 0; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); border: 2px solid var(--border); flex-shrink: 0; }
.status-dot.done  { background: var(--success); border-color: var(--success); }
.status-dot.active { background: var(--primary); border-color: var(--primary); }
.status-dot.danger { background: var(--danger); border-color: var(--danger); }
.status-label { font-size: 11px; color: var(--muted); white-space: nowrap; margin: 0 .3rem; }
.status-label.active { color: var(--primary); font-weight: 600; }
.status-label.done { color: var(--success); }
.status-connector { width: 24px; height: 2px; background: var(--border); flex-shrink: 0; }
.status-connector.done { background: var(--success); }

/* ── Temp password one-time display ── */
.alert-temp-password { background: #fefce8; border: 1px solid #fde047; border-radius: var(--radius); padding: .9rem 1rem; font-family: monospace; font-size: 15px; word-break: break-all; letter-spacing: .05em; color: #713f12; }

/* ── Child selector (chat) ── */
.child-selector { display: flex; align-items: center; gap: .5rem; padding: .5rem 1.25rem; background: var(--light); border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.child-selector span { color: var(--muted); }
.child-pill { padding: .25rem .7rem; border-radius: 20px; border: 1px solid var(--border); background: var(--white); cursor: pointer; font-size: 12px; color: var(--text); transition: all .15s; }
.child-pill.active, .child-pill:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.child-pill-static { font-weight: 600; color: var(--primary); }

/* ── Screening form ── */
.screening-section-head { font-size: .9rem; font-weight: 700; color: var(--primary); padding: .6rem 0 .75rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.screening-section-hint { font-size: 11px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.screening-collapsible-body { padding-top: 1rem; }
.screening-expand-icon { margin-left: auto; font-size: .8rem; color: var(--muted); }
details.screening-collapsible > summary { padding-bottom: .75rem; }
details.screening-collapsible[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: .75rem; }

/* Y/N field grids */
.yn-grid { display: grid; gap: .75rem; }
.yn-grid-3 { grid-template-columns: repeat(3, 1fr); }
.yn-grid-4 { grid-template-columns: repeat(4, 1fr); }
.yn-grid-5 { grid-template-columns: repeat(5, 1fr); }
@media(max-width:700px) { .yn-grid-4, .yn-grid-5 { grid-template-columns: repeat(2, 1fr); } }
@media(max-width:500px) { .yn-grid-3, .yn-grid-4, .yn-grid-5 { grid-template-columns: 1fr 1fr; } }
.yn-field label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: .25rem; text-transform: uppercase; letter-spacing: .03em; }
.yn-field select { width: 100%; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--white); }
.yn-field select:focus { outline: none; border-color: var(--accent); }

/* 3-column form row */
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width:700px) { .form-row-3 { grid-template-columns: 1fr 1fr; } }
@media(max-width:500px) { .form-row-3, .form-row-2 { grid-template-columns: 1fr; } }

/* BMI auto-display */
.bmi-display { background: var(--light); border: 1px solid var(--border); border-radius: var(--radius); padding: .45rem .75rem; font-size: 13px; color: var(--primary); margin-top: .5rem; display: inline-block; }

/* Doctor blocks */
.doctor-block { padding: .75rem 0; }
.doctor-block-label { font-size: .85rem; font-weight: 600; color: var(--primary); margin-bottom: .75rem; }
.doctor-divider { border: none; border-top: 1px dashed var(--border); margin: .5rem 0; }

/* ── Red-flag report ── */
.redflag-categories { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.redflag-category-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .25rem; }
.redflag-pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.redflag-pill { display: inline-flex; align-items: center; gap: .25rem; padding: .2em .55em; border-radius: 3px; font-size: 12px; font-weight: 600; }
.redflag-pill-high   { background: #f8d7da; color: #721c24; }
.redflag-pill-medium { background: #fff3cd; color: #856404; }
.redflag-value { font-weight: 400; font-style: italic; }
.redflag-cell { background: #fff3cd; font-weight: 600; color: #856404; }

/* ── Role banner ── */
.role-banner { background: var(--rb-bg, #EFF6FF); border-bottom: 1px solid rgba(0,0,0,.06); padding: .45rem 1.5rem; }
.role-banner-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.role-badge { display: inline-block; background: var(--rb-color, var(--primary)); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .18em .65em; border-radius: 4px; margin-right: .45rem; vertical-align: middle; }
.role-greeting { font-size: 13px; font-weight: 600; color: var(--text); margin-right: .35rem; }
.role-summary  { font-size: 12px; color: var(--muted); }

/* ── Help toggle button ── */
.help-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .8rem; background: var(--white); border: 1px solid var(--border); border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--primary); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.08); white-space: nowrap; transition: box-shadow .15s, background .15s; }
.help-btn:hover { background: var(--light); box-shadow: 0 2px 6px rgba(0,0,0,.12); }

/* ── Help slide-out panel ── */
.help-overlay { display: none; position: fixed; inset: 0; background: rgba(0,30,60,.22); z-index: 900; }
.help-overlay.open { display: block; }
.help-panel { position: fixed; top: 0; right: -440px; width: 410px; max-width: 95vw; height: 100vh; background: var(--white); border-left: 1px solid var(--border); box-shadow: -6px 0 24px rgba(0,80,140,.13); z-index: 1000; display: flex; flex-direction: column; transition: right .25s cubic-bezier(.4,0,.2,1); }
.help-panel.open { right: 0; }
.help-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); color: #fff; flex-shrink: 0; }
.help-panel-head strong { font-size: 14px; }
.help-close { background: rgba(255,255,255,.18); border: none; color: #fff; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.help-close:hover { background: rgba(255,255,255,.35); }
.help-panel-body { flex: 1; overflow-y: auto; padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0; }
.help-section { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.help-section:last-child { border-bottom: none; margin-bottom: 0; }
.help-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--primary); margin-bottom: .6rem; }
.permission-list { list-style: none; display: flex; flex-direction: column; gap: .3rem; }
.permission-list li { font-size: 12px; color: var(--text); line-height: 1.5; padding-left: .9rem; position: relative; }
.permission-list li::before { content: '•'; position: absolute; left: 0; color: var(--muted); }
.help-nav-item { display: flex; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--light); }
.help-nav-item:last-child { border-bottom: none; }
.help-nav-icon { font-size: 1.05rem; flex-shrink: 0; margin-top: .1rem; }
.help-scenario { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .75rem; border-radius: var(--radius); background: var(--light); margin-bottom: .45rem; border-left: 3px solid var(--accent); }
.help-scenario:last-child { margin-bottom: 0; }
.help-scenario-emoji { font-size: 1.15rem; flex-shrink: 0; }
.help-scenario-steps { font-size: 11px; color: var(--primary); margin-top: .2rem; font-family: monospace; letter-spacing: .01em; }

/* ── Stat card icon ── */
.stat-icon { font-size: 1.3rem; margin-bottom: .3rem; }

/* ── Quick-start cards (dashboard) ── */
.quickstart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.quickstart-card { display: flex; flex-direction: column; gap: .4rem; padding: 1rem 1.1rem; border: 1.5px solid var(--border); border-radius: calc(var(--radius) + 2px); text-decoration: none; color: var(--text); background: var(--white); transition: border-color .15s, box-shadow .15s, transform .15s; }
.quickstart-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,119,182,.13); transform: translateY(-2px); text-decoration: none; color: var(--text); }
.quickstart-icon  { font-size: 1.55rem; }
.quickstart-title { font-weight: 600; font-size: 13px; color: var(--primary); }
.quickstart-desc  { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ═══════════════════════════════════════════════
   Phase 2 — AI & Consent UI additions
   ═══════════════════════════════════════════════ */

/* ── AI suggestion card ── */
.ai-suggestion-card { background: var(--light); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: .75rem; }
.ai-suggestion-card.tier2 { border-left: 4px solid var(--warning); background: #FFFBEB; }
.ai-card-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem; flex-wrap: wrap; }
.ai-card-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.ai-tier2-flag { font-size: 11px; font-weight: 600; color: #92400E; background: #FEF3C7; padding: .15em .5em; border-radius: 4px; }
.ai-disclaimer-note { font-size: 11px; color: var(--muted); font-style: italic; margin-top: .55rem; padding-top: .45rem; border-top: 1px solid var(--border); line-height: 1.5; }
.ai-assisted-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--light); border: 1px solid var(--border); padding: .1em .4em; border-radius: 3px; }

/* ── Triage badges (correction requests) ── */
.triage-badge { display: inline-flex; align-items: center; padding: .2em .55em; border-radius: 3px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.triage-data-entry    { background: #DBEAFE; color: #1E40AF; }
.triage-wrong-student { background: #FED7AA; color: #9A3412; }
.triage-disputed      { background: #FEE2E2; color: #991B1B; }
.triage-unclear       { background: #E2E3E5; color: #383D41; }

/* ── NL query bar (reports) ── */
.nl-query-bar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.nl-query-bar input { flex: 1; min-width: 220px; }
.nl-interpretation { font-size: 12px; color: var(--primary); margin-top: .5rem; padding: .4rem .75rem; background: var(--light); border-radius: var(--radius); border-left: 3px solid var(--accent); }
.nl-error-note { font-size: 12px; color: var(--danger); margin-top: .4rem; }

/* ── Draft follow-up review section ── */
.draft-followup-section { margin-bottom: 1.5rem; }
.draft-followup-section .section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #92400E; background: #FEF3C7; border: 1px solid #FDE68A; border-radius: var(--radius); padding: .4rem .85rem; margin-bottom: .85rem; display: inline-flex; align-items: center; gap: .5rem; }
.draft-followup-row { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: .65rem; display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.draft-meta { flex: 1; min-width: 180px; }
.draft-text { flex: 2; min-width: 240px; }
.draft-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: flex-start; padding-top: .1rem; }
.overdue-flag { font-size: 10px; font-weight: 700; color: var(--danger); background: #FEE2E2; border: 1px solid #FCA5A5; padding: .15em .45em; border-radius: 3px; text-transform: uppercase; letter-spacing: .04em; }

/* ── Cookie banner ── */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: #1B2A3B; color: rgba(255,255,255,.88); font-size: 13px; padding: .65rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; z-index: 800; flex-wrap: wrap; line-height: 1.5; }
.cookie-banner a { color: #48CAE4; }
.cookie-banner-dismiss { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff; padding: .3rem .9rem; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s; }
.cookie-banner-dismiss:hover { background: rgba(255,255,255,.28); }

/* ── Consent page ── */
.consent-wrap { min-height: calc(100vh - 54px); padding: 2rem 1rem; background: var(--light); display: flex; flex-direction: column; align-items: center; }
.consent-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 700px; }
.consent-header { padding: 1.4rem 1.5rem 1rem; border-bottom: 1px solid var(--border); }
.consent-header h1 { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: .3rem; }
.consent-header p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.consent-body { padding: 1.1rem 1.5rem; display: flex; flex-direction: column; gap: .85rem; }
.consent-section { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.consent-section details summary { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text); list-style: none; background: var(--light); user-select: none; }
.consent-section details summary::-webkit-details-marker { display: none; }
.consent-section details summary::after { content: '▸'; font-size: .75rem; color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.consent-section details[open] summary::after { transform: rotate(90deg); }
.consent-section-body { padding: .9rem 1rem; font-size: 13px; color: var(--text); line-height: 1.65; border-top: 1px solid var(--border); }
.consent-section-body p { margin-bottom: .55rem; }
.consent-section-body p:last-child { margin-bottom: 0; }
.consent-accept { display: flex; align-items: flex-start; gap: .6rem; padding: .65rem 1rem; background: #f0fdf4; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; line-height: 1.45; }
.consent-accept:hover { background: #dcfce7; }
.consent-accept input[type=checkbox] { width: auto; margin-top: .15rem; flex-shrink: 0; accent-color: var(--primary); }
.consent-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--light); display: flex; flex-direction: column; gap: .6rem; border-radius: 0 0 var(--radius) var(--radius); }
.consent-submit { width: 100%; }
.consent-submit:disabled { opacity: .42; cursor: not-allowed; pointer-events: none; }
