/* =========================================================
   BMW Riders Club Hellas – Web Manager
   Dark, layered surfaces · BMW blue accent · Inter
   ========================================================= */
:root {
  --bg: #0a0c10;
  --bg-2: #0f1218;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --surface-3: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eef2f7;
  --text-2: #b4bfcd;
  --muted: #7d8898;
  --blue: #2f80d0;
  --blue-2: #4c9bf0;
  --blue-glow: rgba(47, 128, 208, .35);
  --green: #3ccf8e;
  --amber: #f5b14c;
  --red: #f26d6d;
  --violet: #a78bfa;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(47,128,208,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(47,128,208,.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14.5px/1.5 Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--blue-glow); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
a { color: var(--blue-2); }
h1, h2, h3, p { margin: 0; }
.ico { flex-shrink: 0; display: block; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-2); }
.nowrap { white-space: nowrap; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--blue-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
#login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand {
  position: relative; overflow: hidden; display: grid; place-items: center; padding: 48px;
  background: linear-gradient(160deg, #0d1626 0%, #0a0c10 70%);
  border-right: 1px solid var(--line);
}
.login-brand .glow {
  position: absolute; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47,128,208,.35), transparent 65%);
  filter: blur(20px); animation: float 9s ease-in-out infinite;
}
@keyframes float { 50% { transform: translate(30px, -24px) scale(1.06); } }
.login-logo { position: relative; width: min(360px, 70%); height: auto; filter: drop-shadow(0 20px 40px rgba(0,0,0,.5)); animation: rise .8s var(--ease) both; }
.login-logo-mobile { display: none; }
.login-pane { display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 20px; animation: rise .6s .1s var(--ease) both; }
.login-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- form controls ---------- */
.field { display: grid; gap: 7px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
input, select, textarea {
  width: 100%; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 13px; font: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: #5b6573; }
input:hover, select:hover, textarea:hover { border-color: rgba(255,255,255,.22); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-2); box-shadow: 0 0 0 4px rgba(47,128,208,.18); }
input:disabled { opacity: .55; cursor: not-allowed; }
input[type="datetime-local"] { color-scheme: dark; }
select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237d8898' stroke-width='2'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
textarea { min-height: 120px; resize: vertical; }
.input-icon { position: relative; }
.input-icon > .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > input { padding-left: 40px; }

/* toggle switch for checkboxes */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; color: var(--text); user-select: none; }
.switch input {
  appearance: none; width: 38px; height: 22px; padding: 0; border-radius: 99px; flex-shrink: 0; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background .2s;
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.switch input:checked { background: var(--blue); border-color: var(--blue); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { box-shadow: 0 0 0 4px rgba(47,128,208,.25); }
.switch input:disabled { opacity: .4; }
.switch small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: grid; gap: 18px; }
.form-section { display: grid; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.form-section > h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.form-section > h4 .ico { color: var(--blue-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-weight: 600; font-size: 13.5px;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: rgba(255,255,255,.22); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(47,128,208,.3); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(180deg, var(--blue-2), var(--blue)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -6px var(--blue-glow), inset 0 1px 0 rgba(255,255,255,.18); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: rgba(242,109,109,.1); color: var(--red); border-color: rgba(242,109,109,.3); }
.btn.danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.lg { padding: 13px 18px; font-size: 15px; }
.btn.full { width: 100%; }
.btn[aria-busy="true"] { color: transparent !important; position: relative; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }

.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 9px; color: var(--text-2); }
.icon-btn:hover { color: var(--text); }
.icon-btn.danger { background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn.danger:hover { background: rgba(242,109,109,.14); color: var(--red); border-color: transparent; }
.icon-btn.warn:hover { background: rgba(245,177,76,.14); color: var(--amber); }
.icon-btn.ok:hover { background: rgba(60,207,142,.14); color: var(--green); }

/* tooltips for icon buttons */
[data-tip] { position: relative; }
[data-tip]::before {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px);
  background: #1b2130; color: var(--text); border: 1px solid var(--line-2); font-size: 12px; font-weight: 600;
  padding: 5px 9px; border-radius: 7px; white-space: nowrap; pointer-events: none; opacity: 0; transition: .15s; z-index: 10;
}
[data-tip]:hover::before, [data-tip]:focus-visible::before { opacity: 1; transform: translate(-50%, 0); }

/* ---------- shell ---------- */
#shell { display: flex; min-height: 100vh; }
#sidebar {
  width: var(--sidebar); flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; background: rgba(10,12,16,.75); backdrop-filter: blur(18px);
  border-right: 1px solid var(--line); z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; }
.roundel { width: 38px; height: 38px; flex-shrink: 0; filter: drop-shadow(0 4px 12px var(--blue-glow)); }
.brand strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
#sidebar nav { flex: 1; overflow-y: auto; padding: 6px 12px; display: grid; gap: 2px; align-content: start; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #5b6573; padding: 16px 12px 6px; }
#sidebar nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 600; transition: background .15s, color .15s;
}
#sidebar nav a .ico { color: var(--muted); transition: color .15s; }
#sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
#sidebar nav a.active { background: linear-gradient(90deg, rgba(47,128,208,.22), rgba(47,128,208,.06)); color: #fff; }
#sidebar nav a.active .ico { color: var(--blue-2); }
#sidebar nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue-2); box-shadow: 0 0 12px var(--blue-2); }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 14px; margin: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.me-text { min-width: 0; }
.me-text strong, .me-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text strong { font-size: 13px; }
.me-text span { font-size: 11.5px; color: var(--muted); }

#main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 18px 32px; background: rgba(10,12,16,.72); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
#topbar .titles { flex: 1; min-width: 0; }
#topbar h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
#page-actions { display: flex; gap: 10px; }
#menu-btn { display: none; }
#view { padding: 28px 32px 60px; width: 100%; max-width: 1320px; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
#scrim { display: none; }

/* ---------- avatars & badges ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .02em;
  background: linear-gradient(135deg, hsl(var(--h, 210) 65% 52%), hsl(calc(var(--h, 210) + 40) 60% 38%));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge.green { color: var(--green); background: rgba(60,207,142,.1); border-color: rgba(60,207,142,.22); }
.badge.red { color: var(--red); background: rgba(242,109,109,.1); border-color: rgba(242,109,109,.22); }
.badge.amber { color: var(--amber); background: rgba(245,177,76,.1); border-color: rgba(245,177,76,.22); }
.badge.blue { color: var(--blue-2); background: rgba(47,128,208,.12); border-color: rgba(47,128,208,.28); }
.badge.violet { color: var(--violet); background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.24); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- cards & stats ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head a { font-size: 13px; font-weight: 600; text-decoration: none; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.hero h3 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin-top: 4px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat {
  position: relative; overflow: hidden; padding: 18px 18px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); transition: transform .2s var(--ease), border-color .2s;
  animation: rise .5s var(--ease) both;
}
.stat:hover { transform: translateY(-2px); border-color: var(--line-2); }
.stat::after { content: ""; position: absolute; right: -60px; top: -60px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle closest-side, var(--c, var(--blue)), transparent); opacity: .16; }
.stat .stat-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--c, var(--blue-2)); background: color-mix(in srgb, var(--c, var(--blue)) 14%, transparent); margin-bottom: 14px; }
.stat .num { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 2px; }
.stat .sub { font-size: 12px; color: var(--text-2); margin-top: 10px; display: flex; gap: 6px; align-items: center; }

.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); transition: background .15s; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.list-item .meta span { display: inline-flex; align-items: center; gap: 5px; }

.date-chip { width: 48px; flex-shrink: 0; text-align: center; border-radius: 11px; overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-2); }
.date-chip b { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--blue); color: #fff; padding: 2px 0; }
.date-chip span { display: block; font-size: 18px; font-weight: 800; padding: 3px 0 4px; }

.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--blue-2)); transition: width .6s var(--ease); }
.progress.full > i { background: linear-gradient(90deg, #d9534f, var(--red)); }
.cap { font-size: 12px; color: var(--text-2); font-weight: 600; white-space: nowrap; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; max-width: 380px; min-width: 220px; }
.toolbar .search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.toolbar .search input { padding-left: 40px; }
.count { color: var(--muted); font-size: 13px; font-weight: 500; }
.inline-form { display: flex; gap: 10px; flex: 1; max-width: 520px; }
.inline-form .input-icon { flex: 1; }

/* ---------- data tables ---------- */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; container: tbl / inline-size; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; }
table.data th, table.data td { padding: 13px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
table.data th {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  background: rgba(255,255,255,.02); white-space: nowrap; position: sticky; top: 0;
}
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: rgba(255,255,255,.03); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.actions, table.data th.actions { text-align: right; width: 1%; white-space: nowrap; }
.row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main .t { font-weight: 600; color: var(--text); }
.cell-main .s { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.cell-main > div { min-width: 0; }
.tile-ico { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; background: rgba(47,128,208,.12); color: var(--blue-2); }
table.data td.primary { min-width: 260px; }
table.data td.primary .t.clamp { -webkit-line-clamp: 2; }
.badge.cap-t { text-transform: capitalize; }
.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.id-pill { display: inline-block; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12.5px; padding: 3px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.two-line .a { color: var(--text); }
.two-line .b { color: var(--muted); font-size: 12.5px; }
.inline-ico { display: inline-flex; align-items: center; gap: 6px; }
.inline-ico .ico { color: var(--muted); }

.empty-state { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state .ico-wrap { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.empty-state h4 { margin: 4px 0 0; color: var(--text); font-size: 15px; }

/* skeleton loading */
.skeleton { display: grid; gap: 12px; }
.sk { height: 56px; border-radius: 12px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-3) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.sk.big { height: 120px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 4vh 16px; background: rgba(3,5,8,.62); backdrop-filter: blur(6px); animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 620px; background: #11151c; border: 1px solid var(--line-2); border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); animation: pop .28s var(--ease);
  display: flex; flex-direction: column; max-height: 92vh; overflow: hidden;
}
.modal.wide { max-width: 900px; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.modal-foot { flex-shrink: 0; padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #11151c; border-radius: 0 0 18px 18px; }
.modal-foot .spacer { flex: 1; }
.modal.confirm { max-width: 440px; }
.confirm-body { display: flex; gap: 16px; align-items: flex-start; }
.confirm-body .ico-wrap { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: rgba(242,109,109,.12); color: var(--red); }
.confirm-body p { color: var(--text-2); }

.fields-list { display: grid; gap: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 130px auto auto; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); animation: rise .25s var(--ease); }
.field-row input, .field-row select { background: transparent; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; border: 1px solid; }
.alert .ico { margin-top: 1px; }
.alert.error { color: #ffb4b4; background: rgba(242,109,109,.1); border-color: rgba(242,109,109,.25); }
.alert.info { color: var(--text-2); background: rgba(245,177,76,.07); border-color: rgba(245,177,76,.22); }
.alert.info .ico { color: var(--amber); }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 22px; right: 22px; display: grid; gap: 10px; z-index: 100; }
.toast {
  display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 380px; padding: 13px 16px;
  background: rgba(22,27,36,.92); backdrop-filter: blur(12px); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow); font-weight: 500; animation: slideIn .3s var(--ease);
}
.toast .ico { color: var(--blue-2); }
.toast.success .ico { color: var(--green); }
.toast.error .ico { color: var(--red); }
.toast.out { animation: slideOut .25s ease forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } }
@keyframes slideOut { to { opacity: 0; transform: translateX(24px); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .hide-lg { display: none; }
}
@media (max-width: 960px) {
  #login-screen { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-logo-mobile { display: block; width: 150px; margin: 0 auto 4px; }

  #sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .28s var(--ease); background: #0c0f14; }
  #sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  #scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .25s; }
  #sidebar.open + #scrim, #scrim.show { opacity: 1; pointer-events: auto; }
  #menu-btn { display: inline-flex; }
  #topbar { padding: 14px 18px; }
  #view { padding: 20px 18px 48px; }

}
@media (max-width: 640px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .stats { gap: 12px; }
  .stat .num { font-size: 24px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row > input { grid-column: 1 / -1; }
  #page-actions .btn .label { display: none; }
  #page-actions .btn { padding: 9px 11px; }
  .modal-body { padding: 18px; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 94vh; }
  #toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* participants capacity card */
.capacity { margin-bottom: 16px; }
.capacity-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.big-num { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }

/* Tables switch to stacked cards when their own container gets narrow
   (independent of window size, so the actions column is never cut off). */
@container tbl (max-width: 900px) {
  table.data thead { display: none; }
  table.data, table.data tr, table.data td { display: block; width: 100%; }
  table.data tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; padding: 12px; }
  table.data tr { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
  table.data tbody tr:hover { background: var(--bg-2); border-color: var(--line-2); }
  table.data td.actions { margin-top: auto !important; }
  table.data td[colspan] { grid-column: 1 / -1; }
  table.data tr:has(td[colspan]) { grid-column: 1 / -1; border: 0; background: none; }
  table.data td { border: 0 !important; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  table.data td[data-label]::before { content: attr(data-label); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); flex-shrink: 0; text-align: left; }
  table.data td.primary { padding-bottom: 10px; text-align: left; }
  table.data td.actions { width: 100%; justify-content: flex-end; padding-top: 10px; margin-top: 6px; border-top: 1px dashed var(--line) !important; }
  table.data td > .badges { justify-content: flex-end; }
  table.data td .two-line { text-align: right; }
}

.modal.confirm.primary .confirm-body .ico-wrap { background: rgba(47,128,208,.14); color: var(--blue-2); }
