/*
 * ASF Fellows Network — visual-clone stylesheet for the Django/HTMX portal.
 * Baseline: Curtis's v1 portal (Next.js + Tailwind/shadcn), src/app/globals.css
 * as of 2026-09-17. Tokens below are the hex equivalents of v1's oklch values,
 * taken from the comments Curtis left in globals.css. v1 defines a .dark theme
 * but never toggles it, so this file ships light mode only.
 */

/* ---------- Design tokens ---------- */
:root {
  --background: #fffaf2;        /* cream */
  --foreground: #572700;        /* dark brown */
  --card: #ffffff;
  --card-foreground: #572700;
  --primary: #016d7a;           /* teal */
  --primary-foreground: #ffffff;
  --secondary: #f5eadd;         /* beige */
  --secondary-foreground: #572700;
  --muted: #f5eadd;
  --muted-foreground: #977f6c;  /* tan */
  --accent: #f5eadd;
  --accent-foreground: #572700;
  --destructive: #dc2626;
  --border: #e8d5c4;            /* light tan */
  --input: #e8d5c4;
  --ring: #016d7a;

  --radius: 0.625rem;                    /* lg */
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-xl: calc(var(--radius) + 4px);

  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Cinzel', serif;       /* h1 + brand wordmark, per v1 */

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; border-color: var(--border); }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1 { font-family: var(--font-display); }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- Layout shell (AppShell: header + sidebar + main) ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.shell-body { display: flex; flex: 1; }

.staging-banner {
  background: #f59e0b; color: #451a03; text-align: center;
  font-size: 0.875rem; font-weight: 600; padding: 0.25rem 1rem;
}

/* Header (sticky, translucent cream, bottom border) */
.header {
  position: sticky; top: 0; z-index: 50; width: 100%;
  border-bottom: 1px solid var(--border);
  background: rgb(255 250 242 / 0.75);
  backdrop-filter: blur(8px);
}
.header-inner { display: flex; height: 3.5rem; align-items: center; padding: 0 1rem; }
@media (min-width: 768px) { .header-inner { padding: 0 1.5rem; } }

.brand { display: flex; align-items: center; gap: 0.5rem; }
.brand img { width: 28px; height: auto; }
.brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 1.125rem;
}
.brand img, .brand-name-full { display: none; }
.brand-name-short { display: inline; }
@media (min-width: 640px) {
  .brand img, .brand-name-full { display: block; }
  .brand-name-short { display: none; }
}

.header-nav { display: none; align-items: center; gap: 1.5rem; margin-left: 1.5rem; }
@media (min-width: 768px) { .header-nav { display: flex; } }
.header-nav a {
  font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground);
  transition: color 0.15s;
}
.header-nav a:hover, .header-nav a.active { color: var(--primary); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 1rem; }

/* Sidebar (desktop) */
.sidebar {
  display: none; width: 16rem; flex-direction: column;
  border-right: 1px solid var(--border);
  background: rgb(245 234 221 / 0.4);          /* bg-muted/40 */
}
@media (min-width: 768px) { .sidebar { display: flex; } }
.sidebar nav { flex: 1; padding: 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem; font-weight: 500;
  color: var(--muted-foreground);
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--muted); color: var(--foreground); }
.nav-item.active { background: var(--primary); color: var(--primary-foreground); }
.nav-item svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.nav-separator { margin: 1rem 0; border-top: 1px solid var(--border); }
.nav-section-label {
  padding: 0 0.75rem; font-size: 0.75rem; font-weight: 600;
  color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.05em;
  margin: 0 0 0.25rem;
}

/* Main content area */
.main { flex: 1; padding: 1rem; min-width: 0; }
@media (min-width: 768px) { .main { padding: 1.5rem; } }
@media (min-width: 1024px) { .main { padding: 2rem; } }

/* Mobile nav drawer (sheet). Toggled by checkbox hack or htmx/JS adding .open */
.mobile-nav-toggle { display: inline-flex; margin-right: 0.5rem; }
@media (min-width: 768px) { .mobile-nav-toggle { display: none; } }
.mobile-nav {
  position: fixed; inset: 0; z-index: 100; display: none;
}
.mobile-nav.open { display: block; }
.mobile-nav-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 0.5); }
.mobile-nav-panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: 18rem;
  background: var(--background); padding: 1.5rem; overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.mobile-nav-panel nav { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 1.5rem; }

/* Public/auth centered layout */
.centered-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--background); }
.centered-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.site-footer {
  background: var(--foreground); padding: 1.5rem; text-align: center;
  font-size: 0.875rem; color: rgb(255 255 255 / 0.8);
}

/* ---------- Page scaffolding ---------- */
.page { display: flex; flex-direction: column; gap: 1.5rem; }
.page-lg-gap { gap: 2rem; }
.page-header h1 { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.025em; }
.page-header p { color: var(--muted-foreground); }
.page-header-row {
  display: flex; flex-direction: column; gap: 1rem;
}
@media (min-width: 640px) {
  .page-header-row { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- Cards (shadcn Card) ---------- */
.card {
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 1.5rem; padding: 1.5rem 0;
}
.card-header { display: flex; flex-direction: column; gap: 0.375rem; padding: 0 1.5rem; }
.card-title { font-weight: 600; line-height: 1.25; }
.card-title.with-icon { display: flex; align-items: center; gap: 0.5rem; }
.card-title svg { width: 1.25rem; height: 1.25rem; }
.card-description { font-size: 0.875rem; color: var(--muted-foreground); }
.card-content { padding: 0 1.5rem; }
a.card-link { border-radius: var(--radius-xl); display: block; height: 100%; }
a.card-link .card, button.card-button .card { height: 100%; transition: background 0.15s; }
a.card-link:hover .card, button.card-button:hover .card { background: rgb(245 234 221 / 0.5); }
.card-hover-shadow { transition: box-shadow 0.15s; }
button.card-button { display: block; width: 100%; text-align: left; padding: 0; }
button.card-button:hover .card-hover-shadow { box-shadow: var(--shadow-md); }

/* ---------- Buttons (shadcn Button) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  white-space: nowrap; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500;
  height: 2.25rem; padding: 0.5rem 1rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn svg { width: 1rem; height: 1rem; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #01606c; }
.btn-outline { border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow-sm); }
.btn-outline:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-destructive { background: var(--destructive); color: #fff; }
.btn-sm { height: 2rem; padding: 0 0.75rem; border-radius: var(--radius-md); }
.btn-icon { width: 2.25rem; padding: 0; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ---------- Badges (shadcn Badge + v1 help-badge colors) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  border-radius: var(--radius-md); border: 1px solid transparent;
  padding: 0.125rem 0.5rem; font-size: 0.75rem; font-weight: 500;
  width: fit-content; white-space: nowrap;
}
.badge svg { width: 0.75rem; height: 0.75rem; }
.badge-default { background: var(--primary); color: var(--primary-foreground); }
.badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge-outline { border-color: var(--border); color: var(--foreground); }
/* "Willing to help" badges — exact Tailwind palette classes used in v1 */
.badge-mentor   { background: #dcfce7; color: #166534; }  /* green-100 / green-800 */
.badge-advisor  { background: #dbeafe; color: #1e40af; }  /* blue-100 / blue-800 */
.badge-speaker  { background: #f3e8ff; color: #6b21a8; }  /* purple-100 / purple-800 */
.badge-referrer { background: #ffedd5; color: #9a3412; }  /* orange-100 / orange-800 */
/* Community-board category badges — v1 CATEGORY_CONFIG colors */
.badge-cat-blue   { background: #dbeafe; color: #1e40af; }  /* Request for Assistance */
.badge-cat-green  { background: #dcfce7; color: #166534; }  /* Event / Opportunity */
.badge-cat-purple { background: #f3e8ff; color: #6b21a8; }  /* Resource Sharing */
.badge-cat-gray   { background: #f3f4f6; color: #1f2937; }  /* General */

/* ---------- Avatar ---------- */
.avatar {
  position: relative; display: flex; flex-shrink: 0; overflow: hidden;
  border-radius: 9999px; width: 2rem; height: 2rem;
  align-items: center; justify-content: center;
  background: var(--muted); color: var(--foreground);
  font-size: 0.875rem; font-weight: 500;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-md { width: 3rem; height: 3rem; }
.avatar-xl { width: 6rem; height: 6rem; font-size: 1.5rem; }

/* ---------- Forms ---------- */
.label { display: block; font-size: 0.875rem; font-weight: 500; line-height: 1; }
.label-xs { font-size: 0.75rem; color: var(--muted-foreground); margin-bottom: 0.25rem; }
.input, .select, .textarea {
  display: block; width: 100%;
  height: 2.25rem; padding: 0.25rem 0.75rem;
  font-size: 0.875rem; font-family: inherit; color: var(--foreground);
  background: transparent; border: 1px solid var(--input);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; min-height: 4rem; padding: 0.5rem 0.75rem; }
.input::placeholder, .textarea::placeholder { color: var(--muted-foreground); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--ring);
  box-shadow: 0 0 0 3px rgb(1 109 122 / 0.25);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23977f6c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.6rem center; padding-right: 2rem; }
.checkbox { width: 1rem; height: 1rem; accent-color: var(--primary); }
/* Switch (shadcn Switch — settings toggles). <input type="checkbox" class="switch"> */
.switch {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  width: 2rem; height: 1.15rem; flex-shrink: 0;
  border-radius: 9999px; background: var(--input);
  position: relative; transition: background 0.15s; margin: 0;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: calc(1.15rem - 4px); height: calc(1.15rem - 4px);
  border-radius: 9999px; background: var(--card);
  box-shadow: var(--shadow-sm); transition: transform 0.15s;
}
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(0.85rem); }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.input-with-icon { position: relative; }
.input-with-icon svg {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  width: 1rem; height: 1rem; color: var(--muted-foreground); pointer-events: none;
}
.input-with-icon .input { padding-left: 2.25rem; }

/* ---------- Tabs (login Magic Link / Password) ---------- */
.tabs-list {
  display: grid; grid-template-columns: 1fr 1fr; width: 100%;
  background: var(--muted); border-radius: var(--radius-lg, var(--radius));
  padding: 3px; gap: 2px;
}
.tab-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); padding: 0.25rem 0.5rem;
  font-size: 0.875rem; font-weight: 500; color: var(--foreground);
}
.tab-trigger.active { background: var(--card); box-shadow: var(--shadow-sm); }
.tab-panel { margin-top: 1rem; }
.tab-panel[hidden] { display: none; }

/* ---------- Dialog (announcement/event detail modals) ---------- */
dialog.dialog {
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--card); color: var(--card-foreground);
  padding: 1.5rem; max-width: 32rem; width: calc(100% - 2rem);
  box-shadow: var(--shadow-md);
}
dialog.dialog::backdrop { background: rgb(0 0 0 / 0.5); }
.dialog-title { font-weight: 600; font-size: 1.125rem; display: flex; align-items: center; gap: 0.5rem; }
.dialog-description { font-size: 0.875rem; color: var(--muted-foreground); margin-top: 0.375rem; }
.dialog-body { font-size: 0.875rem; white-space: pre-wrap; max-height: 60vh; overflow-y: auto; margin-top: 1rem; }

/* ---------- Dropdown menu (header avatar menu; <details>-based) ---------- */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; border-radius: 9999px; display: inline-flex; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 60;
  min-width: 14rem; background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 0.25rem;
}
.dropdown-label { padding: 0.375rem 0.5rem; }
.dropdown-label .name { font-size: 0.875rem; font-weight: 500; line-height: 1; }
.dropdown-label .email { font-size: 0.75rem; color: var(--muted-foreground); margin-top: 0.25rem; line-height: 1; }
.dropdown-separator { height: 1px; background: var(--border); margin: 0.25rem -0.25rem; }
.dropdown-item {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  padding: 0.375rem 0.5rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; cursor: pointer;
}
.dropdown-item svg { width: 1rem; height: 1rem; color: var(--muted-foreground); }
.dropdown-item:hover { background: var(--accent); color: var(--accent-foreground); }

/* ---------- Separator with centered label ("Or continue with") ---------- */
.separator-label { position: relative; text-align: center; }
.separator-label::before {
  content: ''; position: absolute; inset: 50% 0 auto 0; border-top: 1px solid var(--border);
}
.separator-label span {
  position: relative; background: var(--card); padding: 0 0.5rem;
  font-size: 0.75rem; text-transform: uppercase; color: var(--muted-foreground);
}

/* ---------- Grids used across pages ---------- */
.stat-grid { display: grid; gap: 1rem; }
.two-col-grid { display: grid; gap: 1rem; }
.card-grid { display: grid; gap: 1rem; }
.event-list { display: grid; gap: 1.5rem; }
@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .two-col-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Stat card internals (dashboard) */
.stat-card-header {
  display: flex; flex-direction: row; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
}
.stat-card-header .card-title { font-size: 0.875rem; font-weight: 500; }
.stat-card-header svg { width: 1rem; height: 1rem; color: var(--muted-foreground); }
.stat-value { font-size: 1.5rem; font-weight: 700; }

/* Quick-action rows (dashboard) */
.quick-action { display: block; padding: 0.75rem; border-radius: var(--radius); transition: background 0.15s; }
.quick-action:hover { background: var(--muted); }
.quick-action-title { font-weight: 500; }
.quick-action-desc { font-size: 0.875rem; color: var(--muted-foreground); }

/* Announcement list (dashboard) */
.announcement-list { display: flex; flex-direction: column; gap: 1rem; }
.announcement {
  width: 100%; text-align: left; border-bottom: 1px solid var(--border);
  padding: 0.25rem 0.5rem 1rem; margin: 0 -0.5rem; border-radius: var(--radius-md);
  transition: background 0.15s;
}
.announcement:last-child { border-bottom: 0; padding-bottom: 0; }
.announcement:hover { background: rgb(245 234 221 / 0.5); }
.announcement h4 { font-weight: 500; display: flex; align-items: center; gap: 0.5rem; }
.announcement .pin { width: 0.75rem; height: 0.75rem; color: #f59e0b; flex-shrink: 0; }
.announcement p {
  font-size: 0.875rem; color: var(--muted-foreground); white-space: pre-wrap;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Member card (directory / chapter detail) */
.member-card-row { display: flex; align-items: flex-start; gap: 1rem; }
.member-card-body { flex: 1; min-width: 0; }
.member-card-body h3 { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-card-job { font-size: 0.875rem; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.5rem; }

/* Filters row (directory) */
.filters-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.checkbox-item { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-item label { font-size: 0.875rem; cursor: pointer; }

/* FAQ accordion (help pages; native <details>, shadcn Accordion look) */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: 0; }
.faq-item > summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0; font-size: 0.875rem; font-weight: 500; cursor: pointer;
  list-style: none;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: ''; width: 1rem; height: 1rem; flex-shrink: 0;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23977f6c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  transition: transform 0.15s;
}
.faq-item[open] > summary::after { transform: rotate(180deg); }
.faq-item > summary:hover { text-decoration: underline; }
.faq-item > p { padding-bottom: 1rem; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 0; }
.empty-state svg { width: 3rem; height: 3rem; margin: 0 auto 1rem; color: var(--muted-foreground); }
.empty-state h3 { font-size: 1.125rem; font-weight: 600; margin-top: 1rem; }
.empty-state p { color: var(--muted-foreground); }

/* ---------- Admin area (tables, status badges, breadcrumbs, pagination) ---------- */
/* Status/role badge colors — exact Tailwind *-100/*-800 pairs used in v1 admin */
.badge-green  { background: #dcfce7; color: #166534; }   /* active / healthy */
.badge-yellow { background: #fef9c3; color: #854d0e; }   /* invited / warning */
.badge-red    { background: #fee2e2; color: #991b1b; }   /* suspended */
.badge-purple { background: #f3e8ff; color: #6b21a8; }   /* admin role */
.badge-blue   { background: #dbeafe; color: #1e40af; }   /* staff role */
.badge-gray   { background: #f3f4f6; color: #1f2937; }   /* user role / draft */
.badge-destructive { background: var(--destructive); color: #fff; }

/* Table (shadcn Table) */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-md); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; caption-side: bottom; }
.table th {
  height: 2.5rem; padding: 0 0.75rem; text-align: left; vertical-align: middle;
  font-weight: 500; color: var(--muted-foreground); white-space: nowrap;
}
.table td { padding: 0.5rem 0.75rem; vertical-align: middle; }
.table tbody tr { border-top: 1px solid var(--border); transition: background 0.15s; }
.table tbody tr:hover { background: rgb(245 234 221 / 0.5); }
.table tr.dimmed { opacity: 0.6; }
.table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; }
.sortable-header { display: inline-flex; align-items: center; gap: 0.25rem; color: inherit; }
.sortable-header svg { width: 0.875rem; height: 0.875rem; }
.sortable-header:hover { color: var(--foreground); }

/* Breadcrumbs (admin detail pages) */
.breadcrumbs { display: flex; align-items: center; gap: 0.25rem; font-size: 0.875rem; color: var(--muted-foreground); }
.breadcrumbs a:hover { color: var(--foreground); }
.breadcrumbs svg { width: 1rem; height: 1rem; }

/* Pagination row */
.pagination-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pagination-row .buttons { display: flex; gap: 0.5rem; }

/* Alert (shadcn Alert — admin-only notes, warnings) */
.alert {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.75rem 1rem; font-size: 0.875rem; display: flex; gap: 0.75rem;
  align-items: flex-start; background: var(--card);
}
.alert svg { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.125rem; }
.alert-warning { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.alert-destructive { border-color: rgb(220 38 38 / 0.5); color: var(--destructive); }

/* Progress bar (sync page) */
.progress { width: 100%; height: 0.5rem; border-radius: 9999px; background: var(--secondary); overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 9999px; transition: width 0.3s; }

/* ---------- Small utilities used by the templates ---------- */
.text-muted { color: var(--muted-foreground); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-md { max-width: 28rem; }
.w-full { width: 100%; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.icon-4 { width: 1rem; height: 1rem; }
.icon-5 { width: 1.25rem; height: 1.25rem; }
.hover-underline:hover { text-decoration: underline; }
.error-banner {
  padding: 1rem; background: rgb(220 38 38 / 0.1); color: var(--destructive);
  border-radius: var(--radius-md); font-size: 0.875rem; text-align: center;
}
.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;
}

/* The hidden attribute loses to any inline display, so a template that sets
   both renders the element permanently visible. Two shipped that way: the map
   error overlay (fixed in T76) and the admin role-change warning. Make the
   attribute win so the pattern cannot bite again. */
[hidden] { display: none !important; }
