/* ============================================================
   J10 Oilers – app tokens and components
   Builds on advania-tokens.css. Plain CSS, no JS dependencies:
   every component works in Blazor static SSR.
   ============================================================ */

:root {
  /* --- App surfaces --- */
  --j-bg:            var(--adv-surface-subtle);
  --j-surface:       var(--adv-surface-card);
  --j-header-bg:     var(--adv-surface-brand-deep);
  --j-header-fg:     var(--adv-text-on-dark);
  --j-header-muted:  var(--adv-text-on-dark-muted);
  --j-sidebar-bg:    var(--adv-surface-brand-deep);

  /* --- Shape and size --- */
  --j-radius-card:    var(--adv-radius-md);
  --j-radius-control: var(--adv-radius-sm);
  --j-tap:            44px;
  --j-page-max:       1240px;
  --j-form-max:       560px;

  /* --- Focus (always visible, WCAG 2.4.7) --- */
  --j-focus-color:         var(--adv-indigo);
  --j-focus-color-on-dark: #ffffff;

  /* --- Game status: text / surface pairs (all ≥ 4.5:1) --- */
  --j-open-fg:      #1f6e34;  --j-open-bg:      var(--adv-color-success-surface);
  --j-few-fg:       #a8341f;  --j-few-bg:       var(--adv-color-warning-surface);
  --j-full-fg:      #9e1f1f;  --j-full-bg:      var(--adv-color-danger-surface);
  --j-closed-fg:    var(--adv-text-muted); --j-closed-bg: var(--adv-surface-muted);
  --j-played-fg:    var(--adv-text-muted); --j-played-bg: var(--adv-surface-muted);
  --j-postponed-fg: #0d6e87;  --j-postponed-bg: var(--adv-color-info-surface);
  --j-pending-fg:   var(--adv-indigo); --j-pending-bg: var(--adv-surface-brand-tint);

  /* --- Ticket pips --- */
  --j-seat-free:  var(--adv-color-success);
  --j-seat-taken: var(--adv-grey-300);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--adv-font-sans);
  font-size: var(--adv-text-base);
  line-height: var(--adv-leading-base);
  color: var(--adv-text-body);
  background: var(--j-bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--adv-font-display); color: var(--adv-text-strong); margin: 0; line-height: 1.12; letter-spacing: var(--adv-tracking-tight); text-wrap: balance; }
h1 { font-size: var(--adv-text-2xl); font-weight: 700; }
h2 { font-size: var(--adv-text-lg); font-weight: 700; }
h3 { font-size: var(--adv-text-base); font-weight: 700; letter-spacing: 0; }
p { margin: 0; }
a { color: var(--adv-text-link); text-decoration: underline; text-underline-offset: .18em; }
:focus-visible { outline: 2px solid var(--j-focus-color); outline-offset: 2px; box-shadow: var(--adv-focus-ring); }
.on-dark :focus-visible, .on-dark:focus-visible { outline-color: var(--j-focus-color-on-dark); box-shadow: none; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: var(--adv-text-xs); font-weight: 600; letter-spacing: var(--adv-tracking-wider); text-transform: uppercase; color: var(--adv-color-secondary); }
.muted { color: var(--adv-text-muted); }
.small { font-size: var(--adv-text-sm); line-height: var(--adv-leading-sm); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--j-tap); padding: 10px 20px;
  font: 600 16px/1 var(--adv-font-sans); text-decoration: none; white-space: nowrap;
  border-radius: var(--j-radius-control); border: 1px solid transparent;
  background: var(--adv-color-primary); color: var(--adv-on-primary); cursor: pointer;
  transition: background var(--adv-duration-fast) var(--adv-ease);
}
.btn:hover { background: var(--adv-color-primary-hover); }
.btn:active { background: var(--adv-color-primary-active); }
.btn--ghost { background: transparent; color: var(--adv-indigo); border-color: var(--adv-border-strong); }
.btn--ghost:hover { background: var(--adv-surface-brand-tint); }
.btn--subtle { background: var(--adv-surface-brand-tint); color: var(--adv-indigo); }
.btn--subtle:hover { background: var(--adv-indigo-100); }
.btn--danger { background: var(--adv-color-danger); }
.btn--danger:hover { background: #a81f1f; }
.btn--danger-ghost { background: transparent; color: #9e1f1f; border-color: var(--adv-border-strong); }
.btn--danger-ghost:hover { background: var(--adv-color-danger-surface); }
.btn--sm { min-height: 36px; padding: 8px 14px; font-size: 14px; }
.btn--block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--adv-surface-muted); color: var(--adv-text-muted); border-color: transparent; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Badges (status) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: var(--adv-radius-pill);
  font: 600 13px/1 var(--adv-font-sans); white-space: nowrap;
  background: var(--adv-surface-muted); color: var(--adv-text-muted);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--plain::before { display: none; }
.badge--open      { background: var(--j-open-bg);      color: var(--j-open-fg); }
.badge--few       { background: var(--j-few-bg);       color: var(--j-few-fg); }
.badge--full      { background: var(--j-full-bg);      color: var(--j-full-fg); }
.badge--closed    { background: var(--j-closed-bg);    color: var(--j-closed-fg); }
.badge--played    { background: var(--j-played-bg);    color: var(--j-played-fg); }
.badge--postponed { background: var(--j-postponed-bg); color: var(--j-postponed-fg); }
.badge--pending   { background: var(--j-pending-bg);   color: var(--j-pending-fg); }

/* Home / away marker */
.ha { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; font: 700 12px/1 var(--adv-font-sans); }
.ha--home { background: var(--adv-indigo); color: #fff; }
.ha--away { background: transparent; color: var(--adv-indigo); box-shadow: inset 0 0 0 1.5px var(--adv-indigo); }

/* ---------- Ticket pips (4 seats) ---------- */
.seats { display: inline-flex; gap: 4px; }
.seat { width: 10px; height: 16px; border-radius: 3px 3px 2px 2px; background: var(--j-seat-free); }
.seat--taken { background: var(--j-seat-taken); }
.seats--lg .seat { width: 18px; height: 28px; border-radius: 5px 5px 3px 3px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 600; color: var(--adv-text-strong); }
.label .opt { font-weight: 400; color: var(--adv-text-muted); }
.hint { font-size: 13px; line-height: 18px; color: var(--adv-text-muted); }
.error-text { font-size: 13px; line-height: 18px; color: var(--adv-color-danger); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: var(--j-tap); padding: 10px 14px;
  font: 400 16px/24px var(--adv-font-sans); color: var(--adv-text-body);
  background: var(--j-surface); border: 1px solid var(--adv-border-strong); border-radius: var(--j-radius-control);
}
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--j-focus-color); outline-offset: 0; border-color: var(--adv-indigo); box-shadow: var(--adv-focus-ring); }
.input[aria-invalid="true"] { border-color: var(--adv-color-danger); }
.textarea { min-height: 88px; resize: vertical; }
.select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--adv-indigo) 50%), linear-gradient(135deg, var(--adv-indigo) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--adv-border-strong); border-radius: var(--j-radius-control); background: var(--j-surface); cursor: pointer; }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--adv-indigo); flex: none; }
.choice--on { border-color: var(--adv-indigo); background: var(--adv-surface-brand-tint); }
.check { width: 20px; height: 20px; accent-color: var(--adv-indigo); }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--adv-radius-md); border-left: 3px solid var(--adv-color-info); background: var(--adv-color-info-surface); }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.alert__title { font-weight: 700; line-height: 22px; }
.alert__body { font-size: 14px; line-height: 20px; color: var(--adv-text-muted); }
.alert--info    { border-color: var(--adv-color-info);    background: var(--adv-color-info-surface); }
.alert--info .alert__title, .alert--info svg { color: #0d6e87; }
.alert--success { border-color: var(--adv-color-success); background: var(--adv-color-success-surface); }
.alert--success .alert__title, .alert--success svg { color: #1f6e34; }
.alert--warning { border-color: var(--adv-color-warning); background: var(--adv-color-warning-surface); }
.alert--warning .alert__title, .alert--warning svg { color: #a8341f; }
.alert--danger  { border-color: var(--adv-color-danger);  background: var(--adv-color-danger-surface); }
.alert--danger .alert__title, .alert--danger svg { color: #9e1f1f; }
.alert--brand   { border-color: var(--adv-indigo);        background: var(--adv-surface-brand-tint); }
.alert--brand .alert__title, .alert--brand svg { color: var(--adv-indigo); }

/* ---------- Cards ---------- */
.card { background: var(--j-surface); border: 1px solid var(--adv-border); border-radius: var(--j-radius-card); }

/* ---------- Employee header (mobile + desktop) ---------- */
.topbar { background: var(--j-header-bg); color: var(--j-header-fg); }
.topbar__row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 16px; max-width: var(--j-page-max); margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 29px; }
.brand small { display: block; font-size: 11px; font-weight: 600; letter-spacing: var(--adv-tracking-wider); text-transform: uppercase; color: var(--j-header-muted); line-height: 1; margin-top: 3px; }
.tabs { display: flex; gap: 4px; padding: 0 12px; max-width: var(--j-page-max); margin: 0 auto; }
.tab { display: inline-flex; align-items: center; min-height: var(--j-tap); padding: 0 12px; color: var(--j-header-muted); font-weight: 600; font-size: 15px; text-decoration: none; border-bottom: 3px solid transparent; }
.tab:hover { color: #fff; }
.tab[aria-current="page"] { color: #fff; border-bottom-color: var(--adv-pink); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: var(--j-tap); height: var(--j-tap); border-radius: var(--j-radius-control); border: 0; background: transparent; color: inherit; cursor: pointer; }
.iconbtn:hover { background: rgba(255,255,255,.1); }
.iconbtn svg { width: 22px; height: 22px; }

/* Segmented list/calendar switch – plain links */
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--adv-surface-muted); }
.seg a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--adv-text-muted); text-decoration: none; }
.seg a svg { width: 16px; height: 16px; }
.seg a[aria-current="page"] { background: var(--j-surface); color: var(--adv-indigo); box-shadow: var(--adv-shadow-sm); }

/* ---------- Game card (list) ---------- */
.game { display: flex; gap: 14px; align-items: stretch; padding: 14px; background: var(--j-surface); border: 1px solid var(--adv-border); border-radius: var(--j-radius-card); color: inherit; text-decoration: none; }
.game:hover { border-color: var(--adv-indigo-200); box-shadow: var(--adv-shadow-md); }
.game__date { flex: none; width: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; background: var(--adv-surface-brand-tint); color: var(--adv-indigo); padding: 6px 0; }
.game__dow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.game__day { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.game__mon { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.game__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.game__title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--adv-text-strong); line-height: 22px; }
.game__meta { font-size: 14px; line-height: 20px; color: var(--adv-text-muted); }
.game__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.game--played { background: var(--adv-surface-subtle); }
.game--played .game__date { background: var(--adv-surface-muted); color: var(--adv-text-muted); }
.game--muted .game__date { background: var(--adv-surface-muted); color: var(--adv-text-muted); }
.score { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--adv-text-strong); }
.strike { text-decoration: line-through; }

/* ---------- Calendar (CSS grid) ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--adv-border); border-left: 1px solid var(--adv-border); background: var(--j-surface); border-radius: var(--j-radius-card); overflow: hidden; }
.cal__dow { padding: 10px 12px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--adv-text-muted); background: var(--adv-surface-subtle); border-right: 1px solid var(--adv-border); border-bottom: 1px solid var(--adv-border); }
.cal__day { min-height: 120px; padding: 8px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--adv-border); border-bottom: 1px solid var(--adv-border); }
.cal__num { font-size: 14px; font-weight: 600; color: var(--adv-text-muted); font-variant-numeric: tabular-nums; }
.cal__day--out { background: var(--adv-surface-subtle); }
.cal__day--out .cal__num { color: var(--adv-text-muted); font-weight: 400; }
.cal__day--today .cal__num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--adv-indigo); color: #fff; }
.cal-game { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 8px; text-decoration: none; color: var(--adv-text-strong); background: var(--adv-surface-brand-tint); border-left: 3px solid var(--adv-indigo); }
.cal-game:hover { background: var(--adv-indigo-100); }
.cal-game__top { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; line-height: 18px; }
.cal-game__status { font-size: 12px; font-weight: 600; line-height: 16px; }
.cal-game--open   { border-left-color: var(--adv-color-success); } .cal-game--open .cal-game__status { color: var(--j-open-fg); }
.cal-game--few    { border-left-color: var(--adv-color-warning); } .cal-game--few .cal-game__status { color: var(--j-few-fg); }
.cal-game--full   { border-left-color: var(--adv-color-danger); }  .cal-game--full .cal-game__status { color: var(--j-full-fg); }
.cal-game--closed, .cal-game--played { background: var(--adv-surface-muted); border-left-color: var(--adv-grey-400); }
.cal-game--closed .cal-game__status, .cal-game--played .cal-game__status { color: var(--adv-text-muted); }
.cal-game--postponed { background: var(--j-postponed-bg); border-left-color: var(--adv-color-info); } .cal-game--postponed .cal-game__status { color: var(--j-postponed-fg); }

/* ---------- Dialog (server-rendered, no JS) ---------- */
.scrim { position: absolute; inset: 0; background: rgba(28,0,43,.56); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.dialog { width: 100%; max-width: 440px; background: var(--j-surface); border-radius: 16px; box-shadow: var(--adv-shadow-xl); padding: 24px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Admin shell ---------- */
.admin { display: flex; flex-wrap: wrap; min-height: 100%; background: var(--j-bg); }
.sidenav { flex: 1 1 240px; max-width: 100%; background: var(--j-sidebar-bg); color: #fff; padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidenav .brand { padding: 4px 8px 20px; }
.sidenav a.nav { display: flex; align-items: center; gap: 12px; min-height: var(--j-tap); padding: 0 12px; border-radius: 8px; color: var(--j-header-muted); font-weight: 600; font-size: 15px; text-decoration: none; }
.sidenav a.nav svg { width: 20px; height: 20px; flex: none; }
.sidenav a.nav:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidenav a.nav[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--adv-pink); }
.sidenav .count { margin-left: auto; min-width: 24px; padding: 2px 8px; border-radius: 999px; background: var(--adv-pink); color: #fff; font-size: 12px; text-align: center; line-height: 18px; }
.admin-main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 24px; }
.admin-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; background: var(--j-surface); border: 1px solid var(--adv-border); border-radius: var(--j-radius-card); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--adv-text-muted); background: var(--adv-surface-subtle); padding: 12px 16px; border-bottom: 1px solid var(--adv-border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--adv-border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-hidden td { background: var(--adv-surface-subtle); color: var(--adv-text-muted); }
.table .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: nowrap; }
.table .select--inline { width: 76px; min-height: 36px; padding: 6px 32px 6px 10px; font-size: 14px; }

/* ---------- Sync status ---------- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--adv-color-success); flex: none; }
.dot--error { background: var(--adv-color-danger); }
.dot--warn { background: var(--adv-color-warning); }

/* ---------- Empty and loading ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 24px; }
.skeleton { background: linear-gradient(90deg, var(--adv-grey-100) 0%, var(--adv-grey-50) 50%, var(--adv-grey-100) 100%); background-size: 200% 100%; border-radius: 6px; animation: j-shimmer 1.4s linear infinite; }
@keyframes j-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ============================================================
   Responsive employee shell – one markup, mobile first.
   Breakpoints: 768px (tablet/desktop), 960px (wide).
   ============================================================ */
.topbar__row { flex-wrap: wrap; column-gap: 16px; }
.brand small { display: none; }
.mainnav { order: 3; flex: 1 0 100%; display: flex; gap: 4px; margin: 0 -4px; }
.tab-count { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: 12px; line-height: 18px; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.userbox__name { display: none; color: var(--j-header-muted); font-size: 15px; }
.btn--on-dark { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; }
.btn--on-dark:hover { background: rgba(255,255,255,.1); }
.label-md { display: none; }

.page { max-width: var(--j-page-max); margin: 0 auto; padding: 20px 16px 32px; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.game-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.split { display: grid; gap: 16px; align-items: start; }

/* Login: stacked on phone, side by side on desktop */
.login { display: flex; flex-direction: column; min-height: 100vh; background: var(--j-bg); }
.login__hero { position: relative; overflow: hidden; background: var(--j-header-bg); color: #fff; padding: 56px 24px 36px; display: flex; flex-direction: column; gap: 20px; }
.login__title { color: #fff; font-size: 34px; letter-spacing: -0.03em; line-height: 1.05; }
.login__main { flex: 1; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.login__note { margin-top: auto; }

@media (min-width: 768px) {
  .topbar__row { flex-wrap: nowrap; min-height: 64px; padding: 0 24px; column-gap: 32px; }
  .brand small { display: block; }
  .mainnav { order: 0; flex: 0 1 auto; margin: 0; }
  .mainnav .tab { min-height: 64px; }
  .label-md { display: inline; }
  .page { padding: 32px 24px 48px; gap: 20px; }
  .page h1 { font-size: var(--adv-text-3xl); letter-spacing: var(--adv-tracking-tighter); }
  .scrim { align-items: center; }
}
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; }
  .login { flex-direction: row; }
  .login__hero { flex: 1 1 50%; justify-content: center; padding: 64px; }
  .login__title { font-size: 52px; }
  .login__main { flex: 0 0 480px; justify-content: center; padding: 48px; margin: 0 auto; }
  .login__note { margin-top: 8px; }
}

/* Mid widths: keep the top bar on one line, let calendar chips wrap */
.tab { white-space: nowrap; }
.cal__day, .cal-game { min-width: 0; }
.cal-game__top { flex-wrap: wrap; overflow-wrap: anywhere; }
@media (min-width: 1024px) {
  .userbox__name { display: inline; }
}

/* Party size: customer + Advania = tickets */
.party { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.party-total { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--adv-surface-brand-tint); color: var(--adv-indigo); font-size: 14px; }
.party-total--error { background: var(--adv-color-danger-surface); color: #9e1f1f; }

/* Booking form: customer fields appear only when "Ja, med kunde" is checked.
   Pure CSS (:has), so it works in static SSR without client script. */
.choice:has(input:checked) { border-color: var(--adv-indigo); background: var(--adv-surface-brand-tint); }
.customer-fields { display: none; flex-direction: column; gap: 16px; padding: 16px; border-radius: var(--adv-radius-md); background: var(--adv-surface-subtle); border: 1px solid var(--adv-border); }
.booking-form:has(input[name="WithCustomer"][value="true"]:checked) .customer-fields { display: flex; }
.when-nocust { display: none; }
.booking-form:has(input[name="WithCustomer"][value="false"]:checked) .when-cust { display: none; }
.booking-form:has(input[name="WithCustomer"][value="false"]:checked) .when-nocust { display: inline; }

/* ============================================================
   Responsive admin – mobile first. Under 960px the side menu
   becomes a sticky top bar, and .table--stack tables turn into
   cards (each cell labelled from data-label).
   ============================================================ */
.admin { flex-direction: column; flex-wrap: nowrap; }
.sidenav { flex: none; flex-direction: row; align-items: center; gap: 4px; padding: 8px 12px; overflow-x: auto; position: sticky; top: 0; z-index: 5; }
.sidenav .brand { padding: 0 8px 0 4px; flex: none; }
.sidenav .brand small { display: none; }
.sidenav a.nav { flex: none; padding: 0 12px; }
.sidenav a.nav svg { display: none; }
.sidenav a.nav[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--adv-pink); }
.sidenav__foot { display: flex; flex-direction: row; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.admin-main { flex: 1 1 auto; min-width: 0; padding: 20px 16px 40px; gap: 20px; }

@media (min-width: 960px) {
  .admin { flex-direction: row; }
  .sidenav { flex: 0 0 260px; flex-direction: column; align-items: stretch; padding: 20px 12px; overflow: visible; position: static; }
  .sidenav .brand { padding: 4px 8px 20px; }
  .sidenav .brand small { display: block; }
  .sidenav a.nav svg { display: inline; }
  .sidenav a.nav[aria-current="page"] { box-shadow: inset 3px 0 0 var(--adv-pink); }
  .sidenav__foot { flex-direction: column; align-items: stretch; margin-left: 0; margin-top: auto; padding-top: 24px; }
  .admin-main { flex: 1 1 auto; min-width: 0; padding: 32px 40px 48px; gap: 24px; }
}

@media (max-width: 759px) {
  .table-wrap:has(.table--stack) { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  .table--stack, .table--stack tbody { display: block; }
  .table--stack thead { display: none; }
  .table--stack tr { display: block; margin-bottom: 12px; padding: 6px 0; background: var(--j-surface); border: 1px solid var(--adv-border); border-radius: var(--j-radius-card); }
  .table--stack tr.is-hidden { background: var(--adv-surface-subtle); }
  .table--stack td { display: block; position: relative; padding: 6px 16px 6px 124px; border: 0; min-height: 32px; white-space: normal !important; }
  .table--stack td::before { content: attr(data-label); position: absolute; left: 16px; top: 8px; width: 100px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--adv-text-muted); }
  .table--stack td.cell-head { padding: 10px 16px 4px; font-size: 16px; }
  .table--stack td.cell-head::before, .table--stack td.cell-actions::before { display: none; }
  .table--stack td.cell-actions { padding: 10px 16px 10px; margin-top: 4px; border-top: 1px solid var(--adv-border); }
  .table--stack .actions { justify-content: stretch; flex-wrap: wrap; }
  .table--stack .actions > form, .table--stack .actions > a, .table--stack .actions > span { flex: 1 1 auto; }
  .table--stack .actions .btn { width: 100%; min-height: var(--j-tap); font-size: 15px; }
  .table--stack .actions > a.btn--icon-only { flex: 0 0 auto; width: var(--j-tap); }
}

/* Quick status filters and collapsible extra filters */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--adv-border-strong); background: var(--j-surface); color: var(--adv-text-body); font-size: 14px; font-weight: 600; text-decoration: none; }
.chip:hover { background: var(--adv-surface-brand-tint); text-decoration: none; }
.chip[aria-current="page"] { background: var(--adv-indigo); border-color: var(--adv-indigo); color: #fff; }
.chip .tab-count { margin-left: 0; background: var(--adv-pink); }
.filters > summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--adv-indigo); }
.filters[open] > summary { margin-bottom: 8px; }
.sidenav { scrollbar-width: none; }
.sidenav::-webkit-scrollbar { display: none; }

/* Choice cards: radio + title on one row, description edge to edge below */
.choice { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; align-items: center; }
.choice > span { display: contents; }
.choice > span > strong { grid-column: 2; }
.choice > span > span { grid-column: 1 / -1; line-height: 20px; }
.choice input { margin: 0; }

/* Calendar on phones: the whole month fits the width, no sideways scrolling.
   Each game shows opponent and time; the status is the colour and stays readable for screen readers. */
@media (max-width: 767px) {
  .cal__dow { padding: 6px 0; text-align: center; font-size: 11px; letter-spacing: .02em; }
  .cal__day { min-height: 76px; padding: 3px; gap: 3px; }
  .cal__num { font-size: 12px; padding-left: 2px; }
  .cal__day--today .cal__num { width: 22px; height: 22px; padding: 0; }
  .cal-game { padding: 3px 3px 3px 4px; gap: 1px; border-left-width: 3px; border-radius: 6px; }
  .cal-game__top { display: block; font-size: 11px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-game__status { font-size: 11px; line-height: 13px; }
  .cal-game__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Seats as a bar when a game has more than 8 tickets */
.seat-bar { display: inline-block; width: 64px; height: 10px; border-radius: 999px; background: var(--j-seat-taken); overflow: hidden; }
.seat-bar > span { display: block; height: 100%; background: var(--j-seat-free); }
.seat-bar--lg { width: 120px; height: 14px; }
.seat-bar--dark { background: rgba(255,255,255,0.28); }

/* Expandable section headings: the explanation goes on its own line on phones */
summary { flex-wrap: wrap; }
@media (max-width: 767px) {
  summary .summary-sub { flex: 1 0 100%; padding: 0 0 12px 30px; margin-top: -10px; }
}

/* Admin side menu on desktop: stays put while the page scrolls, with the footer at the bottom */
@media (min-width: 960px) {
  .sidenav { position: sticky; top: 0; height: 100vh; overflow-y: auto; align-self: flex-start; }
}

/* Employee top bar on phones: more air, and "Logg ut" spelled out instead of an icon alone */
@media (max-width: 767px) {
  .topbar__row { padding: 14px 16px 6px; min-height: 64px; row-gap: 6px; }
  .topbar .brand img { width: 32px; height: 31px; }
  .mainnav { margin: 0 -8px; gap: 2px; }
  .mainnav .tab { padding: 0 10px; min-height: 46px; }
  .userbox .label-md { display: inline; }
  .userbox .btn--on-dark { min-height: 38px; padding: 6px 12px; font-size: 14px; gap: 6px; }
}

/* Form being sent (busy.js) */
.spinner { display: inline-block; width: 16px; height: 16px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: j-spin .7s linear infinite; }
@keyframes j-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.btn[aria-busy="true"] { cursor: progress; }

/* Hamburger menu on phones (menu.js adds .js). Without script the menu stays as a row of tabs. */
.menu, .sidenav__top { display: contents; }
.burger { display: none; position: relative; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: auto; padding: 0; border: 1px solid rgba(255,255,255,.35); border-radius: var(--j-radius-control); background: transparent; color: #fff; cursor: pointer; }
.burger:hover { background: rgba(255,255,255,.1); }
.burger svg { width: 24px; height: 24px; }
.burger[aria-expanded="true"] svg:first-child, .burger[aria-expanded="false"] svg:nth-child(2) { display: none; }
.burger__count { position: absolute; top: -6px; right: -6px; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--adv-pink); color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
.burger[aria-expanded="true"] .burger__count { display: none; }

@media (max-width: 767px) {
  .js .topbar .burger { display: inline-flex; }
  .js .topbar__row { padding: 10px 16px; min-height: 64px; }
  .js .topbar .menu { display: none; }
  .js .topbar .menu.is-open { display: flex; order: 3; flex: 1 0 100%; flex-direction: column; gap: 4px; margin: 4px -16px 0; padding: 8px 8px 16px; border-top: 1px solid rgba(255,255,255,.14); }
  .js .topbar .menu .mainnav { order: 0; flex: none; flex-direction: column; gap: 2px; margin: 0; }
  .js .topbar .menu .tab { min-height: 48px; padding: 0 16px; border-bottom: 0; border-radius: 8px; font-size: 16px; }
  .js .topbar .menu .tab[aria-current="page"] { background: rgba(255,255,255,.12); box-shadow: inset 3px 0 0 var(--adv-pink); }
  .js .topbar .menu .tab-count { margin-left: auto; }
  .js .topbar .menu .userbox { margin: 8px 0 0; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.14); justify-content: space-between; }
  .js .topbar .menu .userbox__name { display: inline; }
  .js .topbar .menu .userbox .btn--on-dark { min-height: 44px; padding: 8px 16px; font-size: 15px; }
}

@media (max-width: 959px) {
  .js .sidenav { flex-direction: column; align-items: stretch; padding: 10px 16px; overflow: visible; }
  .js .sidenav__top { display: flex; align-items: center; gap: 12px; min-height: 44px; }
  .js .sidenav .burger { display: inline-flex; }
  .js .sidenav .menu { display: none; }
  .js .sidenav .menu.is-open { display: flex; flex-direction: column; gap: 2px; margin: 10px -8px 6px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.14); max-height: calc(100vh - 80px); overflow-y: auto; }
  .js .sidenav .menu a.nav { min-height: 48px; font-size: 16px; }
  .js .sidenav .menu a.nav svg { display: inline; }
  .js .sidenav .menu a.nav[aria-current="page"] { box-shadow: inset 3px 0 0 var(--adv-pink); }
  .js .sidenav .menu .sidenav__foot { flex-direction: column; align-items: stretch; margin: 8px 0 0; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.14); gap: 8px; }
  .js .sidenav .menu .sidenav__foot .btn { min-height: 44px; }
}

/* Collapsible cards on phones (rows.js). Folded: the head and a one-line summary.
   Pending bookings keep their approve/reject buttons visible. */
.row-peek, .row-toggle { display: none; }
@media (max-width: 759px) {
  .js .table--collapse tr { display: flex; flex-direction: column; margin-bottom: 8px; }
  .js .table--collapse td.cell-head { order: -1; position: relative; padding: 12px 56px 12px 16px; cursor: pointer; white-space: normal !important; }
  .js .table--collapse tr.is-open td.cell-head { padding-bottom: 6px; }
  .js .table--collapse tr:not(.is-open) { padding: 0; }
  .js .table--collapse tr:not(.is-open) > td:not(.cell-head) { display: none; }
  .js .table--collapse tr.keep-actions:not(.is-open) > td.cell-actions { display: block; margin-top: 0; padding-top: 10px; }
  .js .table--collapse tr:not(.is-open) .row-peek { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: 14px; font-weight: 400; line-height: 20px; color: var(--adv-text-muted); }
  .js .table--collapse .row-peek > span { overflow-wrap: anywhere; }
  .js .table--collapse .row-peek .badge { font-size: 12px; padding: 2px 8px; }
  .js .table--collapse .row-toggle { display: inline-flex; align-items: center; justify-content: center; position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--adv-indigo); cursor: pointer; }
  .js .table--collapse .row-toggle:hover { background: var(--adv-surface-brand-tint); }
  .js .table--collapse .row-toggle svg { transition: transform .15s ease; }
  .js .table--collapse tr.is-open .row-toggle svg { transform: rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) { .row-toggle svg { transition: none; } }

/* Searchable dropdowns (selectfilter.js + Tom Select), styled like .select */
.ts-wrapper.select, .ts-wrapper.input { padding: 0; border: 0; background: none; min-height: 0; box-shadow: none; outline: 0; }
.ts-wrapper.single .ts-control { min-height: var(--j-tap); padding: 10px 40px 10px 14px; font: 400 16px/24px var(--adv-font-sans); color: var(--adv-text-body); background: var(--j-surface); border: 1px solid var(--adv-border-strong); border-radius: var(--j-radius-control); box-shadow: none; cursor: pointer; }
.ts-wrapper.single .ts-control::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border: solid var(--adv-indigo); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ts-wrapper.single.dropdown-active .ts-control::after { margin-top: -2px; transform: rotate(-135deg); }
.ts-wrapper.focus .ts-control { outline: 2px solid var(--j-focus-color); outline-offset: 0; border-color: var(--adv-indigo); box-shadow: var(--adv-focus-ring); }
.ts-wrapper .ts-control > input { font-size: 16px; }
.ts-dropdown { margin-top: 4px; border: 1px solid var(--adv-border-strong); border-radius: var(--j-radius-control); background: var(--j-surface); box-shadow: var(--adv-shadow-lg, 0 8px 24px rgba(0,0,0,.12)); overflow: hidden; z-index: 20; font-size: 15px; }
.ts-dropdown .dropdown-input-wrap { padding: 8px; border-bottom: 1px solid var(--adv-border); }
.ts-dropdown .dropdown-input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--adv-border-strong); border-radius: 8px; font: 400 16px/22px var(--adv-font-sans); }
.ts-dropdown .dropdown-input:focus { outline: 2px solid var(--j-focus-color); border-color: var(--adv-indigo); }
.ts-dropdown .ts-dropdown-content { max-height: min(320px, 50vh); }
.ts-dropdown .option { padding: 10px 14px; line-height: 20px; }
.ts-dropdown .active { background: var(--adv-surface-brand-tint); color: var(--adv-indigo); }
.ts-dropdown .selected { font-weight: 600; }
.ts-dropdown .no-results { padding: 10px 14px; color: var(--adv-text-muted); }

/* Live search (livesearch.js): no Søk button needed when script runs */
.js form[data-live] .live-submit { display: none; }
[data-live-results][aria-busy="true"] .table-wrap { opacity: .6; transition: opacity .1s; }
