/* Light clinical palette for ALF mode.
 *
 * Applied automatically when frontend/shared/copy.js sets
 * <html data-mode="alf"> at boot.  Every dashboard's existing :root
 * dark-mode variables stay as the default; this file overrides them
 * only when data-mode="alf" matches.
 *
 * Palette: clinical teal/cyan with WCAG-AA contrast on white.
 * Source of truth for variable names is each dashboard's <style>
 * block — keep this in sync.  See plan at
 * /home/don/.claude/plans/ok-so-we-are-sparkling-nygaard.md.
 */

[data-mode="alf"] {
    /* Re-declare every CSS variable used across the dashboards.  The
     * dashboards each define a slightly different subset in their :root
     * block; we override the superset here.  Unused vars are harmless.
     */
    --bg: #ffffff;
    --bg-dark: #ffffff;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-input: #ffffff;
    --bg-sidebar: #f1f5f9;

    --primary: #0f766e;          /* clinical teal */
    --primary-dark: #115e59;
    --secondary: #0891b2;        /* clinical cyan */
    --accent: #0f766e;

    --danger: #dc2626;
    --warning: #d97706;
    --urgent: #ea580c;
    --critical: #dc2626;
    --success: #16a34a;

    --text: #0f172a;
    --text-primary: #0f172a;
    --text-light: #0f172a;
    --text-dim: #475569;
    --text-secondary: #475569;
    --text-gray: #475569;
    --text-muted: #94a3b8;

    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

    color-scheme: light;
}

/* Make body inherit cleanly — some dashboards set body bg + color
 * directly rather than going through variables.
 */
[data-mode="alf"] body,
[data-mode="alf"] html {
    background: var(--bg);
    color: var(--text);
}

/* Inputs that the dashboards style by selector rather than var — the
 * dark dashboards set border-color: var(--border) inline, but the
 * input element itself often gets a darker shade.  Force light. */
[data-mode="alf"] input,
[data-mode="alf"] textarea,
[data-mode="alf"] select {
    background: var(--bg-input);
    color: var(--text);
    border-color: var(--border);
}
[data-mode="alf"] input::placeholder,
[data-mode="alf"] textarea::placeholder {
    color: var(--text-muted);
}

/* Cards that hardcoded gradients in home mode flatten to a single
 * tone in ALF mode for the clinical look.  Targets any element with
 * a class containing "card" — defensive, no over-reach. */
[data-mode="alf"] .card,
[data-mode="alf"] .resident-card,
[data-mode="alf"] .alert-card,
[data-mode="alf"] .stat-card,
[data-mode="alf"] .login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* Sidebar — most dashboards hardcode `.sidebar { background: ... }`.
 * Pull it back through the variable. */
[data-mode="alf"] .sidebar,
[data-mode="alf"] .app-header,
[data-mode="alf"] .detail-header {
    background: var(--bg-sidebar);
    border-color: var(--border);
}

/* Fall-risk tier pill — primary metric on resident cards in ALF mode.
 *
 * Sized to dominate the card visually (this is the most important
 * signal to a glancing nurse).  The HIGH tier pulses using the same
 * keyframes the alert-card[data-level="critical"] uses elsewhere.
 */
.risk-tier {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
}
.risk-tier.risk-high {
    background: #dc2626;
    color: #ffffff;
    animation: risk-pulse 2s ease-in-out infinite;
}
.risk-tier.risk-moderate {
    background: #d97706;
    color: #ffffff;
}
.risk-tier.risk-low {
    background: #16a34a;
    color: #ffffff;
}
.risk-tier.risk-unknown {
    background: #e2e8f0;
    color: #475569;
}
@keyframes risk-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.0); }
    50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.25); }
}

/* When the resident card leads with Fall Risk in ALF mode, the
 * secondary Mobility metric should still be visible but de-emphasized
 * (smaller, in the metric grid). */
[data-mode="alf"] .rc-fall-risk-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
[data-mode="alf"] .rc-fall-risk-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* The default home mode hides the fall-risk row — staff resident cards
 * still get that block in the DOM but it stays invisible until ALF
 * mode applies. */
.rc-fall-risk-row {
    display: none;
}
