/* Care Circle manager dashboard. Layout follows Cam's mockup: left sidebar, soft grey canvas, white cards. */

:root {
    --blue: #2f6fed;
    --blue-dark: #2358c7;
    --blue-soft: #e8f1fe;
    --green: #22a06b;
    --green-soft: #e9f7ef;
    --amber: #e8a317;
    --amber-soft: #fdf4e3;
    --red: #e5484d;
    --red-soft: #fdecec;
    --purple: #7c5cd6;
    --purple-soft: #f1ecfb;
    --grey: #9aa4b2;
    --ink: #1c2434;
    --ink-soft: #5b6676;
    --line: #e6eaf0;
    --canvas: #f5f7fb;
    --card: #ffffff;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 10px rgba(16, 24, 40, 0.04);
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body { background: var(--canvas); color: var(--ink); font-size: 14.5px; line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 16px; }
p { margin: 0; }
small { font-size: 12.5px; }
code { background: var(--canvas); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.muted { color: var(--ink-soft); }
.block { display: block; }
.nowrap { white-space: nowrap; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--card); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.content { padding: 28px 32px 48px; max-width: 1360px; width: 100%; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--ink); padding: 0 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; stroke: none; }
.brand-centre { justify-content: center; margin-bottom: 18px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--ink-soft); font-weight: 500; }
.nav a svg { width: 18px; height: 18px; }
.nav a:hover { background: var(--canvas); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }

.user-block { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-top: 1px solid var(--line); }
.user-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-text strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-text small { color: var(--ink-soft); }
.signout { margin-left: auto; }
.signout button { background: none; border: 0; color: var(--ink-soft); cursor: pointer; padding: 6px; border-radius: 8px; display: flex; }
.signout button:hover { background: var(--canvas); color: var(--ink); }
.signout svg { width: 18px; height: 18px; }

/* ---------- avatars, dots, chips, badges */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.avatar-sm { width: 34px; height: 34px; font-size: 12.5px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.green { background: var(--green-soft); color: var(--green); }
.avatar.amber { background: var(--amber-soft); color: #b47a07; }
.avatar.red { background: var(--red-soft); color: var(--red); }
.avatar.none { background: #eef1f5; color: var(--ink-soft); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--grey); vertical-align: middle; margin-right: 4px; }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.red { background: var(--red); }
.dot.none { background: var(--grey); }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--canvas); color: var(--ink-soft); font-size: 12px; font-weight: 600; margin-left: 6px; vertical-align: middle; white-space: nowrap; }
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-amber { background: var(--amber-soft); color: #b47a07; }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-blue { background: var(--blue-soft); color: var(--blue); }

.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: #eef1f5; color: var(--ink-soft); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: #b47a07; }
.badge.red { background: var(--red-soft); color: var(--red); }

/* ---------- page head and filters */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-soft); margin-top: 4px; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filter { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ink-soft); font-weight: 600; }
select, input[type="date"], input[type="search"], input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], textarea {
    font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; min-height: 38px;
}
select:focus, input:focus, textarea:focus { outline: 2px solid rgba(47, 111, 237, 0.35); border-color: var(--blue); }
textarea { resize: vertical; }

/* ---------- cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px; }
.card-head { margin-bottom: 14px; }
.card-head p { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.card.tint-amber { background: #fffaf0; border-color: #f6e3b8; }
.card.dashed { border-style: dashed; box-shadow: none; background: transparent; }
.card-link { display: inline-block; margin-top: 12px; font-weight: 600; font-size: 13.5px; }
.grid-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.grid-main > .card { margin-bottom: 0; }
.grid-main { margin-bottom: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack > .card { margin-bottom: 0; }
.footnote { color: var(--ink-soft); font-size: 12.5px; margin-top: 4px; }

/* ---------- KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; border: 1px solid transparent; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.kpi-value { font-size: 34px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-value small { font-size: 18px; font-weight: 700; margin-left: 1px; }
.kpi-word { font-size: 26px; }
.kpi-change { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; color: var(--ink-soft); min-height: 18px; }
.kpi-change span { font-weight: 500; }
.kpi-change.up { color: var(--green); }
.kpi-change.down { color: var(--red); }
.kpi-change.invert.up { color: var(--red); }
.kpi-change.invert.down { color: var(--green); }
.kpi-foot { font-size: 12px; color: var(--ink-soft); }
.arrow { display: inline-block; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; }
.up .arrow { border-bottom: 7px solid currentColor; }
.down .arrow { border-top: 7px solid currentColor; }
.tint-green { background: var(--green-soft); border-color: #cfeedd; }
.tint-green .kpi-value { color: var(--green); }
.tint-blue { background: var(--blue-soft); border-color: #d2e2fb; }
.tint-blue .kpi-value { color: var(--blue); }
.tint-red { background: var(--red-soft); border-color: #f8d4d6; }
.tint-red .kpi-value { color: var(--red); }
.tint-purple { background: var(--purple-soft); border-color: #e2d9f6; }
.tint-purple .kpi-value { color: var(--purple); }

/* ---------- charts */
.chart-wrap { position: relative; width: 100%; }
.status-wrap { display: flex; align-items: center; gap: 22px; }
.donut-wrap { position: relative; width: 170px; height: 170px; flex-shrink: 0; }
.donut-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-centre strong { font-size: 30px; font-weight: 750; line-height: 1; }
.donut-centre span { font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-weight: 600; font-size: 13.5px; }
.legend span { color: var(--ink-soft); font-weight: 500; }

/* ---------- team table */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 380px; display: flex; align-items: center; }
.search svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--grey); }
.search input { width: 100%; padding-left: 34px; }
.team-table, .plain-table { width: 100%; border-collapse: collapse; }
.team-table th, .plain-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.team-table td, .plain-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.team-table tbody tr:last-child td, .plain-table tbody tr:last-child td { border-bottom: 0; }
.team-table tbody tr:hover { background: #fafbfd; }
.person { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.person:hover { text-decoration: none; }
.person:hover strong { color: var(--blue); }
.person-text { display: flex; flex-direction: column; line-height: 1.2; }
.person-text small { color: var(--ink-soft); }
.status { font-weight: 600; white-space: nowrap; }
.spark { display: block; }
.empty { padding: 24px; text-align: center; color: var(--ink-soft); }
tr.muted td { color: var(--ink-soft); }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--blue); color: #fff; border: 1px solid var(--blue); border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--blue-dark); text-decoration: none; }
.btn-secondary { background: var(--card); color: var(--blue); border-color: #c9dafa; }
.btn-secondary:hover { background: var(--blue-soft); }
.btn-small { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- individual view */
.detail-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.back svg { width: 16px; height: 16px; }
.person-card { padding-bottom: 0; }
.person-head { display: flex; gap: 18px; align-items: center; }
.person-meta h1 { font-size: 22px; }
.badges { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 8px; }
.tabs a { padding: 9px 16px; border-radius: 10px 10px 0 0; color: var(--ink-soft); font-weight: 600; border-bottom: 2px solid transparent; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--blue); border-bottom-color: var(--blue); }

.bullets { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.quotes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.quotes blockquote, .answers blockquote { margin: 6px 0 2px; padding: 8px 12px; border-left: 3px solid var(--blue); background: var(--canvas); border-radius: 0 8px 8px 0; font-style: italic; color: var(--ink); }

.answers { width: 100%; border-collapse: collapse; }
.answers td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.answers tr:last-child td { border-bottom: 0; }
.answers .q { color: var(--ink-soft); width: 55%; }
.answers .q small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.answers .a { font-weight: 600; }
.answers tr.flagged .a span { color: #b47a07; }

.checkin-list { display: flex; flex-direction: column; gap: 8px; }
.checkin { border: 1px solid var(--line); border-radius: 10px; }
.checkin summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.checkin summary::-webkit-details-marker { display: none; }
.checkin summary::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid var(--grey); border-bottom: 1.6px solid var(--grey); transform: rotate(-45deg); transition: transform 0.15s; }
.checkin[open] summary::before { transform: rotate(45deg); }
.checkin[open] summary { border-bottom: 1px solid var(--line); }
.checkin .answers { padding: 0 8px; }

/* ---------- forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.form input[type="checkbox"] { width: 16px; height: 16px; }
.form .btn { align-self: flex-start; }
.inline-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.inline-form input[type="text"] { flex: 1; min-height: 34px; padding: 6px 10px; }
.inline-form select { min-height: 34px; padding: 5px 10px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); border: 2px solid var(--card); }
.timeline li.done::before { background: var(--green); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.tl-head .chip { margin-left: 0; }

.flash { background: var(--green-soft); color: var(--green); border: 1px solid #cfeedd; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-weight: 600; }
.alert { background: var(--red-soft); color: var(--red); border: 1px solid #f8d4d6; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }

/* ---------- placeholder */
.placeholder { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.placeholder svg { width: 64px; height: 64px; stroke: none; }
.placeholder p { max-width: 460px; color: var(--ink-soft); }
.placeholder .btn { margin-top: 10px; }

/* ---------- login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 36px 34px; width: 100%; max-width: 420px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .form { margin-top: 22px; }
.demo-logins { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 13px; }
.demo-logins summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.demo-logins ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; color: var(--ink-soft); }
.demo-logins button { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }

/* ---------- responsive */
@media (max-width: 1100px) {
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .user-block { margin-left: auto; border-top: 0; padding: 0; }
    .content { padding: 20px 16px 40px; }
    .status-wrap { flex-direction: column; align-items: flex-start; }
}

/* ---------- print */
@media print {
    .no-print { display: none !important; }
    body { background: #fff; font-size: 12px; }
    .shell { display: block; }
    .content { padding: 0; max-width: none; }
    .card, .kpi { box-shadow: none; break-inside: avoid; }
    .grid-main { grid-template-columns: 1.6fr 1fr; }
    .checkin[open] summary::before, .checkin summary::before { display: none; }
    details.checkin { break-inside: avoid; }
}

/* ---------- shared bits added with the Alerts, Inbox, Reports, Resources and Settings pages */
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--canvas); color: var(--ink); }
.nav-badge { margin-left: auto; background: var(--blue); color: #fff; font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge.red { background: var(--red); }
.attention { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.attention .chip { margin-left: 0; padding: 4px 11px; }
a.chip:hover { text-decoration: none; filter: brightness(0.96); }
.tabs-top { margin: 0 0 18px; border-top: 0; padding-top: 0; border-bottom: 1px solid var(--line); }
.tabs-top a { border-radius: 10px 10px 0 0; display: inline-flex; align-items: center; gap: 8px; }
.tabs .count { background: var(--canvas); color: var(--ink-soft); font-size: 11.5px; padding: 1px 7px; border-radius: 999px; }
.tabs a.active .count { background: var(--blue-soft); color: var(--blue); }
.chip-high { background: var(--red-soft); color: var(--red); }
.chip-medium { background: var(--blue-soft); color: var(--blue); }
.chip-low { background: var(--purple-soft); color: var(--purple); }
.field-error { color: var(--red); font-size: 12px; font-weight: 500; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card.narrow { max-width: 640px; }
h1.h2 { font-size: 20px; }
.facts { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 650; text-align: right; }
.small-head { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; margin: 16px 0 8px; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bars li { display: grid; grid-template-columns: 150px 1fr 30px; align-items: center; gap: 10px; font-size: 13px; }
.bars li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }
.bars li i { display: block; height: 10px; border-radius: 999px; background: var(--blue); min-width: 4px; }
.bars li b { text-align: right; }
.print-only { display: none; }

/* ---------- alerts */
.alert-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.alert-item { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px 14px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.alert-item .sev-bar { position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grey); }
.alert-item.sev-high .sev-bar { background: var(--red); }
.alert-item.sev-medium .sev-bar { background: var(--blue); }
.alert-item.sev-low .sev-bar { background: var(--purple); }
.alert-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.alert-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alert-head .chip { margin-left: 0; }
.alert-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; flex-shrink: 0; }
.alert-actions .btn { justify-content: center; }
.alert-actions form { display: flex; }
.alert-actions form .btn { flex: 1; }
.avatar.kind { background: var(--purple-soft); color: var(--purple); }
.avatar.kind svg { width: 18px; height: 18px; }
.alert-list.compact .alert-item { padding: 10px 14px 10px 18px; }
.alert-list.compact .alert-actions { flex-direction: row; }
.seen-card { padding: 0; }
.seen-card summary { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; cursor: pointer; font-weight: 650; list-style: none; }
.seen-card summary::-webkit-details-marker { display: none; }
.seen-card .alert-list { padding: 0 22px 18px; }

/* ---------- inbox */
.message-list, .request-list, .resource-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.message, .request, .resource { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.message.unread { background: #f7faff; border-color: #cfe0fb; }
.message.unread .subject { font-weight: 700; }
.message-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.message-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.message-head .chip { margin-left: 0; }
.subject { font-weight: 600; }
a.avatar:hover { text-decoration: none; filter: brightness(0.95); }
.avatar.none svg { width: 18px; height: 18px; }
.request.stale { border-color: #f6e3b8; background: #fffdf7; }
.request.closed { opacity: 0.75; }
.followup { margin-top: 6px; flex-wrap: wrap; }
.followup input[type="text"] { min-width: 260px; }
.followup .check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.topic-list { display: flex; flex-direction: column; gap: 10px; }
.topic { border: 1px solid var(--line); border-radius: 12px; }
.topic summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.topic summary::-webkit-details-marker { display: none; }
.topic summary::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid var(--grey); border-bottom: 1.6px solid var(--grey); transform: rotate(-45deg); transition: transform 0.15s; }
.topic[open] summary::before { transform: rotate(45deg); }
.topic[open] summary { border-bottom: 1px solid var(--line); }
.topic summary .chip { margin-left: 0; }
.topic-action { margin: 0 0 0 auto; }
.topic .plain-table td, .topic .plain-table th { padding-left: 16px; }

/* ---------- reports */
.plain-table .num { text-align: right; white-space: nowrap; }
.plain-table td.up { color: var(--green); font-weight: 600; }
.plain-table td.down { color: var(--red); font-weight: 600; }
.question-table .chip { margin-left: 0; margin-top: 4px; display: inline-block; }
.report-banner { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--blue); }
.report-banner strong { display: block; font-size: 18px; }

/* ---------- resources */
.res-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--canvas); color: var(--ink-soft); }
.res-icon svg { width: 18px; height: 18px; }
.cat-wellbeing .res-icon { background: var(--green-soft); color: var(--green); }
.cat-training .res-icon { background: var(--blue-soft); color: var(--blue); }
.cat-support .res-icon { background: var(--purple-soft); color: var(--purple); }
.resource .order { white-space: nowrap; }

/* ---------- settings */
.meter-bar { height: 12px; background: var(--canvas); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.meter-bar i { display: block; height: 100%; background: var(--purple); border-radius: 999px; }
.structure { display: flex; flex-direction: column; gap: 16px; }
.location { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.location > .rename { margin: 0 0 8px; font-weight: 650; }
.location > .rename svg { width: 18px; height: 18px; color: var(--blue); flex-shrink: 0; }
.location > .rename input[type="text"] { font-weight: 650; max-width: 320px; }
.teams { list-style: none; margin: 0; padding: 0 0 0 28px; display: flex; flex-direction: column; gap: 4px; }
.teams .rename input[type="text"] { max-width: 320px; }
.inline-form.rename, .inline-form.add { margin-top: 0; }
.inline-form.add input[type="text"] { max-width: 320px; }

/* ---------- assistant */
.assistant-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.assistant-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.assistant-side { display: flex; flex-direction: column; gap: 20px; }
.exchange { display: flex; flex-direction: column; gap: 12px; }
.asked { display: flex; gap: 12px; align-items: flex-start; padding: 0 4px; }
.asked-text p { font-weight: 600; font-size: 15.5px; }
.answer { display: flex; flex-direction: column; gap: 18px; }
.answer-part { display: flex; flex-direction: column; gap: 10px; }
.part-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.part-head h2 { font-size: 15px; }
.prose p { margin: 0 0 8px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0; padding-left: 20px; }
.prose li { margin: 3px 0; }
.note { background: var(--amber-soft); color: #7a5300; border-radius: 10px; padding: 8px 12px; font-size: 13.5px; }
.figure { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.figure summary { cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.figure summary::-webkit-details-marker { display: none; }
.figure summary::before { content: "\25B8"; color: var(--grey); font-size: 12px; }
.figure[open] summary::before { content: "\25BE"; }
.figure[open] summary { margin-bottom: 8px; }
.figure-note { font-size: 13px; margin-top: 6px; }
.table-scroll { overflow-x: auto; }
.figure-table { font-size: 13px; }
.figure-table th, .figure-table td { padding: 5px 8px; vertical-align: top; }
.figure-table td { max-width: 360px; }
.checked summary { cursor: pointer; font-size: 13px; color: var(--ink-soft); }
.checked ul { margin: 8px 0; padding-left: 18px; font-size: 13px; }
.checked li { margin: 2px 0; }
.ask textarea { width: 100%; min-height: 72px; resize: vertical; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.suggestions .chip { cursor: pointer; border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 13px; padding: 5px 10px; }
.suggestions .chip:hover { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-dark); }
.ask-actions { margin-top: 10px; }
.filter.inline { flex-direction: row; align-items: center; gap: 8px; }
.filter.inline select { min-width: 190px; }
.new-chain { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.recent-questions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.recent-questions li { display: flex; flex-direction: column; gap: 2px; }
button.link { background: none; border: 0; padding: 0; color: var(--blue); text-align: left; cursor: pointer; font: inherit; }
button.link:hover { text-decoration: underline; }
.bullets.small { font-size: 13px; }
.ai-log { font-size: 13px; }
.ai-log td { vertical-align: top; }
button[disabled].btn { opacity: 0.6; cursor: default; }

@media (max-width: 1100px) {
    .alert-summary { grid-template-columns: 1fr; }
    .assistant-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .alert-item, .message, .request, .resource { flex-wrap: wrap; }
    .alert-actions { flex-direction: row; width: 100%; }
    .form-row { grid-template-columns: 1fr; }
    .bars li { grid-template-columns: 110px 1fr 30px; }
}
@media print {
    .print-only { display: block; }
    .alert-summary { grid-template-columns: repeat(3, 1fr); }
    .kpis { grid-template-columns: repeat(4, 1fr); }
    .tabs-top { display: none; }
    .message, .request, .alert-item, .topic { break-inside: avoid; }
    a { color: inherit; }
}

/* ---------- reports: PDF options and request list */
.pdf-options { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.pdf-options .check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
.pdf-options .check input { margin: 0; }
.request-table td { vertical-align: top; }
.followups { margin: 0; padding: 0 0 0 16px; }
.followups li { margin: 2px 0; }
.followups.plain { padding-left: 16px; margin-top: 4px; }
.chip-red { background: var(--red-soft); color: var(--red); }
.ask-links li { margin: 4px 0; }
