/* Hartco Aurum Social — "Ask Aura". Light Aurum theme: cream / ink / gold.
   Desktop-first, responsive. */

:root {
  --bg: #faf8f4;          /* cream */
  --card: #ffffff;
  --ink: #151515;         /* near-black text */
  --muted: #6b6252;       /* warm grey */
  --border: #e7e0d2;      /* light warm border */
  --gold: #7a6234;        /* gold accent (text on light) */
  --gold-strong: #5e4a25;
  --gold-soft: #efe6d2;
  --danger: #9a3b2e;
  --danger-soft: #f6e2de;
  --success: #3d6b4f;
  --success-soft: #e0ece4;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(21, 21, 21, 0.06), 0 4px 14px rgba(21, 21, 21, 0.05);
}

* { box-sizing: border-box; }

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

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

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

/* ── shell ─────────────────────────────────────────────────────────── */

.shell { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-decoration: none;
}
.wordmark:hover { text-decoration: none; }
.wordmark-aura {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.wordmark-sub {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}
.nav-link:hover { background: var(--gold-soft); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--gold-soft); color: var(--gold-strong); font-weight: 600; }

.userbox { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--muted); font-size: 13px; }

.view {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px;
}

.view-loading { color: var(--muted); padding: 32px 0; }
.view-error {
  border: 1px solid var(--danger-soft);
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 20px;
}
.view-error-detail { font-size: 12px; opacity: 0.85; margin: 8px 0 0; white-space: pre-wrap; }

/* ── gate (login / setup) ──────────────────────────────────────────── */

.gate { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 36px;
}
.gate-wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold-strong);
  margin-bottom: 8px;
}
.gate-title { font-size: 22px; margin-bottom: 4px; }
.gate-subtitle { color: var(--muted); margin: 0 0 20px; }
.gate-form { display: flex; flex-direction: column; gap: 12px; }

/* ── forms ─────────────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 500; }

.input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.form-error { color: var(--danger); font-size: 13px; margin: 0; min-height: 1em; }

/* ── buttons ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-strong); border-color: var(--gold-strong); }

.btn-secondary { background: #fff; color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--gold); color: var(--gold-strong); }

.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--ink); border-color: var(--muted); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #7f2d23; border-color: #7f2d23; }

.btn-block { width: 100%; }
.btn-small { padding: 5px 10px; font-size: 13px; }

/* ── cards & layout ────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-header h2, .card-header h3 { margin: 0; }

.muted { color: var(--muted); }
.empty-state { color: var(--muted); text-align: center; padding: 40px 16px; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ── table ─────────────────────────────────────────────────────────── */

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}
.table tr:last-child td { border-bottom: none; }

/* ── badges ────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--bg);
  white-space: nowrap;
}
.badge-gold { background: var(--gold-soft); color: var(--gold-strong); border-color: var(--gold-soft); }
.badge-success { background: var(--success-soft); color: var(--success); border-color: var(--success-soft); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft); }

/* ── toasts ────────────────────────────────────────────────────────── */

#toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 14px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-out { opacity: 0; transform: translateY(6px); }

/* ── modal ─────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 21, 21, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 90;
}
.modal {
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 20px 22px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

/* ── responsive ────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .view { padding: 16px; }
  .card-header { flex-direction: column; align-items: flex-start; }
}
