/* ============================================================
   Post Oak Hub — client admin portal + owner dashboard
   Headline: Fraunces · Body: Inter (matches events-hub)
   ============================================================ */

:root {
  --green-900: #12362a;
  --green-800: #17452f;
  --green-700: #1e5c46;
  --green-600: #2a7a5c;
  --green-100: #e3efe8;
  --cream: #faf7f1;
  --cream-dark: #f2ecdf;
  --ink: #24312b;
  --ink-soft: #55645c;
  --gold: #c9a24b;
  --gold-soft: #f3e8cf;
  --red: #a4432f;
  --red-soft: #f6e2dc;
  --blue-soft: #e5ecf6;
  --blue: #2c4f7c;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(18, 54, 42, 0.08);
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-head); color: var(--green-900); line-height: 1.15; font-weight: 600; }
h2 { font-size: 1.6rem; margin-bottom: 4px; }
h3 { font-size: 1.1rem; }

.container { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 640px; }

.hidden { display: none !important; }
.muted { color: var(--ink-soft); font-weight: 400; font-size: 0.85rem; }

/* ---------- Login / centered cards ---------- */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-card h1 { font-size: 1.4rem; margin-bottom: 4px; }
.login-card p { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 22px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Header ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 247, 241, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(18, 54, 42, 0.08);
}
.app-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { font-family: var(--font-head); font-size: 1.15rem; color: var(--green-900); }
.brand .muted { font-family: var(--font-body); }
.header-actions { display: flex; align-items: center; gap: 10px; }

.tabs { display: flex; gap: 4px; }
.tab {
  border: 0; background: none; cursor: pointer;
  font: 600 0.9rem var(--font-body); color: var(--ink-soft);
  padding: 8px 14px; border-radius: 10px;
}
.tab:hover { background: var(--cream-dark); }
.tab.active { background: var(--green-900); color: var(--white); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px;
  font: 600 0.9rem var(--font-body);
  padding: 10px 18px; cursor: pointer; text-decoration: none;
  transition: background 0.15s ease;
}
.btn-primary { background: var(--green-900); color: var(--white); }
.btn-primary:hover { background: var(--green-800); }
.btn-secondary { background: var(--gold-soft); color: var(--green-900); }
.btn-secondary:hover { background: #ecdcb4; }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--cream-dark); color: var(--ink); }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Cards / forms ---------- */

main.container, main.container.narrow { padding-top: 28px; padding-bottom: 60px; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.view-head p { color: var(--ink-soft); font-size: 0.9rem; }

.card {
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}

.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; }
.field .help { color: var(--ink-soft); font-size: 0.84rem; margin: -2px 0 8px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], select, textarea {
  width: 100%;
  border: 1px solid #dcd6c6;
  border-radius: 10px;
  background: var(--white);
  font: 400 0.95rem var(--font-body);
  color: var(--ink);
  padding: 10px 12px;
}
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green-600); outline-offset: 0; border-color: var(--green-600); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 0.92rem; }
.check input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.form-error { color: var(--red); font-size: 0.88rem; margin-top: 10px; min-height: 1.2em; }

/* ---------- Category option buttons (portal) ---------- */

.option-list { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.option-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--blue-soft); border: 1px solid transparent; border-radius: 10px;
  padding: 12px 14px;
  font: 500 0.95rem var(--font-body); color: var(--blue);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.option-btn:hover { border-color: var(--blue); }
.option-btn.selected { background: var(--green-100); border-color: var(--green-700); color: var(--green-900); }
.option-key {
  flex: 0 0 auto;
  width: 26px; height: 26px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--white); border: 1px solid currentColor;
  font-size: 0.78rem; font-weight: 700;
}

/* ---------- Module tiles (portal) ---------- */

.tile-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile {
  display: block; text-decoration: none;
  background: var(--white); border: 1px solid var(--cream-dark); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.tile:hover { transform: translateY(-2px); border-color: var(--gold); }
.tile h3 { margin-bottom: 2px; }
.tile p { color: var(--ink-soft); font-size: 0.85rem; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th {
  text-align: left; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--cream-dark);
}
td { padding: 10px; border-bottom: 1px solid #f4f0e6; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; }
.row-main { cursor: pointer; }
.row-main:hover td { background: #fdfbf6; }
.row-detail td { background: #fdfbf6; padding: 14px 16px; }
.row-detail .detail-block { white-space: pre-wrap; font-size: 0.92rem; }
.row-detail .detail-meta { color: var(--ink-soft); font-size: 0.84rem; margin-bottom: 8px; }

/* ---------- Badges ---------- */

.badge {
  display: inline-block; border-radius: 999px;
  font-size: 0.74rem; font-weight: 600;
  padding: 3px 10px; white-space: nowrap;
}
.badge-new { background: var(--gold-soft); color: #7a5d1d; }
.badge-in_progress { background: var(--blue-soft); color: var(--blue); }
.badge-done { background: var(--green-100); color: var(--green-800); }
.badge-archived { background: var(--red-soft); color: var(--red); }

select.status-select { width: auto; padding: 5px 8px; font-size: 0.84rem; border-radius: 8px; }

/* ---------- Toast ---------- */

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--green-900); color: var(--white);
  font-size: 0.9rem; padding: 10px 20px; border-radius: 999px;
  opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Portal success ---------- */

.success-card { text-align: center; padding: 40px 24px; }
.success-card .mark {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--green-100); color: var(--green-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin-bottom: 12px;
}
.success-card p { color: var(--ink-soft); margin: 6px 0 18px; }
