@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ============================================================
   TGSBOR PREMIUM UI — 2026 refresh
   Scope: app shell polish + fully redesigned Overview tab.
   Loaded after dashboard.css / hub-ui.css.
   ============================================================ */

:root {
  --ink-0: #04060b;
  --ink-1: #070b12;
  --ink-2: #0b111b;
  --ink-3: #111a28;

  --surface: rgba(14, 20, 31, 0.72);
  --surface-2: rgba(18, 25, 38, 0.82);
  --surface-3: rgba(24, 33, 49, 0.9);

  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);

  --txt: #eef2f9;
  --txt-2: #a9b6c9;
  --txt-3: #74839a;

  --acc: #2fa47c;
  --acc-2: #7fd4b4;
  --cyan: #5fae9c;
  --ok: #3ddc97;
  --warn: #fbbf24;
  --bad: #fb7185;
  --pink: #e6bf85;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
  --shadow-card: 0 18px 44px -22px rgba(0, 0, 0, 0.8);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- page frame ---------- */
html, body {
  background: var(--ink-0) !important;
  color: var(--txt);
  font-family: var(--font) !important;
  -webkit-font-smoothing: antialiased;
}
body {
  background-image:
    radial-gradient(900px 540px at 8% -6%, rgba(47, 164, 124, 0.16), transparent 62%),
    radial-gradient(820px 500px at 96% 4%, rgba(127, 212, 180, 0.12), transparent 60%),
    radial-gradient(700px 460px at 52% 108%, rgba(45, 212, 238, 0.07), transparent 62%) !important;
  background-attachment: fixed !important;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
}
::selection { background: rgba(47, 164, 124, 0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; border: 2px solid var(--ink-0); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

/* ---------- sidebar ---------- */
.sidebar {
  width: 250px !important;
  background: linear-gradient(180deg, rgba(9, 13, 21, 0.96) 0%, rgba(7, 10, 17, 0.98) 100%) !important;
  border-right: 1px solid var(--line) !important;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  padding: 18px 14px !important;
  gap: 14px !important;
}
.logo { padding: 2px 6px 12px !important; }
.logo-box {
  width: 38px !important; height: 38px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #2fa47c 0%, #7fd4b4 55%, #e6bf85 120%) !important;
  box-shadow: 0 10px 26px -8px rgba(47, 164, 124, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
  color: #fff !important; font-size: 16px !important;
}
.logo-text {
  font-size: 16.5px !important; font-weight: 800 !important; letter-spacing: -0.02em !important;
  background: linear-gradient(180deg, #fff, #b9c6dd) !important;
  -webkit-background-clip: text !important; background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
.user-box {
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  padding: 10px 12px !important;
  transition: border-color .18s ease, background .18s ease;
}
.user-box:hover { background: rgba(255, 255, 255, 0.055) !important; border-color: var(--line-strong) !important; }
.avatar {
  width: 34px !important; height: 34px !important; border-radius: 10px !important;
  background: linear-gradient(135deg, #2fa47c, #7fd4b4) !important;
  box-shadow: 0 8px 20px -8px rgba(47, 164, 124, 0.7) !important;
  font-weight: 800 !important;
}
.user-info h4 { font-size: 13.5px !important; font-weight: 700 !important; letter-spacing: -0.01em; }
.user-info span { font-size: 11px !important; color: var(--txt-3) !important; }
.nav { gap: 3px !important; padding: 2px !important; }
.nav a {
  padding: 9px 12px !important;
  border-radius: 11px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--txt-2) !important;
  gap: 11px !important;
  transition: background .16s ease, color .16s ease, transform .16s ease !important;
}
.nav a i { width: 18px; text-align: center; font-size: 14px; opacity: .9; }
.nav a:hover { background: rgba(255, 255, 255, 0.045) !important; color: var(--txt) !important; }
.nav a.active {
  background: linear-gradient(92deg, rgba(47, 164, 124, 0.16), rgba(127, 212, 180, 0.08)) !important;
  color: #fff !important;
  font-weight: 650 !important;
  box-shadow: inset 0 0 0 1px rgba(47, 164, 124, 0.22);
}
.nav a.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, #2fa47c, #7fd4b4);
  box-shadow: 0 0 14px rgba(47, 164, 124, 0.8);
}
.nav a { position: relative; }
.nav-sep { margin: 8px 10px !important; background: var(--line) !important; height: 1px; }
.badge-new, .nav a .badge-new {
  font-size: 8.5px !important; font-weight: 700 !important; letter-spacing: .04em;
  padding: 2px 6px !important; border-radius: 6px !important; opacity: .85;
  background: rgba(255, 255, 255, 0.07) !important; color: var(--txt-2) !important;
}
.sidebar.collapsed { width: 76px !important; }

/* ---------- topbar ---------- */
.topbar {
  height: 64px !important;
  background: rgba(6, 9, 15, 0.72) !important;
  border-bottom: 1px solid var(--line) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0 26px !important;
  gap: 16px;
}
#ticker {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
  font-size: 11.5px !important;
  letter-spacing: -0.01em;
  color: var(--txt-2) !important;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 12px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#ticker span { color: var(--txt) !important; font-weight: 600; }
.top-btn {
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  color: var(--txt-2) !important;
  padding: 8px 12px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  transition: all .16s ease !important;
}
.top-btn:hover { background: rgba(255, 255, 255, 0.07) !important; color: var(--txt) !important; border-color: var(--line-strong) !important; }
.header-activity-monitor .hdr-act-pill {
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  padding: 7px 12px !important;
  font-size: 11.5px !important;
  gap: 7px !important;
}
.hdr-act-stat { color: var(--txt-2) !important; }
.hdr-act-stat strong { color: var(--txt) !important; }
.content { width: 100%; max-width: 1560px; margin: 0 auto; padding: 26px 26px 64px !important; box-sizing: border-box; }

/* ============================================================
   OVERVIEW — HERO
   ============================================================ */
.ov-hero {
  position: relative;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(900px 320px at 12% 0%, rgba(47, 164, 124, 0.22), transparent 60%),
    radial-gradient(700px 300px at 92% 10%, rgba(127, 212, 180, 0.16), transparent 62%),
    linear-gradient(180deg, rgba(17, 24, 38, 0.92), rgba(10, 14, 22, 0.92));
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 30px 32px;
  margin-bottom: 22px;
}
.ov-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.05) 0, transparent 42%),
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 100% 100%, 44px 44px, 44px 44px;
  mask-image: radial-gradient(circle at 20% 0%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 20% 0%, #000, transparent 72%);
  pointer-events: none;
}
.ov-hero-inner {
  position: relative;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 28px; flex-wrap: wrap;
}
.ov-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--acc); margin-bottom: 12px;
  background: rgba(47, 164, 124, 0.09);
  border: 1px solid rgba(47, 164, 124, 0.22);
  padding: 5px 10px; border-radius: 99px;
}
.ov-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.14), 0 0 12px rgba(61, 220, 151, 0.9);
  animation: ovPulse 2.2s ease-in-out infinite;
}
@keyframes ovPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.ov-title {
  font-size: 34px !important; line-height: 1.12 !important;
  font-weight: 800 !important; letter-spacing: -0.035em !important;
  margin: 0 0 10px !important; color: #fff !important;
}
.ov-grad {
  background: linear-gradient(96deg, #7fd4b4 0%, #cfe8dc 45%, #e6bf85 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ov-subtitle { font-size: 13.5px !important; color: var(--txt-2) !important; max-width: 620px; line-height: 1.55; margin: 0; }
.ov-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.ov-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 11px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  font-size: 11.5px; color: var(--txt-2);
  transition: border-color .16s ease, background .16s ease;
}
.ov-chip:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
.ov-chip i { font-size: 11px; opacity: .8; }
.ov-chip b { color: var(--txt); font-weight: 650; }
.ov-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--txt-3); }
.ov-chip .dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(61, 220, 151, 0.7); }
.ov-chip .dot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(251, 191, 36, 0.7); }
.ov-chip .dot.bad { background: var(--bad); box-shadow: 0 0 8px rgba(251, 113, 133, 0.7); }

.ov-hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; min-width: 260px; }
.ov-clock-wrap { text-align: right; }
.ov-clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 38px; font-weight: 600; letter-spacing: -0.03em; line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.ov-clock-date { font-size: 12px; color: var(--txt-3); margin-top: 7px; text-transform: capitalize; }
.ov-hero-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.ov-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 15px; border-radius: 11px; border: 1px solid transparent;
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
  white-space: nowrap;
}
.ov-btn:active { transform: translateY(1px) scale(.995); }
.ov-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #5b7cff 0%, #7c5cff 62%, #9a6bff 100%);
  box-shadow: 0 12px 28px -12px rgba(47, 164, 124, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.ov-btn-primary:hover { box-shadow: 0 16px 34px -12px rgba(47, 164, 124, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.ov-btn-ghost {
  color: var(--txt);
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line-strong);
}
.ov-btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* KPI row */
.ov-kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.ov-kpi {
  position: relative;
  background: linear-gradient(180deg, rgba(20, 27, 41, 0.86), rgba(12, 17, 26, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.ov-kpi:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.ov-kpi::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--kpi, var(--acc)), transparent);
  opacity: .85;
}
.ov-kpi-body { position: relative; display: flex; flex-direction: column; height: 100%; }
.ov-kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ov-kpi-label { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600; color: var(--txt-2); letter-spacing: -0.01em; }
.ov-kpi-icon {
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px;
  color: var(--kpi, var(--acc));
  background: color-mix(in srgb, var(--kpi, var(--acc)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--kpi, var(--acc)) 26%, transparent);
}
.ov-kpi-badge {
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  padding: 4px 8px; border-radius: 7px;
  color: var(--kpi, var(--acc));
  background: color-mix(in srgb, var(--kpi, var(--acc)) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--kpi, var(--acc)) 22%, transparent);
}
.ov-kpi[data-badge] .ov-kpi-badge:empty { display: none; }
.ov-kpi-value {
  font-size: 33px; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
  color: #fff; font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}
.ov-kpi-value small { font-size: 15px; font-weight: 600; color: var(--txt-3); letter-spacing: 0; }
.ov-kpi-sub { font-size: 11.5px; color: var(--txt-3); min-height: 16px; margin-bottom: 14px; }
.ov-kpi-bar {
  height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.055);
  overflow: hidden; margin-bottom: 14px;
}
.ov-kpi-bar > i {
  display: block; height: 100%; width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--kpi, var(--acc)), color-mix(in srgb, var(--kpi, var(--acc)) 55%, #fff));
  box-shadow: 0 0 16px color-mix(in srgb, var(--kpi, var(--acc)) 55%, transparent);
  transition: width .55s cubic-bezier(.22,.9,.24,1);
}
.ov-kpi-foot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: auto; }
.ov-kpi-foot > div { display: flex; flex-direction: column; gap: 2px; }
.ov-kpi-foot b { font-size: 14px; font-weight: 700; color: var(--txt); font-variant-numeric: tabular-nums; }
.ov-kpi-foot span { font-size: 9.5px; color: var(--txt-3); letter-spacing: .01em; }

/* main grid */
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 18px; align-items: start; }
.ov-main, .ov-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ov-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }

/* generic card */
.ov-card {
  position: relative;
  background: linear-gradient(180deg, rgba(18, 24, 37, 0.82), rgba(11, 16, 25, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  overflow: hidden;
}
.ov-card::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
}
.ov-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ov-card-head h3 {
  margin: 0 0 3px !important; font-size: 14px !important; font-weight: 700 !important;
  letter-spacing: -0.015em !important; color: var(--txt) !important;
  display: flex; align-items: center; gap: 9px;
}
.ov-card-head h3 i { font-size: 12.5px; color: var(--acc); opacity: .95; }
.ov-card-head p { margin: 0 !important; font-size: 11.5px; color: var(--txt-3); }
.ov-pill {
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  padding: 5px 9px; border-radius: 8px; white-space: nowrap;
  color: var(--ok);
  background: rgba(61, 220, 151, 0.09);
  border: 1px solid rgba(61, 220, 151, 0.22);
}
.ov-pill.warn { color: var(--warn); background: rgba(251, 191, 36, 0.09); border-color: rgba(251, 191, 36, 0.22); }
.ov-pill.bad { color: var(--bad); background: rgba(251, 113, 133, 0.09); border-color: rgba(251, 113, 133, 0.22); }
.ov-pill.muted { color: var(--txt-2); background: rgba(255, 255, 255, 0.045); border-color: var(--line); }

/* pipeline card */
.ov-pipe { display: flex; align-items: stretch; gap: 6px; margin-bottom: 16px; }
.ov-pipe-stage {
  flex: 1; min-width: 0;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 13px;
  display: flex; flex-direction: column; gap: 3px;
  transition: border-color .16s ease, background .16s ease;
}
.ov-pipe-stage:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.045); }
.ov-pipe-stage b { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; color: #fff; font-variant-numeric: tabular-nums; }
.ov-pipe-stage span { font-size: 10px; color: var(--txt-3); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-pipe-stage .mark { width: 22px; height: 3px; border-radius: 99px; margin-bottom: 6px; }
.ov-pipe-stage.s1 .mark { background: var(--acc); box-shadow: 0 0 12px rgba(47,164,124,.7); }
.ov-pipe-stage.s2 .mark { background: var(--ok); box-shadow: 0 0 12px rgba(61,220,151,.6); }
.ov-pipe-stage.s3 .mark { background: var(--warn); box-shadow: 0 0 12px rgba(251,191,36,.55); }
.ov-pipe-stage.s4 .mark { background: var(--bad); box-shadow: 0 0 12px rgba(251,113,133,.55); }
.ov-pipe-arrow { display: flex; align-items: center; color: var(--txt-3); font-size: 10px; opacity: .5; }
.ov-pipe-track { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, 0.05); margin-bottom: 12px; }
.ov-pipe-track > i { display: block; height: 100%; transition: width .6s cubic-bezier(.22,.9,.24,1); }
.ov-pipe-track .p-ok { background: linear-gradient(90deg, #3ddc97, #34d399); }
.ov-pipe-track .p-pend { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.ov-pipe-track .p-fail { background: linear-gradient(90deg, #fb7185, #ef4444); }
.ov-pipe-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--txt-3); }
.ov-pipe-foot b { color: var(--txt); font-weight: 650; font-variant-numeric: tabular-nums; }
.ov-goal { flex: 1; min-width: 120px; max-width: 240px; height: 5px; background: rgba(255, 255, 255, 0.055); border-radius: 99px; overflow: hidden; display: inline-block; }
.ov-goal > i { display: block; height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--acc), var(--acc-2)); box-shadow: 0 0 14px rgba(47,164,124,.6); transition: width .55s ease; }

/* status / effectiveness cards */
.ov-bars > div { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.ov-bars > div:last-child { margin-bottom: 0; }
.ov-bars .lbl { width: 112px; font-size: 11.5px; color: var(--txt-2); display: flex; align-items: center; gap: 7px; flex: none; }
.ov-bars .lbl i { font-size: 10.5px; }
.ov-bars .track { flex: 1; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.055); overflow: hidden; }
.ov-bars .track > i { display: block; height: 100%; border-radius: 99px; transition: width .55s ease; }
.ov-bars .val { width: 84px; text-align: right; font-size: 11.5px; color: var(--txt); font-weight: 650; font-variant-numeric: tabular-nums; }
.ov-stat-duo { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ov-stat-duo + .ov-stat-duo { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ov-stat-duo .k { font-size: 11px; color: var(--txt-3); margin-bottom: 4px; }
.ov-stat-duo .v { font-size: 23px; font-weight: 800; letter-spacing: -0.03em; color: #fff; font-variant-numeric: tabular-nums; }
.ov-stat-duo .v.ok { color: var(--ok); }
.ov-stat-duo .v.acc { color: var(--acc); }
.ov-stat-duo .v.bad { color: var(--bad); }
.ov-progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.055); overflow: hidden; margin: 10px 0 14px; }
.ov-progress > i { display: block; height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--acc), var(--acc-2)); box-shadow: 0 0 14px rgba(47,164,124,.55); transition: width .55s ease; }
.ov-mini-btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  width: 100%; margin-top: 14px;
  padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--txt-2); font-size: 11.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: all .16s ease;
}
.ov-mini-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--txt); }

/* chart card */
.ov-chart-body { min-height: 196px; }
.ov-chart-body canvas { width: 100% !important; height: 196px !important; }
.ov-chart-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 10.5px; color: var(--txt-3); }
.ov-chart-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }

/* wave card */
.ov-wave-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.ov-wave-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 30px; font-weight: 600; letter-spacing: -0.03em; color: #fff;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.ov-wave-label { font-size: 10.5px; color: var(--txt-3); margin-top: 6px; }
.ov-wave-next { text-align: right; font-size: 11.5px; color: var(--txt-2); }
.ov-wave-next b { display: block; font-size: 12.5px; color: var(--txt); font-weight: 650; margin-top: 3px; }
.ov-wave-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.ov-wave-stat { background: rgba(255, 255, 255, 0.028); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; }
.ov-wave-stat b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.03em; color: #fff; font-variant-numeric: tabular-nums; }
.ov-wave-stat span { font-size: 10px; color: var(--txt-3); }
.ov-wave-stat.ready b { color: var(--ok); }
.ov-wave-stat.curtain b { color: var(--warn); }

/* quick actions */
.ov-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ov-quick-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 12px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--txt-2); font-family: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer; text-align: left; line-height: 1.3;
  transition: all .16s ease;
}
.ov-quick-btn i { font-size: 12px; color: var(--acc); flex: none; }
.ov-quick-btn:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--line-strong); color: var(--txt); transform: translateY(-1px); }
.ov-quick-btn.span2 { grid-column: span 2; }

/* accounts card */
.ov-accounts-list { display: flex; flex-direction: column; gap: 9px; }
.ov-accounts-list > div { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--txt-2); }
.ov-accounts-list .online-dot { flex: none; }
.ov-accounts-list .badge { margin-left: auto; font-size: 9.5px !important; padding: 3px 7px !important; }
.ov-divider { height: 1px; background: var(--line); margin: 15px 0; }
.ov-upload {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 12px; border-radius: 11px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--txt-2); font-size: 11.5px; font-weight: 600; cursor: pointer;
  transition: all .16s ease;
}
.ov-upload:hover { background: rgba(255, 255, 255, 0.055); color: var(--txt); border-color: var(--acc); }
.ov-upload i { color: var(--acc); }
.ov-btn-wide {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 9px; padding: 10px 12px; border-radius: 11px;
  border: 1px solid rgba(47, 164, 124, 0.35);
  background: rgba(47, 164, 124, 0.12);
  color: #cdd8ff; font-size: 11.5px; font-weight: 650; font-family: inherit; cursor: pointer;
  transition: all .16s ease;
}
.ov-btn-wide:hover { background: rgba(47, 164, 124, 0.2); color: #fff; }

/* legacy badges/buttons on overview that JS rewrites */
#stat-crawl-status-badge.ov-pill, #stat-outreach-badge.ov-pill { }
#cc-btn-pipeline.btn, #cc-btn-pipeline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 15px !important; border-radius: 11px !important;
  font-size: 12.5px !important; font-weight: 600 !important;
  border: 1px solid var(--line-strong) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: var(--txt) !important; box-shadow: none !important;
  width: auto !important;
}
#cc-btn-pipeline.btn-red, #cc-btn-pipeline.btn-red:hover {
  border-color: rgba(251, 113, 133, 0.35) !important;
  background: rgba(251, 113, 133, 0.1) !important;
  color: #fecdd3 !important;
}
#cc-btn-pipeline.btn-outline { color: var(--txt) !important; }

/* misc legacy classes still used elsewhere in the app */
.card {
  background: linear-gradient(180deg, rgba(18, 24, 37, 0.82), rgba(11, 16, 25, 0.9)) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-card);
}

/* responsive */
@media (max-width: 1320px) {
  .ov-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .ov-title { font-size: 30px !important; }
}
@media (max-width: 1120px) {
  .ov-grid { grid-template-columns: 1fr; }
  .ov-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    padding: 14px 12px calc(116px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
  }
  .ov-hero { padding: 22px 18px; border-radius: 20px; }
  .ov-hero-inner { gap: 18px; }
  .ov-title { font-size: 25px !important; }
  .ov-hero-right { align-items: flex-start; width: 100%; min-width: 0; }
  .ov-clock-wrap { text-align: left; }
  .ov-clock { font-size: 30px; }
  .ov-hero-actions { justify-content: flex-start; }
  .ov-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ov-kpi { padding: 14px 14px 12px; }
  .ov-kpi-value { font-size: 26px; }
  .ov-kpi-foot { grid-template-columns: 1fr 1fr; }
  .ov-row { grid-template-columns: 1fr; }
  .ov-side { grid-template-columns: 1fr; }
  .ov-pipe { flex-wrap: wrap; }
  .ov-pipe-stage { flex: 1 1 44%; }
  .ov-pipe-arrow { display: none; }
  .ov-card { padding: 15px 14px; }
  .ov-quick { grid-template-columns: 1fr; }
  .ov-quick-btn.span2 { grid-column: auto; }
}

/* ---------- login screen refresh ---------- */
#login-screen {
  background: radial-gradient(1100px 620px at 50% -10%, rgba(47, 164, 124, 0.22), transparent 62%),
              radial-gradient(800px 520px at 88% 100%, rgba(127, 212, 180, 0.14), transparent 62%),
              #04060b !important;
}
#login-screen::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 50% 30%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000, transparent 75%);
  pointer-events: none;
}
.login-box {
  background: linear-gradient(180deg, rgba(19, 26, 40, 0.92), rgba(10, 14, 22, 0.95)) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 24px !important;
  padding: 40px 34px !important;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
  width: 392px !important;
}
.login-logo { font-size: 23px !important; letter-spacing: -0.02em; }
.login-logo-icon {
  background: linear-gradient(135deg, #2fa47c, #7fd4b4) !important;
  color: #fff !important;
  box-shadow: 0 14px 30px -10px rgba(47, 164, 124, 0.8) !important;
}
.login-input {
  background: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 12px !important;
  padding: 13px 15px !important;
}
.login-btn {
  background: linear-gradient(135deg, #5b7cff, #7c5cff 60%, #9a6bff) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 34px -14px rgba(47, 164, 124, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}


/* ================= round 2 polish ================= */
.ov-acc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 11px;
  border: 1px solid transparent;
  transition: background .16s ease, border-color .16s ease;
}
.ov-acc-row:hover { background: rgba(255, 255, 255, 0.035); border-color: var(--line); }
.ov-acc-avatar {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.ov-acc-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ov-acc-meta b { font-size: 11.5px; font-weight: 600; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-acc-meta span { font-size: 10px; color: var(--txt-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-acc-badge {
  margin-left: auto; font-size: 9px !important; font-weight: 700 !important;
  padding: 3px 7px !important; border-radius: 7px !important; white-space: nowrap;
}

/* subtle entrance */
@keyframes ovRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.tab.active .ov-hero { animation: ovRise .5s cubic-bezier(.22,.9,.24,1) both; }
.tab.active .ov-kpi { animation: ovRise .55s cubic-bezier(.22,.9,.24,1) both; }
.tab.active .ov-kpi:nth-child(1) { animation-delay: .04s; }
.tab.active .ov-kpi:nth-child(2) { animation-delay: .08s; }
.tab.active .ov-kpi:nth-child(3) { animation-delay: .12s; }
.tab.active .ov-kpi:nth-child(4) { animation-delay: .16s; }
.tab.active .ov-card { animation: ovRise .6s cubic-bezier(.22,.9,.24,1) both; animation-delay: .1s; }
.tab.active .ov-side .ov-card:nth-child(2) { animation-delay: .16s; }
.tab.active .ov-side .ov-card:nth-child(3) { animation-delay: .22s; }
@media (prefers-reduced-motion: reduce) {
  .tab.active .ov-hero, .tab.active .ov-kpi, .tab.active .ov-card { animation: none; }
}
body { overflow-x: hidden; }
.main { min-width: 0; }

/* mobile topbar / hero / kpi */
@media (max-width: 1024px) {
  .header-activity-monitor { display: none !important; }
  .topbar { padding: 0 14px !important; gap: 10px !important; }
  #ticker { display: none !important; }
}
@media (max-width: 640px) {
  .topbar { height: 58px !important; }
  .topbar .top-btn { padding: 7px 10px !important; font-size: 11.5px !important; }
  .ov-kpis { grid-template-columns: 1fr !important; }
  .ov-kpi { padding: 16px 16px 14px; }
  .ov-kpi-value { font-size: 29px; }
  .ov-kpi-foot { grid-template-columns: repeat(4, 1fr); }
  .ov-hero-actions { width: 100%; }
  .ov-hero-actions .ov-btn { flex: 1; justify-content: center; }
  .ov-wave-stats { grid-template-columns: 1fr 1fr; }
  .ov-pipe-foot { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ov-goal { max-width: none; width: 100%; }
}
@media (max-width: 480px) {
  .ov-kpi-foot { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px 8px !important; }
}


/* ================= round 3 polish ================= */
.ov-chart-legend { margin-top: 10px; }
.ov-chart-legend i { width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; }

/* login: quick bot login + remember checkbox + card entrance */
#login-screen .login-box {
  animation: loginRise .55s cubic-bezier(.22,.9,.24,1) both;
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.95), 0 0 90px -30px rgba(47, 164, 124, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
}
@keyframes loginRise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
#login-screen input[type="checkbox"] { accent-color: #2fa47c !important; }
#login-screen a[href*="t.me"] {
  background: rgba(47, 164, 124, 0.08) !important;
  border: 1px solid rgba(47, 164, 124, 0.28) !important;
  border-radius: 12px !important;
  color: #c7d4ff !important;
  padding: 11px 12px !important;
  font-weight: 600 !important;
  transition: all .18s ease;
}
#login-screen a[href*="t.me"]:hover {
  background: rgba(47, 164, 124, 0.16) !important;
  border-color: rgba(47, 164, 124, 0.45) !important;
  color: #fff !important;
}
#login-screen a[href*="t.me"] i { color: #7fd4b4 !important; }
#login-screen .login-title { color: var(--txt-2) !important; }
#login-screen code { background: rgba(255,255,255,0.05); border-radius: 5px; padding: 1px 5px; color: #a9b6c9; }

/* ===== responsive overflow fixes (2026-11-14) =====
   The topbar ticker and the 4 KPI cards used to overlap on 1180-1440px:
   flex children had no min-width and the KPI grid stayed 4-column too long. */
.topbar > div:first-child { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.topbar > div:last-child { flex-shrink: 0; }
#ticker { flex: 1 1 auto; min-width: 0; }
.ov-kpi-top { min-width: 0; gap: 8px; flex-wrap: nowrap; }
.ov-kpi-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-kpi-badge { flex-shrink: 0; }

@media (max-width: 1440px) {
  .hdr-act-label, .hdr-act-sep { display: none !important; }
  .hdr-act-pill { padding-left: 10px !important; padding-right: 10px !important; gap: 7px !important; }
}
@media (max-width: 1400px) {
  .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .header-activity-monitor { display: none !important; }
}

/* Reserve the final height of the side "Аккаунты" card during page reload.
   Before data arrives it was only 199px and grew to 418px when 4 account rows
   rendered, stretching the whole grid/page on every reload. */
#tab-overview #ov-sessions-mini,
#tab-overview .ov-accounts-list { min-height: 233px; }
.content { scrollbar-gutter: stable; overflow-y: scroll !important; }
@media (max-width: 768px) {
  .content { scrollbar-gutter: auto; overflow-x: hidden !important; overflow-y: auto !important; }
}
/* No entrance movement on reload: Overview must render at its final geometry immediately. */
.tab.active .ov-hero, .tab.active .ov-kpi, .tab.active .ov-card { animation: none !important; }
