/* ShiftStack App — Dark Theme */

:root {
  --bg: #0e0e0e;
  --bg-alt: #141414;
  --bg-card: #1a1a1a;
  --fg: #f0ede8;
  --fg-muted: rgba(240, 237, 232, 0.55);
  --accent: #ff4d00;
  --accent-dim: rgba(255, 77, 0, 0.12);
  --border: rgba(255, 77, 0, 0.18);
  --radius: 12px;
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --green: #22c55e;
  --red: #ef4444;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* ── Header ──────────────────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(14,14,14,0.85);
  backdrop-filter: blur(12px);
  height: 60px;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }
.header-nav { display: flex; gap: 24px; }
.header-nav a {
  color: var(--fg-muted);
  font-size: 0.875rem;
  transition: color 0.2s;
}
.header-nav a:hover, .header-nav a.active { color: var(--fg); text-decoration: none; }

/* ── Page layout ─────────────────────────────────────────────────────────────── */
.page-wrapper {
  padding-top: 60px;
  min-height: 100vh;
}
.page-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ── Typography ──────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }
h1 { font-size: 1.875rem; font-weight: 700; margin-bottom: 8px; }
h2 { font-size: 1.375rem; font-weight: 600; margin-bottom: 6px; }
h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 4px; }
.page-title { margin-bottom: 32px; }
.page-title p { color: var(--fg-muted); font-size: 0.9rem; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 16px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-header h2 { margin: 0; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: #e64400; }
.btn-secondary {
  background: var(--bg-alt);
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #1e1e1e; }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-danger { background: var(--red); color: white; }

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--fg);
  transition: border-color 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 0.78rem; color: var(--fg-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Range sliders */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-alt);
  border-radius: 2px;
  border: none;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 4px;
}
.range-value {
  text-align: center;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
}

/* ── Step indicator ──────────────────────────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--fg-muted);
}
.step.active { color: var(--fg); font-weight: 600; }
.step.done { color: var(--green); }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}
.step.active .step-num { background: var(--accent); border-color: var(--accent); color: white; }
.step.done .step-num { background: var(--green); border-color: var(--green); color: white; }
.step-line { flex: 1; height: 1px; background: var(--border); margin: 0 12px; }

/* ── Client list ─────────────────────────────────────────────────────────────── */
.clients-list { list-style: none; }
.client-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.client-card:hover { border-color: var(--accent); }
.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-right: 14px;
}
.client-info { flex: 1; min-width: 0; }
.client-name { font-weight: 600; font-size: 0.95rem; }
.client-meta { font-size: 0.8rem; color: var(--fg-muted); margin-top: 2px; }
.client-badge {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.badge-active { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-pending { background: var(--accent-dim); color: var(--accent); }

/* ── Monitoring ──────────────────────────────────────────────────────────────── */
.monitoring-hero {
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  margin-bottom: 28px;
}
.monitoring-hero .emoji { font-size: 3rem; margin-bottom: 12px; display: block; }
.monitoring-hero h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 8px; }
.monitoring-hero p { color: var(--fg-muted); font-size: 0.9rem; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.75rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* Check-in form */
.checkin-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.checkin-form h3 { margin-bottom: 20px; }

/* Check-in history */
.checkin-list { margin-top: 28px; }
.checkin-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
}
.checkin-entry-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.checkin-entry-date { font-size: 0.78rem; color: var(--fg-muted); }
.checkin-metrics { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.checkin-metric { font-size: 0.82rem; }
.checkin-metric strong { color: var(--accent); }
.checkin-notes { font-size: 0.85rem; color: var(--fg-muted); font-style: italic; }
.checkin-ai { margin-top: 10px; padding: 12px; background: var(--accent-dim); border-radius: 8px; font-size: 0.82rem; border-left: 3px solid var(--accent); }

/* ── Empty states ────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--fg-muted); }
.empty-state h3 { color: var(--fg); margin-bottom: 8px; }

/* ── Frequency selector ──────────────────────────────────────────────────────── */
.freq-options { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.freq-option {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--bg-alt);
  color: var(--fg-muted);
  transition: all 0.15s;
}
.freq-option:hover, .freq-option.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--fg);
}

/* ── Program structure ────────────────────────────────────────────────────────── */
.program-structure textarea { min-height: 120px; }

/* ── 404 ────────────────────────────────────────────────────────────────────── */
.not-found { text-align: center; padding: 80px 24px; }
.not-found h1 { font-size: 5rem; color: var(--accent); margin-bottom: 16px; }
.not-found p { color: var(--fg-muted); margin-bottom: 24px; }

/* ── Toast / alerts ─────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}
.alert-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: var(--green); }
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .page-content { padding: 24px 16px; }
}