/* ════════════════════════════════════════════════════════
   THEME TOKENS  (matches the AppHub design system)
   ════════════════════════════════════════════════════════ */
:root {
  color-scheme: dark;
  --bg:        #0d1117;
  --bg-2:      #161b22;
  --bg-3:      #1d2433;
  --bg-4:      #252d3d;
  --border:    rgba(255,255,255,0.07);
  --border-2:  rgba(255,255,255,0.13);
  --text-1:    #e6edf3;
  --text-2:    #8b949e;
  --text-3:    #56606b;
  --accent:    #008acb;
  --acc-rgb:   0,138,203;
  --acc-soft:  rgba(0,138,203,0.14);
  --acc-ring:  rgba(0,138,203,0.32);
  --green:     #3fb950;
  --g-soft:    rgba(63,185,80,0.12);
  --g-ring:    rgba(63,185,80,0.28);
  --red:       #f85149;
  --r-soft:    rgba(248,81,73,0.12);
  --r-ring:    rgba(248,81,73,0.28);
  --amber:     #d29922;
  --a-soft:    rgba(210,153,34,0.14);
  --shadow:    0 8px 32px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.35);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --radius:    16px;
  --radius-sm: 10px;
  --t:         0.17s;
  --ease:      cubic-bezier(0.4,0,0.2,1);
}
[data-theme="light"] {
  color-scheme: light;
  --bg:        #f3f4f6;
  --bg-2:      #ffffff;
  --bg-3:      #eaecef;
  --bg-4:      #dde1e6;
  --border:    rgba(0,0,0,0.08);
  --border-2:  rgba(0,0,0,0.14);
  --text-1:    #0d1117;
  --text-2:    #57606a;
  --text-3:    #8c959f;
  --accent:    #0277b0;
  --acc-rgb:   2,119,176;
  --acc-soft:  rgba(2,119,176,0.10);
  --acc-ring:  rgba(2,119,176,0.24);
  --green:     #1a7f37;
  --g-soft:    rgba(26,127,55,0.10);
  --g-ring:    rgba(26,127,55,0.22);
  --red:       #d1242f;
  --r-soft:    rgba(209,36,47,0.09);
  --r-ring:    rgba(209,36,47,0.22);
  --amber:     #9a6700;
  --a-soft:    rgba(154,103,0,0.12);
  --shadow:    0 4px 24px rgba(0,0,0,0.1), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
}

html.theme-transition *, html.theme-transition *::before, html.theme-transition *::after {
  transition: background-color .28s ease, border-color .28s ease,
              color .28s ease, box-shadow .28s ease !important;
}

/* ════════ RESET ════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* The `hidden` attribute must always win over class-based display rules
   (e.g. .modal-backdrop{display:grid}), otherwise hidden overlays stay visible. */
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; border: none; background: none;
         -webkit-tap-highlight-color: transparent; }
input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(var(--acc-rgb),0.10) 0%, transparent 62%);
}

/* ════════ BUTTONS ════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 13.5px; color: var(--text-1); background: var(--bg-3);
  border: 1px solid var(--border-2); transition: all var(--t) var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--bg-4); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08);
  box-shadow: 0 4px 16px var(--acc-ring); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-hover, rgba(255,255,255,0.05)); }
.btn-danger { background: var(--r-soft); border-color: var(--r-ring); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; border-color: transparent; }
.btn-block { width: 100%; padding: 11px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  font-size: 16px; color: var(--text-2); transition: all var(--t) var(--ease);
  text-decoration: none; cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text-1); }
.icon-btn.danger:hover { background: var(--r-soft); color: var(--red); }
.icon-btn .ic { width: 17px; height: 17px; display: block; }
.ic { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }

/* Admin edit bar inside the event detail modal */
.detail-admin { display: flex; gap: 4px; justify-content: flex-end;
  margin: -4px 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* ════════ LOGIN ════════ */
.login-view {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 36px 32px;
  display: flex; flex-direction: column; gap: 16px;
  animation: rise .4s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.login-brand { text-align: center; margin-bottom: 6px; }
.login-logo {
  width: 78px; height: 78px; margin: 0 auto 12px; display: block;
  object-fit: cover; object-position: top center;   /* show the crest, crop the wordmark */
}
.login-brand h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.login-brand p { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field input, .field textarea, .field select {
  background: var(--bg); border: 1px solid var(--border-2); color: var(--text-1);
  padding: 10px 13px; border-radius: var(--radius-sm); transition: all var(--t) var(--ease);
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--acc-soft);
}
.field textarea { resize: vertical; min-height: 80px; }
.login-error {
  background: var(--r-soft); border: 1px solid var(--r-ring); color: var(--red);
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; text-align: center;
}
.login-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-or span { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
#login-passkey-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#login-passkey-btn.pulse { animation: pkpulse 0.9s var(--ease) 2; }
@keyframes pkpulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--acc-soft); border-color: var(--border-2); }
  50%      { box-shadow: 0 0 0 4px var(--acc-soft); border-color: var(--accent); }
}
.btn .ic { width: 16px; height: 16px; }
.ic-slot { display: inline-flex; }
.login-hint { text-align: center; font-size: 12px; color: var(--text-3); line-height: 1.7; }
.login-hint code {
  background: var(--bg-3); padding: 1px 6px; border-radius: 5px;
  font-size: 11.5px; color: var(--text-2);
}
.login-code-info { font-size: 13px; color: var(--text-2); line-height: 1.5; margin-bottom: 10px; }
.login-code-info strong { color: var(--text-1); }
.login-resend { font-size: 12.5px; color: var(--text-3); margin-top: 8px; text-align: center; }
.login-resend a { color: var(--accent); font-weight: 600; text-decoration: none; }
.login-resend a:hover { text-decoration: underline; }
.code-inputs { display: flex; gap: 8px; justify-content: center; margin: 4px 0 2px; }
.code-digit {
  width: 44px; height: 52px; text-align: center; font-size: 22px; font-weight: 700;
  color: var(--text-1); background: var(--bg);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.code-digit:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--acc-soft);
}
.code-digit:disabled { opacity: .55; }
@media (max-width: 400px) {
  .code-inputs { gap: 6px; }
  .code-digit { width: 40px; height: 48px; font-size: 20px; }
}
.form-note { font-size: 12px; color: var(--text-3); line-height: 1.5; margin: -2px 0 2px; }

/* ════════ TOPBAR ════════ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px; background: var(--bg-2);
  border-bottom: 1px solid var(--border); backdrop-filter: blur(12px);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 800;
  letter-spacing: -.02em; }
.topbar-logo {
  width: 34px; height: 34px; object-fit: cover; object-position: top center;
}
.topbar-title { font-size: 16px; }
.tabs { display: flex; gap: 4px; margin-left: 8px; }
.tab {
  padding: 8px 15px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 13.5px; color: var(--text-2); transition: all var(--t) var(--ease);
}
.tab:hover { color: var(--text-1); background: var(--bg-3); }
.tab.active { color: var(--accent); background: var(--acc-soft); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.profile { position: relative; }
.user-chip { display: flex; align-items: center; gap: 9px; background: none; border: none;
  cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 10px; color: inherit; font: inherit;
  transition: background var(--t) var(--ease); }
.user-chip:hover { background: var(--bg-3); }
.user-chip .user-meta { text-align: left; }
.chev { display: inline-flex; color: var(--text-3); transition: transform var(--t) var(--ease); }
.chev .ic { width: 15px; height: 15px; }
.user-chip[aria-expanded="true"] .chev { transform: rotate(180deg); }

.profile-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 212px;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; z-index: 50; animation: rise .16s var(--ease) both; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; padding: 9px 11px; border-radius: 8px;
  color: var(--text-1); font: inherit; font-size: 13.5px;
  transition: background var(--t) var(--ease); }
.menu-item:hover { background: var(--bg-3); }
.menu-item .mi-ic { display: inline-flex; color: var(--text-2); flex-shrink: 0; }
.menu-item .mi-ic .ic { width: 17px; height: 17px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--accent), #016a9b);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-name { font-weight: 600; font-size: 13px; }
.user-role { font-size: 11px; color: var(--text-3); text-transform: capitalize; }

/* ════════ LAYOUT ════════ */
.content { max-width: 1080px; margin: 0 auto; padding: 28px 22px 60px; }
.panel-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.panel-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.panel-sub { color: var(--text-2); font-size: 13.5px; margin-top: 3px; }
.panel-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ════════ VIEW TOGGLE (Kacheln / Liste) ════════ */
.view-toggle { display: inline-flex; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.view-btn { padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: none; background: transparent; color: var(--text-2); border-radius: 7px;
  transition: all var(--t) var(--ease); }
.view-btn:hover { color: var(--text-1); }
.view-btn.active { background: var(--bg-2); color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,.18); }

/* ════════ EVENT LIST VIEW ════════ */
.event-list { border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-2); }
.elist-head, .elist-row { display: grid;
  grid-template-columns: 92px minmax(0,1fr) 120px 208px; gap: 14px; align-items: center;
  padding: 11px 16px; }
.elist-head { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-3); background: var(--bg-3); }
.elist-row { border-top: 1px solid var(--border); cursor: pointer;
  transition: background var(--t) var(--ease); }
.elist-row:hover { background: var(--bg-3); }
.elist-row.is-draft { opacity: 0.55; }
.elist-row.is-draft:hover { opacity: 1; }
.elist-date { display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.elist-date b { color: var(--text-1); }
.elist-time { font-size: 11px; color: var(--text-3); }
.elist-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.elist-title { font-weight: 600; font-size: 14px; display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap; }
.elist-loc { font-size: 12px; color: var(--text-2); }
.elist-c-counts { display: flex; gap: 12px; font-size: 13px; font-weight: 600; }
.count-yes { color: var(--green); }
.count-no  { color: var(--red); }
.elist-c-actions { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
@media (max-width: 720px) {
  .elist-head { display: none; }
  .elist-row { grid-template-columns: 1fr; gap: 8px; }
  .elist-c-counts, .elist-c-actions { justify-content: flex-start; }
}

/* ════════ GENERIC LIST VIEW (Dokumente / Mitglieder) ════════ */
.list-view { border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-2); }
.lrow { display: flex; align-items: center; gap: 14px; padding: 11px 16px;
  border-top: 1px solid var(--border); transition: background var(--t) var(--ease); }
.lrow:first-child { border-top: none; }
.lrow:hover { background: var(--bg-3); }
.l-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.l-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.l-title { font-weight: 600; font-size: 14px; display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap; }
.l-sub { font-size: 12.5px; color: var(--text-2); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.l-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
.l-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
@media (max-width: 720px) {
  .lrow { flex-wrap: wrap; }
  .l-meta { flex-basis: 100%; }
}

/* ════════ EVENT CARDS ════════ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.event-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 12px;
  transition: all var(--t) var(--ease); position: relative; overflow: hidden;
  animation: rise .35s var(--ease) both; cursor: pointer;
}
.event-card:hover { border-color: var(--border-2); transform: translateY(-2px);
  box-shadow: var(--shadow-sm); }
/* Unpublished events (drafts) are dimmed so admins spot them at a glance. */
.event-card.is-draft { opacity: 0.55; }
.event-card.is-draft:hover { opacity: 1; }
.event-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.event-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.event-date {
  flex-shrink: 0; text-align: center; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; min-width: 58px;
}
.event-date .d { font-size: 21px; font-weight: 800; line-height: 1; }
.event-date .m { font-size: 11px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }
.event-date .t { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.event-info { flex: 1; min-width: 0; }
.event-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.event-loc { font-size: 12.5px; color: var(--text-2); margin-top: 3px; display: flex;
  align-items: center; gap: 5px; }
.event-desc { font-size: 13px; color: var(--text-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.event-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2);
  padding-top: 2px; }
.event-stats b { color: var(--text-1); }
.stat-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle; }
.dot-yes { background: var(--green); }
.dot-no  { background: var(--red); }
.event-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px;
  flex-wrap: wrap; align-items: center; }
.rsvp-group { display: flex; gap: 8px; flex: 1; }
.rsvp-btn { flex: 1; }
.rsvp-btn.active-yes { background: var(--green); color: #fff; border-color: transparent; }
.rsvp-btn.active-no  { background: var(--red); color: #fff; border-color: transparent; }
.rsvp-locked-group { flex-direction: column; align-items: flex-start; gap: 3px; }
.rsvp-locked { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  font-weight: 700; padding: 6px 12px; border-radius: 8px; }
.rsvp-locked.locked-yes { color: var(--green); background: var(--g-soft); }
.rsvp-locked.locked-no  { color: var(--red);   background: var(--r-soft); }
.rsvp-hint { font-size: 11.5px; color: var(--text-3); }
.rsvp-wrap { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.rsvp-wrap .rsvp-group { flex: 0 0 auto; }
.rsvp-window { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px;
  font-weight: 600; color: var(--text-2); background: var(--bg-3);
  border: 1px solid var(--border); padding: 8px 12px; border-radius: 8px; }

.badge {
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-draft  { background: var(--a-soft); color: var(--amber); }
.badge-mine-yes { background: var(--g-soft); color: var(--green); }
.badge-mine-no  { background: var(--r-soft); color: var(--red); }
.admin-row { display: flex; gap: 6px; }

/* ════════ DOCUMENTS ════════ */
.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-item {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 15px 16px; display: flex; align-items: center; gap: 14px;
  transition: all var(--t) var(--ease); animation: rise .3s var(--ease) both;
}
.doc-item:hover { border-color: var(--border-2); }
.doc-icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  font-size: 19px; background: var(--acc-soft); flex-shrink: 0;
}
.doc-main { flex: 1; min-width: 0; }
.doc-title { font-weight: 700; font-size: 14.5px; }
.doc-desc { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.doc-meta { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.doc-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ════════ MEMBERS ════════ */
.member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 12px; }
.member-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 15px; display: flex; align-items: center; gap: 13px;
  transition: all var(--t) var(--ease); animation: rise .3s var(--ease) both;
}
.member-card:hover { border-color: var(--border-2); }
.member-main { flex: 1; min-width: 0; }
.member-name { font-weight: 700; font-size: 14px; display: flex; align-items: center;
  gap: 7px; flex-wrap: wrap; }
.member-email { font-size: 12.5px; color: var(--text-2); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.role-tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .04em; }
.role-admin  { background: var(--acc-soft); color: var(--accent); }
.role-member { background: var(--bg-3); color: var(--text-3); }
.pk-badge { display: inline-flex; align-items: center; color: var(--accent);
  vertical-align: middle; }
.pk-badge .ic { width: 14px; height: 14px; }
.member-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ════════ EMPTY ════════ */
.empty {
  text-align: center; padding: 60px 20px; color: var(--text-3);
  border: 1.5px dashed var(--border-2); border-radius: var(--radius);
}
.empty .emoji { font-size: 38px; margin-bottom: 10px; }

/* ════════ MODAL ════════ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px;
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 540px; max-height: 88vh; overflow: auto;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius);
  box-shadow: var(--shadow); animation: rise .25s var(--ease) both;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: var(--bg-2);
}
.modal-head h3 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 15px; }
.modal-row { display: flex; gap: 12px; }
.modal-row .field { flex: 1; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.checkbox-field { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.checkbox-field input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Attendee list inside detail modal */
.attendees { display: flex; flex-direction: column; gap: 7px; }
.att-group-title { font-size: 12px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; }
.att-row { display: flex; align-items: center; gap: 10px; padding: 8px 11px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.att-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid;
  place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), #016a9b); flex-shrink: 0; }
.att-name { flex: 1; font-size: 13.5px; font-weight: 500; }
.att-status { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.att-status.yes { background: var(--g-soft); color: var(--green); }
.att-status.no  { background: var(--r-soft); color: var(--red); }
.att-status.none { background: var(--a-soft); color: var(--amber); }
.att-admin { display: flex; gap: 6px; flex-shrink: 0; }
.att-admin .rsvp-btn { flex: 0 0 auto; min-width: 38px; }

/* Roster filter & sort toolbar (admin event detail) */
.roster-toolbar { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-3); color: var(--text-2);
  border-radius: 99px; transition: all var(--t) var(--ease); }
.chip:hover { color: var(--text-1); border-color: var(--border-2); }
.chip.active { background: var(--acc-soft); color: var(--accent); border-color: var(--acc-ring); }
.roster-sort { display: flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--text-3); white-space: nowrap; }
.roster-sort select { padding: 5px 8px; font-size: 12.5px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border-2); color: var(--text-1); }
.roster-rows { display: flex; flex-direction: column; gap: 6px; }

/* Member's own RSVP block in the event detail modal */
.modal-rsvp { margin: 14px 0 6px; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-3); }
.modal-rsvp .att-group-title { margin: 0 0 8px; }
.modal-rsvp .rsvp-group { gap: 8px; }
.modal-rsvp .rsvp-btn { flex: 1; }

/* ════════ TOAST ════════ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--bg-4); color: var(--text-1); border: 1px solid var(--border-2);
  padding: 11px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow);
  font-size: 13.5px; font-weight: 500; z-index: 200; opacity: 0;
  transition: all .25s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--r-ring); color: var(--red); }

[data-admin] { display: none; }
body.is-admin [data-admin] { display: inline-flex; }
body.is-admin .tab[data-admin] { display: inline-flex; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .tabs { order: 3; width: 100%; margin-left: 0; }
  .user-name, .user-role { display: none; }
  .content { padding: 20px 14px 50px; }
}
