/* Majlis design system — extracted from brand preview */
:root {
  --ink: #0F1A2E;
  --ink-soft: #1E2A42;
  --ink-muted: #4A5468;
  --cream: #F7F3EB;
  --cream-soft: #FBF8F2;
  --paper: #FFFFFF;
  --gold: #B08D57;
  --gold-soft: #D4B888;
  --gold-dim: #8E7044;
  --sage: #6B7F6B;
  --sage-soft: #8FA18F;
  --burgundy: #6B2D2D;
  --line: #E5DFD1;
  --line-soft: #EFEAE0;
  --danger: #8E3A3A;
  --success: #3F5F47;
  --radius: 3px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.auth { background: var(--cream); }

main { flex: 1; }

.serif { font-family: 'Fraunces', Georgia, serif; }
.arabic { font-family: 'IBM Plex Sans Arabic', 'Noto Naskh Arabic', sans-serif; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; letter-spacing: 0.05em; }

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

/* ───── NAV ───── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 243, 235, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 2.5rem;
  max-width: 1280px;
  margin: 0 auto;
}
.wordmark {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
}
.wordmark:hover { color: var(--ink); }
.wordmark-seal { display: inline-flex; }
.nav-right { display: flex; align-items: center; gap: 1.25rem; }
.nav-user { font-size: 0.85rem; color: var(--ink-muted); }
.nav-link { font-size: 0.85rem; color: var(--ink-muted); }
.nav-link:hover { color: var(--ink); }
.nav-cta {
  padding: 0.5rem 1.1rem;
  background: var(--ink);
  color: var(--cream);
  border-radius: 2px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.nav-cta:hover { background: var(--ink-soft); color: var(--cream); }
.btn-link {
  background: none;
  border: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}
.btn-link:hover { color: var(--ink); }

/* ───── LAYOUT ───── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2.5rem;
}
.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* ───── HEADERS ───── */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}
.page-head h1 {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.page-head .sub {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-top: 0.4rem;
}
.breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--ink-muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { color: var(--gold); margin: 0 0.4rem; }

/* ───── BUTTONS ───── */
.btn-primary, .btn-ghost, .btn-gold, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 2px;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover { background: var(--ink-soft); color: var(--cream); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); }
.btn-gold { background: var(--gold); color: var(--cream); }
.btn-gold:hover { background: var(--gold-dim); color: var(--cream); }
.btn-danger { background: transparent; color: var(--burgundy); border-color: var(--burgundy); }
.btn-danger:hover { background: var(--burgundy); color: var(--cream); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }

/* ───── FORMS ───── */
.form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 520px;
  margin: 2rem auto;
}
.form-card h2 {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.form-card .form-sub {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}
.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="datetime-local"],
.field textarea,
.field select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--cream-soft);
  outline: none;
  transition: border-color 0.15s;
  color: var(--ink);
}
.field textarea { min-height: 90px; resize: vertical; font-family: inherit; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); background: var(--paper); }
.field .hint { font-size: 0.75rem; color: var(--ink-muted); margin-top: 0.35rem; }
.field-inline { display: flex; gap: 0.75rem; }
.field-inline > * { flex: 1; }

.color-picker {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.25rem;
}
.color-opt {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--line);
  transition: transform 0.15s;
}
.color-opt.selected { transform: scale(1.1); border-color: var(--ink); }
.color-ink { background: var(--ink); }
.color-gold { background: var(--gold); }
.color-sage { background: var(--sage); }
.color-burgundy { background: var(--burgundy); }
.color-opt input { display: none; }

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.form-actions-right { display: flex; gap: 0.75rem; }

.form-error {
  padding: 0.75rem 1rem;
  background: rgba(107, 45, 45, 0.08);
  border-left: 3px solid var(--burgundy);
  color: var(--burgundy);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  border-radius: 2px;
}

/* ───── ENTITY CARDS ───── */
.entities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.entity-card {
  padding: 1.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.2s;
  text-decoration: none;
  color: var(--ink);
  display: block;
}
.entity-card:hover {
  border-color: var(--gold-soft);
  transform: translateY(-2px);
  color: var(--ink);
  box-shadow: 0 12px 24px -12px rgba(15, 26, 46, 0.1);
}
.entity-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.entity-logo {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.entity-logo.gold { background: var(--gold); }
.entity-logo.sage { background: var(--sage); }
.entity-logo.burgundy { background: var(--burgundy); }
.entity-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  padding: 0.2rem 0.5rem;
  background: rgba(176, 141, 87, 0.1);
  border-radius: 2px;
}
.entity-name {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.15;
  margin-bottom: 0.25rem;
}
.entity-name-ar {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  direction: rtl;
  text-align: left;
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}
.entity-stats {
  display: flex;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}
.stat-item { font-size: 0.8rem; }
.stat-num {
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ink);
  display: block;
  line-height: 1;
  margin-bottom: 0.2rem;
}
.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Empty state */
.empty-card {
  padding: 3rem 2rem;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.empty-card h3 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}
.empty-card p {
  color: var(--ink-muted);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

/* ───── COMMITTEE / MEETING ROWS ───── */
.section-block { margin-bottom: 3rem; }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.section-heading h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1.5rem;
}
.section-heading .mono { color: var(--ink-muted); }

.row-list { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s;
}
.row:first-child { border-top: 0; }
.row:hover { background: var(--cream-soft); color: var(--ink); }
.row-main { flex: 1; }
.row-title {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.25;
}
.row-sub {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}
.row-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
}

/* ───── BADGES ───── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-gold { background: rgba(176, 141, 87, 0.12); color: var(--gold-dim); }
.badge-sage { background: rgba(107, 127, 107, 0.12); color: var(--sage); }
.badge-ink { background: rgba(15, 26, 46, 0.08); color: var(--ink); }
.badge-burgundy { background: rgba(107, 45, 45, 0.1); color: var(--burgundy); }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; }

/* ───── MEETING DETAIL ───── */
.meeting-head .title {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 2.1rem;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 0.4rem;
}
.meeting-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  align-items: center;
  flex-wrap: wrap;
}
.meeting-meta .dot-sep { color: var(--gold); }

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin: 2rem 0;
}
.tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
}
.tab.active {
  color: var(--ink);
  border-bottom-color: var(--gold);
  font-weight: 500;
}
.tab:hover { color: var(--ink); }

.panel-placeholder {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* ───── LANDING ───── */
.landing-hero {
  padding: 8rem 0 6rem;
}
.landing-hero h1 {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  max-width: 22ch;
  margin-bottom: 1.5rem;
}
.landing-hero h1 em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}
.landing-hero .hero-ar {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  direction: rtl;
  font-size: 1.35rem;
  color: var(--ink-soft);
  margin-bottom: 1.75rem;
  padding-right: 1rem;
  border-right: 2px solid var(--gold);
  display: inline-block;
}
.landing-hero .hero-sub {
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 36rem;
  margin-bottom: 2.5rem;
}
.landing-hero .hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ───── FOOTER ───── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0;
  margin-top: 4rem;
  color: var(--ink-muted);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

/* ───── RESPONSIVE ───── */
@media (max-width: 800px) {
  .nav-inner, .container, .container-narrow, .footer-inner { padding: 0 1.25rem; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .landing-hero { padding: 4rem 0 3rem; }
  .entities-grid { grid-template-columns: 1fr; }
  .form-card { padding: 1.75rem; }
}
