@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Syne:wght@700;800&display=swap");

:root {
  --bg: #050505;
  --surface: #101010;
  --surface-2: #161616;
  --line: #2a2a2a;
  --text: #f4f1ec;
  --muted: #8a8680;
  --orange: #ff5a00;
  --orange-2: #ff8a3d;
  --vip: #ffb020;
  --danger: #ff4d3a;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Syne", system-ui, sans-serif;
  --bar: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body {
  display: flex; flex-direction: column; overflow: hidden;
  background:
    radial-gradient(980px 460px at -8% -20%, rgba(255,90,0,.18), transparent 58%),
    radial-gradient(720px 380px at 110% -10%, rgba(255,176,32,.1), transparent 52%),
    var(--bg);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); font-size: .82rem; }
.mono { font-family: ui-monospace, monospace; }

.shell { display: flex; flex: 1; min-height: 0; width: 100%; }
.workspace { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.sidenav { display: none; }

.titlebar {
  flex: none;
  min-height: var(--bar);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,8,8,.92);
  backdrop-filter: blur(16px);
  user-select: none;
}
.app-drag { -webkit-app-region: drag; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: #000; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--display); font-size: 1.15rem; letter-spacing: -.03em; }
.brand-text span { color: var(--muted); font-size: .72rem; margin-top: 3px; }

.topnav { display: flex; gap: 4px; -webkit-app-region: no-drag; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 650;
}
.nav-item:hover { color: var(--text); background: #161616; }
.nav-item.active { color: #111; background: var(--orange); border-color: var(--orange); }

@media (min-width: 861px) {
  .sidenav {
    display: flex;
    flex-direction: column;
    width: 232px;
    flex: none;
    padding: 18px 14px 16px;
    background: #080808;
    border-right: 1px solid var(--line);
  }
  .side-brand { min-width: 0; margin-bottom: 22px; padding: 0 6px; }
  .side-brand .brand-mark { width: 46px; height: 46px; border-radius: 14px; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 11px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-weight: 650;
  }
  .side-nav .nav-item svg {
    width: 18px; height: 18px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .side-nav .nav-item:hover { color: var(--text); background: #141414; }
  .side-nav .nav-item.active {
    color: var(--text);
    background: rgba(255,90,0,.14);
    box-shadow: inset 3px 0 0 var(--orange);
  }
  .titlebar .brand, .titlebar .topnav { display: none; }
  .titlebar { padding-left: 22px; gap: 16px; }
  #pageTitle {
    position: static; width: auto; height: auto; margin-right: auto;
    clip: auto; overflow: visible;
    font-family: var(--display); font-size: 1.15rem; font-weight: 800; letter-spacing: -.03em;
  }
}

.titlebar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; -webkit-app-region: no-drag; }
.search-field { position: relative; }
.search-field input, .search-input, input, select {
  background: #0c0c0c;
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 36px;
  padding: 0 12px;
  outline: none;
  width: 100%;
}
.search-field input { width: 160px; }
input:focus, select:focus { border-color: var(--orange); }
.search-dropdown {
  position: absolute; top: 42px; right: 0; width: 240px; z-index: 20;
  background: #111; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.search-item { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; cursor: pointer; }
.search-item:hover { background: #1a1a1a; }

.status-pill {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px;
  font-size: .75rem; color: var(--muted);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #444; }
.status-dot.on { background: var(--orange); box-shadow: 0 0 0 4px rgba(255,90,0,.18); }
.status-dot.off { background: #555; }
.status-pill.online { color: var(--text); border-color: rgba(255,90,0,.45); }

.icon-btn, .win-btn {
  width: 32px; height: 32px; border: 0; background: transparent; color: var(--text);
  display: grid; place-items: center; border-radius: 8px;
}
.icon-btn svg, .win-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.icon-btn:hover, .win-btn:hover { background: #1a1a1a; }
.win-close:hover { background: var(--danger); }
.icon-btn.is-muted { color: var(--vip); }
.titlebar-clock { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.win-controls { display: flex; }
html.is-web .win-controls { display: none; }

.app { flex: 1; min-height: 0; }
.content { height: 100%; overflow: auto; padding: 18px 20px 28px; }
.page { display: none; }
.page.active { display: block; height: 100%; }

.eyebrow {
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--orange); font-weight: 700; margin-bottom: 4px;
}
h2 { font-family: var(--display); font-size: 1.35rem; letter-spacing: -.03em; font-weight: 800; }

.desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  min-height: calc(100% - 8px);
}
.floor-head, .sheet-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.metrics { display: flex; gap: 8px; flex-wrap: wrap; }
.metrics > div {
  background: rgba(16,16,16,.85);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 12px;
  min-width: 78px;
}
.metrics b { display: block; font-size: 1.02rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.metrics span { color: var(--muted); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; }
.metric-vip { border-color: rgba(255,176,32,.35) !important; }
.metric-vip b { color: var(--vip); }

.bay {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  align-items: stretch;
}
.widget[data-span="2"] { grid-column: span 2; }
.widget[data-span="3"] { grid-column: span 3; }
.zone { margin-top: 22px; }
.zone-vip .eyebrow { color: var(--vip); }
.vip-board { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.widget {
  position: relative;
  background: #101010;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 14px 40px;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease;
}
.widget h3 { font-family: var(--display); font-size: 1.05rem; }
.widget-value { font-family: var(--display); font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; }
.widget-sub { color: var(--muted); font-size: .8rem; }
.widget-vip { border-color: rgba(255,176,32,.4); }
.widget-vip .widget-value { color: var(--vip); }
.widget .live-list {
  margin-top: 4px;
  max-height: 168px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--orange) #1a1a1a;
}
.widget[data-widget="live"] .live-list {
  max-height: min(46vh, 340px);
}
.widget .live-list::-webkit-scrollbar { width: 8px; }
.widget .live-list::-webkit-scrollbar-thumb { background: var(--orange); border-radius: 99px; }
.zone-vip h2 { color: var(--vip); }
.widget.is-moving {
  z-index: 4;
  opacity: 1;
  box-shadow: 0 22px 48px rgba(0,0,0,.5), 0 0 0 1px var(--orange);
  transition: box-shadow .2s ease;
}
@media (prefers-reduced-motion: reduce) {
  .widget { transition: none; }
}
.card-move {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: #1c1c1c; color: var(--muted); cursor: grab; touch-action: none;
}
.card-move:hover, .card-move:active { color: var(--text); }
.card-move:active { cursor: grabbing; }
.card-resize {
  position: absolute; right: 8px; bottom: 8px;
  width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: #1c1c1c; color: var(--muted); cursor: nwse-resize; touch-action: none;
}
.card-resize:hover { color: var(--text); border: 1px solid var(--orange); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.report-stat, .report-play {
  border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: #101010;
}
.report-play { display: flex; flex-direction: column; gap: 4px; }
.report-stat b, .report-play b { display: block; font-variant-numeric: tabular-nums; }
.report-stat span, .report-play span { color: var(--muted); font-size: .75rem; }
.table-wrap { overflow-x: auto; }
.report-title { margin: 18px 0 10px; font-family: var(--display); font-size: 1.05rem; }
.report-plays { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.vip-bay { display: grid; gap: 10px; margin-top: 12px; }

.station-card {
  position: relative;
  background: linear-gradient(180deg, #161616, #101010);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.station-card.live {
  border-color: rgba(255,90,0,.75);
  background: linear-gradient(180deg, #1c1009, #120b07);
  box-shadow: 0 14px 36px rgba(255,90,0,.1), inset 0 1px 0 rgba(255,140,60,.2);
}
.station-card.station-vip { background: linear-gradient(180deg, #1a140b, #100e09); border-color: rgba(255,176,32,.4); }
.station-card.warn { border-color: var(--vip); }
.station-card.crit { border-color: var(--danger); }
.station-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.station-name { font-family: var(--display); font-weight: 800; letter-spacing: -.03em; }
.station-player { margin-top: 16px; font-weight: 650; font-size: 1rem; }
.station-meta { color: var(--muted); font-size: .78rem; margin-top: 4px; }
.station-time {
  margin-top: auto;
  padding-top: 12px;
  font-size: 1.65rem;
  font-weight: 750;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.station-empty { margin-top: 18px; color: var(--muted); font-size: .86rem; flex: 1; }
.station-card .btn-row, .station-card .btn-block { margin-top: 12px; }

.tag {
  font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 8px; border: 1px solid var(--line); color: var(--muted);
}
.tag.on, .tag.open { color: #111; background: var(--orange); border-color: var(--orange); }
.tag.vip { color: #111; background: var(--vip); border-color: var(--vip); }

.cash-card {
  margin-top: 14px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255,90,0,.12), #101010 42%);
}
.cash-main { min-width: 140px; }
.cash-main strong { display: block; font-size: 1.45rem; font-weight: 750; font-variant-numeric: tabular-nums; margin-top: 2px; }
.cash-side { display: flex; flex-direction: column; min-width: 72px; }
.cash-side b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.cash-side span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-tag { border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; font-size: .75rem; color: var(--text); }

.rail { display: flex; flex-direction: column; gap: 16px; }
.rail-block {
  background: #0c0c0c;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.live-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.live-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #1d1d1d;
}
.live-row .btn-row { width: 100%; }
.live-row strong { display: block; }
.live-row span { color: var(--muted); font-size: .75rem; }
.live-time { font-family: var(--display); font-weight: 800; }

.sheet {
  background: #0c0c0c;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
  overflow-x: auto;
}
.sheet h2 { margin-bottom: 14px; }
.panel-desc { color: var(--muted); font-size: .86rem; margin: -6px 0 14px; line-height: 1.5; }

.alert-banner {
  margin-bottom: 12px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(255,77,58,.45); color: #ffd0c8; background: #1a0c0a;
}
.warn-banner { border-color: rgba(255,176,32,.5); color: var(--vip); background: #1a1408; }

.client-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.client-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 12px;
  background: #101010; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
}
.client-card:hover { border-color: var(--orange); }
.client-card.busy { opacity: .55; cursor: default; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-weight: 800;
  background: #1c1009; color: var(--orange-2); border: 1px solid rgba(255,90,0,.35);
}
.client-card .name { font-family: var(--display); font-weight: 800; }
.client-card .meta { color: var(--muted); font-size: .78rem; margin-top: 2px; }

table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th { text-align: left; color: var(--muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; padding: 8px; }
td { padding: 10px 8px; border-top: 1px solid #1c1c1c; }
.ledger tbody tr:hover td { background: #141414; }
.num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--orange-2); }
.empty {
  padding: 22px 12px; text-align: center; color: var(--muted);
  border: 1px dashed #333; border-radius: 14px;
}
.log-ok { color: var(--orange-2); font-weight: 700; }
.log-err { color: var(--danger); font-weight: 700; }

.form-grid { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: block; color: var(--muted); font-size: .75rem; margin-bottom: 6px; }
.station-set { display: grid; grid-template-columns: 1.2fr .7fr 1.4fr .8fr; gap: 8px; margin-bottom: 8px; }
.discount-tier-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: end; }

.btn {
  height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--text); font-weight: 650;
}
.btn:hover { border-color: #555; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #111; box-shadow: 0 8px 18px rgba(255,90,0,.18); }
.btn-primary:hover { background: var(--orange-2); }
.btn-danger { border-color: rgba(255,77,58,.6); color: #ffb1a8; }
.btn-sm { height: 30px; font-size: .78rem; }
.btn-block { width: 100%; }
#btnAdminStart { margin-top: 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-width: 72px; border: 1px solid var(--line); background: #101010; border-radius: 12px;
  padding: 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.chip-dur { font-weight: 700; }
.chip-price { color: var(--orange-2); font-size: .72rem; }
.chip.active { background: var(--orange); border-color: var(--orange); color: #111; }
.chip.active .chip-price { color: #111; }
.price-line { margin: 8px 0; font-family: var(--display); font-weight: 800; }
.divider { text-align: center; color: var(--muted); font-size: .75rem; margin: 12px 0; }
.pick-list { max-height: 180px; overflow: auto; display: grid; gap: 6px; }
.pick-item { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.pick-item:hover { border-color: var(--orange); }
.info-banner { padding: 8px 10px; border-radius: 10px; background: #1a1408; color: var(--vip); }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.62);
  display: none; align-items: center; justify-content: center; z-index: 30; padding: 20px;
}
.modal.show { display: flex; }
.modal-box {
  width: min(460px, 100%); background: #101010; border: 1px solid var(--line);
  border-radius: 18px; padding: 16px;
}
.modal-sm { width: min(380px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal .muted { margin-bottom: 12px; }
.modal .chips { margin: 12px 0; }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: #111; border: 1px solid var(--line); color: var(--text);
  padding: 10px 14px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); }

.tabbar { display: none; }

@media (max-width: 1180px) {
  .desk { grid-template-columns: 1fr; }
  .client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .station-set { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .titlebar { flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px 10px; }
  .brand { min-width: 0; }
  .topnav {
    order: 5;
    width: 100%;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
  }
  .nav-item { flex: 0 0 auto; }
  .titlebar-right { gap: 6px; }
  .titlebar-clock { display: none; }
  .search-field input { width: 120px; }
  .bay { grid-template-columns: 1fr 1fr; }
  .content { padding: 12px 12px 24px; }
  .metrics { gap: 12px; }
}
@media (max-width: 560px) {
  .bay, .client-grid, .form-row, .station-set, .discount-tier-row { grid-template-columns: 1fr; }
  .brand-text span { display: none; }
  .search-field input { width: 100px; }
  .station-card { min-height: 0; }
  .widget, .widget[data-span] { grid-column: auto; }
  .vip-board { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr 1fr; }
  .station-time { font-size: 1.35rem; }
  .ledger thead { display: none; }
  .ledger tr { display: block; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 8px; padding: 8px 10px; background: #101010; }
  .ledger td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; }
  .ledger td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; }
  .ledger .empty-row, .ledger .empty-row td { display: block; border: 0; background: transparent; padding: 0; }
  .ledger .empty-row td::before { content: none; }
  .modal { padding: 10px; align-items: flex-end; }
  .modal-box { max-height: min(92vh, 100%); overflow: auto; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .toast { width: calc(100% - 24px); text-align: center; bottom: 12px; }
  .content { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

html.is-app .sidenav,
html.is-app .topnav,
html.is-app .titlebar-clock,
html.is-app [data-page="parametres"] { display: none !important; }
html.is-app .titlebar {
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  min-height: 0;
}
html.is-app .brand { min-width: 0; }
html.is-app .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
html.is-app .brand-text span { display: none; }
html.is-app .status-pill { padding: 6px 8px; }
html.is-app .tabbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 28;
  margin: 0 auto;
  width: min(520px, 100%);
  padding: 6px 18px calc(8px + env(safe-area-inset-bottom));
  background: rgba(8,8,8,.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
html.is-app .tabbar .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: auto;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  padding: 8px 0 6px;
  font-size: .72rem;
  font-weight: 700;
}
html.is-app .tabbar .nav-item svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
html.is-app .tabbar .nav-item.active,
html.is-app .tabbar .nav-item.active:hover {
  color: var(--orange);
  background: transparent;
  box-shadow: none;
}
html.is-app .content { padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); }
html.is-app .board.plays,
html.is-app .vip-board,
html.is-app .widget,
html.is-app .widget[data-span] { grid-column: auto; }
html.is-app .board.plays,
html.is-app .vip-board { grid-template-columns: 1fr; }
html.is-app .station-card .btn { height: 48px; border-radius: 14px; font-size: 1rem; }
html.is-app .toast {
  width: min(440px, calc(100% - 24px));
  bottom: calc(88px + env(safe-area-inset-bottom));
}
html.is-app .modal { padding: 0; align-items: flex-end; }
html.is-app .modal-box {
  width: min(520px, 100%);
  max-height: min(92vh, 100%);
  overflow: auto;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
html.is-app .report-grid { grid-template-columns: 1fr 1fr; }
html.is-app .ledger thead { display: none; }
html.is-app .ledger tr { display: block; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 8px; padding: 8px 10px; background: #101010; }
html.is-app .ledger td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; }
html.is-app .ledger td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; }
html.is-app .ledger .empty-row,
html.is-app .ledger .empty-row td { display: block; border: 0; background: transparent; padding: 0; }
html.is-app .ledger .empty-row td::before { content: none; }
.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  background:
    radial-gradient(520px 280px at 50% 42%, rgba(255,90,0,.22), transparent 70%),
    #050505;
  transition: opacity .4s ease, visibility .4s ease;
}
.boot-loader img { width: 72px; height: 72px; border-radius: 18px; }
.boot-loader strong {
  font-family: var(--display);
  font-size: 1.8rem;
  letter-spacing: .22em;
}
.boot-loader span { color: var(--orange); letter-spacing: .28em; font-size: .72rem; text-transform: uppercase; }
.boot-loader i {
  display: block;
  width: 140px;
  height: 2px;
  margin-top: 6px;
  background: #2a2a2a;
  position: relative;
  overflow: hidden;
}
.boot-loader i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: var(--orange);
  animation: bootSlide 1s ease-in-out infinite;
}
.boot-loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes bootSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
html.is-app body,
html.is-app .shell {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
html.is-app .content {
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px calc(92px + env(safe-area-inset-bottom));
}
html.is-app .card-move,
html.is-app .card-resize { display: none; }
html.is-app #page-dashboard.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
html.is-app #page-dashboard .alert-banner { order: 0; margin-bottom: 0; }
html.is-app #page-dashboard .zone { order: 1; margin-top: 0; }
html.is-app #page-dashboard .zone-vip { order: 2; }
html.is-app #page-dashboard #widgets { order: 3; }
html.is-app .floor-head { margin-bottom: 8px; }
html.is-app .floor-head h2 { font-size: 1.2rem; }
html.is-app .board.plays,
html.is-app .vip-board {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
html.is-app .station-card {
  min-height: 0;
  padding: 12px;
  border-radius: 16px;
}
html.is-app .station-card.live { grid-column: 1 / -1; }
html.is-app .station-name { font-size: 1.02rem; }
html.is-app .station-empty { margin-top: 8px; font-size: .78rem; }
html.is-app .station-player { margin-top: 8px; font-size: .92rem; }
html.is-app .station-time { font-size: 1.35rem; padding-top: 8px; }
html.is-app .station-card .btn { height: 44px; }
html.is-app .station-card .btn-row .btn { flex: 1; min-width: 0; }
html.is-app .widget { min-height: 0; padding: 12px; }
html.is-app .widget .live-list { max-height: 120px; }
html.is-app .widget[data-widget="live"] .live-list { max-height: 180px; }
html.is-app #widgets { gap: 8px; }
html.is-app .tabbar .nav-item { min-height: 52px; }
html.is-app .tabbar .nav-item.active {
  background: rgba(255, 90, 0, .14);
}
html.is-app .sheet-head { align-items: center; }
html.is-app .report-plays { grid-template-columns: 1fr 1fr; }

html.is-app,
html.is-app body {
  height: 100dvh;
}
html.is-app .titlebar {
  position: relative;
  top: auto;
  flex: none;
  gap: 8px;
  min-height: 56px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  background: #080808;
}
html.is-app .brand { min-width: 0; gap: 8px; }
html.is-app .brand-text { display: none; }
html.is-app #pageTitle {
  position: static;
  width: auto;
  height: auto;
  margin: 0 auto 0 2px;
  clip: auto;
  overflow: visible;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.03em;
}
html.is-app .status-pill { max-width: 38vw; font-size: .72rem; }
html.is-app .tabbar {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  flex: none;
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: #080808;
  border-top: 1px solid var(--line);
  box-shadow: none;
}
html.is-app .tabbar .nav-item {
  min-height: 46px;
  border-radius: 14px;
  background: #121212;
}
html.is-app .tabbar .nav-item.active,
html.is-app .tabbar .nav-item.active:hover {
  color: #111;
  background: var(--orange);
}
html.is-app .content {
  padding: 12px 12px 16px;
}
html.is-app .page.active { height: auto; }
html.is-app .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }

.range-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
  margin: 0 0 12px;
}
.range-chip {
  border: 1px solid var(--line);
  background: #121212;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: .76rem;
  font-weight: 700;
  text-align: center;
}
.range-chip.is-on {
  background: var(--orange);
  border-color: var(--orange);
  color: #111;
}
.range-custom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.range-custom[hidden] { display: none; }
.range-custom label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.range-custom input {
  background: #101010;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  color-scheme: dark;
}
html.is-app .sheet-head { margin-bottom: 12px; }
html.is-app .report-stat b { font-family: var(--display); font-size: 1.05rem; }
html.is-app .ledger tr { padding: 10px 12px; }

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #050505;
}
.lock-screen[hidden] { display: none; }
.lock-card {
  width: min(420px, 100%);
  display: grid;
  gap: 10px;
  background: #101010;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
}
.lock-card img { width: 64px; height: 64px; border-radius: 16px; }
.lock-card strong { font-family: var(--display); font-size: 2rem; letter-spacing: -.04em; }
.lock-card p { color: var(--muted); }
.lock-card label { display: grid; gap: 4px; color: var(--muted); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.lock-card label[hidden] { display: none; }
.lock-card input {
  background: #0c0c0c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
}
.lock-error { color: var(--danger); min-height: 1.2em; }
body.is-locked .shell,
body.is-locked .tabbar { visibility: hidden; }
.check-line { display: flex; align-items: center; gap: 8px; color: var(--muted); text-transform: none; letter-spacing: 0; font-size: .85rem; }
html.is-employee [data-page="parametres"] { display: none !important; }
html.is-app.is-admin .tabbar { grid-template-columns: 1fr 1fr 1fr; }
html.is-app.is-admin .tabbar [data-page="parametres"] { display: flex !important; }
html.is-app #logoutBtn { padding: 6px 10px; }
