/* Veyra design system — black / white / gray, configurable accent, light + dark mode.
   Deliberately restrained: no gradients, no glassmorphism, minimal animation. */

:root {
  --accent: #2563eb; /* admin-configurable in a later phase; sensible default for now */
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --surface: #ffffff;
  --border: #e5e5e5;
  --text: #111111;
  --text-muted: #666666;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --container: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --bg-subtle: #111111;
    --surface: #151515;
    --border: #2a2a2a;
    --text: #f2f2f2;
    --text-muted: #a0a0a0;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-subtle: #111111;
  --surface: #151515;
  --border: #2a2a2a;
  --text: #f2f2f2;
  --text-muted: #a0a0a0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 50;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.wordmark { font-weight: 700; font-size: 1.25rem; letter-spacing: 0.02em; text-decoration: none; }
.wordmark span { color: var(--accent); }
nav.main-nav { display: flex; gap: 28px; }
nav.main-nav a { text-decoration: none; font-size: 0.95rem; color: var(--text-muted); }
nav.main-nav a:hover, nav.main-nav a:focus-visible { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; color: var(--text); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: var(--radius); font-size: 0.95rem; font-weight: 600;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { opacity: 0.85; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-subtle); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { opacity: 0.9; }

/* ---- Hero ---- */
.hero { padding: 96px 0 72px; border-bottom: 1px solid var(--border); }
.hero .eyebrow { color: var(--text-muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; }
.hero h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); margin: 0 0 16px; letter-spacing: -0.02em; }
.hero p { max-width: 640px; color: var(--text-muted); font-size: 1.1rem; margin: 0 0 32px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- Sections ---- */
section { padding: 72px 0; }
section.alt { background: var(--bg-subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 12px; }
.section-head h2 { font-size: 1.75rem; margin: 0; letter-spacing: -0.01em; }
.section-head p { color: var(--text-muted); margin: 4px 0 0; }

/* ---- Cards ---- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 24px; }
.card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card p { color: var(--text-muted); margin: 0; font-size: 0.95rem; }

/* ---- Empty states ---- */
.empty-state { text-align: center; padding: 64px 24px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-muted); }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }

/* ---- Forms ---- */
.form-card { max-width: 420px; margin: 64px auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; background: var(--surface); }
.form-card h1 { font-size: 1.4rem; margin-top: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.9rem; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 0.95rem;
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: var(--radius); padding: 10px 14px; font-size: 0.9rem; margin-bottom: 16px; display: none; }
[data-theme="dark"] .form-error, @media (prefers-color-scheme: dark) { .form-error { background: #2a1414; border-color: #5c1f1f; color: #fca5a5; } }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 0.85rem; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.form-footer { text-align: center; font-size: 0.9rem; color: var(--text-muted); margin-top: 16px; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); padding: 48px 0; margin-top: 48px; color: var(--text-muted); font-size: 0.9rem; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.site-footer a { text-decoration: none; color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

@media (max-width: 760px) {
  nav.main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ---- Admin shell ---- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; flex-shrink: 0; border-right: 1px solid var(--border); background: var(--bg-subtle);
  padding: 20px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .wordmark { display: block; padding: 8px 12px 20px; }
.admin-nav-group { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 16px 12px 6px; }
.admin-nav-link { display: block; padding: 8px 12px; border-radius: var(--radius); font-size: 0.9rem; text-decoration: none; color: var(--text); }
.admin-nav-link:hover { background: var(--border); }
.admin-nav-link.active { background: var(--text); color: var(--bg); }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar { border-bottom: 1px solid var(--border); padding: 16px 28px; display: flex; justify-content: space-between; align-items: center; }
.admin-content { padding: 28px; max-width: 1100px; }
@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; }
}

.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.85rem; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.admin-table th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table-scroll table.admin-table { border: none; }
.table-scroll table.admin-table th, .table-scroll table.admin-table td { white-space: nowrap; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed, .badge-completed, .badge-published, .badge-active { background: #dcfce7; color: #166534; }
.badge-rejected, .badge-disabled { background: #fee2e2; color: #991b1b; }
.badge-in_progress, .badge-not_started { background: #e5e7eb; color: #374151; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.toolbar input[type="text"], .toolbar select {
  padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.9rem;
}
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 28px; max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto; }
.modal h2 { margin-top: 0; }
.pagination { display: flex; gap: 8px; margin-top: 16px; align-items: center; }
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--text-muted); cursor: pointer;
}
.dropzone.dragover { border-color: var(--accent); color: var(--accent); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 20px; }
.media-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.media-item .thumb { aspect-ratio: 1; background: var(--bg-subtle); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-item .meta { padding: 8px 10px; font-size: 0.78rem; color: var(--text-muted); }
.media-item .meta button { font-size: 0.75rem; color: #b91c1c; background: none; border: none; cursor: pointer; padding: 0; }
