.admin, .login-page {
  --line: rgba(15, 23, 42, 0.08);
  --card: #fff;
  --muted: #64748b;
  --text: #0f172a;
  --bg: #f8fafc;
  --primary: #d97706;
  --primary-soft: #fffbeb;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Figtree, ui-sans-serif, system-ui, sans-serif;
}
.dark .admin, .dark .login-page {
  --line: rgba(255,255,255,0.08);
  --card: #18181b;
  --muted: #a1a1aa;
  --text: #fafafa;
  --bg: #09090b;
  --primary: #fbbf24;
  --primary-soft: rgba(251, 191, 36, 0.12);
  background: var(--bg);
  color: var(--text);
}

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.fi-overlay {
  position: fixed; inset: 0; z-index: 40; background: rgba(9,9,11,0.45);
  opacity: 0; pointer-events: none;
}
.nav-toggle:checked ~ .fi-overlay { opacity: 1; pointer-events: auto; }
.fi-sidebar {
  position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: 18rem;
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .2s ease;
}
.nav-toggle:checked ~ .admin .fi-sidebar { transform: none; }
@media (min-width: 1024px) {
  .fi-sidebar { transform: none; }
  .fi-overlay { display: none; }
}
.fi-brand {
  display: flex; gap: 0.75rem; align-items: center;
  padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); text-decoration: none;
}
.fi-brand img { height: 3rem; width: auto; max-width: 8.5rem; object-fit: contain; border-radius: 0.55rem; background: #111; }
.fi-brand strong { display: block; color: var(--text); }
.fi-brand span { color: var(--muted); font-size: 0.78rem; }
.side-nav { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.15rem; overflow: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.7rem; border-radius: 0.6rem; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.92rem;
}
.side-nav a.active, .side-nav a:hover { background: var(--primary-soft); color: var(--text); }
.nav-label { margin: 0.8rem 0.7rem 0.2rem; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.fi-main { min-height: 100dvh; }
@media (min-width: 1024px) { .fi-main { margin-left: 18rem; } }
.fi-topbar {
  position: sticky; top: 0; z-index: 30; height: 4rem;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem; background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.crumbs, .top-actions, .cluster { display: flex; align-items: center; gap: 0.5rem; }
.content { padding: 1.25rem; max-width: 1180px; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; margin-bottom: 1rem; }
.page-head h1 { margin: 0.15rem 0; font-size: 1.7rem; letter-spacing: -0.02em; }
.eyebrow { margin: 0; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--primary); font-weight: 700; }
.muted { color: var(--muted); }
.tiny { font-size: 0.78rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 0.9rem; padding: 1rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.stat strong { display: block; font-size: 1.6rem; }

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font-size: 0.75rem; letter-spacing: 0.04em; color: var(--muted); padding: 0.55rem; border-bottom: 1px solid var(--line); }
.table td { padding: 0.65rem 0.55rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

.btn, .icon-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 0.6rem; padding: 0.45rem 0.75rem; font-weight: 650; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.btn.primary { background: #f59e0b; border-color: #f59e0b; color: #1c1917; }
.dark .btn.primary { background: #fbbf24; border-color: #fbbf24; }
.btn.ghost { background: transparent; }
.btn.delete { color: #e11d48; }
.btn.full { width: 100%; justify-content: center; }
.icon-btn { width: 2.25rem; height: 2.25rem; padding: 0; display: grid; place-items: center; }

.input, .field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 0.6rem; padding: 0.55rem 0.7rem;
}
.field { display: grid; gap: 0.3rem; }
.field label { font-size: 0.82rem; font-weight: 650; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0.75rem; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-12 { grid-column: span 12; }
@media (max-width: 720px) {
  .span-4, .span-6, .span-12 { grid-column: span 12; }
  .page-head { flex-direction: column; align-items: stretch; }
}

.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 0.12rem 0.5rem; background: var(--primary-soft); color: var(--text); font-size: 0.75rem; font-weight: 650; margin: 0.1rem; }
.role-chips { display: flex; flex-wrap: wrap; }
.alert { background: #fff1f2; color: #9f1239; border-radius: 0.7rem; padding: 0.7rem 0.85rem; }
.ok { background: #f0fdf4; color: #166534; border-radius: 0.7rem; padding: 0.7rem 0.85rem; }
.dark .alert { background: rgba(244,63,94,0.15); color: #fda4af; }
.dark .ok { background: rgba(34,197,94,0.15); color: #86efac; }

.theme-switch { display: inline-flex; padding: 0.15rem; border-radius: 0.7rem; background: #f1f5f9; border: 1px solid var(--line); }
.dark .theme-switch { background: #27272a; }
.theme-btn { border: 0; background: transparent; color: var(--muted); border-radius: 0.55rem; padding: 0.35rem 0.5rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.25rem; }
.theme-btn.is-active { background: white; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.dark .theme-btn.is-active { background: #3f3f46; color: white; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(9,9,11,0.55); display: grid; place-items: center; padding: 1rem; }
.modal-card { width: min(860px, 100%); max-height: min(90dvh, 900px); overflow: auto; background: var(--card); color: var(--text); border-radius: 1rem; padding: 1rem 1rem 1.2rem; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.checks { display: flex; gap: 0.8rem; align-items: center; }
.acl { width: 100%; font-size: 0.85rem; }
.acl th, .acl td { text-align: center; }
.acl td:first-child, .acl th:first-child { text-align: left; }
.thumb { width: 72px; height: 52px; object-fit: cover; border-radius: 0.4rem; background: #e5e7eb; }
.photo-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.photo-row figure { margin: 0; position: relative; }
.login-page { display: grid; place-items: center; padding: 2rem 1rem; }
.login-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 1.5rem; }
.login-card h1 { margin: 0.2rem 0 1rem; font-size: 1.4rem; }
.menu-btn { display: inline-flex; }
@media (min-width: 1024px) { .menu-btn { display: none; } }
