:root {
  --brand: #f47b20; --ink: #1f2430; --muted: #667085; --line: #e2e5ea; --bg: #f4f5f7; --card: #fff;
  --ok: #2e9e4f; --err: #c62828; --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--ink); background: var(--bg); }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 20px; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; border: 1px solid #c9ced6; border-radius: 8px; padding: 9px 11px; background: #fff; }
input[type=color] { padding: 2px; height: 40px; width: 64px; }
input[type=checkbox] { width: auto; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; min-width: 0; }
.row > .fit { flex: 0 0 auto; }
.stack > * + * { margin-top: 14px; }

.btn { border: 1px solid #c9ced6; background: #fff; border-radius: 8px; padding: 9px 16px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #98a0ad; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(.94); }
.btn.danger { color: var(--err); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brand); text-decoration: underline; cursor: pointer; }
.check { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 400; color: var(--muted); cursor: pointer; margin-bottom: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.msg { border-radius: 8px; padding: 9px 12px; font-size: 14px; background: #fdecec; color: #8f1d1d; }
.msg.ok { background: #e8f6ec; color: #1e6b36; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; }
.logo-mark { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.logo-mark i { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; font-style: normal; font-size: 18px; }

/* app */
.top { background: #1f2430; color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 20px; min-height: 56px; flex-wrap: wrap; }
.top .logo-mark { margin: 0; font-size: 18px; }
.top nav { display: flex; gap: 2px; flex: 1 1 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top nav button { white-space: nowrap; background: none; border: 0; color: #c5cad3; padding: 17px 12px; cursor: pointer; border-bottom: 3px solid transparent; font-weight: 600; }
.top nav button:hover { color: #fff; }
.top nav button[aria-current=page] { color: #fff; border-bottom-color: var(--brand); }
.top .who { font-size: 13px; color: #c5cad3; display: flex; align-items: center; gap: 10px; }
.top .who .btn { background: transparent; color: #fff; border-color: #4a5160; }
.page { max-width: 1040px; margin: 0 auto; padding: 26px 20px 60px; }
.page > .card + .card { margin-top: 18px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.connect { max-width: 560px; margin: 4vh auto 0; text-align: center; }
.connect h2 { font-size: 24px; margin-bottom: 6px; }
.connect .id { font-size: 30px; text-align: center; letter-spacing: 2px; font-variant-numeric: tabular-nums; padding: 14px; }
.connect .pw { text-align: center; font-size: 18px; letter-spacing: 2px; }
.connect .btn { width: 100%; padding: 13px; font-size: 16px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.cli { min-width: 200px; overflow-wrap: anywhere; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 2px 9px; border-radius: 99px; background: #eef0f3; color: #475467; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #98a2b3; }
.pill.on { background: #e8f6ec; color: #1e6b36; } .pill.on::before { background: var(--ok); }
.pill.busy { background: #fff1e3; color: #9a4b06; } .pill.busy::before { background: var(--brand); }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }

dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(20,24,32,.55); }
dialog form { padding: 22px; }
dialog h3 { margin-bottom: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; }
@media (max-width: 800px) { .brand-grid { grid-template-columns: 1fr; } }
.preview { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; font-size: 13px; }
.preview .pv-logo { height: 100px; display: grid; place-items: center; padding: 12px; font-size: 22px; font-weight: 700; text-align: center; }
.preview .pv-logo img { max-width: 100%; max-height: 76px; }
.preview .pv-head { background: #eceef1; border-block: 1px solid #d9dce1; padding: 8px 12px; font-size: 16px; }
.preview .pv-hint { color: var(--pv, var(--brand)); padding: 12px 14px 4px; min-height: 50px; }
.preview .pv-field { display: flex; justify-content: space-between; align-items: center; margin: 6px 14px 0 0; border-bottom: 1px solid var(--pv, var(--brand)); padding-bottom: 3px; }
.preview .pv-field span { background: #b9bdc4; color: #fff; padding: 2px 16px 2px 10px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); }
.preview .pv-field b { color: var(--pv, var(--brand)); font-size: 21px; font-weight: 400; }
.preview .pv-foot { background: #eceef1; border-top: 1px solid #d9dce1; padding: 7px 12px; margin-top: 18px; display: flex; gap: 8px; align-items: center; }
.preview .pv-foot::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: #5cb531; }
.copy { display: flex; gap: 8px; }
.copy input { font-family: Consolas, monospace; font-size: 13px; }
