/* ==========================================================================
   Components: buttons, forms, cards, tables, badges, tabs, modal, drawer,
   toast, kanban, timeline, stats, progress, empty states
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-primary:hover { background: var(--brand-800); }
.btn-gold { background: var(--gold-500); border-color: var(--gold-500); color: #fff; }
.btn-gold:hover { background: var(--gold-600); }
.btn-success { background: #0f8a3c; border-color: #0f8a3c; color: #fff; }
.btn-success:hover { background: #0b7432; }
.btn-danger { background: #fff; border-color: #efc2c2; color: var(--bad-ink); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-wa { background: #1faa53; border-color: #1faa53; color: #fff; }
.btn-wa:hover { background: #178d44; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn-xs svg { width: 13px; height: 13px; }
.btn-icon { width: 36px; padding: 0; justify-content: center; }
.btn-sm.btn-icon { width: 30px; }
.btn-xs.btn-icon { width: 26px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.active { background: var(--brand-50); border-color: var(--brand-500); color: var(--brand-700); z-index: 1; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; }
.form-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
@media (max-width: 600px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field label .req { color: var(--bad); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.field .error { font-size: 11.5px; color: var(--bad-ink); }
.input, .select, .textarea {
  width: 100%; height: 38px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff;
  padding: 0 11px; font-size: 14px; color: var(--text); transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); }
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--bad); }
.input-sm, .select.input-sm { height: 32px; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand-600); }
.chips-input { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { border: 1px solid var(--border-strong); background: #fff; border-radius: 16px; padding: 4px 11px; font-size: 12.5px; color: var(--text-2); }
.chip-toggle.on { background: var(--brand-50); border-color: var(--brand-500); color: var(--brand-700); font-weight: 500; }
.input-group { display: flex; }
.input-group .addon { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--border-strong); border-right: 0; border-radius: 8px 0 0 8px; background: var(--surface-2); color: var(--text-3); font-size: 12.5px; }
.input-group .input { border-radius: 0 8px 8px 0; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search { position: relative; flex: 1 1 220px; max-width: 320px; }
.toolbar .search input, .toolbar .search .input { padding-left: 34px; height: 36px; width: 100%; min-width: 0; }
.toolbar .search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--text-3); }
.toolbar .select, .toolbar .input { height: 36px; width: auto; min-width: 130px; font-size: 13px; }
.toolbar .spacer { flex: 1; }
@media (max-width: 700px) {
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .toolbar .select { flex: 1 1 45%; }
}

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { font-size: 14.5px; }
.card-head .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12.5px; }

/* ---------- Stat tiles ---------- */
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.stat .label { font-size: 12.5px; color: var(--text-3); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--text); line-height: 1.15; }
.stat .foot { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stat .ico { position: absolute; right: 16px; top: 16px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.stat .ico svg { width: 18px; height: 18px; }
.stat .ico.gold { background: var(--gold-100); color: var(--gold-600); }
.stat .ico.green { background: var(--good-bg); color: var(--good-ink); }
.stat .ico.red { background: var(--bad-bg); color: var(--bad-ink); }
.stat .ico.violet { background: var(--violet-bg); color: var(--violet-ink); }
.stat .ico.orange { background: var(--serious-bg); color: var(--serious-ink); }
.delta { font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 2px; }
.delta.up { color: var(--good-ink); }
.delta.down { color: var(--bad-ink); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
@media (max-width: 700px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .stat { padding: 12px 14px; } .stat .value { font-size: 19px; } .stat .ico { display: none; } }

/* ---------- Badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral-ink); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.good { background: var(--good-bg); color: var(--good-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.serious { background: var(--serious-bg); color: var(--serious-ink); }
.badge.bad { background: var(--bad-bg); color: var(--bad-ink); }
.badge.info { background: var(--info-bg); color: var(--info-ink); }
.badge.violet { background: var(--violet-bg); color: var(--violet-ink); }
.badge.gold { background: var(--gold-100); color: var(--gold-600); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; background: var(--surface-3); color: var(--text-2); font-weight: 500; white-space: nowrap; }

/* ---------- Avatar ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; flex: none; background: var(--brand-600); }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 64px; height: 64px; font-size: 21px; }
.person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.person .meta { min-width: 0; line-height: 1.25; }
.person .meta b { font-weight: 600; font-size: 13.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .meta span { font-size: 12px; color: var(--text-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3);
  background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th .sort { opacity: .5; margin-left: 3px; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr.selected { background: var(--brand-50); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); gap: 10px; flex-wrap: wrap; }
.pager { display: flex; gap: 4px; align-items: center; }
.bulk-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--brand-50); border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }

/* Table → cards on phones */
@media (max-width: 700px) {
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { border-bottom: 1px solid var(--border); padding: 10px 14px; }
  .table.responsive td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table.responsive td::before { content: attr(data-label); font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; text-align: left; flex: none; }
  .table.responsive td.primary { display: block; text-align: left; padding-bottom: 6px; }
  .table.responsive td.primary::before { display: none; }
  .table.responsive td.actions { justify-content: flex-end; }
  .table.responsive td.actions::before { display: none; }
  .table.responsive td.sel { display: none; }
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-700); border-bottom-color: var(--brand-600); font-weight: 600; }
.tab .count { font-size: 11px; background: var(--surface-3); color: var(--text-2); border-radius: 10px; padding: 0 7px; font-weight: 600; }
.tab.active .count { background: var(--brand-100); color: var(--brand-700); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.seg button svg { width: 14px; height: 14px; }
.seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11,31,58,.45); z-index: 100; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; animation: fade .12s ease; }
.modal, .modal-body, .drawer-body { min-width: 0; }
.modal { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .15s ease; }
.modal.lg { max-width: 780px; }
.modal.xl { max-width: 1040px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px; }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 600px) {
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.lg, .modal.xl { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .modal-foot .btn { flex: 1; justify-content: center; }
}

/* ---------- Drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(11,31,58,.35); z-index: 90; animation: fade .12s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 640px; max-width: 100vw; background: #fff; z-index: 91; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease; }
.drawer.wide { width: 860px; }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 32px; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 36px); }
.toast { background: var(--brand-900); color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; align-items: center; gap: 10px; min-width: 260px; animation: pop .15s ease; }
.toast svg { width: 17px; height: 17px; flex: none; }
.toast.good svg { color: #5fe08f; }
.toast.bad svg { color: #ff8a8a; }
.toast.warn svg { color: #ffd166; }
@media (max-width: 700px) { .toasts { bottom: 76px; left: 12px; right: 12px; } }

/* ---------- Key-value lists ---------- */
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 16px; }
.kv-grid .k { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kv-grid .v { font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 600px) { .kv { grid-template-columns: 120px minmax(0, 1fr); } }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item .tl-dot { position: absolute; left: -26px; top: 0; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--border-strong); display: grid; place-items: center; color: var(--text-3); }
.tl-item .tl-dot svg { width: 11px; height: 11px; }
.tl-item.call .tl-dot { border-color: var(--s1); color: var(--s1); }
.tl-item.whatsapp .tl-dot { border-color: #1faa53; color: #1faa53; }
.tl-item.email .tl-dot { border-color: var(--s7); color: var(--s7); }
.tl-item.viewing .tl-dot, .tl-item.meeting .tl-dot { border-color: var(--gold-500); color: var(--gold-600); }
.tl-item.status .tl-dot, .tl-item.system .tl-dot { border-color: var(--muted); }
.tl-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.tl-head b { font-weight: 600; }
.tl-head time { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.tl-body { font-size: 13px; color: var(--text-2); margin-top: 2px; white-space: pre-wrap; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban-col { flex: 0 0 272px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.kanban-col-head { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); }
.kanban-col-head b { font-size: 13px; font-weight: 600; }
.kanban-col-head .sum { font-size: 11.5px; color: var(--text-3); }
.kanban-col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 80px; }
.kanban-col.drop-over { border-color: var(--brand-500); background: var(--brand-50); }
.k-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow-sm); cursor: grab; font-size: 13px; }
.k-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.k-card.dragging { opacity: .5; }
.k-card .t { font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
.k-card .s { color: var(--text-3); font-size: 12px; }
.k-card .f { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 6px; }

/* ---------- Progress / meters ---------- */
.progress { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand-500); border-radius: 4px; }
.progress.good > span { background: var(--good); }
.progress.warn > span { background: var(--warn); }
.progress.bad > span { background: var(--bad); }
.progress.gold > span { background: var(--gold-500); }
.progress.thin { height: 5px; }

/* ---------- Stepper (deal stages) ---------- */
.stepper { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.step { flex: 1 0 auto; min-width: 96px; position: relative; padding: 8px 10px 8px 14px; background: var(--surface-3); color: var(--text-3); font-size: 12px; font-weight: 600; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); text-align: center; border: 0; }
.step:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.step.done { background: var(--brand-100); color: var(--brand-700); }
.step.current { background: var(--brand-700); color: #fff; }
button.step { cursor: pointer; }

/* ---------- Checklist ---------- */
.checklist { display: flex; flex-direction: column; gap: 2px; }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.checklist label:hover { background: var(--hover); }
.checklist input { width: 17px; height: 17px; accent-color: var(--good); }
.checklist label.done span { color: var(--text-3); text-decoration: line-through; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--hover); }
.list-item .grow .t { font-weight: 600; font-size: 13.5px; }
.list-item .grow .s { font-size: 12.5px; color: var(--text-3); }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--text-3); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 14.5px; margin-bottom: 4px; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; padding: 11px 14px; border-radius: 10px; font-size: 13px; border: 1px solid; align-items: flex-start; }
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert.info { background: var(--info-bg); border-color: #c9ddf6; color: var(--info-ink); }
.alert.warn { background: var(--warn-bg); border-color: #f6dea3; color: var(--warn-ink); }
.alert.bad { background: var(--bad-bg); border-color: #f1c4c4; color: var(--bad-ink); }
.alert.good { background: var(--good-bg); border-color: #bfe8bf; color: var(--good-ink); }

/* ---------- Charts ---------- */
.chart { width: 100%; position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .val-label { fill: var(--text-2); font-size: 11px; font-weight: 600; font-family: var(--font); }
.chart-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 8px; padding: 8px 10px; font-size: 12px; z-index: 5; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.chart-tip b { display: block; font-size: 12px; margin-bottom: 2px; }
.chart-tip .r { display: flex; align-items: center; gap: 6px; }
.chart-tip .sw { width: 8px; height: 8px; border-radius: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Misc ---------- */
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
.pill-count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.link-btn { border: 0; background: none; color: var(--brand-600); padding: 0; font-weight: 500; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }
.temp-hot { color: var(--bad-ink); } .temp-warm { color: var(--serious-ink); } .temp-cold { color: var(--info-ink); }
.sla { font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; }
.sla.ok { background: var(--good-bg); color: var(--good-ink); }
.sla.risk { background: var(--warn-bg); color: var(--warn-ink); }
.sla.breach { background: var(--bad-bg); color: var(--bad-ink); }
.score-ring { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; }
.section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 18px 0 10px; }
.msg-preview { background: #e7f7dc; border-radius: 10px 10px 10px 2px; padding: 10px 12px; font-size: 13px; white-space: pre-wrap; border: 1px solid #cfe9bf; }
.email-preview { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 13px; white-space: pre-wrap; }
