/* Golden Break Pool Club - theme premium sombre (noir / blanc / or) */
:root {
  --bg: #0D0D0D;
  --bg-2: #171717;
  --card: #1F1F1F;
  --card-2: #262626;
  --gold: #C8A96A;
  --gold-2: #E6CE97;
  --gold-soft: rgba(200, 169, 106, 0.12);
  --text: #FFFFFF;
  --muted: #A0A0A0;
  --success: #28A745;
  --danger: #DC3545;
  --warning: #FFC107;
  --info: #4DA3FF;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(200, 169, 106, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --sidebar-w: 260px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", "Inter", system-ui, sans-serif;
  background: radial-gradient(1200px 700px at 80% -10%, #1a1712 0%, var(--bg) 55%);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c2c2c; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: inherit; }
.gold { color: var(--gold); }
.muted { color: var(--muted); }
.danger { color: var(--danger); }
.success { color: var(--success); }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ---------- Splash ---------- */
#splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px; background: radial-gradient(900px 600px at 50% 30%, #1c1813, #0a0a0a 70%);
  transition: opacity 0.7s var(--ease);
}
#splash.fade { opacity: 0; pointer-events: none; }
.splash-logo { animation: rise 1s var(--ease) both; }
.splash-title { letter-spacing: 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; animation: fadein 1.4s ease both; }
.splash-bar { width: 220px; height: 3px; border-radius: 3px; background: #2a2a2a; overflow: hidden; }
.splash-bar > i { display: block; height: 100%; width: 40%; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: load 1.3s var(--ease) infinite; }
@keyframes load { 0% { transform: translateX(-120%);} 100% { transform: translateX(360%);} }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.96);} to { opacity: 1; transform: none;} }
@keyframes fadein { from { opacity: 0;} to { opacity: 1;} }

/* ---------- Login ---------- */
#login {
  position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1000px 700px at 50% 0%, #1a1610, #0a0a0a 70%);
}
.login-card {
  width: 380px; padding: 38px 34px; border-radius: 22px; text-align: center;
  background: linear-gradient(160deg, rgba(38,34,28,0.9), rgba(20,20,20,0.92));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); animation: rise 0.6s var(--ease) both;
}
.login-card h1 { font-size: 19px; margin-top: 16px; letter-spacing: 1px; }
.login-card p { color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); color: var(--text);
  background: #141414; border: 1px solid var(--border); transition: border 0.2s, box-shadow 0.2s; font-size: 14px;
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
textarea.input { resize: vertical; min-height: 70px; }
.login-error { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-top: 4px; }
.login-hint { margin-top: 16px; font-size: 11.5px; color: #6a6a6a; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--card-2); color: var(--text); cursor: pointer; font-size: 13.5px; font-weight: 500;
  transition: transform 0.15s var(--ease), background 0.2s, border 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-1px); background: #2f2f2f; }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #1a1206; border: none; font-weight: 600; }
.btn-gold:hover { box-shadow: 0 8px 24px rgba(200,169,106,0.35); background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(220,53,69,0.14); border-color: rgba(220,53,69,0.4); color: #ff8189; }
.btn-danger:hover { background: rgba(220,53,69,0.22); }
.btn-success { background: rgba(40,167,69,0.16); border-color: rgba(40,167,69,0.4); color: #6ee08a; }
.btn-success:hover { background: rgba(40,167,69,0.24); }
.btn-sm { padding: 7px 11px; font-size: 12px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- Layout ---------- */
#app { display: none; height: 100vh; height: 100dvh; }
#app.show { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }

.top-action.menu-btn { display: none; }
.sb-backdrop { display: none; }
.title-box { min-width: 0; }
.sidebar {
  background: linear-gradient(180deg, #141414, #0e0e0e); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 4px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; }
.brand .name { font-size: 14px; font-weight: 700; letter-spacing: 0.5px; line-height: 1.2; }
.brand .name small { display: block; font-size: 10px; color: var(--gold); letter-spacing: 2px; font-weight: 600; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: #5e5e5e; margin: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); cursor: pointer; font-size: 13.5px; position: relative; transition: background 0.2s, color 0.2s;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.85; }
.nav-item:hover { background: var(--gold-soft); color: var(--text); }
.nav-item.active { background: var(--gold-soft); color: var(--gold-2); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--gold); }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 10px; }

.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px 26px; border-bottom: 1px solid var(--border);
  background: rgba(13,13,13,0.6); backdrop-filter: blur(8px);
}
.topbar h2 { font-size: 17px; font-weight: 600; }
.topbar .sub { font-size: 11.5px; color: var(--muted); }
.search-box { margin-left: auto; display: flex; align-items: center; gap: 8px; background: #141414;
  border: 1px solid var(--border); border-radius: 30px; padding: 8px 14px; width: 280px; }
.search-box input { background: transparent; border: none; color: var(--text); width: 100%; outline: none; font-size: 13px; }
.search-box svg { width: 16px; height: 16px; color: var(--muted); }
.top-action { position: relative; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); cursor: pointer; transition: 0.2s; }
.top-action:hover { border-color: var(--border-strong); }
.top-action svg { width: 18px; height: 18px; }
.top-action .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #1a1206; font-weight: 700; font-size: 14px; }
.user-chip .meta b { font-size: 13px; }
.user-chip .meta span { display: block; font-size: 10.5px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; }

.content { padding: 24px 26px; overflow-y: auto; flex: 1; }
.page { animation: pageIn 0.4s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: none;} }

/* ---------- Grilles & cartes ---------- */
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1300px) { .cols-4 { grid-template-columns: repeat(2,1fr);} .cols-3{grid-template-columns:repeat(2,1fr);} }

.card {
  background: linear-gradient(160deg, rgba(31,31,31,0.96), rgba(24,24,24,0.96));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), border 0.25s;
}
.card.hoverable:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head .tools { display: flex; gap: 8px; align-items: center; }

.stat { position: relative; overflow: hidden; }
.stat .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat .icon-box { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); color: var(--gold-2); }
.stat .icon-box svg { width: 20px; height: 20px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 12px; letter-spacing: 0.3px; }
.stat .delta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.stat-row { display: flex; align-items: center; justify-content: space-between; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 4px 10px; border-radius: 20px; font-weight: 600; }
.pill-gold { background: var(--gold-soft); color: var(--gold-2); }
.pill-green { background: rgba(40,167,69,0.16); color: #6ee08a; }
.pill-red { background: rgba(220,53,69,0.16); color: #ff8189; }
.pill-amber { background: rgba(255,193,7,0.16); color: #ffcf4d; }
.pill-grey { background: #2a2a2a; color: var(--muted); }
.pill .dotp { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.35;} }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; padding: 12px 14px; color: var(--muted); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.6px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); }
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
table.tbl tbody tr { transition: background 0.15s; }
table.tbl tbody tr:hover { background: rgba(200,169,106,0.05); }
table.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { text-align: center; padding: 40px; color: var(--muted); font-size: 13px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 800; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); animation: fadein 0.2s ease; }
.modal { width: 520px; max-width: 92vw; max-height: 88vh; overflow-y: auto; border-radius: 20px; padding: 24px;
  background: linear-gradient(160deg, #222, #181818); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  animation: modalIn 0.3s var(--ease) both; }
.modal.wide { width: 820px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.98);} to { opacity: 1; transform: none;} }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-size: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.one { grid-template-columns: 1fr; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }

/* ---------- Toast ---------- */
#toasts { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 12px; min-width: 260px;
  background: #1f1f1f; border: 1px solid var(--border); border-left: 3px solid var(--gold); box-shadow: var(--shadow);
  animation: toastIn 0.3s var(--ease) both; }
.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast svg { width: 18px; height: 18px; }
.toast .t-msg { font-size: 13px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px);} to { opacity: 1; transform: none;} }

/* ---------- Live station cards ---------- */
.station-card { position: relative; overflow: hidden; }
.station-card .st-top { display: flex; align-items: center; justify-content: space-between; }
.station-card .st-name { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.station-card .st-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #161616; color: var(--gold-2); }
.station-card.occupe { border-color: rgba(40,167,69,0.4); }
.station-card.pause { border-color: rgba(255,193,7,0.4); }
.st-timer { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 16px 0 6px; letter-spacing: 1px; }
.st-amount { font-size: 22px; font-weight: 700; color: var(--gold-2); }
.st-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 14px; }
.st-actions { display: flex; gap: 8px; margin-top: 16px; }
.st-actions .btn { flex: 1; }
.st-items { margin-top: 12px; max-height: 90px; overflow-y: auto; font-size: 12px; }
.st-items .li { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }

/* counters animate */
.count { font-variant-numeric: tabular-nums; }

/* skeleton */
.skel { background: linear-gradient(90deg, #1c1c1c 25%, #262626 37%, #1c1c1c 63%); background-size: 400% 100%;
  animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0;} 100% { background-position: -100% 0;} }

/* tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 10px 16px; cursor: pointer; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; transition: 0.2s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold-2); border-bottom-color: var(--gold); font-weight: 600; }

/* dropdown panel (notifications/search) */
.panel { position: absolute; top: 52px; right: 0; width: 340px; max-height: 420px; overflow-y: auto; z-index: 700;
  background: #1c1c1c; border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; }
.panel .ph { padding: 10px 12px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.notif { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; }
.notif:hover { background: #232323; }
.notif .nb { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.notif small { color: var(--muted); font-size: 11px; }

/* bracket */
.bracket { display: flex; gap: 40px; overflow-x: auto; padding: 16px 4px; }
.bracket-round { display: flex; flex-direction: column; justify-content: space-around; gap: 18px; min-width: 220px; }
.bracket-round h5 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); margin-bottom: 4px; text-align: center; }
.match-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: 0.2s;
  animation: rise 0.4s var(--ease) both; }
.match-box:hover { border-color: var(--border-strong); }
.match-box .pl { display: flex; justify-content: space-between; padding: 9px 12px; font-size: 13px; cursor: default; }
.match-box .pl + .pl { border-top: 1px solid var(--border); }
.match-box .pl.win { color: var(--gold-2); font-weight: 600; background: var(--gold-soft); }
.match-box .pl .sc { color: var(--muted); font-variant-numeric: tabular-nums; }
.match-box .pl.bye { color: #5e5e5e; font-style: italic; }
.match-foot { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: #161616; font-size: 11px; color: var(--muted); }

/* segmented control */
.seg { display: inline-flex; background: #141414; border: 1px solid var(--border); border-radius: 30px; padding: 3px; }
.seg button { border: none; background: transparent; color: var(--muted); padding: 7px 16px; border-radius: 30px; cursor: pointer; font-size: 12.5px; transition: 0.2s; }
.seg button.active { background: var(--gold-soft); color: var(--gold-2); font-weight: 600; }

.list-inline { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; background: #141414; border: 1px solid var(--border); border-radius: 20px; font-size: 12.5px; }
.chip .x { cursor: pointer; color: var(--muted); }
.chip .x:hover { color: var(--danger); }

.kpi-mini { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.kpi-mini:last-child { border-bottom: none; }
.kpi-mini .v { font-weight: 700; }

.progress { height: 8px; background: #141414; border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width 0.6s var(--ease); }


/* ---------- Live v2: postes en direct ---------- */
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.live-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.lstat { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; min-width: 132px; }
.lstat i { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lstat b { font-size: 18px; display: block; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lstat span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.9px; white-space: nowrap; }
.lstat.green i { background: rgba(40,167,69,0.16); color: #6ee08a; }
.lstat.amber i { background: rgba(255,193,7,0.16); color: #ffcf4d; }
.lstat.grey i { background: #1b1b1b; color: var(--muted); }
.lstat.gold i { background: var(--gold-soft); color: var(--gold-2); }
.lstat.gold b { color: var(--gold-2); }
#liveFilter button { display: inline-flex; align-items: center; gap: 6px; }
#liveFilter svg { width: 14px; height: 14px; }

.live-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.st2 { position: relative; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden;
  background: linear-gradient(165deg, #232323, #171717); border: 1px solid var(--border);
  transition: transform 0.28s var(--ease), box-shadow 0.28s, border-color 0.28s; animation: rise 0.5s var(--ease) both; }
.st2:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.st2.is-occupe { border-color: rgba(40,167,69,0.55); box-shadow: 0 0 0 1px rgba(40,167,69,0.12), 0 16px 40px rgba(40,167,69,0.10); }
.st2.is-pause { border-color: rgba(255,193,7,0.5); box-shadow: 0 0 0 1px rgba(255,193,7,0.10), 0 16px 40px rgba(255,193,7,0.08); }

.st2-hero { position: relative; height: 146px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
  background: #141414; border-bottom: 1px solid var(--border); }
.st2-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(20,20,20,0.9)); pointer-events: none; }
.st2-billard .st2-hero { background: radial-gradient(130% 95% at 50% 115%, rgba(35,138,87,0.55), rgba(35,138,87,0.10) 55%, transparent 75%), #141414; }
.st2-ps5 .st2-hero { background: radial-gradient(130% 95% at 50% 115%, rgba(77,163,255,0.42), rgba(77,163,255,0.08) 55%, transparent 75%), #141414; }
.st2-art { width: 80%; height: auto; margin-bottom: 2px; position: relative; z-index: 1;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,0.55)); transition: transform 0.45s var(--ease), opacity 0.3s, filter 0.3s; }
.st2:hover .st2-art { transform: translateY(-4px) scale(1.03); }
.st2.is-libre .st2-art { opacity: 0.55; filter: grayscale(0.35) drop-shadow(0 12px 18px rgba(0,0,0,0.55)); }
.st2.is-libre:hover .st2-art { opacity: 0.85; filter: grayscale(0) drop-shadow(0 12px 18px rgba(0,0,0,0.55)); }
.st2.is-pause .st2-art { opacity: 0.8; }

.st2-kind { position: absolute; top: 12px; left: 12px; z-index: 2; font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase; font-weight: 700;
  padding: 5px 9px; border-radius: 8px; backdrop-filter: blur(6px); }
.st2-billard .st2-kind { color: #9fe8c0; background: rgba(35,138,87,0.22); border: 1px solid rgba(35,138,87,0.35); }
.st2-ps5 .st2-kind { color: #a9d2ff; background: rgba(77,163,255,0.18); border: 1px solid rgba(77,163,255,0.35); }
.st2-badge { position: absolute; top: 12px; right: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px; color: var(--muted); background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); border: 1px solid var(--border); }
.st2-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #666; }
.is-occupe .st2-badge { color: #7ee89a; border-color: rgba(40,167,69,0.45); }
.is-occupe .st2-badge .dot { background: #34c759; animation: livePulse 1.6s ease-out infinite; }
.is-pause .st2-badge { color: #ffd464; border-color: rgba(255,193,7,0.45); }
.is-pause .st2-badge .dot { background: #ffc107; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(52,199,89,0.65); } 70% { box-shadow: 0 0 0 8px rgba(52,199,89,0); } 100% { box-shadow: 0 0 0 0 rgba(52,199,89,0); } }

.st2-body { padding: 16px 18px 4px; flex: 1; }
.st2-body h4 { font-size: 16.5px; font-weight: 700; margin-bottom: 12px; letter-spacing: 0.2px; }
.st2-timer { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1.5px; line-height: 1; }
.st2-timer.dim { color: #3b3b3b; }
.is-pause .st2-timer { color: #ffd464; }
.st2-amount { font-size: 21px; font-weight: 700; color: var(--gold-2); margin-top: 8px; font-variant-numeric: tabular-nums; }
.st2-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.st2-meta span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 4px 9px; border-radius: 8px;
  background: #141414; border: 1px solid var(--border); color: var(--muted); }
.st2-meta svg { width: 12px; height: 12px; opacity: 0.8; }
.st2-free p { color: var(--muted); font-size: 13px; margin-top: 10px; }
.st2-units { display: flex; align-items: center; gap: 8px; margin-top: 12px; background: #141414; border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
.st2-units .btn { width: 36px; height: 32px; padding: 0; flex: 0 0 36px; }
.st2-units b { flex: 1; text-align: center; font-size: 13px; }
.st2-items { margin-top: 10px; max-height: 76px; overflow-y: auto; font-size: 12px; border-top: 1px dashed var(--border); padding-top: 8px; }
.st2-items .li { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.st2-actions { display: flex; gap: 8px; padding: 12px 18px 18px; }
.st2-actions .btn { flex: 1; justify-content: center; padding: 11px 12px; }
.st2-actions .btn.ic { flex: 0 0 44px; padding: 0; }
.st2-actions .btn-start { padding: 13px 14px; font-size: 14px; }

/* ---------- Design system v2: typographie, atmosphere, mouvement ---------- */
:root {
  --bg: #0c0b09; --bg-2: #15130f; --card: #1d1b17; --card-2: #26231d;
  --gold-3: #a8894f;
  --font-ui: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-display: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
body { font-family: var(--font-ui); background: radial-gradient(1200px 700px at 82% -12%, #1e1810 0%, var(--bg) 58%); }
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
#app.show { position: relative; z-index: 1; }
::-webkit-scrollbar-thumb { background: #2a2824; }
::selection { background: rgba(200,169,106,0.35); }

h1, h2, h3, h4, .topbar h2, .login-card h1, .stat .value, .kpi-mini .v, .st-timer, .st-amount,
.st2-timer, .st2-amount, .lstat b, .card-head h3, .modal-head h3, .count { font-family: var(--font-display); }
.stat .value { font-weight: 700; letter-spacing: -0.3px; font-size: 27px; }
.card-head h3 { font-weight: 600; letter-spacing: 0.1px; }
.topbar h2 { font-weight: 700; letter-spacing: -0.2px; }
.topbar .sub { text-transform: capitalize; }

/* Splash & login */
.splash-logo { filter: drop-shadow(0 0 26px rgba(200,169,106,0.35)); }
.login-card { box-shadow: var(--shadow), 0 0 90px rgba(200,169,106,0.08); }
.login-card h1 { font-weight: 700; }

/* Sidebar */
.sidebar { background: linear-gradient(180deg, #14120e, #0d0c0a); }
.brand { border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.brand .name { font-family: var(--font-display); letter-spacing: 0.6px; }
.nav-section { color: #6a6252; }
.nav-item { transition: background 0.2s, color 0.2s, transform 0.25s var(--ease); }
.nav-item:hover { transform: translateX(2px); }
.nav-item svg { transition: transform 0.25s var(--ease), opacity 0.2s; }
.nav-item:hover svg, .nav-item.active svg { transform: scale(1.08); opacity: 1; }
.nav-item.active { background: linear-gradient(90deg, rgba(200,169,106,0.20), rgba(200,169,106,0.05)); box-shadow: inset 0 0 0 1px rgba(200,169,106,0.14); }
.nav-item.active::before { box-shadow: 0 0 12px rgba(200,169,106,0.7); }

/* Topbar */
.topbar { border-bottom: 1px solid rgba(255,255,255,0.06); }
.search-box { transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); background: #171512; }
.top-action { transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease-spring); }
.top-action:hover { background: var(--card-2); }
.top-action:active { transform: scale(0.94); }
.avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px rgba(200,169,106,0.45); }
.user-chip .meta b { font-family: var(--font-display); font-weight: 600; }

/* Cards */
.card { background: linear-gradient(160deg, #211f1a, #181714); box-shadow: inset 0 1px 0 rgba(255,255,255,0.045); transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s; }
.card.hoverable:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 16px 36px rgba(0,0,0,0.35); }
.stat .icon-box { background: linear-gradient(135deg, rgba(200,169,106,0.20), rgba(200,169,106,0.06)); color: var(--gold-2); border: 1px solid rgba(200,169,106,0.18); transition: transform 0.3s var(--ease-spring); }
.stat:hover .icon-box { transform: translateY(-2px) rotate(-4deg); }
.stat::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: 0; transition: opacity 0.35s; }
.stat:hover::after { opacity: 1; }
.kpi-mini .v { font-weight: 600; }

/* Apparition en cascade des cartes */
.page .grid > * { animation: rise 0.55s var(--ease) both; }
.page .grid > *:nth-child(1) { animation-delay: 0.02s; } .page .grid > *:nth-child(2) { animation-delay: 0.06s; }
.page .grid > *:nth-child(3) { animation-delay: 0.10s; } .page .grid > *:nth-child(4) { animation-delay: 0.14s; }
.page .grid > *:nth-child(5) { animation-delay: 0.18s; } .page .grid > *:nth-child(6) { animation-delay: 0.22s; }
.page .grid > *:nth-child(7) { animation-delay: 0.26s; } .page .grid > *:nth-child(8) { animation-delay: 0.30s; }
.page .grid > *:nth-child(n+9) { animation-delay: 0.34s; }
.live-grid > *:nth-child(1) { animation-delay: 0.02s; } .live-grid > *:nth-child(2) { animation-delay: 0.08s; }
.live-grid > *:nth-child(3) { animation-delay: 0.14s; } .live-grid > *:nth-child(4) { animation-delay: 0.20s; }
.live-grid > *:nth-child(n+5) { animation-delay: 0.26s; }

/* Boutons */
.btn { transition: transform 0.18s var(--ease-spring), background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s; }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--gold), 0 0 0 4px var(--gold-soft); }
.btn-gold { position: relative; overflow: hidden; box-shadow: 0 6px 18px rgba(200,169,106,0.18); }
.btn-gold::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,0.35) 50%, transparent 65%);
  transform: translateX(-130%); transition: transform 0.7s var(--ease); }
.btn-gold:hover::after { transform: translateX(130%); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); }

/* Champs */
.input { background: #131210; }
.input:hover { border-color: rgba(255,255,255,0.14); }
.input::placeholder { color: #6a6560; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A0A0A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center; }
select.input option { background: #1d1b17; color: var(--text); }
.field label { letter-spacing: 0.2px; }

/* Tableaux */
.table-wrap { border: 1px solid var(--border); background: rgba(0,0,0,0.16); }
table.tbl thead th { position: sticky; top: 0; z-index: 1; background: #1b1916; letter-spacing: 1px; }
table.tbl tbody tr { transition: background 0.15s; }
table.tbl tbody tr:hover { background: rgba(200,169,106,0.06); }
table.tbl td { transition: color 0.15s; }
.empty { border: 1px dashed var(--border); border-radius: 14px; background: rgba(255,255,255,0.015); }

/* Onglets, segments, pills */
.tab { position: relative; transition: color 0.2s; }
.tab::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--gold); transform: scaleX(0); transition: transform 0.3s var(--ease); }
.tab.active { border-bottom-color: transparent; }
.tab.active::after { transform: scaleX(1); }
.seg button { transition: background 0.25s, color 0.2s, box-shadow 0.25s; }
.seg button.active { box-shadow: 0 2px 12px rgba(200,169,106,0.18); }
.pill { letter-spacing: 0.3px; }

/* Modales */
.modal { animation: modalIn 0.4s var(--ease-spring) both; box-shadow: var(--shadow), 0 0 0 1px rgba(200,169,106,0.10); background: linear-gradient(160deg, #24221d, #19181500), #181715; }
.modal-head { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.modal-head [data-close] svg { transition: transform 0.3s var(--ease); }
.modal-head [data-close]:hover svg { transform: rotate(90deg); }
.modal-foot { border-top: 1px solid var(--border); padding-top: 16px; }

/* Toasts */
.toast { background: rgba(30,28,24,0.86); backdrop-filter: blur(12px); transition: opacity 0.3s, transform 0.3s var(--ease); }

/* Panneau notifications */
.panel { animation: modalIn 0.3s var(--ease) both; }

/* Postes en direct: finitions */
.st2 { background: linear-gradient(165deg, #24221c, #171613); }
.st2-body h4 { font-family: var(--font-display); }
.st2-actions .btn.ic:hover { border-color: var(--border-strong); }

/* Accessibilite: mouvement reduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Responsive (tablette / mobile) ---------- */
@media (max-width: 1024px) {
  #app.show { grid-template-columns: minmax(0, 1fr); }
  .main { min-width: 0; }
  .content { overflow-x: hidden; }
  .grid > * { min-width: 0; }
  .topbar { overflow: hidden; }
  .title-box { flex: 0 1 auto; }
  .search-box { flex: 1 1 120px; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 84vw; z-index: 900;
    transform: translateX(-100%); transition: transform 0.28s var(--ease);
    box-shadow: none; padding-top: max(18px, env(safe-area-inset-top));
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .sb-backdrop { position: fixed; inset: 0; z-index: 890; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity 0.25s; display: block; }
  .sb-backdrop.show { opacity: 1; pointer-events: auto; }
  .nav-item { padding: 12px 12px; font-size: 14.5px; }
  .top-action.menu-btn { display: flex; flex-shrink: 0; }
  .topbar { padding: 10px 14px; gap: 10px; flex-wrap: nowrap; }
  .topbar h2 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .search-box { width: auto; flex: 1; min-width: 90px; padding: 8px 12px; }
  .user-chip { padding: 4px; }
  .content { padding: 16px 14px 28px; }
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid { gap: 12px; }
  .card { padding: 16px; }
  .panel { position: fixed; top: 64px; left: 10px; right: 10px; width: auto; max-height: 70vh; }
}

@media (max-width: 900px) {
  /* grilles a colonnes personnalisees (style inline) -> une colonne */
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .grid[style*="repeat(3,1fr)"], .grid[style*="1fr 1fr 1fr"] { grid-template-columns: repeat(2, 1fr) !important; }
  .grid[style*="max-height:62vh"] { max-height: none !important; }
  .form-row.three { grid-template-columns: 1fr 1fr; }
  .modal.wide { width: 100%; }
}

@media (max-width: 640px) {
  .topbar .sub, .user-chip .meta { display: none; }
  .topbar { gap: 8px; padding: 10px 10px; }
  .topbar h2 { font-size: 15px; }
  .top-action { width: 36px; height: 36px; border-radius: 10px; }
  .avatar { width: 32px; height: 32px; font-size: 12px; }
  .search-box { flex: 1 1 60px; padding: 7px 10px; }
  .search-box input::placeholder { color: transparent; }
  .search-box { min-width: 0; }
  .search-box input { font-size: 14px; }
  #btnFullscreen { display: none; }
  .content { padding: 12px 10px 28px; }
  .cols-2 { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: 1fr; }
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 14px; }
  .stat .big, .stat h2, .stat .value { font-size: 22px; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .modal { width: 100%; max-width: 100vw; max-height: 94vh; border-radius: 16px 16px 0 0; padding: 18px 16px;
    align-self: flex-end; }
  .modal-overlay { align-items: flex-end; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; justify-content: center; }
  .card-head { flex-wrap: wrap; gap: 8px; }
  .card-head .tools { flex-wrap: wrap; }
  .tabs { gap: 2px; }
  .tab { padding: 9px 11px; font-size: 12.5px; }
  .seg button { padding: 6px 10px; font-size: 12px; }
  .table-wrap { margin: 0 -4px; }
  table.tbl { min-width: 520px; }
  table.tbl th, table.tbl td { padding: 10px 10px; }
  #toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; }
  .btn { padding: 10px 14px; }
  .station-card .st-name { font-size: 14px; }
  .lstat { flex: 1 1 140px; min-width: 0; }
  .live-head { margin-bottom: 14px; }
  .st-actions { flex-wrap: wrap; }
  .st-actions .btn { flex: 1 1 45%; }
  .st-actions .btn-gold { flex-basis: 100%; }
  .bracket { gap: 20px; }
  .bracket-round { min-width: 180px; }
  input, select, textarea { font-size: 16px; } /* evite le zoom auto iOS */
}

@media (max-width: 480px) {
  #stationGrid.cols-4 { grid-template-columns: 1fr; }
  .st-actions .btn { flex: 1 1 30%; }
  .st-actions .btn-gold { flex-basis: 30%; }
}
