:root {
  --bg: #1E1E29;
  --panel: #2B2B38;
  --panel-2: #343444;
  --panel-3: #3D3D4E;
  --fg: #ECECF4;
  --body: #C9C9D8;
  --muted: #9A9AB0;
  --brand: #7E7ECE;
  --brand-2: #9292E6;
  --brand-soft: rgba(126, 126, 206, 0.16);
  --lead: #2EE6A0;
  --tail: #FF90E6;
  --assistant: #4C9AFF;
  --media: #FFB454;
  --avail: #EE8CAB;
  --border: rgba(126, 126, 206, 0.20);
  --border-strong: rgba(126, 126, 206, 0.38);
  --danger: #EE6A8A;
  --ok: #2EE6A0;

  /* Shape tokens */
  --r-xs: 10px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Elevation: soft, layered diffusion on dark */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.40);
  --shadow-brand: 0 10px 26px rgba(126, 126, 206, 0.28);

  /* Spacing rhythm */
  --sp-1: 6px;
  --sp-2: 10px;
  --sp-3: 14px;
  --sp-4: 18px;
  --sp-5: 24px;
  --sp-6: 30px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.25, 1);
  --t-fast: 0.16s;
  --t-med: 0.24s;

  /* Layout */
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 620px at 88% -12%, rgba(126, 126, 206, 0.14), transparent 60%),
    radial-gradient(900px 520px at -10% 108%, rgba(76, 154, 255, 0.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--fg);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Login ---------- */
.login-wrap {
  position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(rgba(34,34,46,.66), rgba(34,34,46,.84)),
    radial-gradient(1200px 700px at 50% -10%, rgba(126,126,206,.22), transparent 60%),
    url("assets/login-bg.jpg") center / cover no-repeat, var(--bg);
  padding: 24px; overflow: hidden;
}
.login-aurora { position: absolute; inset: 0; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(48px); opacity: .5;
  animation: orbFloat 14s ease-in-out infinite;
}
.orb-a { width: 340px; height: 340px; left: 12%; top: 16%; background: rgba(126,126,206,.45); }
.orb-b { width: 280px; height: 280px; right: 14%; top: 30%; background: rgba(76,154,255,.32); animation-delay: -5s; }
.orb-c { width: 240px; height: 240px; left: 38%; bottom: 8%; background: rgba(255,144,230,.22); animation-delay: -9s; }
.grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(126,126,206,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126,126,206,.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 75%);
  animation: gridDrift 22s linear infinite;
}
.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px; background: rgba(43,43,56,.82); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-left: 4px solid var(--brand);
  border-radius: var(--r-xl); padding: 36px 32px; text-align: center;
  box-shadow: var(--shadow-lg);
  animation: cardIn .5s var(--ease) both;
}
.logo-ring {
  width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center; position: relative;
  background: linear-gradient(135deg, rgba(126,126,206,.25), rgba(76,154,255,.18));
  border: 1px solid var(--border);
}
.logo-ring::before {
  content: ""; position: absolute; inset: -6px; border-radius: 26px;
  border: 1px solid rgba(126,126,206,.35); animation: ringPulse 3.2s ease-in-out infinite;
}
.brand-mark {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), #5E5EB0);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff;
}
.brand-mark.sm { width: 38px; height: 38px; margin: 0; border-radius: 11px; font-size: 19px; }
.brand-logo {
  width: 60px; height: 60px; margin: 0; border-radius: 16px;
  object-fit: cover; display: block; border: 1px solid var(--border);
}
.brand-logo.sm { width: 38px; height: 38px; margin: 0; border-radius: 11px; }
.login-card h1 { margin: 0 0 22px; font-size: 25px; letter-spacing: .06em; font-weight: 800; }
.word-brand { color: var(--brand); }
.word-pink { color: var(--avail); }
.login-card .sub { color: var(--body); font-size: 14px; line-height: 1.6; margin: 0 0 22px; }
.foot-note { color: var(--muted); font-size: 12px; margin: 16px 0 0; }
#btn-login { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.discord-logo { flex: 0 0 auto; }
.slogan { color: var(--muted); font-size: 12px; letter-spacing: .06em; margin: 16px 0 0; }
.login-card .btn-primary { position: relative; overflow: hidden; }
.login-card .btn-primary::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.22), transparent);
  animation: sheen 3.4s ease-in-out infinite;
}

.alert { border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
.alert-err { background: rgba(238,106,138,.14); color: var(--avail); border: 1px solid rgba(238,106,138,.35); }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid transparent; border-radius: var(--r-sm); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; padding: 10px 16px;
  color: var(--fg); background: var(--panel-2);
  transition: filter var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(126,126,206,.42); filter: brightness(1.06); }
.btn-secondary { background: var(--panel-3); }
.btn-danger { background: rgba(238,106,138,.16); color: var(--avail); border-color: rgba(238,106,138,.35); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--body); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-lg { width: 100%; padding: 13px 18px; font-size: 15px; border-radius: var(--r-md); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- App layout ---------- */
.app { position: relative; min-height: 100vh; display: flex; }

/* Sidebar: collapsed icon rail by default; expands on hover. It stays in
   the flex flow, so the main content resizes beside it instead of being
   covered. */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  flex: 0 0 var(--sidebar-w-collapsed); width: var(--sidebar-w-collapsed);
  background: rgba(43, 43, 56, 0.86); backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 22px 12px; gap: 22px;
  overflow: hidden;
  transition: flex-basis var(--t-med) var(--ease), width var(--t-med) var(--ease),
    padding var(--t-med) var(--ease);
  box-shadow: var(--shadow-lg);
}
.sidebar:hover {
  flex-basis: var(--sidebar-w); width: var(--sidebar-w);
  padding-left: 16px; padding-right: 16px;
}
.side-brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.sidebar:hover .side-brand { justify-content: flex-start; }
.side-text { display: none; flex-direction: column; min-width: 0; }
.sidebar:hover .side-text { display: flex; }
.side-title { font-weight: 700; font-size: 16px; letter-spacing: .05em; white-space: nowrap; }
.side-sub { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  text-align: left; background: transparent; border: 0; color: var(--body);
  font: inherit; font-size: 14px; font-weight: 600; padding: 11px 12px; border-radius: var(--r-sm); cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.sidebar:hover .nav-item { justify-content: flex-start; padding-left: 14px; padding-right: 14px; }
.nav-icon { flex: 0 0 auto; width: 18px; height: 18px; }
.nav-label { display: none; white-space: nowrap; }
.sidebar:hover .nav-label { display: inline; }
.nav-item:hover { background: var(--panel-2); color: var(--fg); }
.sidebar:hover .nav-item:hover { transform: translateX(3px); }
.nav-item.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: var(--shadow-brand);
}
.side-user {
  margin-top: auto; display: flex; align-items: center; gap: 10px; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 8px;
}
.sidebar:hover .side-user { justify-content: flex-start; padding: 12px; }
.avatar {
  width: 38px; height: 38px; border-radius: 12px; background: var(--brand);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff;
  overflow: hidden; flex: 0 0 auto;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who { display: none; flex: 1; min-width: 0; }
.sidebar:hover .who { display: block; }
.sidebar #btn-logout { display: none; }
.sidebar:hover #btn-logout { display: inline-flex; }
.who-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-name.role-supervisor { color: var(--brand); }
.who-name.role-assistant { color: var(--assistant); }
.who-name.role-media { color: var(--media); }
.who-name.role-staff { color: var(--fg); }
.who-role { font-size: 12px; color: var(--muted); }
.side-token { display: flex; flex-direction: column; gap: 8px; }
.btn-block { width: 100%; }
.token-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; }
.token-box code { display: block; font-size: 12px; color: var(--fg); word-break: break-all; line-height: 1.5; }
.token-hint { margin: 6px 0 0; font-size: 11px; color: var(--muted); line-height: 1.4; }

.content {
  flex: 1; min-width: 0; margin-left: 0; padding: 30px 32px; overflow: auto;
}
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-head h2 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: .01em; }

.tab { display: none; }
.tab.active { display: block; }

.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.event-grid > .card, .event-side-col { align-self: start; }
.event-side-col { display: flex; flex-direction: column; gap: 18px; }
.cols-1 { grid-template-columns: 1fr; }
@media (max-width: 980px) {
  .cols-2 { grid-template-columns: 1fr; }
  .radar-body { flex-direction: column; }
  .radar-members { width: 100%; flex-basis: auto; }
  .radar-wrap { height: 420px; }
  /* Narrow screens: keep the rail as icons only, no hover expand. */
  .sidebar, .sidebar:hover { flex-basis: var(--sidebar-w-collapsed); width: var(--sidebar-w-collapsed); padding-left: 12px; padding-right: 12px; }
  .side-text, .nav-label, .who, #btn-logout { display: none; }
  .side-brand { justify-content: center; }
  .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
  .side-user { justify-content: center; padding: 12px 8px; }
  .event-details { max-height: none; opacity: 1; }
}

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.card h3 { margin: 0 0 16px; font-size: 15px; font-weight: 700; color: var(--body); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid.single { grid-template-columns: 1fr; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
input, textarea, select {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--fg); font: inherit; font-size: 14px; padding: 10px 12px; outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
input:hover, textarea:hover, select:hover { border-color: rgba(126,126,206,.45); }
input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(126,126,206,.18);
}
textarea { resize: vertical; }
.form-msg { margin-top: 14px; font-size: 13px; min-height: 18px; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--avail); }

/* Large single-column event form */
.event-form-card { padding: 26px; }
.event-form-card .form-grid { gap: 16px; }
.form-block { grid-column: 1 / -1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; }
.form-block-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; letter-spacing: .02em; }
.dlc-group + .dlc-group { margin-top: 12px; }
.dlc-group-title { font-size: 12px; color: var(--body); margin-bottom: 8px; }
.dlc-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; }
.dlc-check { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--body); cursor: pointer; }
.dlc-check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- Seats / status ---------- */
.seat-list, .status-list { display: flex; flex-direction: column; gap: 12px; }
.seat-row {
  display: flex; align-items: center; gap: 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 13px 14px;
}
.seat-badge {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 15px; color: #111;
}
.seat-badge.lead { background: var(--lead); }
.seat-badge.tail { background: var(--tail); }
.seat-info { flex: 1; min-width: 0; }
.seat-name { font-weight: 600; font-size: 14px; }
.seat-meta { color: var(--muted); font-size: 12px; }
.seat-empty { color: var(--muted); font-size: 13px; }
.status-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.status-line:last-child { border-bottom: 0; }
.status-line .k { color: var(--muted); }

/* ---------- Members cards ---------- */
.member-teams { display: flex; flex-direction: column; gap: 24px; }
.team-group { display: flex; flex-direction: column; gap: 12px; }
.team-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px;
}
.team-title { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.team-count { font-size: 12px; }
.member-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}

/* ---------- Radar ---------- */
.radar-card { display: flex; flex-direction: column; gap: 14px; height: calc(100vh - 116px); }
.radar-body { display: flex; gap: 14px; align-items: stretch; flex: 1; min-height: 0; }
.radar-legend { display: flex; gap: 18px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--body); }
.legend-item .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-item .dot.lead { background: var(--lead); }
.legend-item .dot.tail { background: var(--tail); }
.legend-item .dot.supervisor { background: var(--brand); }
.legend-item .dot.assistant { background: var(--assistant); }
.legend-item .dot.media { background: var(--media); }
.legend-item .dot.staff { background: var(--fg); }
.radar-wrap {
  position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; height: 100%; background: #13131E;
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
}
#radar-tile-canvas, #radar-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#radar-tile-canvas { z-index: 0; }
#radar-canvas { z-index: 1; cursor: grab; }
#radar-canvas.dragging { cursor: grabbing; }
.radar-empty {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 14px; z-index: 2;
}
.radar-controls {
  position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 3;
}
.radar-controls button {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel); color: var(--fg); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.radar-controls button:hover { border-color: rgba(126,126,206,.5); background: rgba(126,126,206,.12); }
.radar-members {
  width: 232px; flex: 0 0 232px; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); overflow: hidden;
}
.radar-members h3 {
  margin: 14px 16px 8px; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.radar-member-list { overflow-y: auto; padding: 0 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.radar-member-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-xs);
  border: 1px solid transparent; cursor: pointer; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.radar-member-item:hover { background: rgba(126,126,206,.12); }
.radar-member-item.active { background: rgba(126,126,206,.18); border-color: rgba(126,126,206,.4); }
.radar-member-item .m-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.radar-member-item .m-name {
  flex: 1; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.radar-member-item .m-seat { font-size: 11px; color: var(--muted); text-transform: uppercase; }

/* Lead / Tail live speed chips, pinned to the left / right edge of the map. */
.seat-speed {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  min-width: 156px; padding: 12px 16px; border-radius: 14px;
  background: rgba(46,46,60,.86); border: 1px solid var(--border);
  backdrop-filter: blur(8px); display: flex; flex-direction: column; gap: 4px;
  pointer-events: none;
}
.speed-lead { left: 16px; border-left: 3px solid var(--lead); }
.speed-tail { right: 16px; border-right: 3px solid var(--tail); }
.seat-speed .ss-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-speed .ss-speed { font-size: 22px; font-weight: 800; letter-spacing: .02em; }
.speed-lead .ss-speed { color: var(--lead); }
.speed-tail .ss-speed { color: var(--tail); }
.seat-speed.empty { opacity: .5; }

.member-card {
  position: relative; border-radius: var(--r-lg); padding: 16px 16px 14px;
  border: 1px solid var(--border); border-left: 4px solid var(--brand);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease), opacity var(--t-med) var(--ease);
}
.member-card.enter-anim { animation: fadeUp .35s ease both; }
.member-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.member-card.offline { opacity: .6; }
.member-card.seat-lead { border-left-color: var(--lead); }
.member-card.seat-tail { border-left-color: var(--tail); }
.member-top { display: flex; align-items: center; gap: 10px; }
.member-avatar {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px;
  overflow: hidden;
}
.member-avatar img, .avatar img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.member-avatar:hover img, .avatar:hover img { transform: scale(1.08); }
.seat-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
}
.seat-pill.lead { background: rgba(46,230,160,.18); color: var(--lead); }
.seat-pill.tail { background: rgba(255,144,230,.18); color: var(--tail); }
.member-main { flex: 1; min-width: 0; }
.member-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-name.role-supervisor { color: var(--brand); }
.member-name.role-assistant { color: var(--assistant); }
.member-name.role-media { color: var(--media); }
.member-name.role-staff { color: var(--fg); }
.member-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-meta { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.meta-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.meta-line .k { color: var(--muted); flex: 0 0 auto; }
.meta-line .v { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.foot-actions { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.supervisor { background: rgba(126,126,206,.22); color: var(--brand); }
.pill.assistant { background: rgba(76,154,255,.16); color: var(--assistant); }
.pill.media { background: rgba(255,180,84,.16); color: var(--media); }
.pill.staff { background: rgba(154,154,176,.18); color: var(--body); }
.online-dot { color: var(--ok); font-weight: 700; }
.offline-dot { color: var(--muted); }
select.role-select { padding: 7px 10px; font-size: 13px; }
.member-card.event-member {
  border-left-color: var(--assistant);
  background: linear-gradient(180deg, rgba(76,154,255,.09), var(--panel));
}
.event-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--body); cursor: pointer; }
.event-toggle input { accent-color: var(--assistant); width: 14px; height: 14px; cursor: pointer; }

.cfg-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; font-size: 12px; color: var(--body); white-space: pre-wrap;
  word-break: break-all; margin: 0 0 4px; line-height: 1.5;
}
code { color: var(--brand); }

/* ---------- Motion & interaction polish ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(46,230,160,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(46,230,160,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,230,160,0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.tab.active { animation: fadeIn .25s ease; }
.login-card { animation: fadeUp .4s ease both; }

.pill, .seat-pill { transition: filter .18s, transform .18s; }
.pill:hover, .seat-pill:hover { filter: brightness(1.15); transform: translateY(-1px); }

.seat-row { transition: border-color .2s, transform .2s, background .2s; }
.seat-row:hover { border-color: rgba(126,126,206,.35); transform: translateY(-1px); }

.online-dot {
  color: var(--ok); font-weight: 700;
  display: inline-block; border-radius: 50%;
  animation: pulseDot 2s infinite;
}

/* Slim themed scrollbar for the content area */
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb {
  background: rgba(126,126,206,.28); border-radius: 999px; border: 2px solid var(--bg);
}
.content::-webkit-scrollbar-thumb:hover { background: rgba(126,126,206,.45); }

/* ---------- Event card (Dashboard) ---------- */
.event-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.event-banner {
  height: 150px; background: var(--panel-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.event-banner img { width: 100%; height: 100%; object-fit: cover; }
.event-banner:empty { display: none; }
.event-body { padding: 18px 20px; }
.event-body h3 { margin: 0 0 10px; font-size: 17px; }
.event-body h3 a { color: var(--fg); text-decoration: none; }
.event-body h3 a:hover { color: var(--brand-2); }
.event-meta { display: flex; flex-direction: column; gap: 6px; }
.event-meta .meta-line { font-size: 13px; }
.event-summary { font-size: 13px; }
.event-details {
  display: flex; flex-direction: column; gap: 18px;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height var(--t-med) var(--ease), opacity var(--t-med) var(--ease);
}
.event-card:hover .event-details { max-height: 1200px; opacity: 1; }

/* Large single-column event card on the Dashboard */
.event-card-large { border-radius: 18px; animation: cardIn .5s cubic-bezier(.2,.8,.25,1) both; }
.event-card-large .event-banner { height: 210px; }
.event-card-large .event-body { padding: 24px 26px; display: flex; flex-direction: column; gap: 18px; }
.event-card-large .event-body h3 { font-size: 19px; margin: 0; }
.event-card-large .event-meta { gap: 9px; }
.event-card-large .event-meta .meta-line { font-size: 13.5px; }
.event-card-large .event-meta .meta-line .k { color: var(--muted); min-width: 96px; display: inline-block; }

.seat-block { border-top: 1px solid var(--border); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.seat-block-title { margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.seat-block .seat-row { animation: fadeUp .35s ease both; }
.seat-block .seat-row:nth-child(2) { animation-delay: .08s; }

.save-info { margin-top: 14px; font-size: 13px; min-height: 18px; }
.save-info strong { color: var(--fg); }

/* Dashboard secondary card: files & registration links */
.dash-side-card h3 { margin-bottom: 10px; }
.dash-side-card .save-info { margin-top: 0; margin-bottom: 4px; }
.dash-side-card .btn-row { margin-top: 12px; }
.dash-side-card .btn { flex: 0 1 auto; }

/* ---------- Dashboard hero + stats ---------- */
.dash-hero-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.dash-hero-text h2 { margin: 0 0 4px; font-size: 26px; font-weight: 800; letter-spacing: .01em; }
.dash-greeting-sub { margin: 0; color: var(--muted); font-size: 14px; }

.stats-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px; margin-bottom: 22px;
}
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-icon {
  width: 38px; height: 38px; border-radius: var(--r-sm); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand-2);
}
.stat-icon svg { width: 19px; height: 19px; }
.stat-value { font-size: 25px; font-weight: 800; letter-spacing: .01em; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700;
}
.stat-pill.ok { background: rgba(46, 230, 160, .16); color: var(--lead); }
.stat-pill.warn { background: rgba(255, 180, 84, .16); color: var(--media); }
.stat-pill.muted { background: rgba(154, 154, 176, .16); color: var(--body); }

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }

@media (max-width: 1100px) {
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* ---------- Archive / event list ---------- */
.archive-list { display: flex; flex-direction: column; gap: 12px; }
.archive-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 13px 14px;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.archive-item:hover { border-color: rgba(126,126,206,.35); transform: translateY(-1px); }
.archive-item.active { border-left: 3px solid var(--brand); }
.archive-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.archive-sub { color: var(--muted); font-size: 12px; margin: 4px 0 10px; }
.archive-actions { display: flex; gap: 8px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }

/* ---------- Event attendees ---------- */
.attendee-add { display: flex; gap: 8px; margin-bottom: 12px; }
.attendee-add select { flex: 1; }
.attendee-list { display: flex; flex-direction: column; gap: 10px; }
.attendee-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px;
}
.attendee-avatar {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  background: rgba(126,126,206,.18);
}
.attendee-avatar img { width: 100%; height: 100%; object-fit: cover; }
.attendee-main { flex: 1; min-width: 0; }
.attendee-name { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.attendee-sub { font-size: 12px; margin-top: 2px; display: flex; align-items: center; gap: 8px; }

/* Dashboard attendees: compact avatar row on the card body, full rows in details */
.att-avatars { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 2px; }
.att-avatar {
  position: relative; width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; box-sizing: border-box; cursor: default;
  border: 2px solid var(--body); background: rgba(154, 154, 176, .18);
}
.att-avatar img { width: 100%; height: 100%; object-fit: cover; }
.att-avatar.role-supervisor { border-color: var(--brand); background: rgba(126, 126, 206, .18); }
.att-avatar.role-assistant { border-color: var(--assistant); background: rgba(76, 154, 255, .16); }
.att-avatar.role-media { border-color: var(--media); background: rgba(255, 180, 84, .16); }
.att-avatar.role-staff { border-color: var(--body); background: rgba(154, 154, 176, .18); }
.att-avatar::after {
  content: attr(data-name);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(2px);
  background: var(--panel-3); color: var(--fg); font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 20;
  border: 1px solid var(--border);
}
.att-avatar:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Full rows inside the expandable details: role-colored ring on the avatar */
.event-details .attendee-avatar { box-sizing: border-box; border: 2px solid var(--body); background: rgba(154, 154, 176, .18); }
.event-details .attendee-avatar.role-supervisor { border-color: var(--brand); background: rgba(126, 126, 206, .18); }
.event-details .attendee-avatar.role-assistant { border-color: var(--assistant); background: rgba(76, 154, 255, .16); }
.event-details .attendee-avatar.role-media { border-color: var(--media); background: rgba(255, 180, 84, .16); }
.event-details .attendee-avatar.role-staff { border-color: var(--body); background: rgba(154, 154, 176, .18); }

/* Multi-member target picker */
.multi-targets {
  margin-top: 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 14px 16px;
}
.multi-label { font-size: 12px; color: var(--muted); }
.multi-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 16px; margin-top: 10px;
}
.multi-check {
  flex-direction: row; align-items: center; gap: 8px;
  font-size: 13px; color: var(--body); cursor: pointer;
}
.multi-check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- Notice list ---------- */
.notice-panels {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px; margin-bottom: 6px;
}
.notice-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
  border-top: 3px solid var(--accent, var(--brand));
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.notice-panel:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.notice-panel.editing { border-color: var(--accent, var(--brand)); box-shadow: 0 0 0 3px rgba(126,126,206,.18); }
.np-head { display: flex; align-items: center; gap: 9px; }
.np-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent, var(--brand)); flex: 0 0 auto; }
.np-title { font-weight: 700; font-size: 14px; flex: 1; }
.np-aud { font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.np-actions { display: flex; justify-content: flex-end; margin-top: 2px; }

.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice-item {
  background: var(--bg); border: 1px solid var(--border); border-left: 3px solid var(--accent, var(--assistant));
  border-radius: var(--r-sm); padding: 13px 14px; animation: noticeIn .3s ease both;
}
.notice-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.notice-badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.notice-audience, .notice-aud { color: var(--muted); font-size: 12px; }
.notice-item.single .notice-audience { color: var(--tail); }
.notice-title { font-weight: 600; font-size: 14px; }
.notice-body { color: var(--body); font-size: 13px; line-height: 1.55; margin-top: 4px; }
.notice-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.notice-who { font-size: 12px; color: var(--muted); }

/* ---------- Login keyframes ---------- */
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -26px) scale(1.08); }
  66% { transform: translate(-22px, 18px) scale(.95); }
}
@keyframes gridDrift { from { background-position: 0 0; } to { background-position: 46px 46px; } }
@keyframes ringPulse {
  0%, 100% { opacity: .5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
@keyframes sheen {
  0% { left: -60%; } 45% { left: 130%; } 100% { left: 130%; }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes noticeIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
