:root {
  --brand: #d9604a; --navy: #16203d; --text: #1c2233; --muted: #6c7282; --line: #e4e5ea; --bg: #f5f5f7; --panel: #ffffff;
  --sel: #2f7cf6; font-family: Lato, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ic { display: block; flex: none; }

.bar { height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 14px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; white-space: nowrap; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; }
.venue-name { flex: 1; max-width: 360px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 8px; height: 36px; padding: 0 12px; font-size: 15px; }
.bar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.bar .btn { background: rgba(255,255,255,.12); color: #fff; }
.bar .btn.primary { background: var(--brand); }
.bar .icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: #fff; }
.bar .icon:hover { background: rgba(255,255,255,.12); }
.bar .icon:disabled { opacity: .35; }
.btn { height: 36px; padding: 0 14px; border-radius: 8px; display: inline-flex; align-items: center; gap: 7px; font-weight: 700; background: #eef0f4; white-space: nowrap; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.danger { background: #fbe9e7; color: #b3392a; }
.btn:disabled { opacity: .5; cursor: default; }

.work { position: absolute; top: 56px; left: 0; right: 0; bottom: 0; display: flex; }
.tools { width: 58px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 8px 0; gap: 4px; overflow-y: auto; }
.tool { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: #3c4254; position: relative; }
.tool:hover { background: #f0f1f4; }
.tool.on { background: var(--navy); color: #fff; }
.tool .k { position: absolute; right: 3px; bottom: 1px; font-size: 9px; font-weight: 900; opacity: .55; }
.tools hr { width: 30px; border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.floorbar { display: flex; gap: 6px; align-items: center; padding: 8px 10px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.floor-tab { height: 32px; padding: 0 12px; border-radius: 16px; background: #eef0f4; font-weight: 700; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.floor-tab.on { background: var(--brand); color: #fff; }
.floor-tab .lv { font-size: 11px; opacity: .7; }
.optbar { display: flex; gap: 10px; align-items: center; padding: 6px 10px; min-height: 44px; background: #fbfbfc; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.optbar label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
.optbar select, .optbar input { height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; background: #fff; }
.optbar .hint { color: var(--muted); font-size: 13px; }
.canvas-wrap { flex: 1; position: relative; overflow: hidden; background: #e9e9e6; }
.canvas-wrap.drop { outline: 3px dashed var(--brand); outline-offset: -8px; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.status { height: 28px; display: flex; gap: 18px; align-items: center; padding: 0 12px; font-size: 12px; color: var(--muted); background: var(--panel); border-top: 1px solid var(--line); }
.empty-state { position: absolute; inset: 0; margin: auto; width: min(520px, 90%); height: fit-content; background: #fff; border-radius: 16px; padding: 24px 28px; box-shadow: 0 10px 40px rgba(0,0,0,.12); }
.empty-state h2 { margin: 0 0 6px; }
.empty-state ul { padding-left: 18px; line-height: 1.7; margin: 8px 0 18px; }

.panel { width: 350px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { flex: 1; padding: 11px 4px; font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-color: var(--brand); }
.panel-body { flex: 1; overflow-y: auto; padding: 14px; }
.panel h3 { margin: 4px 0 10px; font-size: 15px; }
.panel h4 { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: #fff; width: 100%; }
.field textarea { min-height: 60px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.list-item { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-radius: 8px; }
.list-item:hover { background: #f5f6f8; }
.list-item .sw { width: 16px; height: 16px; border-radius: 4px; flex: none; border: 1px solid rgba(0,0,0,.1); }
.list-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item button { color: var(--muted); padding: 4px; border-radius: 6px; }
.list-item button:hover { background: #eceef2; color: var(--text); }
.issue { padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; font-size: 13px; line-height: 1.4; }
.issue.err { background: #fbe9e7; color: #8f2a1d; }
.issue.warn { background: #fff4dc; color: #7a5300; }
.issue.ok { background: #e6f4ec; color: #1f6b43; }
.issue.click { cursor: pointer; }
.kbd { display: inline-block; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; background: #fafafa; }

.modal { position: fixed; inset: 0; background: rgba(12, 16, 30, .5); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal-card { background: #fff; border-radius: 14px; width: min(720px, 100%); max-height: 90vh; overflow: auto; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-card h2 { margin: 0 0 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.drop-zone { border: 2px dashed #cfd2da; border-radius: 12px; padding: 26px; text-align: center; margin: 14px 0; color: var(--muted); }
.drop-zone.over { border-color: var(--brand); background: #fff6f3; }
.fmt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.fmt { border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 13px; }
.fmt b { display: block; margin-bottom: 3px; }
table.map { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
table.map td, table.map th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.map select { width: 100%; padding: 4px; border: 1px solid var(--line); border-radius: 6px; }
.report { background: #f5f7fa; border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin-top: 10px; }
.toast { position: fixed; bottom: 40px; left: 50%; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; max-width: 80%; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
