/* Tokens copied verbatim from Customer/static/css/base.css — keep in sync. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0d14;
  --surface: #131720;
  --surface-2: #1a1f2e;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --text-fainter: #475569;
  --accent: #14b8a6;
  --teal: #14b8a6;
  --amber: #f59e0b;
  --green: #22c55e;
  --red: #ef4444;
  --purple: #a78bfa;
  --radius: 10px;
}

html { color-scheme: dark; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.btn-ghost {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px; font-size: 12px; font-weight: 500;
  transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.btn-ghost.active {
  background: var(--surface-2); border-color: var(--border-strong); color: var(--text);
}
.btn-ghost.danger { color: var(--red); }
.btn-ghost.danger:hover { border-color: var(--red); background: rgba(239, 68, 68, .08); }

.btn-primary {
  background: var(--accent); color: #04212a;
  border: none; border-radius: 8px;
  padding: 10px 20px; font-size: 13px; font-weight: 600;
}
.btn-primary:hover { background: #0d9488; }

/* ── shell ──────────────────────────────────────────────────────────── */
/* Top padding clears the fixed .topbar below (its own height + breathing
   room) so page content never starts underneath it. */
.shell { max-width: 1200px; margin: 0 auto; padding: 100px 20px 64px; }

/* Truly fixed (not sticky) — pinned to the viewport at all times, taken
   out of normal flow, so it's visible on every scroll position and reads
   identically across Dashboard/Agents/Sync status. Full-bleed background
   with an inner max-width so it lines up with .shell's content. */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar nav { display: flex; align-items: center; gap: 12px; }
.topbar .who { color: var(--text-faint); font-size: 12px; }

.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: #04212a;
  background: linear-gradient(135deg, var(--teal), var(--purple));
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}

/* ── log form ───────────────────────────────────────────────────────── */
.log-row {
  display: grid; grid-template-columns: 170px 78px 1fr;
  gap: 12px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.log-row:last-of-type { border-bottom: none; }
.log-row label { color: var(--text-dim); font-size: 13px; }

/* Two-column label/input row (agent-tracker addition) — for forms like
   "Add an agent" where log-row's 3-column layout (built for a label + a
   narrow qty field + a note) squeezes the actual input into a ~78px
   column and truncates it. */
.form-row {
  display: grid; grid-template-columns: 170px 1fr;
  gap: 12px; align-items: center; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.form-row:last-of-type { border-bottom: none; }
.form-row label { color: var(--text-dim); font-size: 13px; }

input[type="number"], input[type="text"], input[type="date"], select {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-family: inherit; font-size: 13px; width: 100%;
  color-scheme: dark;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ── period picker (agent-tracker addition) ───────────────────────────── */
.period-picker {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px;
}
.period-picker form {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
}
.period-picker label {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-dim); font-size: 13px;
}
.period-picker input[type="date"] { width: auto; min-width: 150px; }
.period-picker .range {
  margin-left: auto; color: var(--text-dim); font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.form-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

.flash {
  border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; font-size: 13px;
  border: 1px solid var(--border-strong);
}
.flash-ok { color: var(--green); border-color: rgba(34, 197, 94, .35); }
.flash-error { color: var(--red); border-color: rgba(239, 68, 68, .35); }

/* ── week listings ──────────────────────────────────────────────────── */
.week-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 12px;
}
.week-nav .range { font-weight: 600; }
.week-actions { display: flex; gap: 8px; }

.editor-block { margin-bottom: 26px; }
.editor-head {
  font-weight: 600; letter-spacing: .02em;
  padding-bottom: 8px; border-bottom: 1px solid var(--border-strong);
  margin-bottom: 8px;
}
.editor-head .totals { color: var(--teal); font-weight: 500; }

.day-row {
  display: grid; grid-template-columns: 110px 1fr auto;
  gap: 12px; padding: 5px 0; align-items: baseline;
}
.day-row .date { color: var(--text-faint); font-variant-numeric: tabular-nums; }
.day-row .empty { color: var(--text-fainter); font-style: italic; }
.day-note { color: var(--text-faint); font-size: 12px; padding-left: 122px; }

.edited-badge {
  color: var(--amber); font-size: 11px; border: 1px solid rgba(245, 158, 11, .35);
  border-radius: 999px; padding: 1px 7px;
}

/* ── login ──────────────────────────────────────────────────────────── */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 36px 32px; text-align: center;
  max-width: 360px; width: 100%;
}
.login-card .brand-mark { margin: 0 auto 18px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card p { color: var(--text-dim); margin-bottom: 22px; }
.login-card small { display: block; margin-top: 16px; color: var(--text-fainter); }

.google-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; background: #fff; color: #1f2328;
  border-radius: 8px; padding: 11px 16px; font-weight: 600; font-size: 14px;
}
.google-button:hover { background: #f1f3f5; text-decoration: none; }

/* ── metrics / admin tables (agent-tracker addition) ───────────────────── */
.metrics-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.metrics-table th, .metrics-table td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.metrics-table th { color: var(--text-dim); font-weight: 600; font-size: 12px; }
.metrics-table td.num, .metrics-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.metrics-table tr.totals-row td { font-weight: 600; border-top: 1px solid var(--border-strong); border-bottom: none; }
.metrics-table td.empty-cell { color: var(--text-fainter); font-style: italic; }

.banner {
  border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; font-size: 13px;
  border: 1px solid rgba(245, 158, 11, .35); color: var(--amber);
}
.banner-error { border-color: rgba(239, 68, 68, .35); color: var(--red); }

.status-success { color: var(--green); }
.status-partial { color: var(--amber); }
.status-failed { color: var(--red); }
