/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #f4f4f0;
  --surface:    #ffffff;
  --border:     #e4e4e0;
  --text:       #1a1a1a;
  --text-muted: #777;
  --accent:     #2d6a4f;
  --accent-hover: #1f4d39;
  --danger:     #c0392b;
  --success:    #2d6a4f;
  --radius:     10px;
  --shadow:     0 2px 12px rgba(0,0,0,0.07);
  --font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: #1a1a1a;
  padding: 16px 0;
  border-bottom: 1px solid #2a2a2a;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .brand {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-header .brand small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 1px;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-header nav a {
  color: #aaa;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s;
}

.site-header nav a:hover { color: #fff; text-decoration: none; }

/* ─── Page hero ──────────────────────────────────────────────────────────── */
.page-hero {
  padding: 64px 0 48px;
  text-align: center;
}

.page-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.page-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 400;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea { resize: vertical; min-height: 90px; }

.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 28px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Radio / checkbox groups */
.radio-group, .check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.radio-group label, .check-group label {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.radio-group label:hover, .check-group label:hover {
  border-color: var(--accent);
  background: #fff;
}

.radio-group input, .check-group input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.radio-group label:has(input:checked),
.check-group label:has(input:checked) {
  border-color: var(--accent);
  background: #edf7f2;
  color: var(--accent);
  font-weight: 600;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); text-decoration: none; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; text-decoration: none; color: #fff; }

.btn-full { width: 100%; text-align: center; padding: 13px; font-size: 15px; }

/* ─── Flash messages ─────────────────────────────────────────────────────── */
.flash {
  padding: 12px 16px;
  border-radius: 7px;
  font-size: 14px;
  margin-bottom: 20px;
}

.flash-error   { background: #fdf0ef; border: 1px solid #f5c6c2; color: var(--danger); }
.flash-success { background: #edf7f2; border: 1px solid #b7dfca; color: var(--success); }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafaf8; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-active  { background: #edf7f2; color: var(--success); }
.badge-inactive { background: #f4f4f0; color: var(--text-muted); }
.badge-admin   { background: #1a1a1a; color: #fff; }

/* ─── Login page ─────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
}

.login-box {
  width: 100%;
  max-width: 400px;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-brand p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 80px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); text-decoration: none; }

/* ─── Utility ────────────────────────────────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0  { margin-bottom: 0; }
.text-muted  { color: var(--text-muted); font-size: 13px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
