/* getfast · data – tamsus, ramus analitikos skydelis */
:root {
  color-scheme: dark;
  --bg: #0b0c0e;
  --surface-1: #131417;
  --surface-2: #181a1e;
  --line: #23262c;
  --line-soft: #1b1d22;
  --text-primary: #ecedef;
  --text-secondary: #9a9ea8;
  --text-muted: #6a6f79;
  --series-1: #338ced;
  --series-1-soft: rgba(51, 140, 237, 0.16);
  --series-2: #e76624;
  --series-3: #00a888;
  --series-prev: #5b606b;
  --good: #3fc35a;
  --bad: #f07071;
  --live: #0aac23;
  --radius: 14px;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text-primary); }
body {
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(51, 140, 237, 0.07), transparent 60%),
    radial-gradient(900px 400px at -10% 0%, rgba(0, 168, 136, 0.05), transparent 55%),
    var(--bg);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* --- viršutinė juosta --- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: rgba(11, 12, 14, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; font-size: 15px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: conic-gradient(from 210deg, #338ced, #00a888, #338ced);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.brand small { color: var(--text-muted); font-weight: 500; }
.spacer { flex: 1; }
.status { color: var(--text-secondary); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.status.ok .dot { background: var(--live); box-shadow: 0 0 0 3px rgba(10, 172, 35, 0.18); }
.status.busy .dot { background: var(--series-1); animation: pulse 1.2s ease-in-out infinite; }
.status.err .dot { background: var(--bad); }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-1); border: 1px solid var(--line); }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer;
  color: var(--text-secondary); font-size: 13px; font-weight: 500; transition: background .15s, color .15s;
}
.seg button:hover { color: var(--text-primary); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--line); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface-1); color: var(--text-secondary);
  padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: color .15s, border-color .15s, background .15s;
}
.btn:hover { color: var(--text-primary); border-color: #33373f; background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 14px; height: 14px; }
.btn.spin svg { animation: spin 1s linear infinite; }

/* --- turinys --- */
main { max-width: 1440px; margin: 0 auto; padding: 28px 28px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin: 6px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; line-height: 1.15; letter-spacing: -0.03em; margin: 0; font-weight: 600; }
.page-head p { margin: 6px 0 0; color: var(--text-secondary); }
.crumb { color: var(--text-secondary); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.crumb:hover { color: var(--text-primary); }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpis.wide { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 14px; min-height: 108px; display: flex; flex-direction: column; gap: 6px;
}
.kpi-label { color: var(--text-secondary); font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.kpi-value { font-family: var(--mono); font-size: 27px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.1; }
.kpi-sub { color: var(--text-muted); font-size: 12px; display: flex; gap: 8px; align-items: center; margin-top: auto; flex-wrap: wrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(10,172,35,.5); animation: live 2s infinite; }

.delta { font-family: var(--mono); font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 6px; }
.delta.up { color: var(--good); background: rgba(63, 195, 90, 0.1); }
.delta.down { color: var(--bad); background: rgba(240, 112, 113, 0.1); }
.delta.flat { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.delta.new { color: var(--series-1); background: rgba(51,140,237,0.12); }

.grid { display: grid; gap: 14px; }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 14px; min-width: 0;
}
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 14px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.card-head .hint { color: var(--text-muted); font-size: 12px; }
.card-head .right { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.section-gap { margin-top: 14px; }

.legend { display: flex; gap: 14px; color: var(--text-secondary); font-size: 12px; }
.legend i { display: inline-block; width: 14px; height: 2px; border-radius: 2px; vertical-align: middle; margin-right: 6px; background: var(--series-1); }
.legend i.prev { background: repeating-linear-gradient(90deg, var(--series-prev) 0 4px, transparent 4px 7px); }

/* --- grafikai --- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis-text { fill: var(--text-muted); font: 11px var(--mono); }
.chart .crosshair { stroke: #3a3e46; stroke-width: 1; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: rgba(24, 26, 30, 0.96); border: 1px solid #2c3037; border-radius: 10px;
  padding: 9px 11px; font-size: 12px; min-width: 150px; box-shadow: 0 12px 30px rgba(0,0,0,.45);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tooltip.show { opacity: 1; transform: none; }
.tooltip .t-date { color: var(--text-secondary); margin-bottom: 5px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .t-row span:first-child { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.tooltip .sw { width: 8px; height: 8px; border-radius: 2px; }
.tooltip .t-row b { font-family: var(--mono); font-weight: 500; color: var(--text-primary); }

/* --- svetainių lentelė --- */
.table-wrap { overflow-x: auto; margin: 0 -18px -14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: right; font-weight: 500; color: var(--text-muted); font-size: 11.5px; letter-spacing: .02em;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text-secondary); }
th.sorted { color: var(--text-primary); }
th:first-child, td:first-child { text-align: left; padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; }
td.num { font-family: var(--mono); }
tbody tr { transition: background .12s; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: rgba(255,255,255,0.025); }
tbody tr:last-child td { border-bottom: 0; }
.site-cell { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.favicon { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; flex: none; overflow: hidden; }
.favicon img { width: 16px; height: 16px; }
.site-name { font-weight: 550; letter-spacing: -0.01em; }
.site-domain { color: var(--text-muted); font-size: 12px; }
.cell-stack { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.muted { color: var(--text-muted); }
.live-count { display: inline-flex; align-items: center; gap: 6px; }
.badge { font-size: 11px; color: var(--text-muted); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.badge.warn { color: #f2b65a; border-color: rgba(242,182,90,.3); }

/* --- sąrašai su juostomis --- */
.bars { display: flex; flex-direction: column; gap: 3px; }
.bar-row { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 6px 8px; border-radius: 7px; font-size: 12.5px; }
.bar-row .fill { position: absolute; inset: 0 auto 0 0; background: var(--series-1-soft); border-radius: 7px; z-index: 0; }
.bar-row > span { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row > span:last-child { font-family: var(--mono); color: var(--text-secondary); flex: none; }
.empty { color: var(--text-muted); font-size: 13px; padding: 18px 4px; }

.movers { display: flex; flex-direction: column; }
.mover { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.mover:last-child { border-bottom: 0; }
.mover:hover .site-name { color: #fff; }

.setup {
  border: 1px solid var(--line); border-radius: 18px; padding: 34px; margin-top: 8px;
  background: linear-gradient(160deg, rgba(51,140,237,.08), transparent 45%), var(--surface-1);
}
.setup h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -0.02em; }
.setup p { color: var(--text-secondary); max-width: 720px; margin: 0 0 10px; }
.setup code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); }
.errors { margin-top: 14px; color: #f2b65a; font-size: 12.5px; }

.skeleton { height: 108px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-1), var(--surface-2), var(--surface-1)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border: 1px solid var(--line); }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(10,172,35,.5); } 70% { box-shadow: 0 0 0 7px rgba(10,172,35,0); } 100% { box-shadow: 0 0 0 0 rgba(10,172,35,0); } }

@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-2-1, .g-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .topbar .status { order: 5; width: 100%; }
  main { padding: 18px 14px 60px; }
  .kpis, .kpis.wide { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { min-height: 96px; padding: 13px; }
  .kpi-value { font-size: 22px; }
  .g-2-1, .g-2, .g-3 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 22px; }
  .card-head { flex-wrap: wrap; row-gap: 6px; }
  .card-head .right { margin-left: 0; width: 100%; }
  .card { padding: 15px 14px 12px; }
  .table-wrap { margin: 0 -14px -12px; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- prisijungimas --- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; padding: 32px; border-radius: 20px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1)); border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.login-card h1 { font-size: 22px; letter-spacing: -0.03em; margin: 22px 0 6px; }
.login-card p { color: var(--text-secondary); margin: 0 0 22px; }
.login-card label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 7px; }
.login-card input {
  width: 100%; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text-primary); font: 15px var(--sans); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus { border-color: var(--series-1); box-shadow: 0 0 0 4px rgba(51,140,237,.15); }
.login-card button[type=submit] {
  width: 100%; margin-top: 14px; padding: 12px; border: 0; border-radius: 11px; cursor: pointer;
  background: var(--text-primary); color: #0b0c0e; font-weight: 600; font-size: 14px; transition: transform .1s, opacity .15s;
}
.login-card button[type=submit]:hover { opacity: .92; }
.login-card button[type=submit]:active { transform: scale(.99); }
.login-error { color: var(--bad); font-size: 13px; margin-top: 12px; min-height: 18px; }
