/*
 * DartMate Competitions — design system partage (console, tablette, Live).
 * Identite DartMate : nuit profonde + neon vert, cyan, magenta, or, violet.
 * Theme clair et sombre soignes ; bascule immediate (soleil/lune), choix memorise.
 */

:root {
  --dm-font: "Inter", "Segoe UI", system-ui, -apple-system, "Roboto", "Helvetica Neue", Arial, sans-serif;
  --dm-mono: "JetBrains Mono", "SFMono-Regular", "Consolas", "Menlo", monospace;
  --dm-radius-s: 8px;
  --dm-radius: 14px;
  --dm-radius-l: 22px;
  --dm-gap: 16px;
  --dm-touch: 48px;
  --dm-ease: cubic-bezier(.2, .8, .2, 1);

  /* Theme clair (salle lumineuse) */
  --bg: #f4f1e8;
  --bg-2: #ebe6d9;
  --surface: #fffcf5;
  --surface-2: #f7f2e7;
  --surface-3: #efe8d9;
  --line: #ddd4c2;
  --line-strong: #c7bca6;
  --text: #15191f;
  --text-2: #4b5260;
  --text-3: #7a7f8a;
  --accent: #00795f;
  --accent-ink: #ffffff;
  --accent-soft: #d6f2e8;
  --cyan: #006f93;
  --cyan-soft: #d7eef6;
  --magenta: #c22647;
  --magenta-soft: #fbe0e5;
  --gold: #946100;
  --gold-soft: #fbedc9;
  --violet: #5c3fc4;
  --violet-soft: #e7e0fb;
  --danger: #c22647;
  --warning: #9a5b00;
  --ok: #007a50;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 6px 22px rgba(40, 30, 10, .08);
  --shadow-l: 0 2px 6px rgba(40, 30, 10, .08), 0 18px 48px rgba(40, 30, 10, .16);
  --focus: 0 0 0 3px rgba(0, 121, 95, .35);
  --board-black: #1d1b18;
  --board-cream: #f2e6c9;
  --board-red: #c8303a;
  --board-green: #1f7a4d;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #05060b;
  --bg-2: #090c14;
  --surface: #11151f;
  --surface-2: #161b28;
  --surface-3: #1d2333;
  --line: #262d42;
  --line-strong: #353e5a;
  --text: #f2f5ff;
  --text-2: #b6bdd4;
  --text-3: #8e97b3;
  --accent: #2be38b;
  --accent-ink: #00160b;
  --accent-soft: rgba(43, 227, 139, .14);
  --cyan: #53d8ff;
  --cyan-soft: rgba(83, 216, 255, .14);
  --magenta: #ff5470;
  --magenta-soft: rgba(255, 84, 112, .15);
  --gold: #ffc857;
  --gold-soft: rgba(255, 200, 87, .14);
  --violet: #9d7bff;
  --violet-soft: rgba(157, 123, 255, .16);
  --danger: #ff5470;
  --warning: #ffc857;
  --ok: #2be38b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 26px rgba(0, 0, 0, .35);
  --shadow-l: 0 2px 8px rgba(0, 0, 0, .5), 0 22px 60px rgba(0, 0, 0, .55);
  --focus: 0 0 0 3px rgba(43, 227, 139, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--dm-font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s var(--dm-ease), color .25s var(--dm-ease);
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--dm-mono); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: var(--accent-soft); }

/* ------------------------------------------------------------------ shell */

.dm-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; min-height: 60px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.dm-brand { display: flex; align-items: center; gap: 10px; font-weight: 850; letter-spacing: -.02em; color: var(--text); }
.dm-brand:hover { text-decoration: none; }
.dm-logo {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--magenta) 0 18%, var(--accent) 19% 34%, var(--board-black) 35% 52%, var(--accent) 53% 64%, var(--board-black) 65% 100%);
  box-shadow: 0 0 0 2px var(--surface), 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent);
  flex: none;
}
.dm-brand small { display: block; font-weight: 600; color: var(--text-3); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.dm-topbar .spacer { flex: 1; }
.dm-iconbtn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer;
  transition: transform .15s var(--dm-ease), background .2s;
}
.dm-iconbtn:hover { background: var(--surface-3); }
.dm-iconbtn:active { transform: scale(.94); }
.dm-iconbtn svg { width: 20px; height: 20px; }

.dm-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.dm-sidenav { border-right: 1px solid var(--line); padding: 14px 10px; background: var(--surface); position: sticky; top: 60px; height: calc(100vh - 60px); overflow: auto; }
.dm-sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; text-decoration: none; margin-bottom: 2px;
}
.dm-sidenav a:hover { background: var(--surface-2); color: var(--text); }
.dm-sidenav a.active { background: var(--accent-soft); color: var(--accent); }
.dm-sidenav .group { margin: 16px 12px 6px; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 750; }
.dm-sidenav .badge { margin-left: auto; }
.dm-main { padding: 24px clamp(16px, 3vw, 36px) 80px; min-width: 0; }
.dm-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dm-pagehead .eyebrow { font-size: .74rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.dm-pagehead p { color: var(--text-2); margin: 0; }
.dm-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .dm-layout { grid-template-columns: minmax(0, 1fr); }
  .dm-sidenav {
    position: fixed; inset: 60px 0 auto 0; height: auto; max-height: calc(100vh - 60px); z-index: 25;
    transform: translateY(-110%); transition: transform .25s var(--dm-ease); box-shadow: var(--shadow-l);
  }
  .dm-sidenav.open { transform: none; }
  .dm-main { padding: 16px 16px 90px; }
}
@media (min-width: 901px) { .dm-menu-toggle { display: none; } }

/* ------------------------------------------------------------- surfaces */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--dm-radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card.flat { box-shadow: none; }
.card h3 { display: flex; align-items: center; gap: 8px; }
.card .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card .card-head h3, .card .card-head h2 { margin: 0; }
.grid { display: grid; gap: var(--dm-gap); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Deux colonnes de listes sous ~860 px : noms tronques. Une seule colonne, lisible. */
@media (max-width: 860px) { .grid.cols-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); } .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
/* Telephone : la barre du haut tient sur la largeur, le nom se tronque avant les boutons. */
@media (max-width: 560px) {
  .dm-topbar { gap: 8px; padding: 8px 12px; }
  .dm-brand { min-width: 0; flex: 1; }
  .dm-brand > span:last-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .dm-brand small { overflow: hidden; text-overflow: ellipsis; }
  .dm-topbar .spacer { display: none; }
  .dm-iconbtn { width: 38px; height: 38px; }
  .dm-logo { width: 28px; height: 28px; }
  .list > .item { flex-wrap: wrap; }
  .list > .item > .btn { margin-left: auto; }
}
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

.kpi { position: relative; overflow: hidden; }
.kpi .label { font-size: .78rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.kpi .value { font-size: 2rem; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: 4px; }
.kpi .hint { font-size: .85rem; color: var(--text-2); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--accent-soft); opacity: .7; }
.kpi.cyan::after { background: var(--cyan-soft); }
.kpi.gold::after { background: var(--gold-soft); }
.kpi.magenta::after { background: var(--magenta-soft); }

.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--cyan)); border-radius: inherit; transition: width .6s var(--dm-ease); }

/* ------------------------------------------------------------ badges */

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  font-size: .76rem; font-weight: 750; letter-spacing: .02em; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2); border: 1px solid transparent;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.ok, .badge.status-COMPLETED, .badge.status-AVAILABLE, .badge.status-CONFIRMED, .badge.status-CHECKED_IN, .badge.status-PRESENT, .badge.status-ACTIVE, .badge.status-RESOLVED { background: var(--accent-soft); color: var(--ok); }
.badge.live, .badge.status-IN_PROGRESS, .badge.status-LIVE, .badge.status-IN_USE { background: var(--magenta-soft); color: var(--magenta); }
.badge.live::before, .badge.status-IN_PROGRESS::before, .badge.status-LIVE::before { animation: dm-pulse 1.4s infinite; }
.badge.warn, .badge.status-CALLED, .badge.status-AWAITING_VALIDATION, .badge.status-LATE, .badge.status-PENDING, .badge.status-WAITLISTED, .badge.status-OFFERED, .badge.status-ACKNOWLEDGED, .badge.status-PAST_DUE, .badge.status-MAINTENANCE { background: var(--gold-soft); color: var(--warning); }
.badge.info, .badge.status-READY, .badge.status-REGISTRATION_OPEN, .badge.status-PUBLISHED, .badge.status-DRAWN, .badge.status-TRIALING { background: var(--cyan-soft); color: var(--cyan); }
.badge.danger, .badge.status-ABSENT, .badge.status-CANCELLED, .badge.status-OFFLINE, .badge.status-OPEN, .badge.status-DISQUALIFIED, .badge.status-REFUSED, .badge.status-DISABLED { background: var(--magenta-soft); color: var(--danger); }
.badge.violet, .badge.status-SUSPENDED, .badge.status-REGISTRATION_CLOSED, .badge.status-CHECK_IN, .badge.status-TENTATIVE { background: var(--violet-soft); color: var(--violet); }
@keyframes dm-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }

.seed { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--gold-soft); color: var(--gold); font-size: .72rem; font-weight: 850; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
  transition: transform .12s var(--dm-ease), background .2s, border-color .2s, box-shadow .2s;
  text-decoration: none; white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .86rem; border-radius: 10px; }
.btn.big { min-height: 64px; padding: 0 26px; font-size: 1.15rem; border-radius: 16px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid currentColor; border-color: var(--text-2) transparent var(--text-2) transparent; border-radius: 50%; animation: dm-spin .7s linear infinite; }
@keyframes dm-spin { to { transform: rotate(360deg); } }

.segmented { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-3); gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 700; padding: 8px 14px; border-radius: 9px; cursor: pointer; min-height: 38px; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ----------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: .82rem; font-weight: 700; color: var(--text-2); }
.field .help { font-size: .8rem; color: var(--text-3); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s;
}
textarea.input { min-height: 90px; resize: vertical; }
/* Selecteur de langue de la barre du haut : compact, jamais pleine largeur. */
select.input.lang { width: auto; flex: none; min-height: 40px; padding: 6px 10px; }
.input:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
.input.invalid { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 40px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .2s var(--dm-ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* ----------------------------------------------------------- tables */

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--dm-radius); background: var(--surface); }
table.dm { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.dm th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); font-weight: 800; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.dm td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.dm tr:last-child td { border-bottom: 0; }
table.dm tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
table.dm td.right, table.dm th.right { text-align: right; }
table.dm tr.qualified td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
table.dm tr.tied td { background: var(--gold-soft); }

/* ----------------------------------------------------------- tabs */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; color: var(--text-2); font: inherit; font-weight: 700; padding: 12px 14px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ------------------------------------------------------- dialogs, toasts */

.dm-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(5, 6, 11, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: dm-fade .18s ease; }
.dm-dialog { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: var(--dm-radius-l); border: 1px solid var(--line); box-shadow: var(--shadow-l); padding: 22px; animation: dm-rise .22s var(--dm-ease); }
.dm-dialog.wide { width: min(920px, 100%); }
.dm-dialog .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
@keyframes dm-fade { from { opacity: 0; } }
@keyframes dm-rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dm-toasts { position: fixed; z-index: 90; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.dm-toast { padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-l); font-weight: 600; animation: dm-rise .2s var(--dm-ease); border-left: 4px solid var(--accent); }
.dm-toast.error { border-left-color: var(--danger); }
.dm-toast.warn { border-left-color: var(--warning); }

.empty { text-align: center; padding: 36px 16px; color: var(--text-3); }
.empty .icon { font-size: 2rem; margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: dm-shimmer 1.2s infinite; border-radius: 8px; min-height: 18px; }
@keyframes dm-shimmer { to { background-position: -200% 0; } }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--cyan-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--cyan) 30%, transparent); }
.notice.warn { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
.notice.error { background: var(--magenta-soft); border-color: color-mix(in srgb, var(--magenta) 35%, transparent); }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--text-3); }
.conn::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--accent-soft); }
.conn.stale::before { background: var(--warning); box-shadow: 0 0 0 3px var(--gold-soft); }
.conn.off::before { background: var(--danger); box-shadow: 0 0 0 3px var(--magenta-soft); }

/* ------------------------------------------------------ match cards */

.match { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.match .who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.match .player { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.match .player span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .player.winner { color: var(--accent); }
.match .score { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-weight: 850; font-variant-numeric: tabular-nums; }
.match .meta { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--text-3); }
.match.live { border-color: color-mix(in srgb, var(--magenta) 45%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--magenta) 25%, transparent); }

/* --------------------------------------------------------- bracket */

.bracket { display: flex; gap: 28px; overflow-x: auto; padding: 8px 4px 16px; }
.bracket .round { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; min-width: 230px; }
.bracket .round h4 { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: 0 0 4px; text-align: center; }
.bracket .bm { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); overflow: hidden; position: relative; }
.bracket .bm .slot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; min-height: 38px; }
.bracket .bm .slot + .slot { border-top: 1px solid var(--line); }
.bracket .bm .slot.win { font-weight: 800; background: var(--accent-soft); }
.bracket .bm .slot .s { margin-left: auto; font-weight: 850; font-variant-numeric: tabular-nums; }
.bracket .bm .slot.tbd { color: var(--text-3); font-style: italic; }
.bracket .bm.live { border-color: var(--magenta); }
.bracket .bm .when { font-size: .72rem; color: var(--text-3); padding: 4px 10px; border-top: 1px dashed var(--line); }

/* ------------------------------------------------- floor plan, timeline */

.floor { position: relative; border-radius: var(--dm-radius); border: 1px solid var(--line); overflow: hidden; touch-action: none;
  background-color: var(--surface-2);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px; }
.floor .zone { position: absolute; border: 2px dashed var(--line-strong); border-radius: 14px; background: color-mix(in srgb, var(--violet-soft) 60%, transparent); color: var(--violet); font-weight: 800; font-size: .8rem; padding: 6px 10px; }
.floor .zone.STAGE { background: var(--gold-soft); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.floor .label { position: absolute; font-weight: 750; color: var(--text-2); font-size: .85rem; white-space: nowrap; }
.floor .station { position: absolute; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 22px; background: var(--surface); border: 2px solid var(--line-strong); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: grab; user-select: none; transition: box-shadow .2s, border-color .2s; }
.floor .station:active { cursor: grabbing; }
.floor .station .n { font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.floor .station .l { font-size: .7rem; color: var(--text-3); max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.floor .station.IN_USE { border-color: var(--magenta); }
.floor .station.MAINTENANCE, .floor .station.OFFLINE, .floor .station.DISABLED { opacity: .55; border-style: dashed; }
.floor .station.stage { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.floor .station.selected { box-shadow: var(--focus), var(--shadow-l); border-color: var(--accent); }
.floor .station .dot { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.floor .station .dot.on { background: var(--ok); }

.timeline { position: relative; overflow: auto; border: 1px solid var(--line); border-radius: var(--dm-radius); background: var(--surface); }
.timeline .tl-grid { position: relative; }
.timeline .tl-row { position: relative; height: 58px; border-bottom: 1px solid var(--line); }
.timeline .tl-head { position: sticky; left: 0; z-index: 3; width: 120px; height: 100%; display: flex; align-items: center; padding: 0 12px; font-weight: 800; background: var(--surface-2); border-right: 1px solid var(--line); }
.timeline .tl-hours { position: sticky; top: 0; z-index: 4; height: 30px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.timeline .tl-hour { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--line); font-size: .72rem; color: var(--text-3); padding: 6px 4px; }
.timeline .tl-item { position: absolute; top: 6px; height: 46px; border-radius: 10px; padding: 4px 8px; font-size: .74rem; overflow: hidden; cursor: grab; border: 1px solid transparent; background: var(--cyan-soft); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.timeline .tl-item b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline .tl-item.IN_PROGRESS, .timeline .tl-item.CALLED { background: var(--magenta-soft); border-color: var(--magenta); cursor: default; }
.timeline .tl-item.COMPLETED { background: var(--surface-3); color: var(--text-3); cursor: default; }
.timeline .tl-item.TENTATIVE { background: repeating-linear-gradient(45deg, var(--violet-soft), var(--violet-soft) 8px, transparent 8px, transparent 14px); border-color: color-mix(in srgb, var(--violet) 35%, transparent); }
.timeline .tl-item.locked { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.timeline .tl-item.conflict { border-color: var(--danger); box-shadow: 0 0 0 2px var(--magenta-soft); }
.timeline .tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--magenta); z-index: 2; }
.timeline .tl-break { position: absolute; top: 30px; bottom: 0; background: repeating-linear-gradient(-45deg, var(--surface-2), var(--surface-2) 6px, var(--surface-3) 6px, var(--surface-3) 12px); z-index: 0; }

/* ------------------------------------------------------- utilities */

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 850; font-size: .85rem; background: var(--violet-soft); color: var(--violet); flex: none; }
.qr { display: inline-block; padding: 12px; border-radius: 14px; background: #fff; line-height: 0; }
.qr svg { width: 220px; height: 220px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.steps .step { flex: 1; min-width: 110px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: .85rem; color: var(--text-3); }
.steps .step b { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.steps .step.active { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.steps .step.done { color: var(--accent); }
.list { display: flex; flex-direction: column; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.list > .item:last-child { border-bottom: 0; }
.list > .item .grow { flex: 1; min-width: 0; }
.list > .item > .btn, .list > .item > .badge { flex: none; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media print {
  .dm-topbar, .dm-sidenav, .dm-actions, .btn { display: none !important; }
  .dm-layout { display: block; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; }
}
