/* Search Performance dashboard. Builds on app.css tokens (dark surface).
   Chart colours validated with the dataviz validator on #141923:
   series #3987e5 (L/chroma/contrast PASS); previous period = muted grey. */
.dash{--series-1:#3987e5;--series-1-wash:rgba(57,135,229,.10);--series-prev:#6b7689;--grid:#232b38;--panel-2:#182030;--good-ink:#8cdbb6;--bad-ink:#ffadb3;max-width:1180px}
.visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.dash-section{margin:8px 0 32px}
.dash-filters{display:flex;flex-wrap:wrap;align-items:flex-end;gap:14px 18px;margin-bottom:22px}
.dash-field{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted)}
.dash-field select,.dash-field input{min-height:40px;padding:8px 12px;font-size:14px;width:auto;min-width:220px}
.dash-range{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.range-btn{min-height:40px;background:transparent;color:var(--text);border:0;border-right:1px solid var(--line);padding:0 16px;font-size:13px;border-radius:0}
.range-btn:last-child{border-right:0}
.range-btn[aria-checked=true]{background:#222b38;font-weight:650}
.range-btn[aria-checked=true]::before{content:"✓ ";font-weight:700}
.dash-range-label{font-size:12px;color:var(--muted);padding-bottom:12px}
.dash-body{transition:opacity .15s}
.dash-body[aria-busy=true]{opacity:.55}
.kpi-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}
.kpi{display:flex;flex-direction:column;align-items:flex-start;gap:6px;text-align:left;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px 18px;color:var(--text);min-height:112px;position:relative}
.kpi:hover{background:var(--panel-2)}
.kpi[aria-checked=true]{border-color:var(--series-1);box-shadow:inset 0 3px 0 var(--series-1)}
.kpi-label{font-size:12px;color:var(--muted);letter-spacing:.2px}
.kpi-value{font-size:32px;font-weight:650;letter-spacing:-.8px;line-height:1.1}
.kpi-delta{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.kpi-delta[data-dir=good]{color:var(--good-ink)}
.kpi-delta[data-dir=bad]{color:var(--bad-ink)}
.chart-card,.table-card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:18px 20px;margin:0 0 16px;position:relative}
.chart-card figcaption{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:8px}
.chart-title{font-size:15px;font-weight:600}
.legend{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}
.key{display:inline-block;width:16px;height:2px;border-radius:2px;vertical-align:middle}
.key-cur{background:var(--series-1)}
.key-prev{background:none;border-top:2px dashed var(--series-prev);height:0;margin-left:10px}
.chart{height:280px;outline-offset:4px}
.chart svg{display:block;width:100%;height:100%;overflow:visible}
.chart .grid{stroke:var(--grid);stroke-width:1}
.chart .tick{fill:var(--muted);font-size:12px;font-variant-numeric:tabular-nums}
.chart .line-cur{fill:none;stroke:var(--series-1);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.chart .line-prev{fill:none;stroke:var(--series-prev);stroke-width:2;stroke-linejoin:round;stroke-linecap:round;stroke-dasharray:5 4}
.chart .area-cur{fill:var(--series-1-wash)}
.chart .crosshair{stroke:#5d697c;stroke-width:1}
.chart .dot{fill:var(--series-1);stroke:var(--panel);stroke-width:2}
.chart .end-label{fill:var(--text);font-size:12px;font-weight:600}
.tooltip{position:absolute;pointer-events:none;background:#0c0f14;border:1px solid var(--line);border-radius:8px;padding:10px 12px;font-size:12px;min-width:150px;box-shadow:0 6px 24px rgba(0,0,0,.4);z-index:2}
.tooltip .t-date{color:var(--muted);margin-bottom:6px}
.tooltip .t-row{display:flex;align-items:center;gap:8px;margin-top:3px}
.tooltip .t-row strong{font-size:14px;font-variant-numeric:tabular-nums}
.tooltip .t-key{width:12px;height:2px;border-radius:2px;flex:none}
.table-view{margin-top:10px}
.table-head{display:flex;align-items:center;gap:14px 18px;flex-wrap:wrap;margin-bottom:12px}
.table-head h2{font-size:16px;margin:0 auto 0 0}
.tabs{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.tabs [role=tab]{min-height:36px;background:transparent;color:var(--text);border:0;padding:0 14px;font-size:13px;border-radius:0}
.tabs [role=tab][aria-selected=true]{background:#222b38;font-weight:650}
.dash-field.search input{min-width:180px;min-height:36px}
.toggle{display:inline-flex;align-items:center;gap:8px;font-size:13px;margin:0;color:var(--text)}
.toggle input{width:auto;min-height:0}
.detail-table,#dailyTable{overflow-x:auto}
.dash table{width:100%;border-collapse:collapse;font-size:13px}
.dash th{font-size:12px;letter-spacing:.4px;text-transform:uppercase;color:var(--muted);font-weight:600;text-align:right;padding:8px 10px;border-bottom:1px solid var(--line);white-space:nowrap}
.dash th:first-child,.dash td:first-child{text-align:left}
.dash th button{background:none;border:0;color:inherit;font:inherit;letter-spacing:inherit;text-transform:inherit;min-height:0;padding:0;cursor:pointer}
.dash th[aria-sort=descending] button::after{content:" ↓"}
.dash th[aria-sort=ascending] button::after{content:" ↑"}
.dash td{padding:9px 10px;border-bottom:1px solid #1d2430;text-align:right;font-variant-numeric:tabular-nums;vertical-align:middle}
.dash td.q{max-width:420px;overflow-wrap:anywhere}
.dash tr:hover td{background:#171e2a}
.bar-cell{display:flex;align-items:center;justify-content:flex-end;gap:10px}
.bar{height:8px;border-radius:0 4px 4px 0;background:var(--series-1);min-width:2px}
.bar-track{width:90px;display:flex;justify-content:flex-start}
.badge{display:inline-flex;align-items:center;gap:5px;margin-left:8px;padding:2px 8px;border-radius:999px;font-size:12px;background:rgba(237,196,120,.12);color:var(--warning);white-space:nowrap}
.badge::before{content:"▲";font-size:8px}
.empty{background:var(--panel);border:1px dashed var(--line);border-radius:12px;padding:28px}
.manage{margin-top:28px;border-top:1px solid var(--line);padding-top:8px}
.manage>summary{font-size:15px;color:var(--text);padding:14px 0}
@media(max-width:900px){.kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi-value{font-size:26px}}
@media(max-width:650px){.dash-field select{min-width:0;width:100%}.dash-filters>.dash-field{flex:1 1 100%}.chart{height:220px}.bar-track{width:56px}.dash td.q{max-width:180px}}
@media(prefers-reduced-motion:reduce){.dash-body{transition:none}}
@media(forced-colors:active){.bar,.key,.t-key{forced-color-adjust:none}.chart .line-cur{stroke:CanvasText}.chart .line-prev{stroke:GrayText}.kpi[aria-checked=true]{outline:2px solid Highlight}}

/* Connection gallery (2026-11-13): cards with status at a glance; builds on app.css tokens. */
.hub{margin:8px 0 36px}
.hub-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px 24px;margin-bottom:18px}
.hub-head h2{margin:0 0 4px;font-size:22px;letter-spacing:-.01em}
.hub-head p{margin:0;font-size:14px}
.hub-progress{display:grid;grid-template-columns:auto 1fr;align-items:baseline;gap:4px 8px;min-width:200px}
.hub-count{font-size:26px;font-weight:700;color:var(--text);font-variant-numeric:tabular-nums}
.hub-bar{grid-column:1/-1;height:6px;border-radius:99px;background:var(--line);overflow:hidden}
.hub-bar span{display:block;height:100%;width:0;border-radius:inherit;background:var(--accent);transition:width .5s ease}
.hub-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}
.hub-card{position:relative;display:flex;flex-direction:column;gap:8px;padding:18px;border:1px solid var(--line);border-radius:16px;
  background:linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,0)) ,var(--panel);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.hub-card:hover{transform:translateY(-2px);border-color:#3a4558;box-shadow:0 10px 28px rgba(0,0,0,.35)}
.hub-card.is-on{border-color:rgba(140,219,182,.45)}
.hub-card.is-soon{opacity:.62}
.hub-card h3{margin:4px 0 0;font-size:16px}
.hub-blurb{margin:0;color:var(--muted);font-size:13.5px;line-height:1.45;flex:1}
.hub-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.hub-tile{display:inline-grid;place-items:center;width:44px;height:44px;border-radius:12px;color:var(--hue);
  background:color-mix(in srgb,var(--hue) 16%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--hue) 35%,transparent)}
.hub-chip{font-size:12px;font-weight:600;padding:4px 10px;border-radius:99px;white-space:nowrap;background:rgba(255,255,255,.06);color:var(--muted)}
.is-on .hub-chip{background:rgba(140,219,182,.14);color:var(--good)}
.is-warn .hub-chip{background:rgba(237,196,120,.14);color:var(--warning)}
.is-ready .hub-chip{background:rgba(182,255,59,.12);color:var(--accent)}
.hub-card-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:6px}
.hub-safe{font-size:12px;color:var(--muted);white-space:nowrap}
.hub-safe::before{content:"";display:inline-block;width:7px;height:7px;margin-right:6px;border-radius:50%;background:var(--good);vertical-align:1px}
.hub-card button{flex:0 0 auto;width:auto;min-height:44px;min-width:96px;padding:0 18px;border-radius:10px;font-weight:600}
.hub-card button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.hub-card button:disabled{cursor:not-allowed;opacity:.7}
@media(max-width:650px){.hub-grid{grid-template-columns:1fr}.hub-card.is-soon{flex-direction:row;align-items:center;padding:12px 14px;gap:12px}.hub-card.is-soon .hub-card-top{order:0}.hub-card.is-soon .hub-chip,.hub-card.is-soon .hub-blurb,.hub-card.is-soon .hub-card-foot{display:none}.hub-card.is-soon h3{margin:0;font-size:15px}.hub-card.is-soon h3::after{content:" · Sắp có";font-weight:400;color:var(--muted);font-size:13px}.hub-progress{min-width:0;width:100%}.hub-card button{min-width:0;flex:0 0 auto}}
@media(prefers-reduced-motion:reduce){.hub-card,.hub-bar span{transition:none}.hub-card:hover{transform:none}}
