/* denalu dashboard theme.
 *
 * Single source of truth for design tokens, mirroring
 * doc/KalyduAI Theme Spec V2.md and the inline style block in
 * doc/prototype/clinic-demo-prototype.html. Per the Visual Conformance
 * Rule, this is the only file in services/dashboard/ where raw hex
 * literals are allowed; templates and other CSS reference these via
 * var(--token).
 */

:root {
    /* Primary — Teal */
    --primary: #48D0BF;
    --primary-dark: #3BA99A;
    --primary-light: #6DDACC;

    /* Secondary — Saffron */
    --secondary: #E89420;
    --secondary-dark: #C77914;
    --secondary-light: #F4B35A;

    /* Info — Deep Sage */
    --info: #6C8551;
    --info-dark: #52663D;
    --info-light: #93A87B;

    /* Neutrals */
    --ink: #282824;
    --ink-soft: #1A1A17;
    --slate: #5A5A56;
    --disabled: #9E9E9A;

    /* Surfaces */
    --canvas: #ECE6DA;
    --paper: #FFFFFF;
    --paper-on-ink: #FFFFFF;
    --border: rgba(40, 40, 36, 0.1);
    --border-soft: rgba(40, 40, 36, 0.04);
    --input-border: #D8D8D4;

    /* Status */
    --error: #D95336;
    --error-dark: #B43F25;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(40, 40, 36, 0.06);
    --shadow-md: 0 4px 16px rgba(40, 40, 36, 0.08);
    --shadow-primary: 0 4px 12px rgba(72, 208, 191, 0.3);

    /* Spacing scale (8px base unit) */
    --sp-xs: 4px;
    --sp-sm: 8px;
    --sp-md: 16px;
    --sp-lg: 24px;
    --sp-xl: 32px;
    --sp-xxl: 48px;

    /* Calendar surfaces (BL-P0-011) — port from prototype inline hexes. */
    --off-day-stripe-1: #F5F2EB;
    --off-day-stripe-2: #EDE8DC;
    --legend-bg: #FAFAF6;
    --status-off: #D8D8D4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--canvas);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Typography ---------- */
h1 { font-size: 3rem;    font-weight: 800; line-height: 1.15; color: var(--ink); }
h2 { font-size: 2.25rem; font-weight: 700; line-height: 1.20; color: var(--ink); }
h3 { font-size: 1.75rem; font-weight: 700; line-height: 1.30; color: var(--ink); }
h4 { font-size: 1.25rem; font-weight: 700; line-height: 1.35; color: var(--ink); }
.body2 { font-size: .875rem; color: var(--slate); }

/* ---------- Logo lockup ---------- */
.logo-wordmark {
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.logo-wordmark .tld { color: var(--primary); font-weight: 700; }
.logo-tagline {
    font-size: .5625rem;
    line-height: 1;
    font-weight: 500;
    color: var(--slate);
    margin-top: var(--sp-xs);
    letter-spacing: 0.02em;
}
.logo-tagline strong { font-weight: 600; color: var(--ink); }
.logo-mark {
    width: 36px; height: 36px;
    background: var(--ink);
    border-radius: 8px;
    flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.btn {
    font-family: inherit; font-size: .875rem; font-weight: 600;
    border: none; border-radius: 6px; cursor: pointer;
    padding: 12px 28px; transition: all .15s ease;
    display: inline-flex; align-items: center; gap: var(--sp-sm);
    white-space: nowrap;
}
.btn:disabled { cursor: not-allowed; opacity: .5; }
.btn-primary { background: var(--primary); color: var(--paper); box-shadow: var(--shadow-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover:not(:disabled) { background: var(--ink-soft); }
.btn-block { width: 100%; justify-content: center; }
.btn-ghost { background: transparent; color: var(--slate); padding: 12px var(--sp-md); }
.btn-ghost:hover { color: var(--ink); }

/* ---------- Inputs ---------- */
.input {
    font-family: inherit; font-size: 1rem; color: var(--ink);
    background: var(--paper);
    border: 1.5px solid var(--input-border); border-radius: 6px;
    padding: 10px 14px; width: 100%; transition: all .15s ease;
}
.input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(72, 208, 191, 0.2);
}
.label {
    font-size: .875rem; font-weight: 600;
    color: var(--slate); display: block;
    margin-bottom: 6px;
}

/* ---------- Auth screens ---------- */
.auth-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: var(--sp-lg); background: var(--canvas);
}
.auth-card {
    background: var(--paper); border-radius: 12px;
    padding: var(--sp-xxl) 40px; width: 100%; max-width: 440px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-soft);
}
.auth-logo {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: var(--sp-xl);
}
.auth-card h2 { margin-bottom: var(--sp-sm); font-size: 1.75rem; }
.auth-card .body2 { margin-bottom: var(--sp-xl); }
.auth-form-row { margin-bottom: 20px; }
.auth-error {
    background: rgba(217, 83, 54, 0.08);
    color: var(--error);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: var(--sp-md);
    font-size: .875rem;
    font-weight: 600;
}
.auth-meta { font-size: .8125rem; color: var(--slate); margin-top: var(--sp-lg); text-align: center; }
.auth-meta a { color: var(--primary-dark); text-decoration: none; font-weight: 600; cursor: pointer; }
.auth-meta a:hover { text-decoration: underline; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px; background: var(--ink); color: var(--paper-on-ink);
    display: flex; flex-direction: column; flex-shrink: 0;
    position: sticky; top: 0; height: 100vh;
}
.sidebar-header {
    padding: 28px var(--sp-lg) var(--sp-lg);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; }
.sidebar-logo .logo-mark { background: rgba(255, 255, 255, .06); }
.sidebar-logo .logo-wordmark { color: var(--paper-on-ink); }
.sidebar-logo .logo-tagline { color: rgba(255, 255, 255, .45); }
.sidebar-logo .logo-tagline strong { color: rgba(255, 255, 255, .7); }
.sidebar-tag {
    display: block;
    font-size: .6875rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--primary);
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-nav { flex: 1; padding: var(--sp-md) 12px; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 6px;
    color: rgba(255, 255, 255, .72); cursor: pointer;
    font-size: .9375rem; font-weight: 600;
    transition: all .15s ease;
    border: none; background: transparent;
    width: 100%; text-align: left; font-family: inherit;
    text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: var(--paper-on-ink); }
.nav-item.active {
    background: rgba(72, 208, 191, .14); color: var(--primary);
    box-shadow: inset 3px 0 0 var(--primary);
}
.nav-divider {
    height: 1px; background: rgba(255, 255, 255, .08);
    margin: 12px var(--sp-sm);
}

.sidebar-footer {
    padding: var(--sp-md) 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.user-block {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary); color: var(--ink);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .8125rem;
}
.user-email {
    font-size: .8125rem; color: rgba(255, 255, 255, .8);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.logout-form { margin: 0; padding: 0; }
.logout-link {
    font-size: .8125rem; color: rgba(255, 255, 255, .5);
    text-decoration: none; cursor: pointer;
    background: transparent; border: none; padding: 0;
    font-family: inherit;
}
.logout-link:hover { color: var(--paper-on-ink); }

/* ---------- Main content area ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: var(--canvas);
    padding: 20px var(--sp-xl);
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
    min-height: 76px;
    gap: var(--sp-md);
}
.topbar-title h2 { font-size: 1.5rem; }
.topbar-title .body2 { margin-top: 2px; }

.content { padding: var(--sp-xl); flex: 1; overflow-y: auto; }

.card {
    background: var(--paper); border-radius: 8px;
    padding: var(--sp-lg); box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-soft);
}

.placeholder-card h3 { margin-bottom: var(--sp-sm); }
.placeholder-card .body2 { color: var(--slate); }

/* ---------- Overline (BL-P0-012) ---------- */
.overline {
    font-size: .75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--primary); line-height: 2;
}

/* ---------- Practitioners view (BL-P0-012) ---------- */
.prac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.prac-card { display: flex; flex-direction: column; gap: 14px; }
.prac-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px;
}
.prac-head h4 { line-height: 1.25; }
.prac-role { color: var(--primary); }
.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: .6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    flex-shrink: 0;
}
.status-pill.active { background: rgba(72, 208, 191, .14); color: var(--primary-dark); }
.status-pill.partial { background: rgba(232, 148, 32, .14); color: var(--secondary-dark); }
.status-pill.off { background: rgba(40, 40, 36, .06); color: var(--slate); }
.status-pill .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
}
.schedule {
    padding: 14px; background: var(--canvas); border-radius: 6px;
    font-size: .8125rem; color: var(--ink);
}
.schedule strong {
    display: block; font-size: .6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--slate); margin-bottom: 6px;
}
.treatments-label {
    display: block; font-size: .6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--slate); margin-bottom: 8px;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    background: rgba(72, 208, 191, .12); color: var(--primary-dark);
    font-size: .75rem; font-weight: 600;
    padding: 4px 10px; border-radius: 4px;
}

/* ---------- Catalog view (BL-P0-012) ---------- */
.catalog-table { width: 100%; border-collapse: collapse; }
.catalog-table th, .catalog-table td {
    padding: 12px 16px; text-align: left;
    border-bottom: 1px solid var(--border);
}
.catalog-table thead th {
    background: var(--canvas);
    font-size: .6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--slate);
}
.catalog-table tbody tr:hover { background: var(--canvas); }
.catalog-table tbody tr:last-child td { border-bottom: none; }
.code-pill {
    background: var(--ink); color: var(--paper-on-ink);
    font-family: 'JetBrains Mono', monospace;
    font-size: .75rem; font-weight: 600;
    padding: 3px 8px; border-radius: 4px;
}
.duration {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600; color: var(--ink);
}
.catalog-flush { padding: 0; overflow: hidden; }

/* ---------- Policy view (BL-P0-012) ---------- */
.policy-card { max-width: 760px; }
.policy-card h3 { margin-bottom: 16px; }
.policy-card h4 { margin: 24px 0 8px; }
.policy-card ul { padding-left: 24px; margin: 8px 0; }
.policy-card li { margin-bottom: 8px; line-height: 1.6; }

/* ---------- Reseed view (BL-P0-014) ---------- */
.reseed-card {
    max-width: 520px;
    margin: 40px auto;
    text-align: center;
    padding: 40px;
}
.reseed-card h3 { margin-bottom: 12px; }
.reseed-card .body2 { margin-bottom: var(--sp-lg); }
.reseed-fineprint {
    font-size: .8125rem;
    color: var(--slate);
}
.reseed-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}
.reseed-form { margin: 0; padding: 0; }
.reseed-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: rgba(72, 208, 191, 0.14);
    color: var(--primary-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Calendar (BL-P0-011) ---------- */

.cal-toolbar {
    display: flex; align-items: center; gap: var(--sp-sm);
    margin-bottom: var(--sp-md); flex-wrap: wrap;
}
.cal-toolbar .cal-spacer { flex: 1; min-width: 12px; }
.cal-controls {
    display: flex; align-items: center; gap: var(--sp-sm);
    background: var(--paper); border-radius: 8px;
    padding: 6px; box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-soft);
}
.cal-controls .date-display {
    font-weight: 700; padding: 6px var(--sp-md);
    min-width: 220px; text-align: center; color: var(--ink);
}
.cal-btn {
    background: transparent; border: none; cursor: pointer;
    padding: 6px 12px; border-radius: 4px; color: var(--ink);
    text-decoration: none; font-weight: 700; font-size: 1rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.cal-btn:hover { background: var(--canvas); }
.btn-sm { padding: 8px 14px; font-size: .8125rem; }
.cal-view-label {
    font-size: .8125rem; color: var(--slate); font-weight: 600;
}
.cal-view-link {
    font-size: .8125rem; color: var(--slate); font-weight: 600;
    text-decoration: none;
    padding: 6px 10px; border-radius: 4px;
}
.cal-view-link:hover { background: var(--canvas); color: var(--ink); }
.cal-view-link.active {
    background: rgba(72, 208, 191, 0.14);
    color: var(--primary-dark);
}
.cal-practitioner-picker {
    font-family: inherit; font-size: .875rem; color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--input-border); border-radius: 6px;
    padding: 6px 10px;
}

.calendar-card { padding: 0; overflow: hidden; }
.calendar-grid {
    display: grid;
    background: var(--paper);
}
.calendar-grid-day {
    grid-template-columns: 70px repeat(5, minmax(140px, 1fr));
}
.calendar-grid-week {
    grid-template-columns: 70px repeat(5, minmax(140px, 1fr));
}

.cal-header {
    background: var(--paper); border-bottom: 1px solid var(--border);
    padding: var(--sp-md) 12px;
    position: sticky; top: 0; z-index: 2;
}
.cal-header.empty { background: var(--paper); }
.cal-header .name { font-weight: 700; font-size: .9375rem; color: var(--ink); }
.cal-header .role { font-size: .75rem; color: var(--slate); margin-top: 2px; }
.cal-header .status {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--info); margin-right: 6px; vertical-align: middle;
}
.cal-header .status.off { background: var(--status-off); }
.cal-header .status.partial { background: var(--secondary); }

.cal-time-axis {
    background: var(--paper); border-right: 1px solid var(--border);
    position: relative;
}
.cal-time-cell {
    height: 64px; border-bottom: 1px solid var(--border);
    padding: 6px 8px 0; font-size: .75rem;
    color: var(--slate); font-weight: 600;
}

.cal-column {
    position: relative;
    border-right: 1px solid var(--border);
    background:
        linear-gradient(transparent 63px, var(--border) 63px, var(--border) 64px, transparent 64px) 0 0/100% 64px;
}
.cal-column:last-child { border-right: none; }
.cal-column.off-day {
    background:
        repeating-linear-gradient(
            135deg,
            var(--off-day-stripe-1) 0,
            var(--off-day-stripe-1) 8px,
            var(--off-day-stripe-2) 8px,
            var(--off-day-stripe-2) 16px
        );
}
.cal-column.off-day .off-label {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: .75rem; color: var(--slate); font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
    white-space: nowrap;
}
.partial-off {
    position: absolute; left: 0; right: 0; bottom: 0;
    background:
        repeating-linear-gradient(
            135deg,
            var(--off-day-stripe-1) 0,
            var(--off-day-stripe-1) 8px,
            var(--off-day-stripe-2) 8px,
            var(--off-day-stripe-2) 16px
        );
    pointer-events: none;
}

.appt {
    position: absolute; left: 4px; right: 4px;
    border-radius: 4px; padding: 6px 8px;
    font-size: .75rem; line-height: 1.3;
    color: var(--paper); overflow: hidden;
    cursor: pointer; transition: all .15s ease;
    box-shadow: 0 1px 3px rgba(40, 40, 36, 0.12);
}
.appt:hover { transform: translateX(1px); box-shadow: 0 3px 8px rgba(40, 40, 36, 0.18); }
.appt .appt-name { font-weight: 700; margin-bottom: 1px; }
.appt .appt-type { font-size: .6875rem; opacity: .92; font-weight: 600; }

.appt.fam-intake    { background: var(--primary); }
.appt.fam-treatment { background: var(--primary-dark); }
.appt.fam-hygiene   { background: var(--info); }
.appt.fam-ortho     { background: var(--info-light); color: var(--ink); }
.appt.fam-pediatric { background: var(--secondary); color: var(--ink); }
.appt.fam-urgent    { background: var(--error); }
.appt.reserved {
    background: transparent;
    border: 1.5px dashed var(--error);
    color: var(--error);
}
.appt.reserved .appt-name,
.appt.reserved .appt-type { color: var(--error); }

.legend {
    display: flex; flex-wrap: wrap; gap: 14px;
    padding: var(--sp-md) var(--sp-lg);
    border-top: 1px solid var(--border);
    background: var(--legend-bg);
    font-size: .75rem; color: var(--slate); font-weight: 600;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch {
    width: 12px; height: 12px; border-radius: 3px;
    background: var(--canvas);
}
.legend-swatch.swatch-intake    { background: var(--primary); }
.legend-swatch.swatch-treatment { background: var(--primary-dark); }
.legend-swatch.swatch-hygiene   { background: var(--info); }
.legend-swatch.swatch-ortho     { background: var(--info-light); }
.legend-swatch.swatch-pediatric { background: var(--secondary); }
.legend-swatch.swatch-urgent    { background: var(--error); }
.legend-swatch.reserved {
    background: transparent; border: 1.5px dashed var(--error);
}

/* ---------- Chat view (BL-P0-013) ---------- */
.chat-card { padding: 0; overflow: hidden; }
.chat-shell {
    display: flex; flex-direction: column;
    height: calc(100vh - 76px - 64px);
    max-height: 800px;
}
.chat-history {
    flex: 1; overflow-y: auto;
    padding: var(--sp-lg);
    display: flex; flex-direction: column; gap: 14px;
}
.msg {
    max-width: 75%;
    padding: 12px 16px; border-radius: 12px;
    font-size: .9375rem; line-height: 1.5;
}
.msg.from-agent {
    background: var(--paper); color: var(--ink);
    border: 1px solid var(--border-soft);
    align-self: flex-start; border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}
.msg.from-user {
    background: var(--ink); color: var(--paper-on-ink);
    align-self: flex-end; border-bottom-right-radius: 4px;
}
.msg .who {
    display: block; font-size: .6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    margin-bottom: 4px;
}
.msg.from-agent .who { color: var(--primary); }
.msg.from-user .who { color: var(--primary-light); }
.msg-tool {
    align-self: center; font-size: .75rem; color: var(--slate);
    background: rgba(72, 208, 191, .08);
    border: 1px dashed rgba(72, 208, 191, .35);
    padding: 6px 12px; border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
}
.chat-input-row {
    border-top: 1px solid var(--border);
    padding: var(--sp-md) var(--sp-lg);
    background: var(--paper);
    display: flex; align-items: center; gap: var(--sp-sm);
}
.chat-input-row .input { flex: 1; }
.chat-toolbtn {
    width: 42px; height: 42px;
    border-radius: 6px; border: 1px solid var(--border);
    background: var(--paper); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink); position: relative;
}
.chat-toolbtn:hover:not(:disabled) { background: var(--canvas); border-color: var(--ink); }
.chat-toolbtn:disabled { opacity: .5; cursor: not-allowed; }
.chat-toolbtn .badge {
    position: absolute; top: -6px; right: -6px;
    background: var(--secondary); color: var(--ink);
    font-size: .625rem; font-weight: 700;
    padding: 1px 6px; border-radius: 8px;
    text-transform: uppercase; letter-spacing: .04em;
}

/* ---------- Empty-state card (BL-P0-011a) ---------- */
.empty-state-wrap {
    display: flex; align-items: center; justify-content: center;
    padding: var(--sp-xxl) var(--sp-md);
}
.empty-state-card {
    max-width: 480px; text-align: center;
    background: var(--paper); border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: var(--sp-xxl) var(--sp-xl);
    display: flex; flex-direction: column; align-items: center; gap: var(--sp-md);
}
.empty-state-heading {
    font-size: 1.25rem; font-weight: 600; color: var(--ink); margin: 0;
}
.empty-state-body {
    font-size: 1rem; color: var(--slate); margin: 0; line-height: 1.5;
}


/* ---------- Model picker (chat) — ADR-006a D3 ---------- */
/* Mirrors doc/prototype/clinic-demo-prototype.html lines 559–594 + the
 * topbar select+button row at 1035–1044. Per CLAUDE.md theme-literal
 * gate: only var(--*) tokens; no raw hex. */
.topbar-actions {
    display: flex; align-items: center; gap: 12px;
}
/* Wrapper carries the dropdown chevron as a CSS-only ::after pseudo so
 * the chevron color follows the theme's --ink token without a hex
 * literal in the SVG. */
.model-picker-wrap {
    position: relative;
    display: inline-block;
}
.model-picker-wrap::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 8px;
    height: 8px;
    transform: translateY(-70%) rotate(45deg);
    border-right: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    pointer-events: none;
}
.model-picker {
    font-family: inherit;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--paper);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 7px 30px 7px 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color .15s ease;
}
.model-picker:hover { border-color: var(--ink); }
.model-picker:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.model-picker.pending {
    border-style: dashed;
}
.model-picker optgroup {
    font-weight: 700;
    color: var(--slate);
    font-size: .75rem;
}
.model-picker option {
    font-weight: 500;
    color: var(--ink);
    padding: 4px 8px;
}
.model-pending-banner {
    background: var(--paper);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    padding: 10px 14px;
    margin: 0 var(--sp-md) var(--sp-md);
    color: var(--ink);
    font-size: .875rem;
    line-height: 1.5;
}
.hidden { display: none !important; }

/* ---------- Admin: conversations list (BL-It2-007) ---------- */
.conversations-filter-card { margin-bottom: var(--sp-md); }
.conversations-filter-form { width: 100%; }
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-md);
    align-items: end;
}
.filter-field {
    display: flex;
    flex-direction: column;
    gap: var(--sp-xs);
    min-width: 140px;
    flex: 1 1 140px;
}
.filter-label {
    font-size: .75rem;
    color: var(--slate);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}
.filter-field select,
.filter-field input[type="date"],
.filter-field input[type="text"] {
    font-family: inherit;
    font-size: .875rem;
    color: var(--ink);
    background: var(--paper);
    border: 1.5px solid var(--input-border);
    border-radius: 6px;
    padding: 8px 10px;
}
.filter-actions {
    display: flex;
    gap: var(--sp-sm);
    align-items: center;
}
.btn-primary {
    font-family: inherit;
    font-size: .875rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 8px 18px;
    color: var(--paper);
    background: var(--primary);
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-link {
    color: var(--primary-dark);
    background: transparent;
    border: none;
    text-decoration: none;
    font-weight: 600;
    font-size: .875rem;
    padding: 8px 12px;
    cursor: pointer;
}
.btn-link:hover { color: var(--ink); }
.btn-danger {
    font-family: inherit;
    font-size: .875rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 8px 18px;
    color: var(--paper);
    background: var(--error);
}
.btn-danger:hover:not(:disabled) { background: var(--error-dark); }
.conversations-flash {
    margin-bottom: var(--sp-md);
    border-left: 3px solid var(--primary);
}
.conversations-list-card { padding: 0; overflow: hidden; }
.conversations-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-md) var(--sp-lg);
    border-bottom: 1px solid var(--border-soft);
}
.conversations-list-meta { color: var(--slate); }
.conversations-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.conversation-row {
    border-bottom: 1px solid var(--border-soft);
}
.conversation-row:last-child { border-bottom: none; }
.conversation-link {
    display: block;
    padding: var(--sp-md) var(--sp-lg);
    color: var(--ink);
    text-decoration: none;
    transition: background .12s ease;
}
.conversation-link:hover { background: var(--legend-bg); }
.conversation-row-head {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-md);
    align-items: center;
    font-size: .8125rem;
    font-weight: 600;
    margin-bottom: var(--sp-xs);
}
.conversation-when { color: var(--ink); }
.conversation-channel { color: var(--primary-dark); }
.conversation-model { color: var(--slate); }
.conversation-turns { color: var(--slate); }
.conversation-preview {
    color: var(--slate);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pii-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--error);
    color: var(--paper);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.conversations-pagination {
    display: flex;
    justify-content: space-between;
    padding: var(--sp-md) var(--sp-lg);
    border-top: 1px solid var(--border-soft);
}

/* ---------- Admin: conversation detail (BL-It2-007) ---------- */
.conversation-meta-card {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-md);
    margin-bottom: var(--sp-md);
}
.conversation-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--sp-md);
    margin: 0;
    flex: 1 1 60%;
}
.conversation-meta dt {
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--slate);
    font-weight: 600;
    margin-bottom: var(--sp-xs);
}
.conversation-meta dd {
    margin: 0;
    color: var(--ink);
    font-weight: 600;
    font-size: .9375rem;
}
.conversation-delete-form {
    flex-shrink: 0;
}
.conversation-turns {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
}
.conversation-turn {
    border-left: 3px solid var(--border);
}
.conversation-turn--user { border-left-color: var(--primary); }
.conversation-turn--assistant { border-left-color: var(--ink); }
.conversation-turn--tool { border-left-color: var(--info); }
.conversation-turn--error { border-left-color: var(--error); background: var(--legend-bg); }
.conversation-turn-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-md);
    margin-bottom: var(--sp-sm);
}
.conversation-turn-meta { color: var(--slate); font-size: .75rem; }
.conversation-turn-content {
    margin: 0;
    color: var(--ink);
    line-height: 1.55;
    white-space: pre-wrap;
}
.conversation-turn-json {
    margin-top: var(--sp-sm);
    font-size: .8125rem;
    color: var(--slate);
}
.conversation-turn-json summary {
    cursor: pointer;
    color: var(--primary-dark);
    font-weight: 600;
}
.conversation-turn-json pre {
    background: var(--legend-bg);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: var(--sp-sm) var(--sp-md);
    margin-top: var(--sp-sm);
    overflow-x: auto;
    font-size: .75rem;
    color: var(--ink);
    line-height: 1.45;
}
.conversations-empty-card { text-align: center; }
