/* ==========================================================================
   ReSpotify Stats — dark analytics UI
   Palette: #0E0E10 / #1F1F22 / #107C10 / #9BF00B
   No external assets.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #0e0e10;
  --bg-2: #121214;
  --surface: #1f1f22;
  --surface-2: #26262a;
  --surface-3: #2e2e33;
  --line: #303036;
  --line-soft: #26262b;
  --text: #f4f4f6;
  --muted: #9b9ba4;
  --muted-2: #71717b;
  --green: #107c10;
  --green-2: #149414;
  --lime: #9bf00b;
  --lime-soft: rgba(155, 240, 11, 0.14);
  --blue: #57a6ff;
  --amber: #ffc857;
  --pink: #ff7ab6;
  --violet: #b184ff;
  --red: #ff6b6b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
  --font-body: "Segoe UI Variable Text", "Segoe UI", Selawik, system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", Bahnschrift, system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(920px 520px at 88% -8%, rgba(16, 124, 16, 0.24), transparent 62%),
    radial-gradient(720px 460px at -12% 4%, rgba(155, 240, 11, 0.07), transparent 58%);
  background-attachment: fixed;
}

a { color: var(--lime); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
::selection { background: rgba(155, 240, 11, 0.28); color: #fff; }

/* ---------------------------------------------------------------- layout */
.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 16px;
  background: linear-gradient(180deg, #171719 0%, #131315 100%);
  border-right: 1px solid var(--line-soft);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 20px;
}
.brand-mark { flex: 0 0 auto; filter: drop-shadow(0 6px 16px rgba(155, 240, 11, 0.16)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; letter-spacing: 0.01em; }
.brand-text strong span { color: var(--lime); }
.brand-text small { font-size: 0.66rem; color: var(--muted-2); letter-spacing: 0.09em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(16, 124, 16, 0.30), rgba(16, 124, 16, 0.08));
  border-color: rgba(155, 240, 11, 0.16);
}
.nav-item.active svg { color: var(--lime); }

.sidebar-spacer { flex: 1; }

.sidebar-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 14px;
  font-size: 0.71rem;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(155, 240, 11, 0.12);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(155, 240, 11, 0.12); }
  50% { box-shadow: 0 0 0 8px rgba(155, 240, 11, 0.03); }
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.02);
}
.avatar {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--green), #0b5c0b);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.user-meta strong { font-size: 0.82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { font-size: 0.68rem; color: var(--muted-2); }
.logout-form { margin: 0; }
.mobile-logout { display: none; margin: 0; }
.mobile-logout .icon-btn { width: 34px; height: 34px; }

.viewport { min-width: 0; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 28px;
  background: rgba(14, 14, 16, 0.82);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.eyebrow {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 2px;
}
.topbar h1 { font-family: var(--font-display); font-size: 1.32rem; font-weight: 700; letter-spacing: 0.01em; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.range-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-2);
}
.range-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease;
}
.range-switch button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.range-switch button.active {
  color: #0b1a00;
  background: linear-gradient(180deg, var(--lime), #7fce06);
  box-shadow: 0 4px 14px rgba(155, 240, 11, 0.20);
}

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-2);
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover { color: var(--text); border-color: #414148; background: var(--surface-2); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn.spinning svg { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* export menu */
.export-wrap { position: relative; }
.export-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}
.export-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.82rem;
  text-decoration: none;
}
.export-menu a:hover { background: rgba(255, 255, 255, 0.06); color: var(--lime); }
.export-menu a small {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------- page */
.page {
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
  padding: 24px 28px 44px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.banner {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.10);
  color: #ffb3b3;
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------- KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.kpi-card {
  position: relative;
  padding: 17px 18px 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(170deg, #222226 0%, #1c1c1f 100%);
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.kpi-card:hover { transform: translateY(-2px); border-color: #3a3a41; }
.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--lime), transparent 82%);
  opacity: 0.85;
}
.kpi-card:nth-child(2)::before { background: linear-gradient(90deg, var(--lime), #4aa300, transparent 82%); }
.kpi-card:nth-child(3)::before { background: linear-gradient(90deg, var(--blue), #2b6fbd, transparent 82%); }
.kpi-card:nth-child(4)::before { background: linear-gradient(90deg, var(--amber), #b98613, transparent 82%); }

.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.kpi-label {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  flex: 0 0 auto;
}
.kpi-icon.green { color: var(--lime); background: rgba(16, 124, 16, 0.24); }
.kpi-icon.lime { color: var(--lime); background: rgba(155, 240, 11, 0.13); }
.kpi-icon.blue { color: var(--blue); background: rgba(87, 166, 255, 0.13); }
.kpi-icon.amber { color: var(--amber); background: rgba(255, 200, 87, 0.13); }

.kpi-value {
  font-family: var(--font-mono);
  font-size: clamp(1.7rem, 2.4vw, 2.15rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
}
.kpi-sub { margin-top: 6px; font-size: 0.76rem; color: var(--muted-2); }
.kpi-sub strong { color: var(--lime); font-weight: 600; }

/* ---------------------------------------------------------------- mini metrics */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.mini {
  padding: 13px 16px 14px;
  border-left: 1px solid var(--line-soft);
  min-width: 0;
}
.mini:first-child { border-left: 0; }
.mini > span {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini > strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini > small { display: block; margin-top: 2px; font-size: 0.68rem; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- panels */
.panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 { font-family: var(--font-display); font-size: 0.98rem; font-weight: 650; letter-spacing: 0.01em; }
.panel-head p { margin-top: 3px; font-size: 0.74rem; color: var(--muted-2); }
.updated { font-size: 0.72rem; color: var(--muted-2); font-family: var(--font-mono); white-space: nowrap; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }

/* ---------------------------------------------------------------- chart */
.chart-panel .panel-head { align-items: center; }
.metric-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.metric-tabs::-webkit-scrollbar { display: none; }
.metric-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  height: 28px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.metric-tabs button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.metric-tabs button.active { color: var(--text); background: var(--surface-3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04); }

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 0;
  font-size: 0.76rem;
  color: var(--muted-2);
}
.legend-total { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-family: var(--font-mono); font-weight: 600; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px rgba(155, 240, 11, 0.5); }
.legend-peak { font-family: var(--font-mono); }

.chart { position: relative; height: 320px; padding: 6px 10px 10px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid-line { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.chart .axis-y, .chart .axis-x { fill: var(--muted-2); font-family: var(--font-mono); font-size: 10.5px; }
.chart .series-line { fill: none; stroke: var(--lime); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 7px rgba(155, 240, 11, 0.28)); }
.chart .series-area { fill: url(#chartGradient); }
.chart .hover-line { stroke: rgba(255, 255, 255, 0.22); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .hover-dot { fill: var(--lime); stroke: #121214; stroke-width: 2.5; }
.chart .bar { fill: url(#barGradient); rx: 3; }
.chart .bar:hover { fill: var(--lime); }
.chart-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 0.85rem;
}
.chart-empty-note {
  fill: var(--muted-2);
  font-family: var(--font-body);
  font-size: 12.5px;
}

.chart-tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  min-width: 132px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(24, 24, 27, 0.97);
  box-shadow: var(--shadow);
  font-size: 0.75rem;
  color: var(--muted);
}
.chart-tooltip strong { display: block; color: var(--text); font-family: var(--font-mono); font-size: 0.9rem; margin-top: 2px; }
.chart-tooltip .tt-time { color: var(--muted-2); font-size: 0.7rem; }

/* ---------------------------------------------------------------- lists */
.list { display: flex; flex-direction: column; padding: 7px 8px 9px; }
.track-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  transition: background 0.14s ease;
}
.track-row:hover { background: rgba(255, 255, 255, 0.035); }
.thumb {
  width: 42px; height: 42px;
  border-radius: 9px;
  object-fit: cover;
  background: linear-gradient(135deg, #2c2c31, #1b1b1e);
  border: 1px solid var(--line-soft);
  flex: 0 0 auto;
}
.thumb-fallback {
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 1rem;
}
.rank {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}
.track-row:nth-child(1) .rank { color: var(--lime); border-color: rgba(155, 240, 11, 0.30); background: var(--lime-soft); }
.track-main { min-width: 0; }
.track-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-sub {
  font-size: 0.74rem;
  color: var(--muted-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.track-value { text-align: right; flex: 0 0 auto; }
.track-value strong { display: block; font-family: var(--font-mono); font-size: 0.84rem; font-weight: 700; color: var(--text); }
.track-value small { display: block; font-size: 0.66rem; color: var(--muted-2); margin-top: 1px; }

/* country / device rows */
.bar-row { display: block; padding: 9px 10px 10px; border-radius: 12px; transition: background 0.14s ease; }
.bar-row:hover { background: rgba(255, 255, 255, 0.035); }
.bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.bar-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 0.84rem; font-weight: 600; }
.flag-code {
  flex: 0 0 auto;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.45;
}
.bar-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-numbers { flex: 0 0 auto; font-size: 0.72rem; color: var(--muted-2); font-family: var(--font-mono); }
.bar-numbers strong { color: var(--text); font-weight: 700; }
.bar-track { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.055); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), var(--lime)); min-width: 3px; }
.bar-row.device .bar-fill { background: linear-gradient(90deg, #2b6fbd, var(--blue)); }

/* feed */
.feed { display: flex; flex-direction: column; padding: 6px 8px 10px; }
.feed-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 12px;
  transition: background 0.14s ease;
}
.feed-item:hover { background: rgba(255, 255, 255, 0.035); }
.feed-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.9rem;
}
.feed-icon.playback { color: var(--lime); background: rgba(155, 240, 11, 0.10); }
.feed-icon.search { color: var(--blue); background: rgba(87, 166, 255, 0.10); }
.feed-icon.like { color: var(--pink); background: rgba(255, 122, 182, 0.10); }
.feed-icon.app_open { color: #5bd65b; background: rgba(16, 124, 16, 0.16); }
.feed-icon.screen_view { color: var(--violet); background: rgba(177, 132, 255, 0.10); }
.feed-icon.collection_view { color: var(--amber); background: rgba(255, 200, 87, 0.10); }
.feed-main { min-width: 0; }
.feed-title { font-size: 0.84rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-meta { font-size: 0.71rem; color: var(--muted-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-time { font-size: 0.7rem; color: var(--muted-2); font-family: var(--font-mono); white-space: nowrap; text-align: right; }
.feed-time small { display: block; font-size: 0.64rem; color: #55555e; }

/* ---------------------------------------------------------------- misc */
.empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted-2);
  font-size: 0.83rem;
}
.empty strong { display: block; color: var(--muted); font-size: 0.9rem; margin-bottom: 4px; }

.skeleton {
  height: 46px;
  margin: 7px 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.035) 25%, rgba(255, 255, 255, 0.075) 37%, rgba(255, 255, 255, 0.035) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.select-wrap { position: relative; }
.select-wrap select {
  appearance: none;
  height: 33px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 11px; top: 50%;
  width: 6px; height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.page-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 2px 0;
  font-size: 0.69rem;
  color: #55555e;
}

/* ---------------------------------------------------------------- auth */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-shell { width: 100%; display: grid; place-items: center; }
.auth-card {
  width: min(410px, 100%);
  padding: 34px 30px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(175deg, #222226 0%, #19191c 100%);
  box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-brand h1 { font-family: var(--font-display); font-size: 1.28rem; font-weight: 700; }
.auth-brand h1 span { color: var(--lime); }
.auth-brand p { margin-top: 2px; font-size: 0.76rem; color: var(--muted-2); }
.auth-alert {
  margin-bottom: 16px;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255, 107, 107, 0.30);
  background: rgba(255, 107, 107, 0.09);
  color: #ffb0b0;
  font-size: 0.8rem;
}
.field { display: block; margin-bottom: 15px; }
.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.93rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus {
  outline: none;
  border-color: rgba(155, 240, 11, 0.55);
  box-shadow: 0 0 0 3px rgba(155, 240, 11, 0.10);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  border: 0;
  background: linear-gradient(180deg, var(--lime), #7fce06);
  color: #0b1a00;
  box-shadow: 0 8px 24px rgba(155, 240, 11, 0.18);
}
.btn-primary:hover { background: linear-gradient(180deg, #aaff1a, #8bdd08); }
.btn-block { width: 100%; margin-top: 6px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 0.7rem; color: #55555e; }

.error-code { font-family: var(--font-mono); font-size: 3.4rem; font-weight: 800; color: var(--lime); line-height: 1; }
.error-title { font-family: var(--font-display); font-size: 1.3rem; margin: 10px 0 6px; }
.error-copy { font-size: 0.84rem; color: var(--muted); margin-bottom: 20px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .metric-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mini:nth-child(5) { border-left: 0; }
  .mini:nth-child(n + 5) { border-top: 1px solid var(--line-soft); }
}

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 14px 18px; }
  .page { padding: 18px 18px 36px; }
  .mobile-logout { display: block; }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 14px 14px 13px; }
  .kpi-value { font-size: 1.55rem; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini { padding: 11px 13px; }
  .mini:nth-child(odd) { border-left: 0; }
  .mini:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .topbar { flex-wrap: wrap; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .range-switch { flex: 1; }
  .range-switch button { flex: 1; padding: 0 6px; }
  .chart { height: 250px; }
  .chart-legend { flex-direction: column; align-items: flex-start; gap: 4px; }
  .panel-head { padding: 13px 14px; }
  .feed-item { grid-template-columns: 30px minmax(0, 1fr); }
  .feed-time { display: none; }
  .page-foot { flex-direction: column; }
}
