/* Coazoo console. 15 px scale, light and dark, no external fonts or frameworks. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --line: #e1e5ea;
  --text: #17202a;
  --text-2: #4b5563;
  --muted: #8a94a3;
  --accent: #0f6e6a;
  --accent-soft: #e2f2f1;
  --ok: #1f7a3d;
  --ok-soft: #e3f4e8;
  --warn: #9a5b00;
  --warn-soft: #fdf0d9;
  --bad: #b42318;
  --bad-soft: #fde7e5;
  --info: #2a56c6;
  --info-soft: #e6ecfb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  font-size: 15px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1418;
    --surface: #161d23;
    --surface-2: #1c252c;
    --line: #26313a;
    --text: #e6ebef;
    --text-2: #b3bec8;
    --muted: #7d8a96;
    --accent: #4fc1b9;
    --accent-soft: #143331;
    --ok: #5cc97f;
    --ok-soft: #15301f;
    --warn: #f0b35a;
    --warn-soft: #36290f;
    --bad: #f2867c;
    --bad-soft: #3a1b18;
    --info: #8eaaf5;
    --info-soft: #1b2645;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.07rem; }

/* Shell: the menu on the left, the bar on top, the page */
@view-transition { navigation: auto; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.nav {
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px 24px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
}
.brand { display: flex; align-items: center; margin: 2px 8px 4px; }
.brand img { display: block; height: 28px; width: auto; }
.brand-login img { height: 36px; }
.brand:hover { text-decoration: none; }
.nav-group { color: var(--muted); font-size: .73rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 0 10px 4px; }
.nav nav { display: flex; flex-direction: column; gap: 1px; }
.nav nav a { display: flex; align-items: center; gap: 10px; color: var(--text-2); padding: 7px 10px; border-radius: 8px; font-weight: 500; }
.nav nav a .icon { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav nav a[aria-current="page"] .icon { opacity: 1; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 28px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.crumbs { min-width: 0; flex: 1 1 auto; }
.crumbs ol { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; white-space: nowrap; overflow: hidden; }
.crumbs li { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; }
.crumbs li + li::before { content: "/"; color: var(--muted); flex: none; }
.crumbs a, .crumbs span { display: block; min-width: 0; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a { color: var(--text-2); font-weight: 500; }
.crumbs li:last-child { flex-shrink: 0; max-width: 45%; }
.crumbs li:last-child span { font-weight: 600; color: var(--text); }
.search-open {
  display: flex; align-items: center; gap: 10px; width: 360px; max-width: 40vw; height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); text-align: left;
}
.search-open span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-open:hover { border-color: var(--accent); color: var(--text-2); }
kbd { font: inherit; font-size: .75rem; color: var(--text-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; background: var(--surface); }
.me { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.me form { margin: 0; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; border-radius: 50%; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 8px; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
}
.menu-pop .who { margin: 4px 8px 8px; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.menu-pop .who span { color: var(--muted); font-size: .87rem; }
.menu-pop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; border-radius: 8px; background: none; color: var(--text); text-align: left; }
.menu-pop button:hover { background: var(--surface-2); }
.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .87rem;
}
main { padding: 24px 32px 48px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; letter-spacing: -0.02em; }
.page-head .lead { margin-top: 4px; }
.sub-head { justify-content: flex-start; align-items: center; gap: 12px; }
.sub-head h2 { font-size: 1.2rem; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--surface); border-radius: 8px; }
.skip:focus { left: 8px; }
button { font: inherit; cursor: pointer; }
button.link { background: none; border: 0; color: var(--accent); padding: 4px 6px; border-radius: 6px; }
button.link:hover { background: var(--surface-2); }

.content { display: flex; flex-direction: column; gap: 20px; }
.lead { margin: 0; color: var(--text-2); }
.updated, .footnote { margin: 0; color: var(--muted); font-size: .87rem; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.attention { color: var(--warn); font-weight: 700; }
.ok-text { color: var(--ok); font-weight: 600; }
.bad-text { color: var(--bad); font-weight: 600; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text);
}
a.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile .label { color: var(--text-2); font-size: .93rem; font-weight: 500; }
.tile .value { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: .93rem; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.tile .hint { color: var(--muted); font-size: .87rem; }

/* Panels and tables */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel > header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel > header a { font-size: .93rem; }
.panel > .notice, .panel > .empty { margin: 16px 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
.num { text-align: right; }
td .sub { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.panel > .footnote { margin: 12px 18px 14px; }
tr.dim td { color: var(--muted); }
.empty { color: var(--muted); padding: 6px 0; }
.notice { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--info-soft); color: var(--text); }
.notice-error { background: var(--bad-soft); }

/* State chips: always text + dot, never color alone */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px;
  font-size: .87rem; font-weight: 600; background: var(--surface-2); color: var(--text-2);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip-talking, .chip-ok, .chip-agent-ready { background: var(--ok-soft); color: var(--ok); }
.chip-ringing, .chip-agent-ringing, .chip-starting { background: var(--info-soft); color: var(--info); }
.chip-queue, .chip-agent-wrapup, .chip-agent-paused { background: var(--warn-soft); color: var(--warn); }
.chip-ivr, .chip-voicemail { background: var(--accent-soft); color: var(--accent); }
.chip-agent-busy { background: var(--info-soft); color: var(--info); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-agent-logged_out { background: transparent; color: var(--muted); }

.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag { padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: .8rem; }

/* Gauges */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; padding: 18px; }
.gauge { display: flex; flex-direction: column; gap: 6px; }
.gauge .label { color: var(--text-2); font-weight: 500; }
.gauge .value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.gauge .hint { color: var(--muted); font-size: .87rem; }
meter { width: 100%; height: 10px; border-radius: 999px; background: var(--surface-2); border: 0; appearance: none; -webkit-appearance: none; }
meter::-webkit-meter-bar { background: var(--surface-2); border: 0; border-radius: 999px; height: 10px; }
meter::-webkit-meter-optimum-value { background: var(--accent); border-radius: 999px; }
meter::-webkit-meter-suboptimum-value { background: var(--warn); border-radius: 999px; }
meter::-webkit-meter-even-less-good-value { background: var(--bad); border-radius: 999px; }
meter::-moz-meter-bar { background: var(--accent); border-radius: 999px; }
meter.high::-moz-meter-bar { background: var(--warn); }
meter.critical::-moz-meter-bar { background: var(--bad); }

/* Login */
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login { width: 100%; padding: 24px; display: grid; place-items: center; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 16px;
}
.login-card .brand { margin: 0; }
.login-card h1 { font-size: 1.33rem; }
.login-card form { display: flex; flex-direction: column; gap: 8px; }
label { font-weight: 500; color: var(--text-2); font-size: .93rem; margin-top: 6px; }
input {
  font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
button.primary {
  margin-top: 14px; padding: 10px 14px; border-radius: 8px; border: 0; background: var(--accent); color: var(--surface); font-weight: 600;
}
button.primary:hover { filter: brightness(1.05); }


/* Companies (empresas) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .93rem; }
.search { display: flex; gap: 10px; align-items: center; }
.search input { flex: 0 1 420px; height: 42px; padding: 0 14px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.search button { height: 42px; padding: 0 18px; font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 8px; cursor: pointer; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.facts span:last-child { overflow-wrap: anywhere; }
.facts .label { color: var(--muted); font-size: .87rem; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; position: sticky; top: 0; z-index: 1; padding: 8px 0; background: var(--bg); }
.jump a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .93rem; }
.jump a:hover { text-decoration: none; border-color: var(--accent); }
.jump .count { color: var(--muted); margin-left: 4px; }
.panel { scroll-margin-top: 76px; }

/* Language switch (ES · EN) */
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-right: 6px; }
.lang a { padding: 4px 10px; font-size: .87rem; font-weight: 600; color: var(--text-2); }
.lang a + a { border-left: 1px solid var(--line); }
.lang a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.lang a:hover { text-decoration: none; color: var(--accent); }
.login-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.login-top .brand { margin: 0; }
td.wrap { white-space: normal; overflow-wrap: anywhere; min-width: 250px; }

/* Infrastructure: server, charts and the tree */
.page-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ranges { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.ranges a { padding: 7px 14px; font-size: .93rem; font-weight: 600; color: var(--text-2); }
.ranges a + a { border-left: 1px solid var(--line); }
.ranges a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.ranges a:hover { text-decoration: none; color: var(--accent); }
.eyebrow { display: block; color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.server-id h2 { font-size: 1.27rem; margin: 2px 0 2px; }
.server > header { align-items: flex-start; }
.chip-neutral { background: var(--surface-2); color: var(--text-2); }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; padding: 18px; }
.charts.two { border-top: 1px solid var(--line); }
.charts figure { margin: 0; min-width: 0; }
.charts figcaption { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; color: var(--text-2); font-weight: 600; }
.charts figcaption strong { color: var(--text); font-size: 1.13rem; }
.charts figcaption .muted { font-weight: 400; font-size: .87rem; }
.chart-plot { position: relative; height: 150px; margin-left: 56px; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .area { fill: var(--accent); opacity: .12; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ytick { position: absolute; left: -56px; width: 48px; text-align: right; transform: translateY(-50%); color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.chart-x { display: flex; justify-content: space-between; margin: 6px 0 0 56px; color: var(--muted); font-size: .8rem; }
.hover-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--text-2); opacity: .5; pointer-events: none; }
.hover-tip { position: absolute; top: -6px; transform: translate(8px, -100%); white-space: nowrap; padding: 4px 9px; border-radius: 6px; background: var(--text); color: var(--surface); font-size: .87rem; pointer-events: none; box-shadow: var(--shadow); }
.hover-tip.left { transform: translate(calc(-100% - 8px), -100%); }
.chart-empty { margin: 0; padding: 30px 0; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 8px; }
.spark { width: 120px; height: 28px; overflow: visible; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.5; }

.tree { padding: 6px 18px 4px; }
.tree-group { padding: 14px 0 6px; }
.tree-group + .tree-group { border-top: 1px solid var(--line); }
.tree-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.tree-head h3 { margin: 0; font-size: 1.07rem; }
.tree-head p { margin: 2px 0 0; color: var(--text-2); font-size: .93rem; }
.tree-head > .muted { white-space: nowrap; font-size: .87rem; padding-top: 3px; }
.tree-items { list-style: none; margin: 10px 0 6px 8px; padding: 0 0 0 22px; border-left: 2px solid var(--line); }
.tree-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 210px 200px; gap: 16px; align-items: center; padding: 12px 14px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.tree-item::before { content: ""; position: absolute; left: -24px; top: 50%; width: 22px; border-top: 2px solid var(--line); }
.tree-coazoo .tree-items { border-left-color: var(--accent); }
.tree-coazoo .tree-item::before { border-top-color: var(--accent); }
.ti-name { margin: 0; font-weight: 600; }
.ti-name .mono { font-weight: 400; font-size: .8rem; margin-left: 6px; }
.ti-desc { margin: 2px 0 0; color: var(--text-2); font-size: .93rem; }
.tree-item .tags { margin: 8px 0 0; }
.ti-reach { margin: 8px 0 0; font-size: .87rem; }
.ti-state { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ti-state .sub { color: var(--muted); font-size: .8rem; }
.ti-num { display: grid; grid-template-columns: 120px auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; font-size: .93rem; }
.ti-num .spark { grid-row: span 2; }
.reach-public { background: var(--warn-soft); color: var(--warn); }
.reach-nginx { background: var(--info-soft); color: var(--info); }
.reach-internal, .reach-local { background: var(--surface-2); color: var(--text-2); }
@media (max-width: 1100px) {
  .charts { grid-template-columns: minmax(0, 1fr); }
  .tree-item { grid-template-columns: minmax(0, 1fr); }
}
.ytick.y100 { top: 0; } .ytick.y50 { top: 50%; } .ytick.y0 { top: 100%; }

/* Accounts as a tree */
td.acct { position: relative; }
td.acct.depth-1 { padding-left: 46px; } td.acct.depth-2 { padding-left: 74px; } td.acct.depth-3 { padding-left: 102px; } td.acct.depth-4 { padding-left: 130px; }
td.acct:not(.depth-0)::before { content: ""; position: absolute; top: 0; bottom: 50%; width: 14px; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); border-bottom-left-radius: 6px; }
td.acct.depth-1::before { left: 26px; } td.acct.depth-2::before { left: 54px; } td.acct.depth-3::before { left: 82px; } td.acct.depth-4::before { left: 110px; }
.chip-reseller { background: var(--accent-soft); color: var(--accent); font-size: .8rem; vertical-align: 1px; }

/* Simulator, quotes and the channels form */
.sim, .channels { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: flex-end; padding: 16px 18px; }
.sim label, .channels label { display: flex; flex-direction: column; gap: 4px; font-size: .87rem; color: var(--text-2); }
.sim input, .sim select, .channels input { height: 42px; padding: 0 12px; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 150px; }
.sim select { min-width: 260px; }
.channels small { color: var(--muted); font-size: .8rem; }
.sim button, .channels button { height: 42px; padding: 0 18px; font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 8px; cursor: pointer; }
.quote { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 0 18px 16px; }
.quote-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.quote-card .label { color: var(--muted); font-size: .87rem; }
.quote-card .value { font-size: 1.47rem; font-weight: 700; }
.quote-card .hint { color: var(--text-2); font-size: .87rem; overflow-wrap: anywhere; }
.panel > .notice { margin: 0 18px 14px; }
@media (max-width: 1100px) { .quote { grid-template-columns: minmax(0, 1fr); } }

/* Price configuration: actions, steps, forms */
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.action { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.action strong { color: var(--accent); }
.action small { color: var(--text-2); font-size: .87rem; }
.action:hover { text-decoration: none; border-color: var(--accent); }
.notice-ok { background: var(--ok-soft); }
.tf { display: flex; flex-direction: column; gap: 16px; }
.step h2 { display: flex; align-items: center; gap: 10px; }
.step .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .87rem; }
.step-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; }
.step-body.grid, .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-weight: 600; font-size: .93rem; }
.field small, .margin small { color: var(--muted); font-size: .8rem; }
.field input, .field select, .field textarea, .inline input { height: 42px; padding: 0 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.field textarea { height: auto; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .93rem; }
.field.wide { max-width: 860px; }
input.small { width: 110px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; border: 0; padding: 0; margin: 0; }
.choices legend { font-weight: 600; font-size: .93rem; margin-bottom: 6px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice > span { display: flex; flex-direction: column; gap: 3px; }
.choice small { color: var(--text-2); font-size: .87rem; }
.inline { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.margin { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; }
.margin p { margin: 0; font-weight: 600; width: 100%; }
.check { display: flex; gap: 8px; align-items: center; }
.form-actions { display: flex; gap: 16px; align-items: center; }
.form-actions button, .assign button { height: 42px; padding: 0 22px; font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 8px; cursor: pointer; }
/* Show only what applies to the chosen kind (no JavaScript). */
.tf:has(input[name=kind][value=cost]:checked) .only-price, .tf:has(input[name=kind][value=price]:checked) .only-cost { display: none; }
.policy { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; padding: 16px 18px; align-items: start; }
.policy .wide { grid-column: 1 / -1; }
.policy .form-actions { grid-column: 1 / -1; }
.sub-block { padding: 14px 18px; border-top: 1px solid var(--line); }
.sub-block h3 { margin: 0 0 8px; font-size: 1.07rem; }
.sub-block .policy, .sub-block .channels { padding: 8px 0 0; }
.sub-block .table-wrap { border: 1px solid var(--line); border-radius: 8px; margin: 6px 0 10px; }
.chains { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chain { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.chain-title { margin: 0 0 6px; font-weight: 600; }
.chain ol { margin: 0 0 10px; padding-left: 20px; }
.chain li { margin: 4px 0; }
.button-link { display: inline-block; padding: 7px 14px; border: 1px solid var(--accent); border-radius: 8px; font-weight: 600; font-size: .93rem; }
.button-link:hover { text-decoration: none; background: var(--accent-soft); }
.assign { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.assign .field select, .assign .field input { min-width: 170px; }
@media (max-width: 1100px) { .actions, .chains { grid-template-columns: minmax(0, 1fr); } }
.field:has(select[name=unit]) input[name=unit_other] { display: none; margin-top: 6px; }
.field:has(option[value=_other]:checked) input[name=unit_other] { display: block; }
.only-cost .field:has(input[name=carrier_other]) { display: none; }
.only-cost:has(option[value=_other]:checked) .field:has(input[name=carrier_other]) { display: flex; }

/* Profit report */
.report-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.report-filters input, .report-filters select { height: 36px; padding: 0 10px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.report-filters button, .pending button { height: 36px; padding: 0 18px; font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 8px; cursor: pointer; }
.notice-warn { background: var(--warn-soft); }
.pending { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.attention-panel { border-color: var(--warn); }
.checks { list-style: none; margin: 0; padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; }
.chart-wrap { padding: 18px 18px 14px; }
.chart.bars .chart-plot { height: 190px; }
.chart .bar-rev { fill: var(--accent); }
.chart .bar-cost { fill: var(--muted); }
.chart .hit { fill: transparent; }
.chart g:hover .hit { fill: var(--surface-2); }
.legend { display: flex; align-items: center; gap: 8px; margin: 10px 0 0 56px; color: var(--text-2); font-size: .87rem; }
.legend .key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.legend .key-rev { background: var(--accent); }
.legend .key-cost { background: var(--muted); margin-left: 10px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
table.report td, table.report th { padding: 9px 12px; }
@media (max-width: 1300px) { .report-grid { grid-template-columns: minmax(0, 1fr); } }

.probe { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.probe input { height: 40px; width: 230px; padding: 0 12px; font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.probe button { height: 40px; padding: 0 20px; font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 8px; cursor: pointer; }
.probe-result { margin-top: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.probe-result .answer { margin: 0 0 8px; }
.probe-chain { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; font-size: .93rem; }
.probe-chain li.dim { color: var(--text-2); }
.rest-row td { background: var(--accent-soft); }
.margin-warn { color: var(--warn); font-weight: 600; }
.tf:has(select[name=account_id] option[value=""]:checked) .margin-warn { display: none; }
.dests { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 0; }
.dests legend { font-weight: 600; font-size: .93rem; padding: 0 6px; }
.dests > p { grid-column: 1 / -1; margin: 0; font-size: .87rem; }
@media (max-width: 900px) { .dests { grid-template-columns: minmax(0, 1fr); } }

button.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); margin-left: auto; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
#salida select { height: 34px; padding: 0 8px; font: inherit; font-size: .93rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
#salida td button[type=submit]:not(.link) { height: 34px; padding: 0 14px; font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 6px; cursor: pointer; }
.probe label.inline input, .probe label.inline select { height: 40px; padding: 0 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.assign .wide-input { flex: 1 1 360px; }
.assign .wide-input input { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { height: 32px; padding: 0 8px; font: inherit; font-size: .9rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }

/* Call history */
table.calls td { padding: 8px 12px; }
.dir { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-weight: 700; }
.dir-inbound { color: var(--accent); }
.dir-outbound { color: var(--warn); }
.icons { color: var(--accent); letter-spacing: 4px; }
.more { padding: 12px 18px; margin: 0; }
.small-id { font-size: .8rem; word-break: break-all; }
.timeline { margin: 0; padding: 14px 18px 14px 38px; display: flex; flex-direction: column; gap: 8px; }
.attempts { margin: 4px 0 0; padding-left: 18px; font-size: .93rem; color: var(--text-2); }
.chat { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; max-height: 560px; overflow-y: auto; }
.turn { max-width: 75%; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.turn p { margin: 2px 0 0; }
.turn .who { font-size: .8rem; color: var(--muted); font-weight: 600; }
.turn-agent, .turn-right { align-self: flex-end; background: var(--accent-soft); }
.turn-left { align-self: flex-start; background: var(--surface-2); }
audio { width: 100%; max-width: 640px; }
.tags { white-space: nowrap; }
.tag { display: inline-block; margin-right: 4px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 600; }

.record-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 16px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0; }
.record-boxes legend { font-weight: 600; font-size: .93rem; padding: 0 6px; }
.config-form { display: flex; flex-direction: column; gap: 12px; }
.inline-field { flex-direction: row; align-items: center; gap: 10px; }
.inline-field select { height: 36px; }
.danger-zone { border-color: var(--bad); }
.inline-form input[name=emails] { min-width: 260px; }

/* Callflow diagram (ADR-0024) */

/* ---- Controls: buttons, fields, switches, radio cards ---------------------------------- */
.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn-secondary, a.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.btn-small { height: 32px; padding: 0 12px; font-size: .93rem; border-radius: 8px; }
.btn-danger { background: var(--bad); }
.icon-button {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
}
.icon-button:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
input[type=text], input[type=email], input[type=number], input[type=search], input[type=date], input[type=datetime-local], input[type=password], input[type=tel], input:not([type]), select, textarea {
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px !important; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.field input, .field select, .field textarea, .sim input, .sim select, .channels input, .probe input { border-radius: 10px; }
.hint { margin: -4px 0 0; color: var(--muted); font-size: .87rem; }

/* A switch: a checkbox with role=switch */
input[role=switch] {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 42px; height: 24px; margin: 0;
  border-radius: 999px; background: var(--line); cursor: pointer; transition: background .15s;
}
input[role=switch]::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s;
}
input[role=switch]:checked { background: var(--accent); }
input[role=switch]:checked::before { transform: translateX(18px); }
input[role=switch]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0; padding: 10px 0; cursor: pointer; color: var(--text); font-size: 1rem; }
.toggle-text { display: flex; flex-direction: column; gap: 2px; }
.toggle-text > span { font-weight: 600; }
.toggle-text small { color: var(--muted); font-size: .87rem; font-weight: 400; }
.toggles { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; }
.toggles + .toggles { margin-top: 22px; }
.toggles legend, .radio-cards legend { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; padding: 0; }
.toggles .toggle + .toggle { border-top: 1px solid var(--surface-2); }

.radio-cards { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.radio-card { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--text); }
.radio-card > span { display: flex; flex-direction: column; gap: 2px; }
.radio-card small { color: var(--muted); font-size: .85rem; font-weight: 400; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card:hover { border-color: var(--accent); }

/* ---- Pills, tags, dots, avatars ----------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: .83rem; font-weight: 600; white-space: nowrap; }
.pill-net { background: var(--info-soft); color: var(--info); }
.pill-native { background: var(--accent-soft); color: var(--accent); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.tag-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; font-weight: 600; }
.tag-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; font-weight: 600; }
.tag-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-weight: 600; }
.state { display: inline-flex; align-items: center; gap: 7px; }
.dot-ok { background: var(--ok); }
.dot-off { background: var(--muted); opacity: .6; }
.tile-avatar {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 1.13rem;
}
.tile-avatar.small { width: 34px; height: 34px; border-radius: 9px; font-size: .93rem; }
.person-avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .8rem; letter-spacing: .02em;
}
.person-avatar.big { width: 44px; height: 44px; font-size: .93rem; }

/* ---- Lists: clickable rows -------------------------------------------------------------------- */
tr.row-link { cursor: pointer; }
tr.row-link.selected td { background: var(--accent-soft); }
td.go, th.go { width: 32px; padding-left: 0; color: var(--muted); }
tr.row-link:hover td.go { color: var(--accent); }
.who-cell { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.who-cell:hover { text-decoration: none; }
.who-cell > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.who-cell small { color: var(--muted); font-size: .85rem; font-weight: 400; }
tr.row-link:hover .who-cell strong { color: var(--accent); }
td.acct .pill { margin-left: 8px; }
td.acct .sub { margin-left: 46px; }
td.acct.depth-1, td.acct.depth-2, td.acct.depth-3, td.acct.depth-4 { vertical-align: middle; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar > .muted { margin: 0; flex: 1 1 260px; }
.toolbar .btn { margin-left: auto; }
.filter { flex: 0 1 380px; margin: 0; }
.search-field { display: flex; align-items: center; gap: 8px; height: 40px; margin: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-field input { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; padding: 0; height: 100%; background: transparent; font: inherit; color: var(--text); }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented a { padding: 6px 14px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: .93rem; }
.segmented a:hover { color: var(--text); text-decoration: none; }
.segmented a[aria-current="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }

/* ---- A company's workspace ------------------------------------------------------------------ */
.ws-head { margin: -24px -32px 0; padding: 22px 32px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.ws-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ws-name { min-width: 0; flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
.ws-name h1 { font-size: 1.47rem; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.ws-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: .9rem; color: var(--text-2); }
.online { display: inline-flex; align-items: center; gap: 6px; }
.ws-actions { display: flex; gap: 10px; }
.tabs { display: flex; gap: 2px; margin-top: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; white-space: nowrap;
  color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.tabs .count { font-size: .78rem; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-weight: 600; line-height: 1.5; }
.tabs a[aria-current="page"] .count { background: var(--accent-soft); color: var(--accent); }
.ws-head + .sub-head { margin-top: 4px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card-link {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.card-link .icon { grid-row: span 2; width: 22px; height: 22px; color: var(--accent); }
.card-link .card-value { font-size: 1.47rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.card-link .card-label { color: var(--text-2); font-size: .9rem; }
.card-link:hover { border-color: var(--accent); text-decoration: none; }
dl.facts { margin: 0; border: 0; border-radius: 0; }
dl.facts dt { color: var(--muted); font-size: .85rem; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.panel > header { gap: 16px; flex-wrap: wrap; }
.panel > header h2 { font-size: 1.07rem; }
.panel-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.panel-body > p { margin: 0; }
.panel-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.settings .panel-body { max-width: 760px; }
.inline-field { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; margin: 0; }
.inline-field > span { color: var(--text); font-size: 1rem; }
.inline-field select { min-width: 180px; height: 40px; padding: 0 12px; font: inherit; }

.box-list { list-style: none; margin: 0; padding: 0; }
.box-item { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.box-item:last-child { border-bottom: 0; }
.box-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.box-count { margin-left: auto; display: inline-flex; gap: 10px; align-items: center; font-size: .9rem; }
.box-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 22px; margin: 0; }
.box-form .grow { flex: 1 1 320px; margin: 0; }
.box-form .toggle { padding: 8px 0; }

/* ---- The panel on the right (editing over the list) --------------------------------------- */
.drawer-layer { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: flex-end; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .32); animation: fade-in .18s ease-out; }
.drawer {
  position: relative; width: min(500px, 100%); height: 100%; background: var(--surface); box-shadow: -16px 0 40px rgba(15, 23, 42, .18);
  animation: slide-in .22s cubic-bezier(.2, .8, .2, 1);
}
.drawer-form { display: flex; flex-direction: column; height: 100%; margin: 0; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head > div { flex: 1; min-width: 0; }
.drawer-head h2 { font-size: 1.2rem; }
.drawer-head p { margin: 2px 0 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-2 .field { margin: 0; }
body:has(.drawer-layer) { overflow: hidden; }
.danger-zone { border: 1px solid var(--bad-soft); border-radius: 12px; padding: 12px 14px; }
.danger-zone summary { cursor: pointer; color: var(--bad); font-weight: 600; }
.danger-zone p { color: var(--text-2); }
.danger-zone .btn { margin-top: 10px; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---- Notices that a change was saved ------------------------------------------------------ */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  max-width: min(560px, calc(100vw - 32px)); padding: 12px 12px 12px 16px; border-radius: 12px;
  background: #17202a; color: #fff; box-shadow: 0 12px 32px rgba(15, 23, 42, .28); animation: toast-in .25s ease-out;
}
.toast > .icon { color: #5cc97f; }
.toast-close { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: #b3bec8; }
.toast-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.toast.hide { opacity: 0; transform: translate(-50%, 10px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translateX(-50%); } }

/* ---- The search (Ctrl K) ----------------------------------------------------------------------- */
dialog.search {
  width: min(640px, calc(100vw - 32px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(15, 23, 42, .3);
}
dialog.search::backdrop { background: rgba(15, 23, 42, .35); backdrop-filter: blur(2px); }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-box input { flex: 1; height: 56px; border: 0 !important; box-shadow: none !important; background: transparent; font: inherit; font-size: 1.07rem; color: var(--text); padding: 0; }
.search-res { max-height: 56vh; overflow-y: auto; padding: 8px; }
.search-hint { margin: 10px; color: var(--muted); }
.hits { list-style: none; margin: 0; padding: 0; }
.hit { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.hit .icon { color: var(--muted); }
.hit-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hit-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit-text small { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit-kind { color: var(--muted); font-size: .8rem; }
.hit:hover, .hit.active { background: var(--accent-soft); text-decoration: none; }
.hit.active .icon, .hit:hover .icon { color: var(--accent); }

@media (max-width: 1100px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav .brand { margin: 0 8px 0 0; }
  .nav-section { display: contents; }
  .nav-group { display: none; }
  .nav nav { flex-direction: row; }
  .nav nav a { white-space: nowrap; }
  .top { padding: 0 16px; position: static; }
  .search-open { width: auto; max-width: none; }
  .search-open span, .search-open kbd { display: none; }
  main { padding: 20px 16px 32px; }
  .ws-head { margin: -20px -16px 0; padding: 18px 16px 0; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* Selects keep their arrow even where an older rule sets their background. */
select, .field select, .sim select, .report-filters select, .probe select, .inline-field select, #salida select, .assign .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
.two-col td, .two-col th { white-space: normal; }
table.list td.acct { white-space: normal; min-width: 300px; }

/* ---- Callflows: a tree of cards ---------------------------------------------------------- */
:root {
  --cf-line: #cfd6de;
  --fam-ring: #0f766e; --fam-ring-soft: #d5f5ef;
  --fam-decide: #6d28d9; --fam-decide-soft: #ede7fe;
  --fam-queue: #b45309; --fam-queue-soft: #fdefd3;
  --fam-end: #be123c; --fam-end-soft: #fde4ea;
  --fam-other: #1d4ed8; --fam-other-soft: #dfe8fd;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cf-line: #36424d;
    --fam-ring: #5eead4; --fam-ring-soft: #12332f;
    --fam-decide: #c4b5fd; --fam-decide-soft: #2a2146;
    --fam-queue: #fbbf24; --fam-queue-soft: #3a2b10;
    --fam-end: #fda4af; --fam-end-soft: #3d1a22;
    --fam-other: #93c5fd; --fam-other-soft: #1a2846;
  }
}
.cf-panel { padding: 0; }
.cf-canvas { padding: 28px 0 8px; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.cf-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; padding: 12px 18px; margin: 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.cf-toolbar .field { margin: 0; }
.cf-toolbar .field input { height: 38px; }
.cf-foot { padding: 10px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.sub-head-stats { display: flex; gap: 8px; margin-left: auto; }
.sim-path { padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--accent-soft); }
.sim-when { display: block; font-weight: 700; margin-bottom: 8px; }
.sim-path ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sim-path li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.sim-path li > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.sim-path small { color: var(--text-2); }
.cf-scroll { overflow: auto; }
.cft { display: inline-block; min-width: 100%; padding: 0 24px 28px; box-sizing: border-box; }
.cft ul { display: flex; justify-content: center; margin: 0; padding: 26px 0 0; position: relative; }
.cft > ul { padding-top: 0; }
.cft li { list-style: none; position: relative; display: flex; flex-direction: column; align-items: center; padding: 26px 12px 0; }
.cft > ul > li { padding-top: 0; }
.cft li::before, .cft li::after { content: ""; position: absolute; top: 0; width: 50%; height: 26px; border-top: 2px solid var(--cf-line); }
.cft li::before { right: 50%; }
.cft li::after { left: 50%; border-left: 2px solid var(--cf-line); }
.cft li:first-child::before, .cft li:last-child::after { border-top: 0; }
.cft li:last-child::before { border-top-right-radius: 10px; border-right: 2px solid var(--cf-line); width: calc(50% - 2px); right: 50%; }
.cft li:last-child::after { border-left: 0; }
.cft li:first-child::after { border-top-left-radius: 10px; }
.cft li:only-child::before { display: none; }
.cft li:only-child::after { border-top: 0; border-left: 2px solid var(--cf-line); border-radius: 0; }
.cft > ul > li::before, .cft > ul > li::after { display: none; }
.cft ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 26px; border-left: 2px solid var(--cf-line); }
.cft li.on::before, .cft li.on::after { border-color: var(--accent); }
.cft li.on:first-child::before, .cft li.on:last-child::after { border-color: transparent; }
.cft li.on:last-child::before { border-top-color: var(--accent); border-right-color: var(--accent); }
.cft ul:has(> li.on)::before { border-color: var(--accent); }
.cft li.on:only-child::after { border-left-color: var(--accent); }

.cf-entry {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-radius: 16px; position: relative; z-index: 1;
  background: linear-gradient(135deg, var(--accent), #12867f); color: #fff; box-shadow: 0 6px 18px rgba(15, 110, 106, .3);
}
.cf-entry .icon { width: 26px; height: 26px; }
.cf-entry-text { display: flex; flex-direction: column; gap: 6px; }
.cf-entry-text small { opacity: .85; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.cf-dials { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-dial { padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; font-weight: 600; }
.cf-dial.more { font-family: inherit; font-weight: 500; }

.cf-card {
  --fam: var(--fam-other); --fam-soft: var(--fam-other-soft);
  display: flex; align-items: flex-start; gap: 12px; width: 260px; padding: 12px 14px; position: relative; z-index: 1;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-top: 3px solid var(--fam); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 16px rgba(16, 24, 40, .06); text-align: left; transition: transform .12s, box-shadow .12s;
}
a.cf-card:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(16, 24, 40, .12); }
.fam-ring { --fam: var(--fam-ring); --fam-soft: var(--fam-ring-soft); }
.fam-decide { --fam: var(--fam-decide); --fam-soft: var(--fam-decide-soft); }
.fam-queue { --fam: var(--fam-queue); --fam-soft: var(--fam-queue-soft); }
.fam-end { --fam: var(--fam-end); --fam-soft: var(--fam-end-soft); }
.cf-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--fam-soft); color: var(--fam); }
.cf-icon .icon { width: 22px; height: 22px; }
.cf-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cf-kind { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--fam); }
.cf-main { font-size: .97rem; line-height: 1.3; overflow-wrap: anywhere; }
.cf-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cf-chip { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: .78rem; font-weight: 600; }
.cf-branch {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 3px 11px;
  border-radius: 999px; background: var(--surface); border: 1.5px solid var(--cf-line); color: var(--text-2); font-size: .82rem; font-weight: 600; white-space: nowrap;
}
.cf-branch::after { content: ""; position: absolute; left: 50%; top: 100%; height: 14px; border-left: 2px solid var(--cf-line); }
.cf-calls { padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; }
li.on > .cf-branch { background: var(--accent); border-color: var(--accent); color: #fff; }
li.on > .cf-branch::after { border-color: var(--accent); }
li.on > .cf-branch .cf-calls { background: rgba(255, 255, 255, .25); color: #fff; }
.cf-card.on { border-color: var(--accent); border-top-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 8px 20px rgba(16, 24, 40, .1); }
.cft.simulating .cf-card:not(.on), .cft.simulating li:not(.on) > .cf-branch, .cft.simulating .cf-ref { opacity: .42; }
.cf-end { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: .85rem; font-weight: 700; position: relative; z-index: 1; }
.cf-ref { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1.5px dashed var(--cf-line); border-radius: 12px; background: var(--surface); color: var(--text-2); font-size: .9rem; position: relative; z-index: 1; }
.cf-ref:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.cf-card:target { animation: pulse 1.2s ease-out 2; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent); } 100% { box-shadow: 0 0 0 12px transparent; } }

.cf-stats { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cf-stats .muted { margin: 0 0 0 6px; flex: 1 1 260px; }
.stat { display: flex; flex-direction: column; padding: 10px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.stat-value { font-size: 1.47rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-label { color: var(--text-2); font-size: .87rem; }
.sim-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; padding: 16px 18px; overflow: visible; }
.sim-title { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; flex: 1 1 240px; align-self: center; }
.sim-title .icon { grid-row: span 2; width: 22px; height: 22px; color: var(--accent); }
.sim-title small { color: var(--muted); }
.sim-bar .field { margin: 0; }
.sim-bar .field input { height: 40px; }
.small-field input { width: 90px; }
.toggle.compact { padding: 0 0 8px; gap: 10px; }
.sim-actions { display: flex; gap: 8px; margin-left: auto; }
.timeline { list-style: none; margin: 0; padding: 14px 18px; display: flex; flex-direction: column; gap: 0; }
.timeline li { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; border-left: 2px solid var(--accent-soft); }
.tl-n { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .82rem; font-weight: 700; }
.timeline li > span:last-child { display: flex; flex-direction: column; padding-top: 3px; }
.timeline small { color: var(--text-2); }

/* ---- Every page: header, filters, indicators, tables ------------------------------------- */
.page-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 420px; }
.page-sub { margin: 0; color: var(--text-2); max-width: 880px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Filters: one card, each control with its name above */
.report-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; margin: 0; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.report-filters label.inline { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin: 0; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.report-filters label.inline input, .report-filters label.inline select { height: 38px; min-width: 150px; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .95rem; color: var(--text); padding: 0 10px; }
.report-filters button { height: 38px; border-radius: 10px; margin-left: auto; }
.report-filters .ranges { align-self: flex-end; }
.ranges { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); overflow: visible; }
.ranges a { padding: 5px 12px; border-radius: 8px; border: 0 !important; color: var(--text-2); font-weight: 500; font-size: .9rem; }
.ranges a[aria-current="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }

/* Tables: they fit the page; long text wraps instead of pushing a scroll bar */
th, td { white-space: normal; }
td.num, th.num, td.mono, td.nowrap { white-space: nowrap; }
th { font-size: .74rem; letter-spacing: .06em; background: var(--surface); border-bottom: 1px solid var(--line); }
td { padding-top: 12px; padding-bottom: 12px; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.panel { border-radius: 14px; }
.panel > header { padding: 16px 18px; }

/* Indicators */
.tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { border-radius: 14px; padding: 16px 18px; gap: 2px; position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); opacity: .7; }
.tile .label { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.tile .value { font-size: 1.87rem; }
a.tile:hover { box-shadow: 0 8px 20px rgba(16, 24, 40, .08); }

/* Facts of one thing (a call, a tariff) */
.facts { border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; gap: 16px 28px; }
.facts .label { text-transform: uppercase; font-size: .72rem; font-weight: 700; letter-spacing: .06em; }

/* A company's summary: how it is doing, each card goes where to fix it */
.status-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.status-card {
  --st: var(--muted); --st-soft: var(--surface-2);
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text);
}
.status-card:hover { text-decoration: none; border-color: var(--st); }
.status-card.ok { --st: var(--ok); --st-soft: var(--ok-soft); }
.status-card.warn { --st: var(--warn); --st-soft: var(--warn-soft); }
.status-card.bad { --st: var(--bad); --st-soft: var(--bad-soft); }
.status-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--st-soft); color: var(--st); }
.status-icon .icon { width: 22px; height: 22px; }
.status-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.status-label { color: var(--text-2); font-size: .85rem; }
.status-text strong { font-size: 1.02rem; }

/* One call: what happened, step by step; technical data folded away */
.timeline li > span:last-child { gap: 4px; }
.attempts { display: flex; flex-wrap: wrap; gap: 6px; }
details.tech { padding: 0; }
details.tech > summary { padding: 14px 18px; cursor: pointer; color: var(--text-2); font-weight: 600; }
details.tech[open] > summary { border-bottom: 1px solid var(--line); }
details.tech .facts { box-shadow: none; border: 0; }

/* Calls */
.when { display: flex; flex-direction: column; line-height: 1.2; color: var(--text); }
.when small { color: var(--muted); }
.when:hover { text-decoration: none; }
.call-route { display: flex; align-items: center; gap: 10px; }
.call-route > span:last-child { display: flex; flex-direction: column; }
.call-route > span:last-child > span:first-child, .call-route .route-line { white-space: nowrap; }
.call-route small { color: var(--muted); }
.dir-badge { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); }
.dir-badge .icon { width: 16px; height: 16px; }
.dir-inbound { background: var(--info-soft); color: var(--info); }
.dir-outbound { background: var(--accent-soft); color: var(--accent); }
.media-icons { color: var(--muted); }
.media-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; }
.media-icon .icon { width: 17px; height: 17px; }
p.more { padding: 12px 18px; margin: 0; border-top: 1px solid var(--line); text-align: center; }

.num-cell { display: flex; flex-direction: column; gap: 4px; }
.num-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* Routing */
.panel > header h2 { display: flex; align-items: center; gap: 8px; }
.panel > header h2 .icon { color: var(--accent); }
.plan-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trunk-chain { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.chain-sep { color: var(--muted); font-weight: 700; }
.route-answer { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.trunk-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.trunk-steps li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.trunk-steps li.dim { opacity: .6; }
.trunk-text { display: flex; flex-direction: column; min-width: 160px; }
.trunk-text small { color: var(--muted); }
.trunk-cost { margin-left: auto; color: var(--text-2); }
.tl-n.off { background: var(--surface-2); color: var(--muted); }

/* Tariffs */
.sim-form label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--text-2); margin: 0; }
.sim-form input, .sim-form select { height: 38px; padding: 0 10px; min-width: 140px; font: inherit; font-size: .95rem; color: var(--text); }
.quote-pad { padding: 16px 18px; }
.panel-note { padding: 10px 18px; border-bottom: 1px solid var(--line); }

/* Carriers: one card per trunk */
.trunk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.trunk-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.trunk-card.dim { opacity: .65; }
.trunk-head { display: flex; align-items: center; gap: 12px; }
.trunk-head .status-icon { background: var(--surface-2); color: var(--muted); }
.trunk-head .status-icon.on { background: var(--accent-soft); color: var(--accent); }
.trunk-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trunk-title span { color: var(--text-2); font-size: .9rem; }
.trunk-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.trunk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 12px 10px; margin: 0; }
.trunk-stats dd { white-space: nowrap; }
.trunk-stats div { display: flex; flex-direction: column; gap: 2px; }
.trunk-stats dt { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.trunk-stats dd { margin: 0; font-size: 1.07rem; font-weight: 700; font-variant-numeric: tabular-nums; }
meter.asr { height: 6px; }

/* Integrations: providers in order */
.provider-list { list-style: none; margin: 0; padding: 0; }
.provider { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.provider.dim { opacity: .6; }
.provider-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; }
.provider-text .mono { color: var(--text-2); font-size: .85rem; overflow-wrap: anywhere; }
.provider-test { display: flex; gap: 6px; margin: 0; }
.provider-test input { height: 32px; padding: 0 10px; font: inherit; font-size: .9rem; }
.add-form { padding: 0; }
.add-form > summary { padding: 14px 18px; cursor: pointer; color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 6px; list-style: none; }
.add-form > summary::-webkit-details-marker { display: none; }
.add-form[open] > summary { border-bottom: 1px solid var(--line); }
.add-form .assign { padding: 16px 18px; }

.tile { padding-right: 64px; }
.tile-icon { position: absolute; right: 16px; top: 16px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.tile-icon .icon { width: 19px; height: 19px; }
.btn.btn-small, a.btn.btn-small { height: 32px; padding: 0 12px; font-size: .9rem; border-radius: 8px; }
.sim-form input, .sim-form select, .report-filters input, .report-filters select { font-weight: 400; }
.tag { white-space: nowrap; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* Live: tabs; queues and a queue's dashboard */
.segmented.big a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; }
.segmented .count { font-size: .78rem; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.segmented .count.warn { background: var(--warn-soft); color: var(--warn); }
.tag-info { background: var(--info-soft); color: var(--info); border-color: transparent; font-weight: 600; }
.sl { font-weight: 700; }
.sl.ok { color: var(--ok); } .sl.warn { color: var(--warn); } .sl.bad { color: var(--bad); }
.live-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-size: .85rem; font-weight: 600; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse-dot 1.6s ease-out infinite; }
@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; }
.kpi {
  --k: var(--accent); --k-soft: var(--accent-soft);
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); border-top: 3px solid var(--k); box-shadow: var(--shadow);
}
.kpi.ok { --k: var(--ok); } .kpi.warn { --k: var(--warn); } .kpi.bad { --k: var(--bad); }
.kpi-label { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: .85rem; font-weight: 600; }
.kpi-label .icon { width: 16px; height: 16px; color: var(--k); }
.kpi-value { font-size: 1.87rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: .85rem; font-weight: 500; color: var(--text-2); }
.kpi.warn .kpi-value, .kpi.bad .kpi-value { color: var(--k); }
.kpi-hint { color: var(--muted); font-size: .82rem; }
.kpi meter { height: 6px; margin-top: 4px; }
.line { list-style: none; margin: 0; padding: 6px 0; }
.line li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; }
.line li + li { border-top: 1px solid var(--line); }
.line li.ringing { background: color-mix(in srgb, var(--info-soft) 60%, transparent); }
.line-pos { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.line li.ringing .line-pos { background: var(--info-soft); color: var(--info); }
.line-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.line-who small { color: var(--text-2); }
.line-wait { font-size: 1.13rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.icon-button.small { width: 30px; height: 30px; border-radius: 8px; }
.icon-button.small .icon { width: 15px; height: 15px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 18px; color: var(--muted); }
.empty-state .icon { width: 28px; height: 28px; color: var(--ok); }
.empty-state p { margin: 0; }
.agents { list-style: none; margin: 0; padding: 6px 0; }
.agent { display: flex; align-items: center; gap: 12px; padding: 9px 18px; }
.agent + .agent { border-top: 1px solid var(--line); }
.agent.state-logged_out { opacity: .55; }
.agent-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.agent-who small { color: var(--muted); }
.agent-since { width: 56px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.hour-chart { overflow-x: auto; }
svg.hours { display: block; height: 182px; width: auto; max-width: 100%; overflow: visible; }
svg.hours .bar-ok { fill: var(--accent); }
svg.hours .bar-bad { fill: var(--bad); }
svg.hours .bar-other { fill: var(--muted); opacity: .6; }
svg.hours .hit { fill: transparent; }
svg.hours g:hover .hit { fill: var(--surface-2); }
svg.hours .hx { fill: var(--muted); font-size: 11px; }
.legend .key-ok { background: var(--accent); }
.legend .key-bad { background: var(--bad); margin-left: 10px; }
.legend .key-other { background: var(--muted); opacity: .6; margin-left: 10px; }
.hour-chart .legend { margin-left: 0; }

/* A card's configuration, one line each */
.cf-card { width: 290px; }
.cf-details { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.cf-det { display: grid; grid-template-columns: minmax(70px, auto) 1fr; gap: 8px; font-size: .8rem; line-height: 1.35; }
.cf-det-k { color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.cf-det-v { color: var(--text); overflow-wrap: anywhere; }

.cf-canvas { position: relative; }
.cf-zoom { position: sticky; top: 8px; left: 0; z-index: 3; display: flex; justify-content: flex-end; gap: 6px; padding: 0 14px 8px; }
.cf-zoom .icon-button.small { font-size: 1.1rem; font-weight: 700; }

.cf-audio { min-width: 0; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.cf-audio audio { width: 100%; min-width: 200px; max-width: 100%; height: 32px; }
.cf-say { font-size: .85rem; color: var(--muted); font-style: italic; }

/* Sistema › Desarrollo: the "Coazoo por dentro" page, in a frame that fills the content area. */
.dev-frame { display: block; width: 100%; height: calc(100vh - 190px); min-height: 560px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
@media (max-width: 760px) { .dev-frame { height: calc(100vh - 150px); min-height: 480px; } }

/* Tab Callflows: how the company answers (kinds), how outside calls come in (a tree), the list. */
.cf-overview .cf-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.cf-kind { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.cf-kind:hover { border-color: var(--accent); }
.cf-kind.on { border-color: var(--accent); background: var(--accent-soft); }
.cf-kind-icon { grid-row: 1 / 4; color: var(--accent); }
.cf-kind-icon svg { width: 22px; height: 22px; }
.cf-kind-n { font-size: 1.5rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cf-kind span { text-transform: none; letter-spacing: normal; }
.cf-kind-l { font-weight: 600; font-size: .93rem; line-height: 1.3; }
.cf-kind-c { color: var(--muted); font-size: .8rem; }
.cf-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.cf-facts .chip { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.cf-facts .chip svg { width: 15px; height: 15px; }
.chip-warn { background: var(--warn-soft); color: var(--warn); }

.cf-tree, .cf-tree ul { list-style: none; margin: 0; padding: 0; }
.cf-tree { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cf-tree ul { margin: 6px 0 0 22px; padding-left: 16px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.cf-node-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.cf-node-card:hover { border-color: var(--accent); }
.cf-node-card.seen { border-style: dashed; color: var(--text-2); }
.cf-node-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); flex: none; }
.cf-node-icon svg { width: 18px; height: 18px; }
.cf-node-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cf-node-body .sub { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.cf-node-calls { color: var(--text-2); font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-more { margin-top: 12px; }
.cf-more summary { cursor: pointer; color: var(--accent); font-weight: 600; }

.cf-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.cf-filters .grow { flex: 1 1 240px; }
.cf-filter-actions { display: flex; gap: 8px; }
.cf-count { color: var(--muted); margin: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; color: var(--text-2); }
.cf-pad { padding: 14px 18px; }
.cf-pad + .cf-pad { padding-top: 0; }
.cf-overview .cf-kinds { margin-top: 0; }
.panel > header .sub { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.pager { padding-bottom: 14px; }

/* A callflow's page: the way back and how a call gets here. */
.cf-back { display: inline-flex; align-items: center; gap: 6px; max-width: 320px; }
.cf-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-head-stats .pill svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.cf-reach { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.cf-reach-title { font-weight: 600; color: var(--text-2); margin-right: 4px; }
.cf-reach-item { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .9rem; text-decoration: none; }
a.cf-reach-item:hover { border-color: var(--accent); color: var(--accent); }
.cf-reach-item svg { width: 15px; height: 15px; }
@media (max-width: 760px) { .cf-node-calls { display: none; } .cf-tree ul { margin-left: 8px; padding-left: 10px; } }
.cf-pad .footnote { margin-top: 12px; }

/* A call's audio quality (ADR-0026): the verdict, then each leg. */
.q-verdict { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 14px 18px; font-size: 1rem; }
.q-verdict .chip { flex: none; }
.q-bad { background: var(--bad-soft); }
.q-fair { background: var(--warn-soft); }
.num-flag { margin-right: 6px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }

/* Virtual numbers: made up by the .NET to reach an extension directly (no country, no carrier). */
.num-virtual { display: inline-flex; vertical-align: -3px; margin-right: 6px; color: var(--info); }
.num-virtual svg { width: 16px; height: 16px; }
.panel-summary { display: flex; align-items: center; gap: 4px; padding: 14px 18px; cursor: pointer; }
.virtual-note { margin: 0 18px 12px; }
a.tile { color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--accent); }
#virtuales { scroll-margin-top: 96px; }

/* Números: mark numbers and give them their owner carrier at once. */
.bulk-owner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .93rem; }
.bulk-owner select { height: 34px; }
th.check, td.check { width: 34px; padding-right: 0; }
td.check input, th.check input { width: 17px; height: 17px; }
