/* assets/css/statz.css — KISS admin look. Source Sans Pro, bright white,
   accent #3080a7, sidebar + main grid. */

:root {
  --accent: #3080a7;
  --accent-dark: #266a8c;
  --accent-hover: #3a91bb;
  --sidebar-bg: #f7f9fb;
  --sidebar-border: #e3e7eb;
  --main-bg: #ffffff;
  --text: #2d3a45;
  --muted: #7d8a96;
}

body {
  font-family: 'Source Sans Pro', sans-serif;
  color: var(--text);
  background: var(--main-bg);
  margin: 0;
}

/* ── Login page ──────────────────────────────────────────── */
body.statz-login {
  background: var(--sidebar-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.statz-login-box {
  background: #fff;
  padding: 2.5rem 2.25rem 2rem;
  border-radius: 6px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.statz-login-brand h1 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.statz-login-form { margin-top: 1.5rem; }

.statz-login-form .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}

.statz-login-form .btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.statz-login-form .btn-primary:active {
  background: var(--accent-dark) !important;
  border-color: var(--accent-dark) !important;
}

.statz-login-form label { font-weight: 600; font-size: 0.85rem; }

/* ── Layout ──────────────────────────────────────────────── */
.statz-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.statz-sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 1.125rem 0;        /* ~2px tighter than the original 1.25rem */
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;           /* if the nav ever outgrows the viewport */
}

.sidebar-brand {
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 0.75rem;
}
.sidebar-brand h2 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.sidebar-brand a { color: var(--accent); text-decoration: none; }

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
}
.sidebar-nav li a:hover { background: rgba(48, 128, 167, 0.06); }
.sidebar-nav li a.active {
  background: rgba(48, 128, 167, 0.12);
  border-left-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}

.sidebar-nav li.sidebar-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 0.5rem 1.25rem;
}

.sidebar-version {
  padding: 0.75rem 1.25rem 0;
  border-top: 1px solid var(--sidebar-border);
  font-size: 0.78rem;
  line-height: 1.4;
}

.statz-main {
  padding: 1.25rem 1.5rem 2rem;
  background: var(--main-bg);
  overflow-x: auto;
}

.statz-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1.25rem;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; }
.toolbar-left > label, .toolbar-right > label { white-space: nowrap; }   /* keep "History window:" and "Interval:" on one line */
.toolbar-divider { display: inline-block; width: 1px; height: 22px; background: var(--sidebar-border); margin: 0 0.75rem; }

.statz-pane { display: none; }
.statz-pane.active { display: block; }

/* ── Cards ───────────────────────────────────────────────── */
.statz-card {
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  margin-bottom: 1rem;
}
.statz-card .card-header {
  background: #fff;
  border-bottom: 1px solid var(--sidebar-border);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.statz-card .card-body { padding: 1rem; }

/* Lucide icon sizing in headers/buttons */
[data-lucide] { width: 1em; height: 1em; vertical-align: -0.15em; }
.card-header [data-lucide] { width: 1.1em; height: 1.1em; margin-right: 0.35rem; }

/* ── Buttons ─────────────────────────────────────────────── */
/* Rule: icons always sit left of the text. Use `.btn-icon-right`
   (sparingly) for the rare "Next"-style button where the arrow belongs
   on the right. Clicks must NOT change geometry: no transform on
   :active, no box-shadow shift on focus. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;             /* keep icon + label on a single line */
  transition: background-color 120ms linear, border-color 120ms linear, color 120ms linear, opacity 120ms linear;
  transform: none !important;       /* kill Bootstrap's :active translate */
}

.btn:active,
.btn:focus,
.btn.active {
  transform: none !important;
}

.btn:focus,
.btn:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
  box-shadow: none !important;
}

/* Icon inside a button: always to the left by default. */
.btn [data-lucide] {
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  order: 1;
}

/* Label text: order 2 (after the icon). */
.btn .btn-label {
  order: 2;
}

/* Right-side icon override for the rare "Next" / "Continue" style. */
.btn.btn-icon-right [data-lucide] { order: 2; margin-left: 0.2rem; margin-right: 0; }
.btn.btn-icon-right .btn-label    { order: 1; }

/* Primary */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-primary:active,
.btn-primary:focus,
.btn-primary:focus-visible {
  background: var(--accent-dark) !important;
  border-color: var(--accent-dark) !important;
  box-shadow: none !important;
}

/* Outline (Live Stats toggle) */
.btn-outline-secondary { color: var(--text); }
.btn-outline-secondary:hover {
  background: rgba(48, 128, 167, 0.08);
  color: var(--accent-dark);
}
.btn-outline-secondary[data-live="on"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-outline-secondary[data-live="on"]:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-outline-secondary:active,
.btn-outline-secondary:focus,
.btn-outline-secondary:focus-visible {
  background: var(--accent-dark) !important;
  border-color: var(--accent-dark) !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* Live-only controls */
.live-only { display: none; }

/* ── Table polish ────────────────────────────────────────── */
#table-samples td, #table-samples th { font-size: 0.85rem; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}
