@import url('/fonts/fonts.css');
:root {
  --ink: #16171b; --ink2: #3d4049; --mut: #6b6f7a; --faint: #9a9ea8;
  --line: #e6e7eb; --line2: #f0f1f3; --bg: #f6f7f9; --card: #fff;
  --side: #16171b; --side2: #23252b; --sidetx: #c9cbd1;
  --lime: #c8f04a; --lime2: #eefbc4; --limeink: #3c5a00;
  --ok: #1f8a4c; --okbg: #e8f6ee; --warn: #a2620a; --warnbg: #fdf3e1; --bad: #c2362f; --badbg: #fdecea; --info: #2f5fb3; --infobg: #eaf1fc;
  --r: 10px; --sans: 'Onest', system-ui, sans-serif; --mono: 'Geist Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.5 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.015em; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.mut { color: var(--mut); } .faint { color: var(--faint); }
.hide { display: none !important; }

/* ---------- shell ---------- */
.demo-bar { background: var(--lime); color: var(--ink); font-size: 13px; text-align: center; padding: 7px 16px; }
.demo-bar a { font-weight: 600; }
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: calc(100vh - 34px); }
.side { background: var(--side); color: var(--sidetx); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: calc(100vh - 34px); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; color: #fff; text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand b { font-size: 16px; letter-spacing: -.02em; }
.wsname { margin: 0 6px 14px; padding: 10px 12px; background: var(--side2); border-radius: 8px; font-size: 13px; line-height: 1.35; }
.wsname b { display: block; color: #fff; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; text-decoration: none; font-size: 14px; position: relative; }
.nav a:hover { background: var(--side2); color: #fff; }
.nav a.on { background: var(--side2); color: #fff; }
.nav a.on::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lime); }
.nav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav .count { margin-left: auto; background: var(--lime); color: var(--ink); font-size: 11.5px; font-weight: 650; border-radius: 99px; padding: 0 7px; line-height: 19px; }
.nav .sep { height: 1px; background: var(--side2); margin: 10px 8px; }
.side .foot { margin-top: auto; padding: 12px 10px 0; font-size: 13px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--side2); }
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--lime); color: var(--ink); display: grid; place-items: center; font-weight: 650; font-size: 12px; flex: none; }
.side .foot button { margin-left: auto; background: none; border: 0; color: var(--sidetx); cursor: pointer; font-size: 12.5px; text-decoration: underline; }
.main { padding: 28px 36px 60px; min-width: 0; max-width: 1320px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.top h1 { font-size: 25px; }
.top p { margin: 4px 0 0; color: var(--mut); }
.mtop { display: none; }

/* ---------- pieces ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; font-weight: 550; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #cfd1d7; }
.btn.pri { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.pri:hover { background: #2b2d34; }
.btn.lime { background: var(--lime); border-color: #b5dc35; color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.card > h2, .card .hd { font-size: 15px; padding: 14px 18px; border-bottom: 1px solid var(--line2); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card .bd { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); align-items: start; }
.stat { padding: 16px 18px; }
.stat small { color: var(--mut); font-size: 13px; display: block; }
.stat b { display: block; font-size: 27px; font-weight: 650; letter-spacing: -.03em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--mut); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 550; padding: 2px 9px; border-radius: 99px; background: var(--line2); color: var(--ink2); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.ok { background: var(--okbg); color: var(--ok); } .pill.warn { background: var(--warnbg); color: var(--warn); } .pill.bad { background: var(--badbg); color: var(--bad); } .pill.info { background: var(--infobg); color: var(--info); }
.pill.lime { background: var(--lime2); color: var(--limeink); } .pill.plain::before { display: none; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 550; font-size: 12.5px; color: var(--mut); padding: 9px 14px; border-bottom: 1px solid var(--line); background: #fafafb; white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #fafbfc; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .sub { font-size: 12.5px; color: var(--mut); }
.empty { padding: 34px 20px; text-align: center; color: var(--mut); }
.list .row { display: flex; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line2); align-items: flex-start; text-decoration: none; }
.list .row:last-child { border-bottom: 0; }
a.row:hover { background: #fafbfc; }
.att { border-left: 3px solid var(--line); padding-left: 12px; }
.att.bad { border-color: var(--bad); } .att.warn { border-color: #e0a43a; } .att.info { border-color: var(--info); }
.att b { display: block; font-weight: 600; font-size: 14px; }
.att p { margin: 2px 0 0; font-size: 13px; color: var(--mut); }
.when { font-family: var(--mono); font-size: 12.5px; color: var(--ink2); min-width: 92px; padding-top: 1px; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 8px; text-decoration: none; font-size: 13.5px; color: var(--ink2); border: 1px solid transparent; }
.tabs a.on { background: #fff; border-color: var(--line); color: var(--ink); font-weight: 550; }
.search { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-width: 260px; background: #fff; }
.note { background: var(--warnbg); color: #6e4a0c; border-radius: 8px; padding: 10px 14px; font-size: 13.5px; }
.note.info { background: var(--infobg); color: #24467f; } .note.ok { background: var(--okbg); color: #155f35; } .note.bad { background: var(--badbg); color: #8e241f; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--mut); } .kv dd { margin: 0; }
.chart { padding: 8px 18px 14px; }
.chart canvas { width: 100%; height: 170px; display: block; }

/* forms */
.f { display: grid; gap: 5px; margin-bottom: 12px; }
.f label { font-size: 13px; font-weight: 550; color: var(--ink2); }
.f input, .f select, .f textarea { border: 1px solid #d9dbe0; border-radius: 8px; padding: 9px 11px; background: #fff; width: 100%; }
.f input:focus, .f select:focus, .f textarea:focus, .search:focus { outline: 2px solid var(--lime); outline-offset: 0; border-color: #a9cf2c; }
.f .err { color: var(--bad); font-size: 12.5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }
.check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); margin-top: 1px; flex: none; }
.check input[type=text] { margin-left: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 13px; width: 200px; }

/* booking detail */
.steps { display: grid; gap: 0; }
.step { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line2); align-items: flex-start; }
.step:last-child { border-bottom: 0; }
.step i { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #cfd2d8; flex: none; display: grid; place-items: center; font-style: normal; font-size: 12px; margin-top: 1px; }
.step.done i { background: var(--ink); border-color: var(--ink); color: var(--lime); }
.step.done i::before { content: '✓'; }
.step b { font-weight: 600; display: block; }
.step p { margin: 2px 0 0; font-size: 13px; color: var(--mut); }
.step .btn { margin-left: auto; }
.code { font-family: var(--mono); font-size: 30px; font-weight: 500; letter-spacing: .22em; background: var(--ink); color: var(--lime); border-radius: 10px; padding: 12px 18px; display: inline-block; }
.ledger td { font-size: 13.5px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: #c7cad1; }
.timeline small { display: block; color: var(--faint); font-family: var(--mono); font-size: 11.5px; }

/* schedule */
.gantt { overflow-x: auto; }
.gantt table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; table-layout: fixed; }
.gantt th, .gantt td { border-bottom: 1px solid var(--line2); border-right: 1px solid var(--line2); height: 46px; padding: 0; }
.gantt th { font-weight: 500; font-size: 12px; color: var(--mut); height: 40px; background: #fafafb; text-align: center; line-height: 1.2; }
.gantt th.today { color: var(--ink); background: var(--lime2); font-weight: 650; }
.gantt th.we, .gantt td.we { background: #fbfbfc; }
.gantt .unit { width: 210px; text-align: left; padding: 6px 12px; font-size: 13px; position: sticky; left: 0; background: #fff; z-index: 2; border-right: 1px solid var(--line); }
.gantt .unit b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt .unit small { color: var(--mut); font-size: 11.5px; }
.gantt .lane { position: relative; }
.gantt .bar { position: absolute; top: 7px; bottom: 7px; border-radius: 6px; font-size: 12px; padding: 0 8px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-decoration: none; z-index: 1; min-width: 6px; }
.bar.confirmed { background: var(--ink); color: #fff; }
.bar.out { background: var(--lime); color: var(--ink); font-weight: 550; }
.bar.held { background: repeating-linear-gradient(135deg, #eef0f3 0 6px, #e1e4e9 6px 12px); color: var(--ink2); }
.bar.closed, .bar.returned_check { background: #e8e9ed; color: var(--mut); }
.gantt tr.repair .lane { background: repeating-linear-gradient(135deg, #fff 0 8px, #fbeeed 8px 16px); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--mut); flex-wrap: wrap; }
.legend span::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; background: var(--k); }

/* concerts */
.ev { display: grid; grid-template-columns: 74px 1fr auto; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line2); text-decoration: none; align-items: center; }
.ev:hover { background: #fafbfc; }
.ev .date { text-align: center; border: 1px solid var(--line); border-radius: 9px; padding: 6px 0; line-height: 1.15; }
.ev .date b { display: block; font-size: 22px; font-weight: 650; }
.ev .date small { font-size: 11.5px; color: var(--mut); }
.meter { height: 7px; border-radius: 99px; background: var(--line2); overflow: hidden; min-width: 160px; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.meter.full i { background: var(--lime); box-shadow: inset 0 0 0 1px #a9cf2c; }
.tiers .t { display: grid; grid-template-columns: 1fr 70px 180px 60px; gap: 14px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line2); font-size: 14px; }

/* door */
.door { max-width: 560px; margin: 0 auto; }
.door .scan { aspect-ratio: 4/3; background: #0d0e10; border-radius: 14px; overflow: hidden; position: relative; display: grid; place-items: center; color: #8b8f98; }
.door video { width: 100%; height: 100%; object-fit: cover; }
.door .frame { position: absolute; inset: 18%; border: 2px solid var(--lime); border-radius: 14px; }
.result { border-radius: 14px; padding: 22px; margin-top: 14px; text-align: center; }
.result b { font-size: 24px; display: block; }
.result.in { background: var(--okbg); color: var(--ok); } .result.no { background: var(--badbg); color: var(--bad); }
.bigcount { font-family: var(--mono); font-size: 15px; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login .l { padding: 48px 8vw; display: flex; flex-direction: column; justify-content: center; }
.login .r { background: var(--side); color: #fff; padding: 48px 6vw; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.login h1 { font-size: 30px; margin: 18px 0 8px; }
.role { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--side2); border: 1px solid #2f3239; color: #fff; border-radius: 10px; padding: 13px 16px; cursor: pointer; }
.role:hover { border-color: var(--lime); }
.role small { display: block; color: var(--sidetx); font-size: 13px; }
.role .av { background: var(--lime); }
.seg { display: inline-flex; background: var(--side2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; color: var(--sidetx); padding: 7px 14px; border-radius: 7px; cursor: pointer; font-weight: 550; }
.seg button.on { background: var(--lime); color: var(--ink); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(15, 16, 19, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal .box { background: #fff; border-radius: 14px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
.modal .box .hd { padding: 16px 20px; border-bottom: 1px solid var(--line2); display: flex; justify-content: space-between; align-items: center; }
.modal .box .hd b { font-size: 16px; }
.modal .box .bd { padding: 18px 20px; }
.modal .box .ft { padding: 14px 20px; border-top: 1px solid var(--line2); display: flex; justify-content: flex-end; gap: 8px; }
.x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--mut); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; z-index: 60; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.toast.bad { background: var(--bad); }
.testcards { font-size: 12.5px; color: var(--mut); background: var(--bg); border-radius: 8px; padding: 10px 12px; margin-top: 4px; }
.testcards code { font-family: var(--mono); color: var(--ink); }

@media (max-width: 1080px) { .g-main, .g4 { grid-template-columns: 1fr 1fr; } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; height: 100vh; }
  body.navopen .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .4); }
  .mtop { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 30; }
  .mtop button { background: none; border: 1px solid #3a3d45; color: #fff; border-radius: 8px; padding: 6px 10px; }
  .mtop img { width: 24px; height: 24px; border-radius: 6px; }
  .main { padding: 18px 16px 50px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; }
  .login { grid-template-columns: 1fr; }
  .tiers .t { grid-template-columns: 1fr 60px; } .tiers .t .meter, .tiers .t .mut { display: none; }
  .ev { grid-template-columns: 60px 1fr; } .ev > :last-child { grid-column: 2; }
  .kv { grid-template-columns: 110px 1fr; }
  .search { min-width: 0; width: 100%; }
  .tbl.resp thead { display: none; } .tbl.resp tr { display: block; border-bottom: 1px solid var(--line2); padding: 8px 0; } .tbl.resp td { display: block; border: 0; padding: 3px 14px; } .tbl.resp td.num { text-align: left; }
}
@media (max-width: 480px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .row2 { grid-template-columns: 1fr; } .top h1 { font-size: 22px; } }
