﻿/* ==========================================================================
   Components — reusable across every module
   ========================================================================== */

/* ---------- Layout helpers ---------- */
.grid { display: grid; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h2 { font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.page-head p { color: var(--text-2); margin-top: 4px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.grad-text { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Card ---------- */
.card {
  position: relative;
  background: var(--surface);
  background-image: var(--card-sheen);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  min-width: 0;
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background-color var(--t) var(--ease);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-head h3 { font-size: 15px; font-weight: 650; letter-spacing: -.005em; margin-top: 4px; }
.card-body { padding: 16px 20px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); }
.card.hoverable:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card.clickable { cursor: pointer; }

/* ---------- KPI ---------- */
.kpi { padding: 18px 20px; overflow: hidden; }
.kpi::before {
  content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--grad-brand); opacity: .9;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.kpi-ic svg { width: 17px; height: 17px; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin: 10px 0 4px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.kpi-spark { position: absolute; right: 14px; bottom: 12px; width: 96px; height: 34px; opacity: .95; }

.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.delta svg { width: 13px; height: 13px; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  font-weight: 600; font-size: 13px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.btn:active { transform: scale(.97); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-primary {
  border: 0; color: #fff;
  background: var(--grad-brand); background-size: 160% 100%; background-position: 0 0;
  box-shadow: 0 6px 18px -6px rgba(124, 58, 237, .7), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-primary:hover { background: var(--grad-brand); background-size: 160% 100%; background-position: 100% 0; box-shadow: 0 10px 26px -8px rgba(124, 58, 237, .85), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: transparent; }

.link-btn { color: var(--primary); font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.link-btn svg { width: 14px; height: 14px; transition: transform var(--t) var(--spring); }
.link-btn:hover svg { transform: translateX(3px); }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill svg { width: 12px; height: 12px; }
.pill.violet { background: var(--primary-soft); color: var(--primary-strong); }
.pill.green { background: var(--success-soft); color: var(--success); }
.pill.amber { background: var(--warning-soft); color: var(--warning); }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.pill.blue { background: var(--info-soft); color: var(--info); }
.pill.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }

.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; }
.prio i { display: flex; gap: 2px; align-items: flex-end; height: 11px; }
.prio i b { width: 3px; border-radius: 1px; background: var(--border-strong); }
.prio i b:nth-child(1) { height: 5px; } .prio i b:nth-child(2) { height: 8px; } .prio i b:nth-child(3) { height: 11px; }
.prio.urgent { color: var(--danger); } .prio.urgent i b { background: var(--danger); }
.prio.high { color: var(--warning); } .prio.high i b:nth-child(-n+3) { background: var(--warning); }
.prio.medium { color: var(--info); } .prio.medium i b:nth-child(-n+2) { background: var(--info); }
.prio.low { color: var(--text-3); } .prio.low i b:nth-child(1) { background: var(--text-3); }

/* ---------- Avatar ---------- */
.av {
  --av: 32px;
  position: relative; flex-shrink: 0;
  width: var(--av); height: var(--av); border-radius: 50%;
  display: grid; place-items: center;
  font-size: calc(var(--av) * .36); font-weight: 700; color: #fff; letter-spacing: .02em;
  background: var(--av-bg, var(--grad-brand));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.av.sq { border-radius: 30%; }
.av > img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.av-xs { --av: 22px; } .av-sm { --av: 28px; } .av-lg { --av: 44px; } .av-xl { --av: 72px; }
.av .st { position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 8px; min-height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.st-online { background: #34d399; } .st-focus { background: #a78bfa; } .st-away { background: #fbbf24; } .st-offline { background: #6b6480; }
.av-stack { display: flex; }
.av-stack .av { box-shadow: 0 0 0 2px var(--surface); margin-left: -8px; }
.av-stack .av:first-child { margin-left: 0; }

/* ---------- Progress ---------- */
.bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--grad-brand); width: 0; transition: width 1100ms var(--ease-out); }
.bar.green > span { background: var(--success); }
.bar.amber > span { background: var(--warning); }
.bar.red > span { background: var(--danger); }
.bar.thin { height: 4px; }

.ring { position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-track { stroke: var(--surface-3); }
.ring .ring-val { transition: stroke-dashoffset 1300ms var(--ease-out); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-size: 18px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: 10.5px; color: var(--text-3); }

/* ---------- Checkbox (task complete) ---------- */
.check {
  position: relative; flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 7px;
  border: 1.6px solid var(--border-strong);
  display: grid; place-items: center;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t-fast);
}
.check svg { width: 13px; height: 13px; color: #fff; stroke-dasharray: 26; stroke-dashoffset: 26; transition: stroke-dashoffset 320ms var(--ease-out) 80ms; }
.check:hover { border-color: var(--primary); background: var(--primary-soft); }
.check:active { transform: scale(.85); }
.check.on { background: var(--grad-brand); border-color: transparent; animation: pop 380ms var(--spring); }
.check.on svg { stroke-dashoffset: 0; }
.burst { position: fixed; pointer-events: none; z-index: 90; width: 6px; height: 6px; border-radius: 50%; }

.done-text { text-decoration: line-through; text-decoration-color: var(--text-3); color: var(--text-3) !important; transition: color var(--t); }

/* ---------- Segmented / tabs ---------- */
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); }
.seg button { position: relative; z-index: 1; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 550; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; transition: color var(--t); white-space: nowrap; }
.seg button svg { width: 15px; height: 15px; }
.seg button:hover { color: var(--text); }
.seg button.on { color: #fff; }
.seg .seg-ind { position: absolute; top: 3px; left: 0; height: 30px; border-radius: 8px; background: var(--grad-brand); box-shadow: 0 4px 14px -4px rgba(124, 58, 237, .6); transition: transform var(--t-slow) var(--ease-out), width var(--t-slow) var(--ease-out); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 550; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; transition: all var(--t-fast); }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.on { background: var(--primary-soft); border-color: var(--primary-ring); color: var(--primary-strong); }
.chip .cnt { font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.search-in {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px; border-radius: 10px; min-width: 220px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-3);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-in:focus-within { border-color: var(--primary-ring); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-in svg { width: 16px; height: 16px; }
.search-in input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; color: var(--text); font-size: 13px; }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 13.5px; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a8fb5' stroke-width='2' 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 10px center; }
.select option { background: var(--surface); color: var(--text); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary-ring); box-shadow: 0 0 0 4px var(--primary-soft); background: var(--surface); }
.input.invalid { border-color: var(--danger); animation: shake 320ms; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.select-sm { height: 32px; font-size: 12.5px; border-radius: 8px; padding: 0 30px 0 10px; width: auto; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  text-align: left; font-family: var(--mono); font-weight: 500; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; background: var(--surface);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-hover); }
.table .r { text-align: right; }
.table tr.enter { animation: rowIn 700ms var(--ease-out); }
@keyframes rowIn { from { background: var(--primary-soft); } }

/* ---------- List rows ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.list-row:last-child { border-bottom: 0; }

/* ---------- Empty / skeleton ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--text-3); }
.empty .empty-ic { width: 46px; height: 46px; border-radius: 14px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty .empty-ic svg { width: 22px; height: 22px; }
.empty b { display: block; color: var(--text); font-size: 14px; margin-bottom: 2px; }

.sk { border-radius: 8px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-hover) 40%, var(--surface-3) 80%); background-size: 800px 100%; animation: shimmer 1.2s linear infinite; }
.sk-page { display: grid; gap: 18px; }
.sk-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

/* ---------- Overlays: modal / drawer / popover ---------- */
.overlay { position: fixed; inset: 0; z-index: 70; background: var(--scrim); backdrop-filter: blur(3px); animation: fadeIn var(--t) var(--ease); }
.overlay.closing { opacity: 0; transition: opacity 200ms var(--ease); }

.modal {
  position: fixed; z-index: 71; left: 50%; top: 50%;
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -50%);
  animation: modalIn 420ms var(--ease-out);
}
.modal.closing { opacity: 0; transform: translate(-50%, -48%) scale(.97); transition: all 200ms var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 4px; }
.modal-head h3 { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.modal-head p { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.modal-body { padding: 18px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; }

.drawer {
  position: fixed; z-index: 71; top: 10px; right: 10px; bottom: 10px;
  width: min(520px, calc(100vw - 20px));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  animation: drawerIn 480ms var(--ease-out);
}
.drawer.closing { transform: translateX(105%); transition: transform 280ms var(--ease); }
@keyframes drawerIn { from { transform: translateX(105%); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 28px; }
.drawer-body > * { animation: fadeUp 500ms var(--ease-out) both; }
.drawer-body > *:nth-child(2) { animation-delay: 60ms; } .drawer-body > *:nth-child(3) { animation-delay: 120ms; } .drawer-body > *:nth-child(4) { animation-delay: 180ms; } .drawer-body > *:nth-child(n+5) { animation-delay: 240ms; }
.section-title { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin: 22px 0 10px; }

.popover {
  position: fixed; z-index: 65;
  min-width: 220px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 6px;
  transform-origin: top right;
  animation: popIn 260ms var(--ease-out);
}
.popover.closing { opacity: 0; transform: scale(.96) translateY(-4px); transition: all 140ms var(--ease); }
@keyframes popIn { from { opacity: 0; transform: scale(.95) translateY(-6px); } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--text); text-align: left; transition: background var(--t-fast); }
.menu-item svg { width: 16px; height: 16px; color: var(--text-3); }
.menu-item:hover { background: var(--surface-hover); }
.menu-item:hover svg { color: var(--primary); }
.menu-item small { margin-left: auto; color: var(--text-3); font-size: 11px; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-label { padding: 8px 10px 4px; }

/* Notifications panel */
.notif-panel { width: min(380px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background var(--t-fast); cursor: pointer; }
.notif:hover { background: var(--surface-hover); }
.notif.unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.notif-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.notif-ic svg { width: 16px; height: 16px; }
.notif p { font-size: 13px; line-height: 1.4; }
.notif time { font-size: 11.5px; color: var(--text-3); }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 95; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 14px; border-radius: 12px;
  background: #1a1030; color: #fff; font-size: 13px; font-weight: 500;
  border: 1px solid rgba(167, 139, 250, .25);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .6);
  animation: toastIn 420ms var(--spring);
}
.toast.out { opacity: 0; transform: translateY(10px) scale(.96); transition: all 220ms var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } }
.toast-ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(52, 211, 153, .18); color: #34d399; }
.toast-ic svg { width: 12px; height: 12px; }
.toast button { color: #c4b5fd; font-weight: 600; font-size: 12.5px; padding: 4px 8px; border-radius: 7px; }
.toast button:hover { background: rgba(167, 139, 250, .15); }

/* ---------- Command palette ---------- */
.cmdk { position: fixed; z-index: 71; left: 50%; top: 12vh; transform: translateX(-50%); width: min(620px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: cmdkIn 320ms var(--ease-out); }
.cmdk.closing { opacity: 0; transform: translateX(-50%) scale(.97); transition: all 160ms var(--ease); }
@keyframes cmdkIn { from { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(.97); } }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cmdk-in svg { width: 18px; height: 18px; color: var(--text-3); }
.cmdk-in input { flex: 1; border: 0; outline: 0; background: none; font-size: 15px; color: var(--text); }
.cmdk-list { max-height: 380px; overflow-y: auto; padding: 8px; }
.cmdk-group { padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 13.5px; }
.cmdk-item svg { width: 16px; height: 16px; color: var(--text-3); }
.cmdk-item small { margin-left: auto; color: var(--text-3); font-size: 11.5px; }
.cmdk-item.sel { background: var(--primary-soft); }
.cmdk-item.sel svg { color: var(--primary); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }
.cmdk-foot kbd { padding: 2px 5px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-3); margin-right: 4px; }

/* ---------- Chart ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis-label { font-family: var(--mono); font-size: 10.5px; fill: var(--text-3); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { stroke: var(--surface); stroke-width: 2; transition: r var(--t-fast); }
.chart .xhair { stroke: var(--border-strong); stroke-dasharray: 3 3; opacity: 0; transition: opacity var(--t-fast); }
.chart.hovering .xhair { opacity: 1; }
.chart .barrect { transition: opacity var(--t-fast); }
.chart.hovering .barrect:not(.hl) { opacity: .45; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none;
  min-width: 150px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  font-size: 12px; opacity: 0; transform: translateY(4px); transition: opacity 120ms, transform 120ms;
}
.chart-tip.show { opacity: 1; transform: none; }
.chart-tip .tt-title { font-weight: 650; margin-bottom: 6px; }
.chart-tip .tt-row { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.chart-tip .tt-row b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tip .sw { width: 8px; height: 8px; border-radius: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend i.dash { height: 2px; border-radius: 0; background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; }
