/* UAS Institutional Platform — Design System */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f6f7f9;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbfc;
  --bg-input: #ffffff;
  --border: #d8dde5;
  --border-focus: #8896a8;
  --text: #1a2332;
  --text-dim: #4a5568;
  --text-faint: #8896a8;
  --accent: #1b4965;
  --accent-light: #2d6a8f;
  --accent-glow: rgba(27,73,101,0.06);
  --gold: #b8860b;
  --gold-light: #d4a843;
  --gold-bg: rgba(184,134,11,0.08);
  --success: #2d6a4f;
  --warning: #b45309;
  --danger: #b91c1c;
  --info: #1e6091;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
}

[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbfc;
  --bg-input: #ffffff;
  --border: #d8dde5;
  --border-focus: #8896a8;
  --text: #1a2332;
  --text-dim: #4a5568;
  --text-faint: #8896a8;
  --accent: #1b4965;
  --accent-light: #2d6a8f;
  --accent-glow: rgba(27,73,101,0.06);
  --gold: #b8860b;
  --gold-light: #d4a843;
  --gold-bg: rgba(184,134,11,0.08);
  --success: #2d6a4f;
  --warning: #b45309;
  --danger: #b91c1c;
  --info: #1e6091;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #253247;
  --bg-input: #1e293b;
  --border: #334155;
  --border-focus: #64748b;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --accent: #93b4d4;
  --accent-light: #b0cde0;
  --accent-glow: rgba(147,180,212,0.1);
  --gold: #d4a843;
  --gold-light: #e8c66a;
  --gold-bg: rgba(212,168,67,0.12);
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #38bdf8;
  --shadow: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
}

/* ============ Base ============ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text);
  line-height: 1.3;
}

a { color: var(--accent); }
a:hover { color: var(--accent-light); }

/* ============ Layout ============ */

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; }

/* ============ Cards ============ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--border-focus); box-shadow: var(--shadow-md); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.card-title { font-size: 1.1rem; font-weight: 600; }
.card-subtitle { font-size: 0.85rem; color: var(--text-dim); }

/* ============ Stats ============ */

.stat { text-align: center; padding: 1.5rem; }
.stat-value { font-size: 2.2rem; font-weight: 700; color: var(--accent); font-family: var(--font-heading); }
.stat-label { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.25rem; }

/* ============ Badges ============ */

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-draft { background: #e5e7eb; color: #4b5563; }
.badge-submitted { background: #dbeafe; color: #1e40af; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-published { background: #d1fae5; color: #065f46; }
.badge-voting { background: #fef3c7; color: #92400e; }
.badge-passed { background: #d1fae5; color: #065f46; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #e5e7eb; color: #6b7280; }
.badge-overdue { background: #fee2e2; color: #991b1b; }
.badge-observing { background: var(--gold-bg); color: var(--gold); font-weight: 600; text-transform: none; letter-spacing: 0; padding: 0.2rem 0.5rem; font-size: 0.72rem; }
.badge-governance { background: rgba(30,96,145,0.12); color: var(--info); }
.badge-committee { background: rgba(30,96,145,0.12); color: var(--info); }
.badge-administrative { background: rgba(184,134,11,0.12); color: var(--gold); }
.badge-working_group { background: rgba(124,58,237,0.12); color: #7c3aed; }
.badge-dissolved { background: #e5e7eb; color: #6b7280; }

/* ============ Buttons ============ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-light); border-color: var(--accent-light); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-accent { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-accent:hover { opacity: 0.85; color: #fff; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.72rem; }
.btn-lg { padding: 0.75rem 1.6rem; font-size: 0.95rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ Forms ============ */

.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.35rem; color: var(--text-dim); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-textarea { min-height: 100px; resize: vertical; }

/* ============ Tables ============ */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.65rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.78rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: var(--accent-glow); }

/* ============ Navigation ============ */

.nav {
  display: flex;
  align-items: center;
  padding: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav .container {
  display: flex;
  align-items: center;
  width: 100%;
  padding-top: 0;
  padding-bottom: 0;
  gap: 1rem;
}
.nav-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  padding: 0.65rem 0;
  flex-shrink: 0;
}
.nav-logo { height: 30px; width: auto; border-radius: 50%; filter: invert(1); }
.nav-links {
  display: flex;
  gap: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
}
.nav-link {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.84rem;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--accent-glow); }
.nav-link.active { color: var(--accent); font-weight: 500; }
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.nav-user { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text-dim); flex-shrink: 0; }
.nav-burger { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 0.35rem 0.6rem; font-size: 1rem; line-height: 1; cursor: pointer; flex-shrink: 0; }
.nav-burger:hover { background: var(--accent-glow); }
@media (max-width: 900px) {
  .nav .container { flex-wrap: wrap; padding-top: 0.4rem; padding-bottom: 0.4rem; }
  .nav-burger { display: inline-flex; align-items: center; margin-left: auto; }
  .nav-links {
    display: none;
    order: 10;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 0.25rem;
    border-top: 1px solid var(--border);
    margin-top: 0.4rem;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links .nav-link { padding: 0.6rem 0.5rem; width: 100%; text-align: left; }
  .nav-right { margin-left: auto; }
  .nav-user { display: none; }
  .nav.open .nav-user { display: flex; }
}
@media (min-width: 901px) {
}

/* ============ Notification bell ============ */

.nav-bell { position: relative; margin-left: auto; }
.bell-btn { position: relative; background: none; border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 0.35rem 0.6rem; font-size: 1rem; line-height: 1; cursor: pointer; }
.bell-btn:hover { background: var(--accent-glow); }
.bell-badge { position: absolute; top: -0.45rem; right: -0.45rem; background: var(--danger); color: #fff; font-size: 0.65rem; font-weight: 700; line-height: 1; padding: 0.2rem 0.35rem; border-radius: 999px; min-width: 1.05rem; text-align: center; }
.bell-panel { display: none; position: absolute; right: 0; top: calc(100% + 0.5rem); width: 320px; max-height: 420px; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); z-index: 100; }
.bell-panel::before { content: ''; position: absolute; top: -6px; right: 14px; width: 10px; height: 10px; background: var(--bg-card); border-left: 1px solid var(--border); border-top: 1px solid var(--border); transform: rotate(45deg); }
.bell-items { max-height: 340px; overflow-y: auto; }
.bell-item { display: block; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.bell-item:hover { background: var(--accent-glow); }
.bell-item.unread { background: var(--gold-bg); }
.bell-item-title { font-size: 0.85rem; font-weight: 600; }
.bell-item-body { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.15rem; }
.bell-item-time { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.2rem; }
.bell-empty { padding: 1.25rem; text-align: center; color: var(--text-dim); font-size: 0.85rem; }
.bell-read-all { display: block; width: 100%; border: 0; border-top: 1px solid var(--border); background: none; color: var(--accent); font-size: 0.8rem; padding: 0.5rem; cursor: pointer; }
.bell-read-all:hover { text-decoration: underline; }

/* ============ Pending items list ============ */

.pending-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
  transition: border-color 0.15s;
  background: var(--bg-card);
}
.pending-item:hover { border-color: var(--border-focus); }
.pending-item-type { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; color: var(--gold); min-width: 80px; }
.pending-item-title { flex: 1; font-weight: 500; }
.pending-item-meta { font-size: 0.8rem; color: var(--text-dim); text-align: right; }
.pending-item-age { font-size: 0.75rem; color: var(--text-faint); }
.pending-item-age.overdue { color: var(--danger); font-weight: 600; }
.pending-item-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* ============ Footer ============ */

.site-footer {
  background: var(--accent);
  color: rgba(255,255,255,0.85);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}
.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand { font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; color: #fff; margin-bottom: 0.75rem; }
.footer-desc { font-size: 0.85rem; line-height: 1.6; color: rgba(255,255,255,0.7); }
.footer-heading { font-family: var(--font); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.5); margin-bottom: 0.75rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.4rem; }
.footer-links a { font-size: 0.85rem; color: rgba(255,255,255,0.75); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* ============ Utility ============ */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.85rem; }
.text-center { text-align: center; }
.hidden { display: none; }
.loading { opacity: 0.5; pointer-events: none; }

/* ============ Tabs ============ */

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab { padding: 0.6rem 1rem; border-bottom: 2px solid transparent; color: var(--text-dim); cursor: pointer; font-size: 0.9rem; transition: all 0.15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-disabled { opacity: 0.4; pointer-events: none; }
.tab-disabled:hover { background: transparent; color: var(--text-dim); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============ Modal ============ */

.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-close { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1.2rem; }
.badge-applied { background: #d1fae5; color: #065f46; }

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* ============ Icons (inline SVG) ============ */

.icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-inline.icon-sm { width: 0.875em; height: 0.875em; }
.icon-inline.icon-lg { width: 1.25em; height: 1.25em; }

/* ============ Card Images ============ */

.card-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: block;
}
.card-thumb-sm { height: 140px; }
.card-thumb-header {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: block;
}
.page-hero {
  position: relative;
  height: 240px;
  display: flex;
  align-items: flex-end;
  padding: 2rem 0;
  color: #fff;
  margin-bottom: 2rem;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0.3) 0%, rgba(15,23,42,0.75) 100%);
}
.page-hero > * { position: relative; z-index: 1; }
.page-hero h1 { font-size: 2rem; font-weight: 700; color: #fff; }
.page-hero p { color: rgba(255,255,255,0.85); margin-top: 0.25rem; }

/* ============ Focus states ============ */

*:focus-visible { outline: 2px var(--accent) solid; outline-offset: 2px; }

/* ============ Mobile Responsive ============ */

@media (max-width: 768px) {
  /* Dashboard */
  .dash-hero .container { flex-direction: column; text-align: center; }
  .dash-hero-actions { margin-left: 0; justify-content: center; }
  .dash-hero-roles { justify-content: center; }
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .dash-grid { grid-template-columns: 1fr !important; }
  .dash-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dash-tab { padding: 0.6rem 0.8rem; font-size: 0.8rem; white-space: nowrap; }

  /* Pending / Calendar */
  .filter-bar { flex-direction: column; gap: 0.35rem; }
  .cal-grid { font-size: 0.65rem; }
  .cal-day { min-height: 36px; padding: 0.15rem; }

  /* Modals */
  .modal-overlay { padding: 0.5rem; }
  .modal { width: 100%; max-height: 90vh; padding: 1rem; }
  .modal-header h3 { font-size: 1rem; }

  /* Forms */
  .form-group { margin-bottom: 0.65rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr !important; }

  /* Cards */
  .member-grid { grid-template-columns: 1fr !important; }
  .create-grid { grid-template-columns: 1fr !important; }
  .values-grid { grid-template-columns: 1fr !important; }
  .leadership-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Buttons */
  .btn { font-size: 0.85rem; padding: 0.45rem 0.85rem; }
  .btn-sm { font-size: 0.78rem; padding: 0.35rem 0.65rem; }

  /* Tables */
  table { font-size: 0.8rem; }
  th, td { padding: 0.5rem !important; }

  /* Stat cards */
  .stat-card { padding: 1rem; }
  .stat-value { font-size: 1.5rem; }

  /* Page hero */
  .page-hero { padding: 2rem 0 1.5rem; }
  .page-hero h1 { font-size: 1.5rem; }

  /* Contact */
  .contact-wrap { padding: 1.5rem 1rem 2rem; }

  /* Budget bars */
  .budget-bar { margin-top: 0.25rem; }

  /* Working groups */
  .wg-card { padding: 0.75rem; }

  /* Vote bar */
  .vote-bar { flex-wrap: wrap; }
  .vote-bar .bar { min-width: 100%; order: 3; margin-top: 0.25rem; }

  /* Notification bell */
  .bell-panel { width: calc(100vw - 2rem); right: -1rem; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr !important; }
  .leadership-grid { grid-template-columns: 1fr !important; }
  .page-header h1 { font-size: 1.6rem; }
  .nav-brand { font-size: 0.85rem; }
}

/* Screen reader only */
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
.sr-only:focus { position:fixed;top:0;left:0;width:auto;height:auto;padding:0.5rem 1rem;margin:0;z-index:9999;background:var(--accent);color:#fff;outline:2px solid #fff; }

/* Pagination */
.pagination { display:flex; justify-content:center; align-items:center; gap:0.5rem; margin-top:2rem; padding:1rem 0; }
.pagination button { display:inline-flex; align-items:center; justify-content:center; min-width:2.25rem; height:2.25rem; padding:0 0.5rem; border:1px solid var(--border); border-radius:var(--radius); background:var(--bg-card); color:var(--text); font-size:0.85rem; cursor:pointer; transition:all 0.2s; }
.pagination button:hover:not(:disabled) { border-color:var(--accent); color:var(--accent); }
.pagination button.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.pagination button:disabled { opacity:0.4; cursor:not-allowed; }
.pagination .page-info { font-size:0.82rem; color:var(--text-dim); margin:0 0.5rem; }
@media (max-width:480px) { .pagination button { min-width:1.8rem; height:1.8rem; font-size:0.78rem; } }

/* FormBuilder */
.uas-form .form-group { margin-bottom:1rem; }
.uas-form .form-required { color:var(--danger); margin-left:0.15rem; }
.uas-form .form-error { color:var(--danger); font-size:0.8rem; min-height:1.1em; margin-top:0.2rem; }
.uas-form .input-error { border-color:var(--danger) !important; }
.uas-form .form-help { color:var(--text-dim); font-size:0.8rem; margin-top:0.2rem; }
.uas-form .form-actions { margin-top:1.25rem; padding-top:1rem; border-top:1px solid var(--border); }

/* Rich Text Editor */
.rte-wrap { border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; background:var(--bg-input); }
.rte-wrap:focus-within { border-color:var(--border-focus); box-shadow:0 0 0 3px rgba(27,73,101,0.08); }
.rte-toolbar { display:flex; gap:0; padding:0.35rem 0.5rem; background:var(--bg); border-bottom:1px solid var(--border); flex-wrap:wrap; }
.rte-btn { display:inline-flex; align-items:center; justify-content:center; min-width:1.75rem; height:1.75rem; padding:0 0.35rem; border:1px solid transparent; border-radius:4px; background:transparent; color:var(--text); font-size:0.82rem; cursor:pointer; transition:all 0.15s; font-family:inherit; }
.rte-btn:hover { background:var(--bg-card); border-color:var(--border); }
.rte-btn:active { background:var(--border); }
.rte-editor { min-height:200px; max-height:500px; overflow-y:auto; padding:0.75rem; font-family:var(--font); font-size:0.92rem; line-height:1.6; outline:none; }
.rte-editor:empty::before { content:attr(data-placeholder); color:var(--text-dim); pointer-events:none; }
.rte-editor h3 { font-family:var(--font-heading); font-size:1.1rem; margin:0.75rem 0 0.5rem; }
.rte-editor p { margin:0 0 0.5rem; }
.rte-editor ul, .rte-editor ol { margin:0.5rem 0; padding-left:1.5rem; }
.rte-editor a { color:var(--accent); text-decoration:underline; }
@media (max-width:480px) { .rte-toolbar { gap:0; } .rte-btn { min-width:1.5rem; height:1.5rem; font-size:0.75rem; } }

/* ============ Detail Page Shared Styles ============ */

/* Hero with dynamic background image */
.detail-hero {
  position: relative;
  min-height: 35vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6rem 1.5rem 3rem;
  color: #fff;
  overflow: hidden;
}
.detail-hero .hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.detail-hero .hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0.35) 0%, rgba(15,23,42,0.88) 100%);
}
.detail-hero > * { position: relative; z-index: 1; }
.detail-hero .breadcrumb { font-size: 0.85rem; margin-bottom: 0.75rem; }
.detail-hero .breadcrumb a { color: rgba(255,255,255,0.7); text-decoration: none; }
.detail-hero .breadcrumb a:hover { color: #fff; }
.detail-hero h1 { font-size: 2.2rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; line-height: 1.25; }
.detail-hero .hero-meta { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; font-size: 0.9rem; }
.detail-hero .hero-meta span { color: rgba(255,255,255,0.8); display: flex; align-items: center; gap: 0.3rem; }

/* Content grid: 2-column layout */
.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; align-items: start; }
.content-main { min-width: 0; }
.sidebar { position: sticky; top: 100px; }

/* Card section: used for about, team, outputs, etc. */
.card-section {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}
.card-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Info grid: 4-column detail boxes */
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.info-box { padding: 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.info-box .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 0.25rem; }
.info-box .value { font-size: 0.95rem; font-weight: 600; }

/* Rich description body */
.description-body { font-size: 1.02rem; line-height: 1.85; color: var(--text); }
.description-body p { margin-bottom: 1.1rem; }
.description-body h2, .description-body h3 { color: var(--text); margin: 1.5rem 0 0.75rem; }
.description-body img { max-width: 100%; border-radius: var(--radius-lg); margin: 1rem 0; }
.description-body blockquote { border-left: 3px solid var(--accent); margin: 1rem 0; padding: 0.5rem 1rem; background: var(--bg-card); border-radius: 0 var(--radius) var(--radius) 0; }
.description-body a { color: var(--accent); }
.description-body ul, .description-body ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.description-body li { margin-bottom: 0.3rem; }

/* Social share row */
.share-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 0.78rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Profile card (author, organizer, lead) */
.profile-card { display: flex; align-items: center; gap: 0.75rem; }
.profile-card .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.profile-card .profile-info { min-width: 0; }
.profile-card .profile-name { font-weight: 600; }
.profile-card .profile-role { font-size: 0.8rem; color: var(--text-dim); }

/* Tag pills */
.tags-row { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.5rem; }
.tag-pill {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.tag-pill:hover { background: var(--accent); color: #fff; }

/* Related content cards */
.related-card {
  display: block;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}
.related-card:hover { border-color: var(--border-focus); box-shadow: var(--shadow); }
.related-card h4 { font-size: 0.9rem; margin-bottom: 0.2rem; }
.related-card p { font-size: 0.78rem; color: var(--text-dim); }

/* Team member card */
.team-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}
.team-card:hover { border-color: var(--accent); }
.team-card .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.team-card .team-info { min-width: 0; }
.team-card .team-name { font-weight: 600; font-size: 0.9rem; }
.team-card .team-role { font-size: 0.78rem; color: var(--text-dim); }

/* Responsive: detail pages */
@media (max-width: 768px) {
  .detail-hero { min-height: 25vh; padding: 4rem 1rem 2rem; }
  .detail-hero h1 { font-size: 1.5rem; }
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .info-grid { grid-template-columns: 1fr; }
}
