:root {
  --bg: #0d0d0d; --bg2: #161616; --bg3: #1f1f1f; --line: #2a2a2a; --line2: #3a3a3a;
  --text: #ececec; --muted: #a3a3a3; --dim: #6f6f6f;
  --gold: #d4af37; --gold2: #f3d774; --gold-dim: #8a7122; --gold-bg: #2a2410;
  --green-bg: #1d3320; --green: #8fd48f; --amber-bg: #3a3217; --amber: #e8cc6a; --blue-bg: #17283a; --blue: #7db6f0;
  --red-bg: #3a1a1a; --red: #f08a8a; --gray-bg: #2b2b2b; --gray: #bdbdbd;
  --radius: 12px; --nav-h: 64px; --head-h: 56px;
  font-size: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100vw; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", Roboto, system-ui, -apple-system, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; overscroll-behavior-y: none; }
a { color: var(--blue); word-break: break-all; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 700; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .gold { color: var(--gold); }
.small { font-size: 13px; } .tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }

/* ---------- header ---------- */
.header { position: sticky; overflow: hidden; max-width: 100vw; top: 0; z-index: 20; background: #000; border-bottom: 1px solid var(--line); height: var(--head-h); display: flex; align-items: center; gap: 12px; padding: 0 14px; }
.brand { display: flex; min-width: 0; overflow: hidden; text-overflow: ellipsis; align-items: center; gap: 9px; text-decoration: none; color: var(--gold); font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 50%; }
.tabs { display: none; gap: 4px; margin-left: 10px; }
.tabs a { color: var(--muted); text-decoration: none; padding: 8px 9px; border-radius: 8px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tabs a.on { color: var(--gold); background: var(--gold-bg); }
.tabs a:hover { color: var(--gold2); }
.hsearch { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.hsearch input { width: 180px; max-width: 42vw; display: none; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 12px; color: var(--text); }
.hsearch input:focus { outline: none; border-color: var(--gold); }
.iconbtn { background: var(--bg2); border: 1px solid var(--line2); color: var(--text); border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600; }
.iconbtn:hover { border-color: var(--gold); color: var(--gold2); }
.offline-bar { background: var(--amber-bg); color: var(--amber); font-size: 13px; padding: 7px 14px; text-align: center; }

/* ---------- layout ---------- */
.main { padding-bottom: calc(var(--nav-h) + 16px); }
.pane-list, .pane-detail { min-width: 0; }
.pane-detail { display: none; }
.pane-detail.show { display: block; }
.pane-list.hide-mobile { display: none; }
.content { padding: 10px 12px 24px; max-width: 980px; margin: 0 auto; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 10px; }
.title { font-size: 20px; color: #fff; }
.subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.4; }
.rule { color: var(--dim); font-size: 12px; margin: 6px 0 10px; line-height: 1.45; }
.count { color: var(--gold); font-weight: 700; }

/* ---------- bottom nav ---------- */
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; height: var(--nav-h); background: #000; border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: stretch; padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: #8a8a8a; font-size: 11px; font-weight: 600; }
.nav a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav a.on { color: var(--gold); }

/* ---------- chips / filters ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line2); color: #d0d0d0; background: var(--bg2); border-radius: 18px; padding: 6px 11px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--gold); color: #000; border-color: var(--gold); }
.chip select { background: transparent; border: none; color: inherit; font-weight: 600; font-size: 12.5px; padding: 0; max-width: 150px; }
.chip select:focus { outline: none; }
.chip.on select { color: #000; }
.chip select option { background: var(--bg2); color: var(--text); }
.chip input[type=date] { background: transparent; border: none; color: inherit; font-size: 12.5px; padding: 0; font-weight: 600; }
.chip.on input[type=date] { color: #000; }
.filters { margin: 4px 0 10px; }
.filters details summary { cursor: pointer; color: var(--gold); font-size: 13px; font-weight: 600; list-style: none; padding: 4px 0; }
.filters details summary::-webkit-details-marker { display: none; }

/* ---------- tags ---------- */
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: var(--gray-bg); color: var(--gray); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.gold { background: var(--gold); color: #000; }
.tag.outline { background: transparent; border: 1px solid var(--line2); }

/* ---------- lists / cards ---------- */
.dayhead { color: var(--gold); font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 12px 4px 4px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; margin: 6px 0; cursor: pointer; display: block; color: inherit; text-decoration: none; }
.card:hover { border-color: var(--line2); background: #1a1a1a; }
.card.sel { border-color: var(--gold); background: #1d1a10; }
.card.booked { border-color: var(--gold-dim); }
.card .n { font-size: 15px; font-weight: 600; color: #fff; line-height: 1.3; }
.card .m { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.4; }
.card .tags { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.empty { color: var(--muted); padding: 30px 10px; text-align: center; line-height: 1.5; }

/* ---------- detail ---------- */
.detail { padding: 12px 14px 30px; }
.detail h2 { font-size: 22px; color: #fff; line-height: 1.25; }
.detail .meta { color: #c9c9c9; font-size: 14px; margin-top: 6px; line-height: 1.5; }
.detail .tags { margin: 10px 0 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sec { margin-top: 14px; }
.sec .h { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; margin-bottom: 4px; }
.sec p, .sec .v { color: #d6d6d6; font-size: 14px; line-height: 1.5; margin: 0; white-space: pre-wrap; word-break: break-word; }
.sec a { display: inline-block; margin-top: 2px; }
.btns { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.btn { font-size: 14px; font-weight: 600; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); color: #e6e6e6; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--gold); color: var(--gold2); }
.btn.gold { background: var(--gold); color: #000; border-color: var(--gold); }
.btn.gold:hover { background: var(--gold2); color: #000; }
.btn.danger { border-color: #5a2a2a; color: var(--red); }
.btn.sm { font-size: 12.5px; padding: 6px 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.status-select { background: var(--gold); color: #000; border: none; border-radius: 9px; padding: 6px 10px; font-weight: 700; font-size: 13px; }
.status-select.none { background: var(--bg3); color: var(--text); border: 1px solid var(--line2); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 8px; }

/* ---------- forms ---------- */
.form { display: grid; grid-template-columns: 1fr; gap: 12px; }
.form .f { display: flex; flex-direction: column; gap: 4px; }
.form label { color: var(--gold); font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.form input, .form select, .form textarea { background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; color: var(--text); width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--gold); }
.form textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
.form .hint { color: var(--dim); font-size: 12px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .span { grid-column: 1 / -1; }
.msg { padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 10px 0; }
.msg.err { background: var(--red-bg); color: var(--red); }
.msg.ok { background: var(--green-bg); color: var(--green); }
.msg.info { background: var(--blue-bg); color: var(--blue); }

/* ---------- login ---------- */
.login { max-width: 420px; margin: 40px auto; padding: 24px; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; }
.login .logo { display: flex; justify-content: center; margin-bottom: 14px; }
.login .logo img { width: 72px; height: 72px; border-radius: 50%; }
.login h1 { text-align: center; color: var(--gold); font-size: 22px; }
.login p { text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- promoters ---------- */
.ptable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ptable th { text-align: left; color: var(--gold); font-size: 11px; letter-spacing: .5px; text-transform: uppercase; padding: 8px 6px; border-bottom: 1px solid var(--line2); position: sticky; top: var(--head-h); background: var(--bg); }
.ptable td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ptable tr { cursor: pointer; }
.ptable tr:hover td { background: #171717; }
.ptable .num { text-align: right; color: var(--muted); white-space: nowrap; }
.letter { color: var(--gold); font-weight: 700; padding: 14px 4px 4px; font-size: 13px; }
.alpha { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.alpha a { color: var(--muted); text-decoration: none; font-size: 12px; padding: 3px 6px; border-radius: 6px; background: var(--bg2); }
.alpha a.has { color: var(--gold); }

/* ---------- month ---------- */
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mgrid .dow { color: var(--gold); font-size: 11px; font-weight: 700; text-align: center; padding: 4px 0; text-transform: uppercase; }
.mcell { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; min-height: 64px; padding: 4px; cursor: pointer; overflow: hidden; }
.mcell.other { opacity: .35; }
.mcell.today { border-color: var(--gold); }
.mcell.sel { background: #1d1a10; border-color: var(--gold); }
.mcell .d { font-size: 12px; color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.mcell .cnt { font-size: 9.5px; background: var(--bg3); color: var(--gold); border-radius: 8px; padding: 0 5px; font-weight: 700; }
.mcell .ev { font-size: 10.5px; color: #ddd; background: var(--bg3); border-radius: 4px; padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcell .ev.booked { background: var(--gold); color: #000; font-weight: 700; }
.mcell .more { font-size: 10px; color: var(--gold); margin-top: 2px; }
.mnav { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 10px; }

/* ---------- settings ---------- */
.settings .block { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 12px 0; }
.settings .block h3 { color: var(--gold); font-size: 15px; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13.5px; }
.kv div:nth-child(odd) { color: var(--muted); }
progress { width: 100%; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 14px); transform: translateX(-50%); background: var(--gold); color: #000; font-weight: 700; padding: 10px 16px; border-radius: 12px; z-index: 50; box-shadow: 0 6px 24px rgba(0,0,0,.5); max-width: 90vw; text-align: center; }
.toast.err { background: #c0392b; color: #fff; }
.snip { color: var(--dim); font-size: 12px; margin-top: 4px; }
.snip b { color: var(--gold2); font-weight: 600; }
.changes li { font-size: 13px; color: #ccc; padding: 6px 0; border-bottom: 1px solid var(--line); list-style: none; }
.changes { padding: 0; margin: 0; }
.dl { display: inline-block; margin-top: 4px; }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .tabs { display: flex; }
  .nav { display: none; }
  .main { padding-bottom: 20px; }
  .main.two { display: grid; grid-template-columns: minmax(360px, 440px) 1fr; min-height: calc(100vh - var(--head-h)); }
  .main.two .pane-list { border-right: 1px solid var(--line); height: calc(100vh - var(--head-h)); overflow-y: auto; }
  .main.two .pane-detail { display: block; height: calc(100vh - var(--head-h)); overflow-y: auto; }
  .main.two .pane-list.hide-mobile { display: block; }
  .main.two .content { max-width: none; }
  .main.two .detail { max-width: 900px; padding: 18px 26px 40px; }
  .back.mobile-only { display: none; }
  .toast { bottom: 24px; }
  .hsearch input { width: 220px; display: block; }
}
@media (min-width: 900px) and (max-width: 1180px) {
  .hsearch input { display: none; }
  .tabs a { padding: 8px 7px; font-size: 13px; }
  .form { grid-template-columns: 1fr 1fr; }
}

/* ---------- install banner ---------- */
.install { background: linear-gradient(135deg, #1d1a10, #161616); border: 1px solid var(--gold-dim); border-radius: var(--radius); padding: 12px 14px; margin: 8px 0 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.install b { color: var(--gold2); font-size: 14.5px; }
.install.compact { padding: 10px 12px; }
