/* ManageHex Voice: one stylesheet for the whole panel. */
:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #f0f2ef;
  --ink: #14201c;
  --ink-2: #44514c;
  --ink-3: #78847f;
  --line: #e2e6e3;
  --line-2: #d3d9d5;
  --brand: #1f5c4d;
  --brand-2: #2b7a66;
  --brand-soft: #e5f0ec;
  --good: #1f7a4d;
  --good-soft: #e3f3ea;
  --warn: #9a6a12;
  --warn-soft: #fbf1dc;
  --bad: #b23a33;
  --bad-soft: #fae6e4;
  --side: #10201b;
  --side-ink: #c9d6d1;
  --side-active: #1d3a32;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 27, .05), 0 4px 16px rgba(16, 32, 27, .05);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1412; --surface: #141d1a; --surface-2: #1a2522; --ink: #e8efec; --ink-2: #b4c1bc; --ink-3: #82918b;
    --line: #24302c; --line-2: #2e3b37; --brand: #5fbfa3; --brand-2: #79d1b6; --brand-soft: #16302a;
    --good: #6cc99a; --good-soft: #15302a; --warn: #e2b55a; --warn-soft: #2e2715; --bad: #f08b83; --bad-soft: #351c1a;
    --side: #0a110f; --side-ink: #a9b8b2; --side-active: #16302a; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; letter-spacing: -.01em; font-weight: 650; }
h2 { font-size: 15px; margin: 0; font-weight: 620; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }

.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: #fff; font-weight: 640; letter-spacing: -.01em; }
.brand__mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(140deg, #2b7a66, #1f5c4d); display: grid; place-items: center; }
.brand__mark svg { width: 17px; height: 17px; stroke: #fff; }
.brand small { display: block; font-weight: 450; color: var(--side-ink); font-size: 11.5px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6f8780; padding: 12px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.04); text-decoration: none; color: #fff; }
.nav a.is-on { background: var(--side-active); color: #fff; }
.nav svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side__foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.07); padding-top: 14px; font-size: 12.5px; }
.side__foot strong { color: #fff; display: block; font-weight: 560; }
.side__foot button { margin-top: 10px; width: 100%; }

.main { padding: 28px 34px 60px; max-width: 1240px; width: 100%; min-width: 0; }
/* Grid items keep their content's width unless told they may shrink; wide
   tables then scroll inside their card instead of pushing the page sideways. */
.grid > *, .stats > *, .stack > *, .card { min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head p { color: var(--ink-3); margin-top: 4px; }
.head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card__h p { color: var(--ink-3); font-size: 12.5px; }
.card__b { padding: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: 2fr 1fr; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 16px 18px; }
.stat__l { color: var(--ink-3); font-size: 12.5px; }
.stat__v { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat__s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 140px; padding-top: 8px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar__col { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: var(--brand-soft); position: relative; min-height: 4px; }
.bar__col i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: inherit; background: var(--brand); }
.bar span { font-size: 11.5px; color: var(--ink-3); }

table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11.5px; font-weight: 560; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.t td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.is-link { cursor: pointer; }
.t tr.is-link:hover td { background: var(--surface-2); }
.t .num { font-variant-numeric: tabular-nums; text-align: right; }
.t-wrap { overflow-x: auto; }
.muted { color: var(--ink-3); }
.empty { padding: 34px 18px; text-align: center; color: var(--ink-3); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 540; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.is-good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.is-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.is-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.is-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 560 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn--danger { color: var(--bad); }
.btn--danger:hover { border-color: var(--bad); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side .btn { background: transparent; color: var(--side-ink); border-color: rgba(255,255,255,.12); }
.side .btn:hover { color: #fff; border-color: rgba(255,255,255,.3); }

.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 560; color: var(--ink-2); }
label.f small { font-weight: 400; color: var(--ink-3); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 14px var(--font);
}
textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 220px; white-space: pre; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink-2); }
fieldset.f { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; font-size: 12.5px; font-weight: 560; color: var(--ink-2); }
fieldset.f legend { padding: 0; margin-bottom: 6px; }
fieldset.f legend small { display: block; font-weight: 400; color: var(--ink-3); margin-top: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; min-height: 38px; align-items: center; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
textarea[dir=rtl] { font-family: "Vazirmatn", "Noto Naskh Arabic", "Segoe UI", Tahoma, var(--font); font-size: 15px; line-height: 1.7; }
.card__note { margin: 0; padding: 12px 18px 14px; color: var(--ink-3); font-size: 13px; border-bottom: 1px solid var(--line); }
.rtl-text { font-family: "Vazirmatn", "Noto Naskh Arabic", "Segoe UI", Tahoma, var(--font); font-size: 15px; }
.prompt__lang { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.err { color: var(--bad); font-size: 12px; font-weight: 500; }

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; font-weight: 500; }
.flash.is-good { background: var(--good-soft); color: var(--good); }
.flash.is-bad { background: var(--bad-soft); color: var(--bad); }
.flash.is-warn { background: var(--warn-soft); color: var(--ink); }
.once { border: 1px dashed var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; color: var(--ink); }
.once h2 { color: var(--warn); margin-bottom: 6px; }
.once dl { display: grid; grid-template-columns: max-content 1fr auto; gap: 8px 14px; align-items: center; margin: 10px 0 0; }
.once dt { color: var(--ink-3); font-size: 12.5px; }
.once dd { margin: 0; font-family: var(--mono); font-size: 13px; word-break: break-all; }

.timeline { display: flex; flex-direction: column; gap: 10px; }
.step { display: grid; grid-template-columns: 46px 1fr; gap: 10px; align-items: start; }
.step__t { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; padding-top: 7px; }
.step__b { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); max-width: 680px; }
.step.is-line .step__b { background: var(--brand-soft); }
.step.is-caller .step__b { background: var(--surface); border: 1px solid var(--line); justify-self: start; }
.step.is-system .step__b { background: transparent; color: var(--ink-3); font-size: 12.5px; padding: 6px 0; }
.step__text[dir=rtl] { text-align: right; font-family: "Vazirmatn", "Noto Naskh Arabic", "Segoe UI", Tahoma, var(--font); font-size: 14.5px; line-height: 1.8; }
.step__who { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 2px; }

.facts { display: grid; gap: 12px; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; padding-bottom: 0; }
.fact span:first-child { color: var(--ink-3); }
.fact span:last-child { font-weight: 560; text-align: right; }

pre.out { margin: 0; padding: 16px 18px; background: var(--side); color: #d6e4de; border-radius: 0 0 var(--radius) var(--radius); font: 12px/1.5 var(--mono); overflow-x: auto; max-height: 460px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; font-weight: 520; }
.tabs a.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs a:hover { text-decoration: none; border-color: var(--ink-3); }

.prompt { display: grid; grid-template-columns: 220px 1fr auto; gap: 14px; align-items: start; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.prompt:last-child { border-bottom: 0; }
.prompt__k { font-weight: 580; font-size: 13px; }
.prompt__k small { display: block; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.prompt.is-custom .prompt__k::after { content: "Reworded"; display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 1px 6px; border-radius: 5px; vertical-align: 1px; }

dialog.confirm { border: 0; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0,0,0,.25); background: var(--surface); color: var(--ink); }
dialog.confirm::backdrop { background: rgba(10, 20, 17, .45); backdrop-filter: blur(2px); }
.confirm__b { padding: 22px 22px 8px; }
.confirm__b h2 { font-size: 16px; margin-bottom: 6px; }
.confirm__b p { color: var(--ink-2); }
.confirm__f { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 10% -10%, rgba(43,122,102,.18), transparent 60%), var(--bg); }
.login .card { width: min(400px, 100%); }
.login .brand { color: var(--ink); justify-content: center; margin-bottom: 18px; font-size: 16px; }
.login .brand small { color: var(--ink-3); }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; }
.inline { display: inline; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filters input[type=search] { max-width: 260px; }
.filters select { max-width: 220px; }
audio { width: 100%; height: 36px; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav__label, .side__foot { display: none; }
  .main { padding: 20px 16px 48px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .prompt { grid-template-columns: 1fr; }
}
