/* Base styles for the User Counter app (served by the public counter-server).
   The admin dashboard ships its own copy at web/dashboard/styles.css — the two
   servers are deployed independently, so keep the copies in sync by hand. */

:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f0f1f6;
  --border: #e2e4ee;
  --text: #1a1c25;
  --text-dim: #666a7b;
  --brand: #4f46e5;
  --brand-dim: #6366f1;
  --new: #dc2626;
  --old: #475569;
  --on: #22c55e;
  --off: #cbd5e1;
  --danger: #ef4444;
  --shadow: 0 1px 3px rgba(20, 22, 40, 0.08), 0 8px 24px rgba(20, 22, 40, 0.06);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f16;
    --surface: #171922;
    --surface-2: #1f2230;
    --border: #2a2d3d;
    --text: #e9eaf2;
    --text-dim: #9aa0b4;
    --brand: #818cf8;
    --brand-dim: #6366f1;
    --old: #94a3b8;
    --off: #333849;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav .brand { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.nav .brand span { color: var(--brand); }

.container { max-width: 960px; margin: 0 auto; padding: 28px 20px 64px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card h2 { margin: 0 0 4px; font-size: 1.05rem; }
.card .subtitle { color: var(--text-dim); font-size: 0.9rem; margin: 0 0 18px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.badge.new { background: var(--new); color: #fff; border: none; }
.badge.old { background: var(--surface-2); color: var(--text-dim); }

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  transition: transform 0.05s ease, filter 0.15s ease, background 0.15s ease;
}
button:hover { filter: brightness(1.03); }
button:active { transform: translateY(1px); }
button.primary { background: var(--brand); border-color: transparent; color: #fff; }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.ghost { background: transparent; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.muted { color: var(--text-dim); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
