/* PSSPF Member Engagement demonstration. Burgundy and gold are drawn from the supplied logo. */
:root {
    --brand: #7a0f14; --brand-dark: #5a0a0e; --brand-soft: #f8eded; --gold: #d2a428; --gold-soft: #fbf4de;
    --ink: #1d1b1a; --ink-2: #55504b; --muted: #8a847d; --line: #e7e2db; --line-2: #f1ede7;
    --bg: #f7f5f2; --panel: #ffffff;
    --good: #0b7a3e; --good-soft: #e6f4ec; --warn: #9a5800; --warn-soft: #fdf2dd;
    --bad: #b42318; --bad-soft: #fdecea; --info: #1f5fae; --info-soft: #e8f0fb;
    --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
    --radius: 10px; --shadow: 0 1px 2px rgba(29, 27, 26, .05), 0 1px 8px rgba(29, 27, 26, .04);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--ink);
    background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.wrap { width: 100%; margin: 0 auto; padding: 0 clamp(24px, 2.5vw, 80px); }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---- Sign in ---- */
.login { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(340px, 44%) 1fr; background: var(--bg); z-index: 50; }
.login-side { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 70%); color: #fff; padding: 56px 52px;
    display: flex; flex-direction: column; gap: 18px; }
.login-brand { background: #fff; border-radius: 12px; padding: 14px 18px; align-self: flex-start; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.login-brand img { display: block; height: 62px; width: auto; }
.login-side h1 { font-size: 34px; margin-top: 28px; }
.login-side p { font-size: 16px; opacity: .9; max-width: 420px; }
.login-side ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; font-size: 14.5px; }
.login-side li i { color: var(--gold); width: 26px; }
.login-foot { margin-top: auto; font-size: 12.5px; opacity: .75; border-top: 1px solid rgba(255, 255, 255, .2); padding-top: 14px; }
.login-main { display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 32px;
    box-shadow: 0 8px 30px rgba(29, 27, 26, .07); display: grid; gap: 14px; }
.login-card h2 { font-size: 22px; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---- Shell ---- */
.topbar { background: var(--panel); border-top: 3px solid var(--brand); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 16px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { height: 46px; width: auto; display: block; }
.brand span { display: grid; border-left: 1px solid var(--line); padding-left: 16px; line-height: 1.25; }
.brand strong { font-size: 16px; } .brand small { color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.status-pill { font-size: 12px; font-weight: 600; color: var(--good); background: var(--good-soft); border-radius: 999px; padding: 5px 11px; }
.status-pill i { font-size: 7px; vertical-align: 2px; margin-right: 4px; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 9px; background: none; border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; cursor: pointer; }
.user-btn:hover { border-color: var(--line); }
.user-btn > i { font-size: 10px; color: var(--muted); }
.user-text { display: grid; text-align: left; line-height: 1.2; } .user-text small { color: var(--muted); font-size: 11.5px; text-transform: capitalize; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(29, 27, 26, .12); padding: 6px; min-width: 190px; z-index: 30; }
.menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; background: none; border: 0; border-radius: 6px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--bg); }
.menu i { color: var(--muted); width: 16px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 10px 14px; color: var(--ink-2); font-weight: 550; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.nav a i { margin-right: 6px; opacity: .8; }
.demo-strip { background: var(--gold-soft); border-bottom: 1px solid #f0e2b4; font-size: 12.5px; color: #6b5210; padding: 6px 0; }
.demo-strip i { margin-right: 6px; }
main#view { padding-top: 26px; padding-bottom: 40px; min-height: 60vh; }
.footer { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; padding-top: 14px; padding-bottom: 26px; border-top: 1px solid var(--line); }

/* ---- Page headers ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { color: var(--ink-2); margin-top: 2px; }
.subnav { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.subnav a { padding: 7px 13px; border-radius: 999px; color: var(--ink-2); font-weight: 550; border: 1px solid var(--line); background: var(--panel); }
.subnav a:hover { text-decoration: none; border-color: #d5cec4; }
.subnav a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.subnav .count { font-size: 11.5px; background: rgba(0, 0, 0, .08); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.subnav a.active .count { background: rgba(255, 255, 255, .22); }

/* ---- Buttons and inputs ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: 8px; border: 1px solid #d9d2c8;
    background: var(--panel); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: #faf8f5; border-color: #c9c1b5; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #3d2f05; }
.btn.danger { color: var(--bad); border-color: #efc4bf; }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; padding: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font-weight: 600; }
.link:hover { text-decoration: underline; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], input[type=search], select, textarea {
    width: 100%; padding: 8px 11px; border: 1px solid #d9d2c8; border-radius: 8px; background: #fff; outline: none; min-height: 38px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(122, 15, 20, .12); }
textarea { resize: vertical; line-height: 1.6; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.input-icon { position: relative; } .input-icon .icon-btn { position: absolute; right: 4px; top: 4px; }
.input-icon > i { position: absolute; left: 12px; top: 12px; color: var(--muted); } .input-icon.lead input { padding-left: 34px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 7px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.active { background: var(--brand); color: #fff; }

/* ---- Panels, tiles, pills ---- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-pad { padding: 18px 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.panel-head p { color: var(--muted); font-size: 12.5px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tiles.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); text-align: left; }
button.tile, a.tile { cursor: pointer; transition: transform .12s, border-color .12s; color: inherit; display: block; }
button.tile:hover, a.tile:hover { transform: translateY(-1px); border-color: #cfc7bb; text-decoration: none; }
.tile.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(122, 15, 20, .16); }
.tile.hero { background: var(--brand); border-color: var(--brand); color: #fff; }
.tile.hero .tile-label, .tile.hero .tile-sub { color: rgba(255, 255, 255, .85); }
.tile-label { font-size: 12px; font-weight: 600; color: var(--ink-2); display: flex; gap: 7px; align-items: center; }
.tile-value { font-size: 27px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin-top: 2px; }
.tile-value.bad { color: var(--bad); }
.tile-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.delta { font-size: 11.5px; font-weight: 650; margin-left: 6px; } .delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap;
    background: var(--line-2); color: var(--ink-2); border: 1px solid transparent; }
.pill.good { background: var(--good-soft); color: var(--good); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.info { background: var(--info-soft); color: var(--info); }
.pill.brand { background: var(--brand-soft); color: var(--brand); } .pill.gold { background: var(--gold-soft); color: #7a5c08; }
.pill.outline { background: #fff; border-color: var(--line); }
.mb { border: 1px solid; } .mb::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mb.teal { background: #e3f4f1; color: #0f6b5d; border-color: #bfe3dc; } .mb.blue { background: #e8f0fb; color: #1f5fae; border-color: #c6dbf5; }
.mb.purple { background: #f0eafa; color: #5b3a9c; border-color: #dccff2; } .mb.slate { background: #eceff3; color: #44546a; border-color: #d3dae3; }
.mb.orange { background: #fdeee3; color: #a04a0c; border-color: #f6d3b8; } .mb.red { background: #fdecea; color: #a52318; border-color: #f4c9c4; }
.mb.gold { background: #fbf4de; color: #7a5c08; border-color: #eeddb0; }
.alert { padding: 10px 13px; border-radius: 8px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; border-left: 3px solid; }
.alert.warn { background: var(--warn-soft); color: #6f4100; border-color: var(--gold); } .alert.bad { background: var(--bad-soft); color: #8f1c13; border-color: var(--bad); }
.alert.info { background: var(--info-soft); color: #17467f; border-color: var(--info); } .alert.good { background: var(--good-soft); color: #075c2f; border-color: var(--good); }
.alert ul { margin: 0; padding-left: 16px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); } .empty i { font-size: 34px; color: #d8d1c7; display: block; margin-bottom: 12px; }
.empty h3 { color: var(--ink-2); margin-bottom: 4px; }
.loading { text-align: center; padding: 42px; color: var(--muted); }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .25s; }

/* ---- Tabs and filters ---- */
.tabs { display: flex; gap: 4px; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 13px 10px 11px; font-weight: 600; color: var(--ink-2); cursor: pointer; margin-bottom: -1px; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { background: var(--line-2); border-radius: 999px; font-size: 11.5px; padding: 1px 8px; margin-left: 5px; color: var(--ink-2); }
.filters { display: grid; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); grid-template-columns: 1.1fr 2fr 1fr 1fr auto; align-items: end; }
.filters.second { grid-template-columns: 1fr 1fr auto 1fr; border-bottom: 1px solid var(--line); padding-top: 0; }
.filters.register { grid-template-columns: 1.6fr repeat(6, 1fr); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; color: var(--ink-2); font-size: 13px; }

/* ---- Email cards ---- */
.email { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 22px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.email:last-child { border-bottom: 0; }
.email.done { background: #fcfbf9; }
.email-top { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin-bottom: 7px; }
.email h3 { font-size: 15.5px; cursor: pointer; } .email h3:hover { color: var(--brand); }
.email-meta { display: flex; gap: 16px; color: var(--ink-2); font-size: 12.5px; margin: 3px 0 8px; flex-wrap: wrap; }
.email-meta i { color: var(--muted); margin-right: 5px; }
.email-preview { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; border-top: 1px solid var(--line-2); margin-top: 12px; padding-top: 11px; }
.fact small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; } .fact b { font-weight: 600; font-size: 13px; }
.idchip { display: inline-flex; gap: 6px; align-items: center; padding: 2px 8px; border: 1px solid #e9c8c8; background: var(--brand-soft); color: var(--brand);
    border-radius: 6px; font-weight: 650; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.idchip.invalid { border-color: #f4c9c4; background: var(--bad-soft); color: var(--bad); }
.email-side { border-left: 1px solid var(--line-2); padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.conf { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); } .conf b { font-size: 13px; color: var(--ink); }
.bar { height: 5px; background: var(--line-2); border-radius: 999px; overflow: hidden; } .bar > i { display: block; height: 100%; border-radius: 999px; background: var(--good); }
.bar.mid > i { background: var(--gold); } .bar.low > i { background: var(--bad); }
.sentiment { margin-left: auto; font-size: 12.5px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.sentiment.positive i { color: var(--good); } .sentiment.negative i { color: var(--bad); } .sentiment.neutral i { color: var(--muted); }

/* ---- Review and send ---- */
.review-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.review-head h1 { font-size: 20px; }
.review { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); gap: 16px; align-items: start; }
.section-title { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 12px; } .section-title i { color: var(--brand); }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.msg.out { background: #fbf8f3; border-color: #ebe2d2; }
.msg-head { display: flex; gap: 10px; align-items: center; cursor: pointer; } .msg-head .avatar { width: 30px; height: 30px; font-size: 11px; }
.msg.out .avatar { background: var(--gold-soft); color: #7a5c08; }
.msg-who { flex: 1; min-width: 0; line-height: 1.3; } .msg-who small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-body { white-space: pre-wrap; margin-top: 11px; color: #2a2726; line-height: 1.62; } .msg.collapsed .msg-body, .msg.collapsed .msg-files { display: none; }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ent { padding: 0 4px; border-radius: 4px; font-weight: 600; } .ent.id, .ent.member, .ent.psira { background: #efe7fb; color: #55329b; cursor: pointer; }
.ent.amount { background: var(--good-soft); color: var(--good); } .ent.reference { background: var(--gold-soft); color: #7a5c08; }
.file { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 12.5px; background: #fff; }
.file i { color: var(--brand); } .file button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; } .file button:hover { color: var(--ink); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; text-align: right; }
.kv.left dd { text-align: left; } .kv.wide { grid-template-columns: 1fr auto; }
.steps { list-style: none; margin: 8px 0 0; padding: 0 0 0 4px; } .steps li { position: relative; padding: 0 0 9px 22px; font-size: 12.5px; color: var(--ink-2); }
.steps li::before { content: ''; position: absolute; left: 0; top: 4px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #cfc7bb; background: #fff; }
.steps li::after { content: ''; position: absolute; left: 5.5px; top: 16px; bottom: -3px; width: 2px; background: var(--line); } .steps li:last-child::after { display: none; }
.steps li.done::before { background: var(--good); border-color: var(--good); } .steps li.now::before { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.steps li.now { color: var(--ink); font-weight: 600; } .steps small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.draft-box { border: 1px solid #d9d2c8; border-radius: 10px; overflow: hidden; } .draft-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(122, 15, 20, .1); }
.draft-to { padding: 9px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); background: #fcfbf9; }
.draft-box textarea { border: 0; border-radius: 0; min-height: 200px; padding: 14px; font-size: 14.5px; box-shadow: none !important; resize: none; overflow: hidden; display: block; }
.doc { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); } .doc:last-child { border-bottom: 0; }
.doc.off { opacity: .55; } .doc b { font-weight: 600; } .doc small { display: block; color: var(--muted); }
.send-bar { background: #fcfbf9; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); padding: 16px 20px; display: grid; gap: 12px; }
details > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 12.5px; } details[open] > summary { margin-bottom: 10px; }
.trace { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 12.5px; } .trace dt { color: var(--muted); } .trace dd { margin: 0; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fcfbf9; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: #fcfaf7; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.ref { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; }
.clip { max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Bars and charts ---- */
.hbar { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 54px; gap: 12px; align-items: center; padding: 6px 0; font-size: 13px; }
a.hbar { color: inherit; border-radius: 6px; } a.hbar:hover { background: var(--bg); text-decoration: none; }
.hbar .track { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; } .hbar .track i { display: block; height: 100%; border-radius: 999px; background: var(--s1); }
.hbar .track i.alt { background: var(--s2); } .hbar .track i.brand { background: var(--brand); }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.chart-box { position: relative; height: 280px; } .chart-box.short { height: 220px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

/* ---- Timeline (case history) ---- */
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.timeline li::after { content: ''; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line); } .timeline li:last-child::after { display: none; }
.timeline b { font-weight: 600; } .timeline small { display: block; color: var(--muted); }
.note { background: #fffdf5; border: 1px solid #f0e6c4; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; } .note small { color: var(--muted); display: block; margin-top: 4px; }
.transcript p { margin: 0 0 9px; padding-left: 74px; position: relative; } .transcript b { position: absolute; left: 0; font-size: 12px; color: var(--muted); font-weight: 650; }
.transcript p.agent b { color: var(--brand); }

/* ---- Modal and toast ---- */
.overlay { position: fixed; inset: 0; background: rgba(29, 27, 26, .5); display: grid; place-items: start center; padding: 6vh 16px; z-index: 60; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 14px; width: min(560px, 100%); box-shadow: 0 24px 70px rgba(0, 0, 0, .28); }
.modal.wide { width: min(860px, 100%); } .modal.xl { width: min(1080px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-body { padding: 18px 20px; display: grid; gap: 14px; } .modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }
.toasts { position: fixed; top: 18px; right: 18px; display: grid; gap: 8px; z-index: 80; }
.toast { background: var(--ink); color: #fff; padding: 11px 15px; border-radius: 9px; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); max-width: 380px; display: flex; gap: 10px; animation: drop .2s; }
.toast.good i { color: #5fd597; } .toast.bad i { color: #ff9c92; } .toast.info i { color: var(--gold); }
@keyframes drop { from { transform: translateY(-10px); opacity: 0; } }
.guide-step { display: flex; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; text-align: left; width: 100%; }
.guide-step:hover { border-color: var(--brand); background: var(--brand-soft); } .guide-step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.guide-step b { display: block; } .guide-step small { color: var(--ink-2); }
iframe.preview { width: 100%; height: 68vh; border: 1px solid var(--line); border-radius: 8px; }
.obs-charts { gap:18px; margin-bottom:18px; }
.grid > *, .chart-box, .panel { min-width:0; }
.chart-box canvas { max-width:100%; }
.obs-filters { display:grid; grid-template-columns:minmax(220px,2fr) repeat(5,minmax(110px,1fr)); gap:12px; margin-bottom:16px; }
.obs-code { display:block; max-width:340px; overflow-wrap:anywhere; font-size:11px; }
#w-live { width:auto; min-height:0; margin-right:6px; }
@media(max-width:1100px) { .obs-filters { grid-template-columns:repeat(3,minmax(0,1fr)); } .obs-charts { grid-template-columns:minmax(0,1fr); } }
@media(max-width:720px) { .obs-filters { grid-template-columns:1fr; } .obs-code { max-width:180px; } }

@media (max-width: 1100px) {
    .tiles, .tiles.five { grid-template-columns: repeat(3, 1fr); } .tiles.four, .cols-4 { grid-template-columns: repeat(2, 1fr); }
    .review, .cols-2, .cols-3 { grid-template-columns: 1fr; } .filters, .filters.second, .filters.register { grid-template-columns: 1fr 1fr; }
    .email { grid-template-columns: 1fr; } .email-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-2); padding-top: 12px; }
    .user-text, .brand small { display: none; }
}
@media (max-width: 720px) {
    .login { grid-template-columns: 1fr; } .login-side { display: none; } .wrap { padding: 0 14px; }
    .tiles, .tiles.four, .tiles.five, .facts { grid-template-columns: repeat(2, 1fr); } .nav { overflow-x: auto; } .nav a { white-space: nowrap; }
    .brand span, .status-pill { display: none; } .filters, .filters.second, .filters.register { grid-template-columns: 1fr; }
}
