/* Capable Workforce CRM — stylesheet
   Palette + type lifted from Capable Workforce Brand Board v1 */
:root {
  --navy: #14213D;
  --navy-2: #0E1730;
  --amber: #F4A300;
  --amber-ink: #8A5A00;
  --chalk: #F7F5F0;
  --steel: #4A5568;
  --bg: #EEF0F3;
  --panel: #FFFFFF;
  --panel-2: #E9ECF1;
  --line: #DDE2E9;
  --ink: #14213D;
  --muted: #75808F;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Barlow", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  margin: 0;
}
button, input, select { font-family: inherit; }
::selection { background: rgba(244,163,0,.35); }

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

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--navy);
  color: #E9EDF3;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 16px; }
.sidebar__brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.sidebar__wordmark { font-weight: 800; text-transform: uppercase; line-height: 1; letter-spacing: .01em; font-size: 17px; }
.sidebar__wordmark span { display: block; color: var(--amber); font-size: 10px; font-weight: 600; letter-spacing: .22em; margin-top: 4px; font-family: "Barlow", sans-serif; text-transform: uppercase; }

.sidebar__nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  background: transparent; border: none; border-left: 3px solid transparent;
  color: #C9D1DE; padding: 11px 12px;
  font-family: "Barlow Condensed", Arial, sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 14px;
  border-radius: 0 6px 6px 0; cursor: pointer; text-align: left; transition: background .12s, color .12s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.is-active { background: rgba(244,163,0,.14); color: #fff; border-left-color: var(--amber); }
.nav-item.is-active svg { opacity: 1; }

.sidebar__footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.user-chip .avatar { width: 34px; height: 34px; }
.user-chip b { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.user-chip span { display: block; font-size: 11px; color: #9DA8B8; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.topbar {
  height: 62px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.topbar__crumb { font-family: "Barlow Condensed", Arial, sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 15px; color: var(--ink); }

.content { flex: 1; overflow-y: auto; padding: 26px 32px 60px; }

/* ---------- view head / toolbar ---------- */
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.view-head h1 { font-size: 30px; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; }
.view-sub { color: var(--steel); font-size: 13px; margin-top: 4px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type="search"], .toolbar select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel);
  font-size: 13px; color: var(--ink); min-width: 160px;
}
.toolbar input[type="search"] { min-width: 260px; }
.toolbar select:focus, .toolbar input:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.toolbar__check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--steel); padding: 0 4px; }

/* ---------- buttons ---------- */
.btn {
  font-family: "Barlow Condensed", Arial, sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  font-size: 14px; padding: 10px 18px; border-radius: 5px; border: none; cursor: pointer; transition: filter .12s, background .12s;
}
.btn--primary { background: var(--amber); color: var(--navy); }
.btn--primary:hover { filter: brightness(0.95); }
.btn--ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn--ghost:hover { background: var(--panel-2); }
.btn--danger-ghost { background: transparent; border: 1px solid #E0B3AC; color: #B2302B; }
.btn--danger-ghost:hover { background: #FBEEEC; }
.btn--sm { padding: 7px 13px; font-size: 12px; }
.icon-btn { background: transparent; border: none; font-size: 15px; color: var(--steel); cursor: pointer; width: 30px; height: 30px; border-radius: 6px; }
.icon-btn:hover { background: var(--panel-2); }

/* ---------- table ---------- */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th {
  text-align: left; padding: 12px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line);
  font-family: "Barlow Condensed", Arial, sans-serif; text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px;
  color: var(--steel); font-weight: 700; cursor: pointer; user-select: none; white-space: nowrap;
}
.data-table thead th:hover { color: var(--ink); }
.data-table tbody td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(20,33,61,.035); cursor: pointer; }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-row { text-align: center !important; padding: 44px !important; color: var(--muted); cursor: default !important; }

.cell-lead { display: flex; align-items: center; gap: 10px; }
.cell-lead__name { font-weight: 600; color: var(--ink); }
.cell-lead__sub { font-size: 12px; color: var(--steel); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--avatar-bg, var(--navy)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }

.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 10.5px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  background: color-mix(in srgb, var(--badge-color) 14%, white);
  color: color-mix(in srgb, var(--badge-color) 70%, black);
  border: 1px solid color-mix(in srgb, var(--badge-color) 35%, white);
  white-space: nowrap;
}
.badge--sm { padding: 2px 8px; font-size: 10px; }

.stage-pill { padding: 4px 11px; border-radius: 999px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; display: inline-block; white-space: nowrap; }
.stage-pill--new { background: #E3E7EC; color: #4A5568; }
.stage-pill--contacted { background: #DCE6F7; color: #2F5FB3; }
.stage-pill--qualified { background: #E6DAF3; color: #7B4FA6; }
.stage-pill--proposal { background: #FBE7CC; color: #8A5A00; }
.stage-pill--negotiation { background: #F7DBCB; color: #C25A2A; }
.stage-pill--won { background: #DCEFDD; color: #2E7D32; }
.stage-pill--lost { background: #F5DBDA; color: #B2302B; }

/* ---------- kanban board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(252px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: start; }
.board__col { background: var(--panel-2); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; min-height: 160px; }
.board__col-head { display: flex; justify-content: space-between; align-items: center; font-family: "Barlow Condensed", Arial, sans-serif; text-transform: uppercase; font-weight: 700; font-size: 13px; letter-spacing: .03em; color: var(--ink); }
.board__col-head--won { color: #2E7D32; }
.board__col-head--lost { color: #B2302B; }
.board__count { background: #fff; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; color: var(--steel); font-family: Barlow, sans-serif; font-weight: 600; }
.board__col-total { font-size: 12px; color: var(--steel); margin: 3px 0 12px; font-variant-numeric: tabular-nums; }
.board__dropzone { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 70px; border-radius: 6px; transition: background .12s, outline .12s; padding: 2px; }
.board__dropzone.is-over { background: rgba(244,163,0,.14); outline: 2px dashed var(--amber); outline-offset: -2px; }
.board__empty { font-size: 12px; color: var(--muted); text-align: center; padding: 22px 6px; border: 1px dashed var(--line); border-radius: 6px; }

.kcard {
  background: #fff; border-radius: 6px; padding: 11px 12px; border-left: 4px solid var(--track-color, var(--navy));
  box-shadow: 0 1px 2px rgba(20,33,61,.08); cursor: grab; display: flex; flex-direction: column; gap: 6px;
}
.kcard.is-dragging { opacity: .45; }
.kcard__top { display: flex; justify-content: space-between; align-items: center; }
.kcard__value { font-weight: 700; font-size: 12.5px; color: var(--navy); font-variant-numeric: tabular-nums; }
.kcard__name { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.kcard__company { font-size: 11.5px; color: var(--steel); margin-top: -4px; }
.kcard__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.kcard__time { font-size: 10.5px; color: var(--muted); }

/* ---------- calendar ---------- */
.cal-layout { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: start; }
.cal-main { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav .icon-btn { font-size: 18px; }
.cal-month { font-family: "Barlow Condensed", Arial, sans-serif; font-weight: 700; text-transform: uppercase; font-size: 17px; min-width: 160px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.cal-dow { background: var(--panel-2); text-align: center; padding: 8px 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--steel); }
.cal-day { background: var(--panel); min-height: 96px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.cal-day:hover { background: var(--panel-2); }
.cal-day--out { background: #FAFBFC; color: var(--muted); }
.cal-day--out .cal-day__num { color: var(--muted); }
.cal-day--today .cal-day__num { background: var(--amber); color: var(--navy); border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.cal-day__num { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.cal-day__events { display: flex; flex-direction: column; gap: 3px; }
.evt-chip {
  display: block; width: 100%; text-align: left; background: color-mix(in srgb, var(--evt-color) 16%, white);
  color: color-mix(in srgb, var(--evt-color) 70%, black); border: none; border-left: 3px solid var(--evt-color);
  border-radius: 3px; padding: 2px 5px; font-size: 10.5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.evt-chip__time { font-weight: 700; }
.evt-more { font-size: 10px; color: var(--muted); padding-left: 2px; }
.cal-side h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--steel); font-weight: 700; margin-bottom: 10px; }
.cal-upcoming { display: flex; flex-direction: column; gap: 8px; }
.cal-upcoming__item {
  display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--evt-color); border-radius: 6px; padding: 10px 12px; cursor: pointer;
}
.cal-upcoming__item:hover { border-color: var(--evt-color); }
.cal-upcoming__type { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--evt-color); }
.cal-upcoming__title { font-size: 13px; font-weight: 600; color: var(--ink); }
.cal-upcoming__time { font-size: 11.5px; color: var(--steel); }
@media (max-width: 900px) { .cal-layout { grid-template-columns: 1fr; } .cal-day { min-height: 70px; } }

/* ---------- analytics ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--steel); font-weight: 700; }
.kpi__value { font-family: "Barlow Condensed", Arial, sans-serif; font-weight: 800; font-size: 30px; color: var(--navy); line-height: 1.1; }
.kpi__sub { font-size: 11.5px; color: var(--muted); }

.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.chart-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; min-width: 0; }
.chart-card--wide { grid-column: 1 / -1; }
.chart-card h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .02em; font-weight: 700; margin-bottom: 14px; color: var(--ink); }
.chart-canvas-wrap { position: relative; height: 250px; }
.chart-card--wide .chart-canvas-wrap { height: 240px; }

.recent-comms { display: flex; flex-direction: column; }
.recent-comm {
  display: grid; grid-template-columns: 22px 150px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px;
}
.recent-comm:last-child { border-bottom: none; }
.recent-comm:hover { background: var(--panel-2); }
.recent-comm__icon { text-align: center; }
.recent-comm__lead { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-comm__body { color: var(--steel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-comm__time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
@media (max-width: 700px) {
  .recent-comm { grid-template-columns: 18px 1fr auto; }
  .recent-comm__body { display: none; }
}

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(14,23,48,.55); display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 100; padding: 20px;
}
.modal-overlay.is-open { opacity: 1; pointer-events: all; }
.form-card { background: var(--panel); width: min(600px, 100%); border-radius: 10px; padding: 24px 26px 26px; max-height: 88vh; overflow-y: auto; }
.form-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.form-card__head h3 { font-size: 22px; text-transform: uppercase; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--steel); font-weight: 600; }
.field input, .field select { padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px; font-size: 14px; color: var(--ink); background: #fff; }
.field input:focus, .field select:focus { outline: 2px solid var(--amber); outline-offset: 1px; border-color: var(--amber); }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------- drawer ---------- */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(14,23,48,.4); display: flex; justify-content: flex-end;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 90;
}
.drawer-overlay.is-open { opacity: 1; pointer-events: all; }
.drawer-panel {
  width: min(430px, 100%); height: 100%; background: var(--panel); padding: 26px 26px 40px; overflow-y: auto;
  box-shadow: -8px 0 28px rgba(20,33,61,.18); transform: translateX(24px); transition: transform .18s;
}
.drawer-overlay.is-open .drawer-panel { transform: translateX(0); }
.drawer__head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; gap: 10px; }
.drawer__eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--amber-ink); font-weight: 700; }
.drawer__head h2 { font-size: 25px; text-transform: uppercase; font-weight: 800; margin: 3px 0; }
.drawer__company { color: var(--steel); font-size: 13px; }
.drawer__badges { display: flex; gap: 8px; margin: 14px 0 18px; flex-wrap: wrap; }
.drawer__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; padding: 16px; background: var(--panel-2); border-radius: 8px; margin-bottom: 20px; }
.drawer__grid div { display: flex; flex-direction: column; gap: 2px; }
.drawer__grid span { font-size: 10.5px; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; font-weight: 600; }
.drawer__grid b { font-size: 13.5px; color: var(--ink); font-weight: 600; word-break: break-word; }
.drawer__section { margin-bottom: 22px; }
.drawer__label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--steel); font-weight: 700; margin-bottom: 9px; }
.stage-mover { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-chip { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 11.5px; cursor: pointer; color: var(--steel); font-weight: 600; }
.stage-chip:hover { border-color: var(--amber); }
.stage-chip.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.drawer__quick-actions { display: flex; gap: 8px; margin: 2px 0 18px; flex-wrap: wrap; }
.drawer__actions { display: flex; gap: 10px; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 18px; }

/* ---------- compose (email / sms / call / note) ---------- */
.compose-card { background: var(--panel-2); border-radius: 8px; padding: 12px; }
.chan-tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.chan-tab {
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 12px;
  font-weight: 600; color: var(--steel); cursor: pointer;
}
.chan-tab:hover { border-color: var(--amber); }
.chan-tab.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.compose-form { display: flex; flex-direction: column; gap: 10px; }
.compose-form .field { font-size: 11.5px; }
.compose-form input, .compose-form select, .compose-form textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px; font-size: 13.5px; color: var(--ink);
  background: #fff; font-family: Barlow, sans-serif; resize: vertical;
}
.compose-form input:focus, .compose-form select:focus, .compose-form textarea:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.compose-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.compose-hint { font-size: 11px; color: var(--muted); }

/* ---------- AI toggle, portal link, documents ---------- */
.badge-alert {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  background: #FBE7CC; color: #8A5A00; border: 1px solid #F0CFA0;
}
.ai-toggle-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 34px; height: 20px; background: var(--line); border-radius: 999px; position: relative; transition: background .15s; flex-shrink: 0; }
.switch__thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .switch__track { background: var(--amber); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(14px); }
.switch__label { font-size: 12.5px; color: var(--steel); font-weight: 600; }
.portal-url { font-size: 12px; color: var(--steel); background: var(--panel-2); border-radius: 6px; padding: 8px 10px; word-break: break-all; font-family: ui-monospace, Consolas, monospace; }
.msg-bubble--ai.msg-bubble--out { background: var(--navy-2); }

.doc-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.doc-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.doc-row:hover { border-color: var(--amber); }
.doc-row__name { font-weight: 600; color: var(--ink); flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row__meta { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.doc-upload-btn { display: inline-flex; cursor: pointer; }

/* ---------- communication thread ---------- */
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding-right: 2px; }
.thread-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 18px 0; }
.msg-row { display: flex; }
.msg-row--out { justify-content: flex-end; }
.msg-row--in { justify-content: flex-start; }
.msg-bubble { max-width: 88%; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.msg-bubble--out { background: var(--navy); color: #fff; border-bottom-right-radius: 2px; }
.msg-bubble--in { background: #fff; border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 2px; }
.msg-bubble__head { display: flex; justify-content: space-between; gap: 10px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .75; margin-bottom: 5px; }
.msg-bubble--out .msg-bubble__head time { color: #C9D1DE; }
.msg-bubble__subject { font-weight: 700; margin-bottom: 3px; }
.msg-bubble__body { white-space: pre-wrap; line-height: 1.45; }
.msg-pill {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px dashed var(--line);
  border-radius: 8px; padding: 8px 12px; font-size: 12px; color: var(--steel); flex-wrap: wrap;
}
.msg-pill__icon { flex-shrink: 0; }
.msg-pill__body { color: var(--ink); flex: 1 1 auto; min-width: 140px; }
.msg-pill__meta { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* ---------- login gate ---------- */
.login-gate {
  position: fixed; inset: 0; background: var(--navy); display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: 20px;
}
.login-gate[hidden] { display: none; }
.login-card { background: var(--panel); border-radius: 10px; padding: 34px 32px; width: min(360px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.login-card h2 { font-size: 22px; text-transform: uppercase; font-weight: 800; margin-top: 4px; }
.login-card p { color: var(--steel); font-size: 13px; margin: 0; }
.login-card input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 5px; font-size: 14px; margin-top: 6px; }
.login-card input:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.login-card .btn { width: 100%; margin-top: 4px; }
.login-error { color: #B2302B !important; font-size: 12.5px !important; }
.loading-state { color: var(--muted); font-size: 14px; padding: 60px 0; text-align: center; }

/* ---------- toast ---------- */
.toast-host { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 6px; font-size: 13px;
  box-shadow: 0 8px 22px rgba(20,33,61,.28); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.toast--in { opacity: 1; transform: translateY(0); }
.toast--danger { background: #B2302B; }

/* ---------- scrollbars (subtle) ---------- */
.content::-webkit-scrollbar, .board::-webkit-scrollbar, .drawer-panel::-webkit-scrollbar { height: 8px; width: 8px; }
.content::-webkit-scrollbar-thumb, .board::-webkit-scrollbar-thumb, .drawer-panel::-webkit-scrollbar-thumb { background: #C8CFD8; border-radius: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 10px 14px; }
  .sidebar__brand { border-bottom: none; margin-bottom: 0; padding: 0; margin-right: auto; }
  .sidebar__wordmark span { display: none; }
  .sidebar__nav { flex-direction: row; }
  .nav-item { border-left: none; border-bottom: 3px solid transparent; border-radius: 6px; }
  .nav-item.is-active { border-bottom-color: var(--amber); }
  .sidebar__footer { display: none; }
  .main { height: auto; }
  .content { padding: 20px 16px 50px; }
  .kpi-row, .chart-grid { grid-template-columns: 1fr; }
}
