/* WOCOM portal - enterprise dashboard theme (spec 3). No inline styles (CSP). */
:root {
  --navy: #082746; --navy-deep: #06213F; --navy-hover: #0E3460; --navy-line: #18406B;
  --blue: #245A9B; --blue-dark: #1D4C85; --blue-tint: #EEF4FB; --orange: #F07818;
  --bg: #F1F5F9; --card: #FFFFFF; --text: #1C2A3F;
  --muted: #5B6B80; /* spec #64748B darkened: 4.34:1 on #F1F5F9 fails WCAG AA */
  --side-text: #C9D6E6; --side-muted: #A9BCD3;
  --ok: #15803D; --err: #DC2626; --warn: #B45309; --line: #DCE3EC; --line-strong: #C3CEDB; --row-alt: #F8FAFC;
  --focus: #F07818; --side-w: 240px; --top-h: 56px; --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 33, 60, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font: 13.5px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
h1 { font-size: 20px; line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -.005em; }
h2 { font-size: 14.5px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 11.5px; margin: 18px 0 8px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus, main:focus-visible { outline: none; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 4px; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: var(--top-h) 1fr; min-height: 100vh; }
.sidebar { grid-row: 1 / 3; background: var(--navy); color: var(--side-text); }
.sidebar-inner { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { height: var(--top-h); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 18px; background: var(--navy-deep); font-weight: 700; letter-spacing: .14em; color: #fff; font-size: 16px; line-height: 1.15; }
.brand-mark { width: 26px; height: 26px; stroke: var(--orange); flex: none; }
.brand small { font-weight: 400; letter-spacing: .01em; color: var(--side-muted); font-size: 11px; display: block; }
.navsearch { padding: 14px 12px 6px; }
.navsearch input { width: 100%; padding: 7px 10px; border-radius: 4px; border: 1px solid #2D5482; background: var(--navy-deep); color: #fff; }
.navsearch input::placeholder { color: var(--side-muted); }
.navsearch.meta { color: var(--side-muted); }
.navgroup-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; color: var(--side-muted); padding: 14px 18px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; cursor: pointer; }
.navgroup-toggle:hover { color: #fff; }
.navgroup-toggle .chev { width: 14px; height: 14px; stroke: currentColor; flex: none; transition: transform .15s; }
.navgroup-toggle[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.navlist { list-style: none; margin: 0; padding: 0 10px 2px; }
.navlist a { display: flex; align-items: center; gap: 11px; color: var(--side-text); text-decoration: none; padding: 7px 10px; border-radius: 4px; margin: 1px 0; position: relative; }
.navlist a:hover { background: var(--navy-hover); color: #fff; }
.navlist a[aria-current="page"] { background: var(--blue); color: #fff; font-weight: 600; }
.navlist a[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 2px 2px 0; background: var(--orange); }
.navlist a .ico { width: 17px; height: 17px; flex: none; stroke: var(--orange); }
.navlist a[aria-current="page"] .ico { stroke: #fff; }
.nav-foot { margin-top: auto; padding: 12px 18px; font-size: 11.5px; color: var(--side-muted); border-top: 1px solid var(--navy-line); display: flex; justify-content: space-between; gap: 8px; }
.nav-backdrop { display: none; }

.topbar { background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 20px; position: sticky; top: 0; z-index: 5; min-width: 0; }
.topbar .spacer { flex: 1; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 4px; padding: 6px 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; position: relative; white-space: nowrap; }
.icon-btn:hover { background: var(--bg); border-color: var(--line); }
.icon-btn svg { width: 19px; height: 19px; stroke: var(--text); flex: none; }
.icon-btn.menu-btn { display: none; }
.badge-count { background: var(--orange); color: #1C2A3F; font-weight: 700; font-size: 10.5px; line-height: 16px; border-radius: 8px; padding: 0 5px; min-width: 16px; text-align: center; position: absolute; top: 1px; right: 0; }
.callpill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 15px; padding: 4px 12px; font-size: 12.5px; color: var(--muted); text-decoration: none; background: var(--row-alt); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.callpill:hover { border-color: var(--line-strong); color: var(--text); }
.callpill.live { border-color: var(--orange); color: var(--text); font-weight: 600; background: #FFF6EC; }
.callpill .dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); flex: none; }
.callpill.live .dot { background: var(--orange); border-color: var(--orange); }
.topsep { width: 1px; height: 28px; background: var(--line); }
.userbox { display: flex; align-items: center; gap: 9px; line-height: 1.2; }
.userbox .who { text-align: right; }
.userbox small { color: var(--muted); display: block; font-size: 11.5px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-tint); color: var(--blue-dark); border: 1px solid #BBD0EA; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }

main { padding: 20px 24px 48px; min-width: 0; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead p { margin: 3px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.toolbar .checkbox { min-height: 34px; }

/* ---------- Cards / layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.metrics { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.two { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }
.three { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.metric { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; }
.metric .label { color: var(--muted); font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.metric .label svg { width: 15px; height: 15px; stroke: var(--blue); flex: none; }
.metric .value { font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.metric .sub { font-size: 11.5px; color: var(--muted); }
.section-gap { margin-top: 16px; }
.banner { border: 1px solid #F3C38F; background: #FFF6EC; padding: 9px 13px; border-radius: var(--radius); margin-bottom: 14px; }
.banner.info { border-color: #BBD0EA; background: var(--blue-tint); }
.banner.err { border-color: #F2B8B8; background: #FDF0F0; }
.banner.ok { border-color: #9DCFAE; background: #EFF8F2; }
.card .banner:last-child { margin-bottom: 0; }
.meta { color: var(--muted); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--muted); }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=date], input[type=datetime-local], input[type=time], select, textarea {
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 6px 9px; background: #fff; min-width: 0; min-height: 34px; }
input:hover, select:hover, textarea:hover { border-color: #9FB0C5; }
input:disabled, select:disabled { background: var(--row-alt); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); flex: none; }
textarea { min-height: 64px; resize: vertical; width: 100%; line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; }
.form-grid .span-all { grid-column: 1 / -1; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 16px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 12px; margin: 16px 0 0; min-width: 0; }
legend { font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 4px; }
.btn { border: 1px solid var(--line-strong); background: #fff; border-radius: 4px; padding: 6px 13px; min-height: 34px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--bg); border-color: #9FB0C5; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; flex: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.call { background: var(--orange); border-color: #D9690F; color: #1C2A3F; }
.btn.call:hover { background: #E06D12; }
.btn.danger { border-color: #E9A3A3; color: #B91C1C; }
.btn.danger:hover { background: #FDF0F0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 3px 9px; min-height: 28px; font-size: 12.5px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btnrow.end { align-items: flex-end; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-actions .spacer { flex: 1; }
.dirty-flag { font-size: 12px; color: var(--warn); font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline-offset: -3px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--row-alt); white-space: nowrap; border-bottom-color: var(--line-strong); }
tbody th { font-weight: 600; }
tbody tr:hover { background: var(--row-alt); }
tbody tr:last-child > * { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--blue-tint); }
tr.clickable > :first-child { color: var(--blue); font-weight: 600; }
tr.clickable:focus-visible { outline-offset: -3px; }
.empty { color: var(--muted); padding: 28px 8px; text-align: center; margin: 0; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 12px 2px 0; flex-wrap: wrap; }

/* ---------- Status chips: text + shape, never colour alone ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 18px; padding: 0 8px 0 6px; border-radius: 10px; border: 1px solid var(--line-strong); white-space: nowrap; background: #fff; color: var(--text); font-weight: 500; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.chip.ok { border-color: #9DCFAE; color: #0F5F2D; background: #F3FAF5; } .chip.ok::before { background: var(--ok); }
.chip.err { border-color: #F0AAAA; color: #A11D1D; background: #FEF5F5; } .chip.err::before { background: var(--err); border-radius: 1px; transform: rotate(45deg); }
.chip.warn { border-color: #F3C38F; color: #8A4B0B; background: #FFF8F0; } .chip.warn::before { background: var(--orange); border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 8px; height: 8px; }
.chip.info { border-color: #BBD0EA; color: #1D4C85; background: #F5F9FD; } .chip.info::before { background: var(--blue); }
.chip.none::before { background: transparent; border: 1.5px solid var(--muted); width: 5px; height: 5px; }
.demo { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; color: #7A3E06; background: #FDE7D1; border: 1px solid #F3C38F; border-radius: 3px; padding: 0 4px; margin-left: 6px; vertical-align: 1px; line-height: 14px; }
.prio-high { color: #A11D1D; font-weight: 600; }
.tag { display: inline-block; font-size: 11.5px; background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; margin: 1px 4px 1px 0; white-space: nowrap; }

/* ---------- Charts ---------- */
.chart-box { margin-top: 8px; min-height: 120px; }
.chart-svg { display: block; width: 100%; overflow: visible; }
.chart-svg text { font-size: 11.5px; fill: var(--muted); font-family: var(--font); }
.chart-svg text.val { fill: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-svg text.cat { fill: var(--text); }
.chart-svg .axis { stroke: var(--line-strong); }
.chart-svg .grid { stroke: var(--line); }
.chart-svg .s0 { fill: var(--blue); } .chart-svg .s1 { fill: var(--err); } .chart-svg .s2 { fill: var(--orange); } .chart-svg .s3 { fill: #7FA3CF; }
.chart-svg rect.track { fill: var(--row-alt); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; display: inline-block; }
.sw.s0 { background: var(--blue); } .sw.s1 { background: var(--err); } .sw.s2 { background: var(--orange); } .sw.s3 { background: #7FA3CF; }
.sw.p1 { border-radius: 50%; } .sw.p2 { clip-path: polygon(50% 0, 100% 100%, 0 100%); }

/* ---------- Agent desktop ---------- */
.desk { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
.kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 7px 14px; margin: 0; align-items: baseline; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.big { font-size: 19px; font-weight: 600; }
.timer { font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 600; color: var(--blue); }
.note { border-left: 3px solid var(--orange); background: #FFF8F0; padding: 7px 11px; margin: 10px 0; font-size: 12.5px; border-radius: 0 4px 4px 0; }
.hist-item { border-top: 1px solid var(--line); padding: 10px 0; }
.hist-item:first-child { border-top: 0; padding-top: 0; }
.idle { text-align: center; padding: 48px 16px; color: var(--muted); }
.idle svg { width: 44px; height: 44px; stroke: #9FB0C5; display: block; margin: 0 auto 10px; }
.idle .big { color: var(--text); margin-bottom: 4px; }
.idle p { max-width: 460px; margin-left: auto; margin-right: auto; }

/* ---------- Tabs / settings ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); margin-bottom: 16px; overflow-x: auto; scrollbar-width: thin; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 9px 14px 8px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); background: rgba(36, 90, 155, .05); }
.tab[aria-selected="true"] { color: var(--blue-dark); border-bottom-color: var(--blue); }
.tab:focus-visible { outline-offset: -3px; }
.tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.settings-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); align-items: start; }
.side-note h2 { font-size: 13px; margin-bottom: 8px; }
.side-note p, .side-note li { color: var(--muted); font-size: 12.5px; }
.side-note ul { padding-left: 18px; margin: 0 0 8px; }
.queue-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.queue-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--row-alt); display: grid; gap: 10px; align-content: start; }
.queue-card h3 { margin: 0; color: var(--text); font-size: 13px; text-transform: none; letter-spacing: 0; }
.hours-row { display: grid; grid-template-columns: 150px minmax(0, 130px) minmax(0, 130px) 1fr; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.hours-row:last-child { border-bottom: 0; }
.hours-row .closed { color: var(--muted); font-size: 12px; }
.chips-edit { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-x { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 1px 3px 1px 10px; font-size: 12.5px; background: #fff; }
.chip-x button { border: 0; background: none; cursor: pointer; border-radius: 50%; width: 22px; height: 22px; line-height: 1; color: var(--muted); font-size: 15px; }
.chip-x button:hover { background: var(--bg); color: var(--err); }
.rule-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }
.diff { margin: 0; padding: 0; list-style: none; font-size: 12px; }
.diff li { padding: 1px 0; overflow-wrap: anywhere; }
.diff .k { color: var(--muted); }
.diff del { color: #A11D1D; }
.diff ins { color: #0F5F2D; text-decoration: none; font-weight: 600; }
.counter { font-size: 11.5px; color: var(--muted); text-align: right; }

/* ---------- Dialog ---------- */
dialog { border: 1px solid var(--line); border-radius: 8px; padding: 0; width: min(900px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 16px 48px rgba(6, 33, 63, .28); color: var(--text); }
dialog.narrow { width: min(580px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(6, 33, 63, .5); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.dlg-head h2 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dlg-body { padding: 16px 18px 20px; }
.dlg-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); align-items: start; }
.action-panel { background: var(--row-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.action-panel h3:first-child { margin-top: 0; }
.action-panel .btn { width: 100%; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-grid .wide { grid-column: 1 / -1; }
.stack { display: grid; gap: 10px; }
.x-btn { border: 1px solid transparent; background: none; border-radius: 4px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: var(--muted); flex: none; }
.x-btn:hover { background: var(--bg); border-color: var(--line); color: var(--text); }
.x-btn svg { width: 18px; height: 18px; stroke: currentColor; }

/* ---------- Login ---------- */
/* Sign-in: split layout modelled on the WOCOM Workspace sample (logo once, left). */
.login-wrap { --wp-purple: #7A2C9E; --wp-purple-dark: #5E1D80; --wp-ink: #1C1F4A; --wp-soft: #F3F0FA; --wp-lilac: #E4D6F3;
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 32px;
  padding: 40px max(24px, 6vw); color: var(--wp-ink);
  background: linear-gradient(135deg, #FBFAFE 0%, var(--wp-soft) 55%, #EEE6F8 100%); }
/* Decorative curves, like the sample's top-left and bottom-right sweeps. */
.login-wave { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.login-wave-tl { width: 70vw; height: 46vh; min-width: 520px; min-height: 260px; top: -28vh; left: -18vw;
  background: radial-gradient(closest-side, rgba(228, 214, 243, .9), rgba(228, 214, 243, 0)); }
.login-wave-br { width: 80vw; height: 70vh; min-width: 640px; min-height: 360px; right: -22vw; bottom: -40vh;
  background: radial-gradient(closest-side, #C9A6E6 0%, #D7BFEE 38%, rgba(215, 191, 238, 0) 72%); }
.login-side { position: relative; display: grid; gap: 22px; justify-items: start; max-width: 520px; width: 100%; }
.login-logo { width: min(440px, 100%); height: auto; }
.login-tagline { font-size: clamp(22px, 2.3vw, 30px); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
.login-features { display: flex; flex-wrap: wrap; gap: 20px 34px; margin-top: 4px; }
.login-feature { display: grid; justify-items: center; gap: 8px; font-size: 14px; font-weight: 600; line-height: 1.25; text-align: center; }
.login-feature-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(122, 44, 158, .10); color: var(--wp-purple); }
.login-feature-ico .ico { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.7; }
/* Faint office silhouette (laptop, mug, plant) bottom-left, like the sample. */
.login-desk { position: absolute; z-index: -1; left: 0; bottom: 0; width: min(46vw, 560px); pointer-events: none; }
.login-desk-svg { width: 100%; height: auto; display: block; fill: rgba(122, 44, 158, .13); }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 16px; font-size: 13px; }
.login-remember { display: inline-flex; align-items: center; gap: 8px; color: #3F4160; cursor: pointer; }
.login-remember input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.login-check { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid #B9B7CC; background: #fff; display: grid; place-items: center; }
.login-remember input:checked + .login-check { background: var(--wp-purple); border-color: var(--wp-purple); }
.login-remember input:checked + .login-check::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.login-remember input:focus-visible + .login-check { outline: 3px solid rgba(122, 44, 158, .35); outline-offset: 1px; }
.login-link { border: 0; background: none; padding: 0; color: var(--wp-purple); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.login-link:focus-visible { outline: 3px solid rgba(122, 44, 158, .35); outline-offset: 2px; border-radius: 3px; }
.login-panel { display: flex; justify-content: center; }
.login { width: min(430px, 100%); background: #fff; border-radius: 14px; padding: 40px 38px 28px;
  box-shadow: 0 24px 60px rgba(76, 29, 120, .16), 0 2px 6px rgba(28, 31, 74, .06); }
.login h1 { font-size: 26px; font-weight: 700; text-align: center; margin: 0 0 6px; color: var(--wp-ink); }
.login .lead { text-align: center; color: #5F6178; margin: 0 0 26px; }
.login .field { margin-bottom: 14px; }
.login-input { position: relative; display: flex; align-items: center; }
.login-input input { width: 100%; min-height: 46px; padding: 0 44px 0 42px; border: 1px solid #D7D6E4;
  border-radius: 8px; font-size: 14.5px; color: var(--wp-ink); background: #fff; }
.login-input input::placeholder { color: #6B6D82; }
.login-input input:focus { border-color: var(--wp-purple); outline: 3px solid rgba(122, 44, 158, .22); outline-offset: 0; }
.login .ico { stroke: currentColor; fill: none; }
.login-ico { position: absolute; left: 14px; width: 18px; height: 18px; color: #5F6178; pointer-events: none; }
.login-reveal { position: absolute; right: 6px; width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; background: none; border-radius: 6px; color: #5F6178; cursor: pointer; }
.login-reveal:hover { color: var(--wp-purple); background: var(--wp-soft); }
.login-reveal .ico { width: 19px; height: 19px; }
.login-hint { margin: -6px 0 14px; font-size: 12.5px; color: #5F6178; background: var(--wp-soft); border-radius: 6px; padding: 8px 10px; }
.login .err { color: #B91C1C; margin: 0 0 12px; font-weight: 500; }
.login .err:empty { display: none; }
.login .btn.primary { width: 100%; min-height: 46px; font-size: 15.5px; font-weight: 600; border: 0; border-radius: 8px;
  background: linear-gradient(90deg, var(--wp-purple), var(--wp-purple-dark)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.login .btn.primary:hover { background: var(--wp-purple-dark); }
.login .btn.primary:focus-visible { outline: 3px solid rgba(122, 44, 158, .35); outline-offset: 2px; }
.login .btn.primary .ico { width: 18px; height: 18px; }
.login .btnrow .btn { flex: 1; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 24px 0 0; font-size: 12.5px; color: #5F6178; }
.login-foot::before, .login-foot::after { content: ""; flex: 1; height: 1px; background: #E2E1EC; margin: 0 10px; }
.login-foot strong { color: var(--wp-purple); font-weight: 600; }
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; align-content: center; gap: 22px; padding: 28px 16px; }
  .login-side { justify-items: center; text-align: center; max-width: none; }
  .login-logo { width: min(300px, 80%); }
  .login-tagline { text-align: center; }
  .login-features { justify-content: center; gap: 16px 22px; }
  .login-feature-ico { width: 54px; height: 54px; }
  .login-desk { display: none; }
  .login { padding: 30px 22px 22px; }
}
.qr { width: 172px; height: 172px; display: block; margin: 10px auto; border: 1px solid var(--line); border-radius: 4px; }
.secret { font-family: var(--mono); word-break: break-all; background: var(--bg); padding: 7px 9px; border-radius: 4px; font-size: 12.5px; letter-spacing: .04em; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 32px); }
.toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.22); max-width: 380px; border-left: 4px solid #4ADE80; }
.toast.err { background: #8E1B1B; border-left-color: #FCA5A5; }
pre.json { background: var(--bg); padding: 10px; border-radius: 4px; overflow-x: auto; font-size: 12px; max-height: 260px; margin: 0; }
.loading { color: var(--muted); padding: 28px 4px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.help-list { margin: 0; padding-left: 18px; }
.help-list li { margin-bottom: 5px; }
kbd { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; background: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .settings-grid, .dlg-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .desk { grid-template-columns: minmax(0, 1fr); }
  .topbar .userbox .who { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; width: min(280px, 85vw); transform: translateX(-100%); transition: transform .2s, visibility .2s; visibility: hidden; }
  .sidebar-inner { height: 100%; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 4px 0 24px rgba(0,0,0,.35); visibility: visible; }
  .shell.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(6, 33, 63, .5); z-index: 25; }
  .icon-btn.menu-btn { display: inline-flex; }
  .topbar { gap: 4px; padding: 0 8px; }
  .topsep, .hide-sm { display: none; }
  .avatar { width: 30px; height: 30px; }
  main { padding: 16px 16px 32px; }
  .pagehead > div:first-child { width: 100%; }
  h1 { font-size: 19px; }
  .metric .value { font-size: 21px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 14px; }
  .kv { grid-template-columns: minmax(96px, 38%) 1fr; }
  .toolbar > .field { flex: 1 1 140px; }
  .toolbar > .field input, .toolbar > .field select { width: 100%; }
  .hours-row { grid-template-columns: 1fr 1fr; }
  .hours-row > :first-child, .hours-row > .closed { grid-column: 1 / -1; }
  .rule-row { grid-template-columns: 1fr 1fr; }
  /* Data tables become labelled stacks: no sideways scrolling on phones. */
  .table-wrap.stackable table, .table-wrap.stackable tbody, .table-wrap.stackable tr { display: block; width: 100%; }
  .table-wrap.stackable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap.stackable tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table-wrap.stackable tbody tr:last-child { border-bottom: 0; }
  .table-wrap.stackable td, .table-wrap.stackable tbody th { border: 0; padding: 3px 2px; display: grid; grid-template-columns: minmax(92px, 36%) minmax(0, 1fr); gap: 10px; text-align: left; overflow-wrap: anywhere; justify-items: start; }
  .table-wrap.stackable td::before, .table-wrap.stackable tbody th::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 500; }
  .table-wrap.stackable td[data-label=""], .table-wrap.stackable tbody th[data-label=""] { grid-template-columns: minmax(0, 1fr); }
  .table-wrap.stackable td[data-label=""]::before, .table-wrap.stackable tbody th[data-label=""]::before { display: none; }
  .table-wrap.stackable tr.clickable > :first-child { font-size: 14px; }
  dialog { max-height: calc(100vh - 16px); width: calc(100vw - 16px); }
  .dlg-body { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.login .err.info-msg { color: var(--blue-dark); }
.filters { margin-bottom: 16px; padding: 0; }
.filters > summary { padding: 11px 18px; cursor: pointer; font-weight: 600; color: var(--blue-dark); list-style-position: inside; }
.filters > summary:hover { background: var(--row-alt); }
.filters[open] > summary { border-bottom: 1px solid var(--line); }
.filters > .form-grid { padding: 14px 18px 16px; margin: 0; }
.sidebar .navsearch input { background: var(--navy-deep); color: #fff; border-color: #2D5482; }
.sidebar .navsearch input:hover { border-color: #4A72A0; }
.tab { position: relative; }
.perm span { display: flex; flex-direction: column; line-height: 1.3; }
.perm small { font-size: 11.5px; }
.check-grid .checkbox { align-items: flex-start; }
.check-grid .checkbox input { margin-top: 2px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.jump-actions { display: none; }
@media (max-width: 1100px) { .jump-actions { display: inline-flex; margin-bottom: 12px; } }
.kv.section-gap { margin-top: 14px; }
.call-controls > .field { flex: 1 1 220px; }
td.nowrap { white-space: nowrap; }
td .tag { white-space: normal; overflow-wrap: anywhere; }

/* ---------- Trunks and routes ---------- */
.cell-stack { display: inline-grid; gap: 1px; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.row-actions { flex-wrap: nowrap; }
.check-field { justify-content: flex-end; }
.check-field .hint { margin-left: 24px; }
.trunk-chain { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; }
.trunk-chain .tag { margin: 0; }
.chain-arrow { color: var(--muted); font-size: 12px; }
.order-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--row-alt); }
.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.order-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; background: #fff; }
.order-n { width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }
.order-name { flex: 1 1 120px; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.order-box .btnrow.end > .field { flex: 1 1 160px; }
.banner a { color: var(--blue-dark); font-weight: 600; }

/* Device set-up block in the extension dialog */
.device-setup .withcopy { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.device-setup .btn.small { padding: 2px 8px; min-height: 26px; font-size: 12px; }
.device-setup dd.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
