/* Dashboard page (js/dashboard.js) */
.dash-view { width: min(1100px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 64px; }
.dash-view[hidden], .dash-chip[hidden] { display: none !important; }
.dash-body { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }

.dash-card { padding: 22px 24px; border-radius: 20px; border: 1px solid rgba(255,255,255,.14); background: rgba(12,12,15,.16); -webkit-backdrop-filter: blur(5px) saturate(110%); backdrop-filter: blur(5px) saturate(110%); min-width: 0; }
.dash-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dash-card-h h2 { margin: 0; font: 600 16px/1.2 'Inter', system-ui, sans-serif; color: #fafafa; }
.dash-card-h span { color: #71717a; font-size: 12px; }
.dash-p { margin: 12px 0 0; color: #a1a1aa; font-size: 13px; line-height: 1.55; }
.dash-p.dim { color: #71717a; font-size: 12px; }

.dash-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dash-av { position: relative; width: 76px; height: 76px; flex: none; }
.dash-av img:not(.pf-flag) { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,.18); background: #18181b; display: block; }
.dash-av .pf-flag { width: 28px; height: 19px; right: -6px; bottom: -3px; }
.dash-who { flex: 1 1 260px; min-width: 0; }
.dash-who h2 { margin: 0; font: 700 26px/1.15 'Outfit', 'Inter', system-ui, sans-serif; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dash-id { margin-top: 3px; color: #71717a; font-size: 12px; word-break: break-all; }
.dash-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dash-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); color: #d4d4d8; font: 500 12px/1 'Inter', system-ui, sans-serif; white-space: nowrap; }
.dash-chip img { width: 18px; height: 13px; border-radius: 2px; object-fit: cover; }
.dash-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-btn { height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); color: #fafafa; font: 600 14px/1 'Inter', system-ui, sans-serif; cursor: pointer; transition: background .2s, transform .2s, color .2s; }
.dash-btn:hover { background: rgba(255,255,255,.12); }
.dash-btn.solid { background: #fafafa; border-color: #fafafa; color: #09090b; }
.dash-btn.solid:hover { background: #e4e4e7; transform: translateY(-1px); }

.dash-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dash-stat { display: flex; flex-direction: column; }
.dash-cap { margin-bottom: 12px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #8b8b95; }
.dash-num { width: 100%; display: flex; justify-content: center; overflow: hidden; margin: 6px 0 4px; }
.dash-num .zodo { font: 700 40px/1.25 'Outfit', 'Inter', system-ui, sans-serif; color: #fff; }
.dash-num .zodo, .dash-num .zodo .c { color: #fff; transition: color .35s ease; }
.dash-num .zodo.pf-fup, .dash-num .zodo.pf-fup .c, .dash-num .zodo.pf-fup .c.s { color: #4ade80 !important; }
.dash-num .zodo.pf-fdn, .dash-num .zodo.pf-fdn .c, .dash-num .zodo.pf-fdn .c.s { color: #f87171 !important; }
.dash-gains { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 14px; }
.dash-gains > div { padding: 9px 8px; border-radius: 14px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); text-align: center; }
.dash-gains span { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #a1a1aa; }
.dash-gains b { font: 700 16px/1 'Outfit', 'Inter', system-ui, sans-serif; white-space: nowrap; }
.dash-note { margin-top: auto; padding-top: 12px; font-size: 12px; color: #71717a; text-align: center; }
.dash-big { margin: 6px 0 14px; font: 700 34px/1.2 'Outfit', 'Inter', system-ui, sans-serif; color: #fff; text-align: center; white-space: nowrap; }
.dash-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.dash-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: #4ade80; transition: width .6s ease; }
.dash-bar span.low { background: #f87171; }

.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); }
.dash-seg button { height: 42px; border: 0; border-radius: 10px; background: transparent; color: #a1a1aa; font: 600 14px/1 'Inter', system-ui, sans-serif; cursor: pointer; transition: background .2s, color .2s; }
.dash-seg button:hover:not(:disabled):not(.on) { background: rgba(255,255,255,.07); color: #fafafa; }
.dash-seg button.on { background: #fafafa; color: #09090b; }
.dash-seg button:disabled { cursor: default; opacity: .6; }
.dash-rows { display: flex; flex-direction: column; }
.dash-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 13px; }
.dash-row:last-child { border-bottom: 0; }
.dash-row span { color: #a1a1aa; flex: none; }
.dash-row b { font-weight: 600; color: #fafafa; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.dash-row b.mono { font: 500 12px ui-monospace, Consolas, monospace; }

.dash-empty { text-align: center; padding: 40px 24px; }
.dash-empty h2 { margin: 0 0 8px; font: 700 22px/1.2 'Outfit', 'Inter', system-ui, sans-serif; }
.dash-empty p { margin: 0 auto 20px; max-width: 420px; color: #a1a1aa; font-size: 14px; line-height: 1.55; }

@media (max-width: 900px) { .dash-stats { grid-template-columns: 1fr 1fr; } .dash-stats .dash-stat:last-child { grid-column: 1 / -1; } }
@media (max-width: 767px) {
  .dash-view { width: calc(100% - 28px); padding-top: 18px; }
  .dash-cols { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: 1fr; }
  .dash-card { padding: 18px 16px; border-radius: 18px; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .dash-who { flex: 0 0 auto; width: 100%; }
  .dash-acts { width: 100%; }
  .dash-acts .dash-btn { flex: 1 1 calc(50% - 5px); padding: 0 12px; }
  .dash-acts .dash-btn.solid { flex-basis: 100%; }
  .dash-num .zodo { font-size: 34px; }
}

/* ---- Analytics (js/dashboard.js) ---- */
.dash-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 10px 2px -4px; }
.dash-sec-h h2 { margin: 0; font: 700 20px/1.2 'Outfit', 'Inter', system-ui, sans-serif; letter-spacing: -.01em; color: #fafafa; }
.dash-sec-h span { color: #71717a; font-size: 12px; text-align: right; }
.dash-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.dash-kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.dash-kpi .dash-cap { margin-bottom: 6px; }
.dash-kpi-v { font: 700 26px/1.1 'Outfit', 'Inter', system-ui, sans-serif; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dash-kpi.pf-pos .dash-kpi-v { color: #4ade80 !important; } .dash-kpi.pf-neg .dash-kpi-v { color: #f87171 !important; }
.dash-kpi.pf-pos, .dash-kpi.pf-neg { color: inherit !important; }
.dash-kpi-s { font-size: 12px; color: #71717a; line-height: 1.35; }
.dash-chartcard .dash-seg3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; max-width: 360px; }
.dash-chart-sum { margin-bottom: 10px; font-size: 13px; color: #d4d4d8; font-variant-numeric: tabular-nums; }
.dash-chart { position: relative; height: 170px; border-radius: 14px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.02); overflow: hidden; }
.dash-chart-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; text-align: center; color: #71717a; font-size: 13px; line-height: 1.5; }
.dash-line { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dash-line .ln { fill: none; stroke: #4ade80; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.dash-line .area { fill: rgba(74,222,128,.12); stroke: none; }
.dash-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.22); }
.dash-bars { position: absolute; inset: 10px 8px; display: flex; gap: 3px; align-items: stretch; }
.dash-barcol { position: relative; flex: 1 1 0; min-width: 0; cursor: default; border-radius: 4px; }
.dash-barcol:hover { background: rgba(255,255,255,.06); }
.dash-barfill { position: absolute; left: 12%; right: 12%; border-radius: 4px; background: #4ade80; }
.dash-barfill.neg { background: #f87171; }
.dash-barfill.part { background: repeating-linear-gradient(135deg, #4ade80 0 4px, rgba(74,222,128,.45) 4px 8px); }
.dash-zero { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed rgba(255,255,255,.18); pointer-events: none; }
.dash-chart-axis { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; color: #71717a; font-size: 11px; }
.dash-chart-axis span { flex: 1 1 0; text-align: center; white-space: nowrap; }
.dash-chart-axis span:first-child { text-align: left; } .dash-chart-axis span:last-child { text-align: right; }
.dash-rivals { display: flex; flex-direction: column; gap: 10px; }
.dash-rival { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); min-width: 0; }
.dash-rival.lead { justify-content: center; color: #fde047; font-weight: 600; font-size: 14px; }
.dash-rival img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: #27272a; }
.dash-rival .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-rival .tx b { font-size: 14px; font-weight: 600; color: #fafafa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-rival .tx small { font-size: 12px; color: #a1a1aa; }
.dash-rival .tx small.v { color: #8b8b95; }
.dash-rival .rk { flex: none; color: #71717a; font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-kpi-v { font-size: 22px; }
  .dash-chart { height: 150px; }
}
/* ---- polish pass: hero, tiles, charts, tooltips, daily log (beats refine.css's flat cards with higher specificity) ---- */
.dash-view .dash-card.dash-hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #17171f 0%, #121214 62%) !important; border-color: #2d2d36 !important; }
.dash-view .dash-card.dash-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, #6366f1, #22d3ee, #4ade80); }
.dash-view .dash-card.dash-kpi { position: relative; transition: border-color .15s; }
.dash-view .dash-card.dash-kpi::after { content: ""; position: absolute; left: 18px; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: #3f3f46; }
.dash-view .dash-card.dash-kpi.pf-pos::after { background: #4ade80; } .dash-view .dash-card.dash-kpi.pf-neg::after { background: #f87171; }
.dash-view .dash-card:hover { border-color: #3a3a40 !important; }
.dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-chart::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, transparent calc(25% - 1px), rgba(255,255,255,.06) 25%, transparent calc(25% + 1px), transparent calc(50% - 1px), rgba(255,255,255,.06) 50%, transparent calc(50% + 1px), transparent calc(75% - 1px), rgba(255,255,255,.06) 75%, transparent calc(75% + 1px)); }
.dash-chart { height: 200px; touch-action: pan-y; }
.dash-line .area { fill: url(#dashFill); } 
.dash-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.28); pointer-events: none; }
.dash-tip { position: absolute; top: 8px; z-index: 5; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; border: 1px solid #3a3a40; background: rgba(18,18,22,.96); box-shadow: 0 8px 24px rgba(0,0,0,.5); pointer-events: none; white-space: nowrap; font-size: 12px; color: #a1a1aa; font-variant-numeric: tabular-nums; }
.dash-tip b { color: #fafafa; font-weight: 600; }
.dash-barcol:hover .dash-barfill { filter: brightness(1.15); }
.dash-daylog { display: flex; flex-direction: column; }
.dash-dl { display: grid; grid-template-columns: 64px minmax(0, 1fr) 90px 104px; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.07); font-size: 13px; font-variant-numeric: tabular-nums; }
.dash-dl:first-child { border-top: 0; }
.dash-dl .dt { color: #a1a1aa; } .dash-dl .dk { color: #71717a; font-size: 12px; text-align: right; } .dash-dl b { text-align: right; font-weight: 600; }
.dash-dl .db { height: 6px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.dash-dl .db i { display: block; height: 100%; border-radius: inherit; background: #4ade80; } .dash-dl .db i.neg { background: #f87171; }
.dash-mile { margin: 14px 0 2px; } .dash-mile-t { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 12px; color: #71717a; font-variant-numeric: tabular-nums; } .dash-mile-t b { color: #fafafa; font-size: 13px; }
.dash-view .dash-btn { border-radius: 10px !important; }
@media (max-width: 1100px) { .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .dash-chart { height: 170px; }
  .dash-dl { grid-template-columns: 52px minmax(0, 1fr) 76px; } .dash-dl .dk { display: none; }
  .dash-sec-h { flex-direction: column; gap: 2px; } .dash-sec-h span { text-align: left; }
  .dash-chartcard .dash-seg3 { max-width: none; }
  .dash-tip { font-size: 11px; }
}
