/* Modern theme layer: loaded after style.css and only restyles (same class names). */
:root {
  --bg: #f3f5fb; --panel: #ffffff; --text: #141a2e; --muted: #687089; --line: #e4e8f2;
  --accent: #5b5bf6; --accent-2: #8b5cf6; --accent-soft: #eef0ff; --ok: #12a46b; --warn: #e08a00; --bad: #e5484d;
  --side: #0c1124; --side-2: #151c3a; --side-text: #aeb7d6;
  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --shadow-sm: 0 1px 2px rgba(20, 26, 46, .04), 0 1px 3px rgba(20, 26, 46, .06);
  --shadow: 0 2px 6px rgba(20, 26, 46, .04), 0 8px 24px rgba(20, 26, 46, .07);
  --shadow-lg: 0 12px 40px rgba(20, 26, 46, .16);
  --radius: 16px;
  --ring: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
@media (prefers-color-scheme: dark) { html:not([data-mode="light"]) {
    --bg: #0a0e1a; --panel: #121829; --text: #e8ecf8; --muted: #8e98b5; --line: #222b44;
    --accent: #7c7cff; --accent-2: #a78bfa; --accent-soft: #1d2142; --side: #070a14; --side-2: #0e1428; --side-text: #a3acc9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 8px 24px rgba(0, 0, 0, .35); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
    --ring: 0 0 0 4px rgba(124, 124, 255, .22);
  } }
html[data-mode="dark"] {
    --bg: #0a0e1a; --panel: #121829; --text: #e8ecf8; --muted: #8e98b5; --line: #222b44;
    --accent: #7c7cff; --accent-2: #a78bfa; --accent-soft: #1d2142; --side: #070a14; --side-2: #0e1428; --side-text: #a3acc9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 8px 24px rgba(0, 0, 0, .35); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
    --ring: 0 0 0 4px rgba(124, 124, 255, .22);
  }

body {
  font: 15px/1.55 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Tahoma, sans-serif;
  background:
    radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 60%),
    radial-gradient(900px 500px at 20% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
* { scrollbar-width: thin; scrollbar-color: rgba(128, 138, 170, .35) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(128, 138, 170, .35); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 248px; padding: 20px 14px; overflow-y: auto;
  background: linear-gradient(180deg, var(--side-2) 0%, var(--side) 100%);
  border-right: 1px solid rgba(255, 255, 255, .05);
}
.brand { padding: 2px 8px 22px; gap: 12px; }
.brand strong { font-size: 16px; letter-spacing: -.01em; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent); font-size: 19px; }
.nav-group { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(174, 183, 214, .55); padding: 14px 12px 6px; }
.nav-group:first-of-type { padding-top: 0; }
.sidebar a {
  align-items: center; padding: 9px 12px; border-radius: 10px; margin-bottom: 2px; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s, transform .15s;
}
.sidebar a .nav-label { display: flex; align-items: center; gap: 11px; }
.nav-ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.sidebar a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar a.active { background: var(--grad); color: #fff; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.sidebar a.active .nav-ico { opacity: 1; }
.sidebar .badge { background: #ff5d6c; box-shadow: 0 0 0 3px rgba(255, 93, 108, .18); font-weight: 600; }
.sidebar-user { border-top: 1px solid rgba(255, 255, 255, .07); padding: 14px 12px 6px; }
.sidebar-user b { font-size: 14px; }
.status-pick select { border-radius: 8px; }

/* ---------- layout & type ---------- */
main { padding: 32px 40px 48px; max-width: 1240px; min-width: 0; }  /* min-width: wide tables scroll inside their card */
h1 { font-size: 28px; font-weight: 750; letter-spacing: -.025em; margin-bottom: 20px; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-weight: 650; }
.page.active { animation: page-in .28s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page > .muted:first-of-type, .page > p.muted { margin-top: -8px; }

/* ---------- cards ---------- */
.card, .kpi, .wb-tile, .modal-box, .login-box {
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card { padding: 20px 22px; margin-bottom: 18px; }
.card:hover { box-shadow: var(--shadow); }
.card, .kpi, .wb-tile { transition: box-shadow .2s, transform .2s, border-color .2s; }
.stats { gap: 18px; }
.stat { position: relative; overflow: hidden; }
.stat::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: var(--grad); opacity: .08;
}
.stat:hover, .kpi:hover, .wb-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .num, .kpi .num, .wb-tile .num { font-weight: 750; letter-spacing: -.03em; }
.stat .num { font-size: 34px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi { padding: 16px 18px; }
.kpi.hero, .wb-tile.good { position: relative; }
.kpi.hero { background: var(--grad); border: 0; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent); }
.agent-card { background: linear-gradient(135deg, var(--panel) 60%, var(--accent-soft)); }
.agent-state { font-size: 22px; letter-spacing: -.01em; }
.dot.online { box-shadow: 0 0 0 4px rgba(18, 164, 107, .18); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px rgba(18, 164, 107, .06); } }

/* ---------- buttons ---------- */
.btn {
  border-radius: 10px; padding: 8px 16px; font-weight: 550; background: var(--panel);
  box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .15s, border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: var(--grad); border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 32%, transparent); }
.btn.primary:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 42%, transparent); filter: brightness(1.05); }
.btn.danger { background: linear-gradient(135deg, #e5484d, #f06b5a); border-color: transparent; }
.btn.danger-outline { border-color: rgba(229, 72, 77, .35); }
.btn.danger-outline:hover { background: rgba(229, 72, 77, .07); border-color: var(--bad); }
.btn.small { border-radius: 8px; padding: 5px 11px; }
.btn:disabled { transform: none; box-shadow: none; }

/* ---------- forms ---------- */
label { font-weight: 500; }
input, select, textarea {
  border-radius: 10px; background: var(--panel); border-color: var(--line); padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23687089' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.status-pick select { background-image: none; padding-right: 8px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.mode { border-radius: 12px; transition: border-color .15s, background .15s, box-shadow .15s; }
.mode:has(input:checked) { box-shadow: var(--ring); }
details summary { font-weight: 550; }
.save-bar { background: linear-gradient(180deg, transparent, var(--bg) 35%); padding: 18px 0 14px; }
.slider { background: #cfd5e4; }
.switch input:checked + .slider { background: var(--grad); }

/* ---------- tables ---------- */
.table-card { border-radius: var(--radius); }
th { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; background: transparent; }
th, td { padding: 12px 16px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- pills, badges, boxes ---------- */
.pill { padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: 11.5px; letter-spacing: .01em; }
.rules-box { border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 6%, transparent)); }
#ai-cap-warning { border-color: rgba(224, 138, 0, .35); background: linear-gradient(135deg, #fff6e5, #fff1e0); color: #7a4b00; }
@media (prefers-color-scheme: dark) { html:not([data-mode="light"]) #ai-cap-warning { background: #2a210f; color: #ffcf7a; } }
html[data-mode="dark"] #ai-cap-warning { background: #2a210f; color: #ffcf7a; }
.dropzone { border-radius: 14px; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.log { border-radius: 12px; }

/* ---------- conversation bubbles ---------- */
.msg, .cmsg { border-radius: 16px; box-shadow: var(--shadow-sm); }
.msg.agent, .cmsg.ai { background: var(--accent-soft); border-bottom-left-radius: 6px; }
.cmsg.ai, .cmsg.agent { border-bottom-right-radius: 6px; border-bottom-left-radius: 16px; }
.cmsg.agent { background: linear-gradient(135deg, #dff7ec, #e9fbf2); }
.cmsg.customer, .msg.caller { border-bottom-left-radius: 6px; }
.msg.caller { border-bottom-right-radius: 6px; border-bottom-left-radius: 16px; }
.cmsg.system { box-shadow: none; }
.chat-item { border-radius: 12px; border-bottom: 0; margin-bottom: 2px; transition: background .12s; }
.chat-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.chat-view { border-radius: var(--radius); }
.chat-msgs { background: linear-gradient(180deg, var(--bg), var(--panel)); }

/* ---------- live call visual ---------- */
.call-icon { background: var(--grad); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent); }
.call-visual.listening .call-icon { background: linear-gradient(135deg, #12a46b, #34d399); box-shadow: 0 10px 30px rgba(18, 164, 107, .35); }
.call-visual.thinking .call-icon { background: linear-gradient(135deg, #e08a00, #fbbf24); }
.ring { border-color: var(--accent-2); }
.keypad button { border-radius: 12px; transition: background .12s, transform .08s; }
.keypad button:hover { background: var(--accent-soft); }
.keypad button:active { transform: scale(.95); }

/* ---------- workforce & charts ---------- */
.shift-chip { background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 12%, transparent)); font-weight: 550; }
.bar .ai, .sw.ai, .hbar .fill { background: var(--grad); }
.abar > span { background: linear-gradient(90deg, #12a46b, #34d399); }
.hbar .track, .progress, .abar { border-radius: 999px; }
.progress span { background: linear-gradient(90deg, #12a46b, #34d399); }

/* ---------- overlays ---------- */
.toast {
  background: rgba(20, 26, 46, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 20px; font-weight: 500;
  animation: toast-in .25s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.modal { background: rgba(10, 14, 26, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-box { box-shadow: var(--shadow-lg); border-radius: 20px; padding: 24px; animation: page-in .2s ease both; }
.ringer { border-radius: 18px; box-shadow: var(--shadow-lg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* ---------- sign-in ---------- */
.login-screen {
  background:
    radial-gradient(700px 400px at 15% 10%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, color-mix(in srgb, var(--accent-2) 30%, transparent), transparent 60%),
    linear-gradient(160deg, #0c1124, #151c3a);
}
.login-box { border: 1px solid rgba(255, 255, 255, .5); border-radius: 22px; padding: 34px 32px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); background: var(--panel); }
.big-logo { width: 56px; height: 56px; border-radius: 16px; }
.login-box .btn.primary { width: 100%; padding: 11px; font-size: 15px; }

@media (max-width: 800px) {
  .sidebar { width: 100%; padding: 10px; }
  .nav-group { display: none; }
  main { padding: 18px 16px 32px; }
  h1 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- AI features ---------- */
.ai-hero { background: linear-gradient(135deg, var(--panel) 40%, var(--accent-soft)); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.ai-box { background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 8%, transparent)); border: 1px dashed color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.ins-examples { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.ai-answer { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: var(--panel); border-left: 4px solid var(--accent); white-space: pre-wrap; box-shadow: var(--shadow-sm); }
.brief-head { font-size: 17px; font-weight: 650; margin: 4px 0 12px; }
.brief-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.brief-col { border-radius: 12px; padding: 10px 14px; border: 1px solid var(--line); }
.brief-col h3 { margin: 0 0 6px; }
.brief-col ul { margin: 0; padding-left: 18px; font-size: 14px; }
.brief-col.good { background: rgba(18, 164, 107, .06); } .brief-col.bad { background: rgba(229, 72, 77, .06); } .brief-col.act { background: var(--accent-soft); }
.topic-row { grid-template-columns: 170px 1fr 40px 260px; }
.chat-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px 10px 0; border-top: 1px solid var(--line); }
.chat-tools + .chat-reply { border-top: 0; }
.cmsg .tr { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
@media (max-width: 900px) { .brief-grid { grid-template-columns: 1fr; } .topic-row { grid-template-columns: 120px 1fr 32px; } .topic-row > :last-child { grid-column: 1 / -1; } }
.warn-box { border-color: rgba(229, 72, 77, .35); background: linear-gradient(135deg, #fdecec, #fff3f0); color: #7a1f22; }
@media (prefers-color-scheme: dark) { html:not([data-mode="light"]) .warn-box { background: #2c1416; color: #ffb3b5; } }
html[data-mode="dark"] .warn-box { background: #2c1416; color: #ffb3b5; }

/* ---------- knowledge base ---------- */
.kb-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.kb-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); box-shadow: var(--shadow-sm); }
.kb-stat b { color: var(--text); font-size: 15px; margin-right: 2px; }
.kb-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 6px 0 18px; }
.kb-tab { border: 0; background: none; font: inherit; font-weight: 550; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 10px 10px 0 0; display: inline-flex; gap: 6px; align-items: center; }
.kb-tab:hover { color: var(--text); background: var(--accent-soft); }
.kb-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.kb-count { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 7px; }
.kb-count:empty { display: none; }
.kb-add { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.kb-add-card { margin: 0; display: flex; flex-direction: column; gap: 4px; justify-content: center; text-align: left; padding: 18px 20px; min-height: 150px; }
.kb-add-ico { font-size: 26px; }
.kb-web-form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.kb-web-form input, .kb-web-form select { margin: 0; }
.kb-web-form .inline-form select { width: auto; flex: 1; }
.kb-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.kb-toolbar input[type=search] { flex: 1; min-width: 220px; margin: 0; padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23687089' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; }
.kb-toolbar select { width: auto; margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: none; font: inherit; font-size: 14px; padding: 8px 14px; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--grad); color: #fff; }
.kb-bulk { display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin-bottom: 10px; border-radius: 12px;
  background: linear-gradient(135deg, #fff1f1, #fff6f2); border: 1px solid rgba(229, 72, 77, .25); font-weight: 550; }
@media (prefers-color-scheme: dark) { html:not([data-mode="light"]) .kb-bulk { background: #2c1416; } }
html[data-mode="dark"] .kb-bulk { background: #2c1416; }
.kb-list-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.src-row { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 10px; transition: background .12s; }
.src-row:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.src-row.selected { background: var(--accent-soft); }
.src-row input[type=checkbox] { width: 18px; height: 18px; margin: 0; flex: none; }
.src-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex: none; background: var(--accent-soft); }
.src-ico.file { background: rgba(224, 138, 0, .12); }
.src-main { flex: 1; min-width: 0; }
.src-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.src-actions { display: flex; gap: 6px; flex: none; }
.site-pages { margin: 4px 0 12px 58px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--bg); border-radius: 0 12px 12px 0; }
.sp-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.sp-tools input { flex: 1; min-width: 200px; margin: 0; }
#sp-list { max-height: 360px; overflow-y: auto; }
.sp-row { display: flex; gap: 10px; align-items: center; padding: 6px 4px; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.sp-row input { width: 16px; height: 16px; margin: 0; flex: none; }
.sp-path { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-size { flex: none; font-size: 12px; }
#sp-more { margin-top: 8px; }
@media (max-width: 800px) {
  .kb-add { grid-template-columns: 1fr; }
  .site-pages { margin-left: 0; }
  .src-actions .btn { padding: 5px 8px; }
}
.act-form { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 6px; }
.act-out .ai-answer { margin-top: 8px; font-size: 13.5px; word-break: break-word; }
/* ---------- AI agents ---------- */
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.prof-card { margin: 0; }
.prof-card.off { opacity: .6; }
.prof-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.prof-avatar { width: 46px; height: 46px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.prof-meta { font-size: 13px; color: var(--muted); margin: 3px 0; }
.prof-role { font-size: 13px; margin-top: 8px; padding: 8px 10px; background: var(--bg); border-radius: 10px; }

/* ---------- feedback & satisfaction ---------- */
.fb-q { padding: 12px 0; border-bottom: 1px solid var(--line); }
.fb-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.fb-avg { font-size: 20px; font-weight: 750; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fb-dist { display: flex; gap: 8px; align-items: flex-end; height: 70px; margin: 18px 0 18px; }
.fb-bar { position: relative; width: 34px; height: 100%; display: flex; align-items: flex-end; }
.fb-bar span { display: block; width: 100%; background: var(--grad); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.fb-bar small { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.fb-bar em { position: absolute; top: -16px; left: 0; right: 0; text-align: center; font-size: 11px; font-style: normal; }
.fb-ans { font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.csat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.csat-block { background: var(--bg); border-radius: 14px; padding: 14px 16px; }
.csat-num { font-size: 34px; font-weight: 750; }
.csat-num small { font-size: 15px; color: var(--muted); font-weight: 500; }
.csat-stars { color: #f5a524; letter-spacing: 2px; }

/* ---------- test lab ---------- */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 18px; }
.lab-card { margin: 0; border-left: 4px solid var(--line); }
.lab-card.ok { border-left-color: var(--ok); }
.lab-card.bad { border-left-color: var(--bad); }
.lab-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.lab-txt { font-size: 13px; margin: 3px 0; }
.ver-diff { font-size: 13px; margin: 6px 0; }
.ver-old { background: rgba(229, 72, 77, .08); border-radius: 8px; padding: 4px 8px; margin: 2px 0; white-space: pre-wrap; text-decoration: line-through; opacity: .8; }
.ver-new { background: rgba(18, 164, 107, .08); border-radius: 8px; padding: 4px 8px; margin: 2px 0; white-space: pre-wrap; }

.lang-ticks { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.lang-ticks label.check { margin: 0; }

.name-check .row { display: flex; gap: 8px; align-items: center; }
.name-check .row input { flex: 1; }
#name-check-result { margin: 6px 0; }

.stats-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.stats-row .stat { background: var(--surface-2, rgba(127,127,127,.08)); border-radius: 12px; padding: 10px 14px; min-width: 96px; }
.stats-row .stat b { display: block; font-size: 1.35em; }
.stats-row .stat span { font-size: .85em; opacity: .75; }

/* ---------- grouped navigation: tab row above the page ---------- */
.tabbars { margin: -6px 0 18px; }
.tabbar { display: none; gap: 4px; padding: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-sm); overflow-x: auto; width: max-content; max-width: 100%; }
.tabbar.shown { display: flex; }
.tabbar a { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 8px 14px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 550; font-size: 14px; transition: background .15s, color .15s; }
.tabbar a:hover { color: var(--text); background: var(--accent-soft); }
.tabbar a.active { background: var(--grad); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.tabbar a.hidden { display: none; }
.tabbar .badge { background: #ff5d6c; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.tabbar .badge:empty { display: none; }
.sidebar .group-badge:empty { display: none; }

/* ---------- long pages: chips show one part at a time ---------- */
.section-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; position: sticky; top: 0; z-index: 5;
  padding: 10px 0; background: linear-gradient(var(--bg) 70%, transparent); }
.section-chips .chip { padding: 7px 14px; font-weight: 550; }
.section-chips .chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.section-hidden { display: none !important; }

/* sidebar: a little more air now that there are fewer entries */
.sidebar a[data-group] { padding-top: 10px; padding-bottom: 10px; }
@media (max-width: 800px) {
  .tabbars { margin-top: 0; }
  .tabbar { width: 100%; }
  .section-chips { position: static; }
}

/* ---------- Inbox (agent workspace): conversations · timeline · dialer ---------- */
main:has(#page-chats.active) { max-width: none; }
#page-chats { position: relative; }
.ws { display: grid; grid-template-columns: 300px minmax(0, 1fr) 290px; gap: 14px; height: calc(100vh - 170px); min-height: 560px; }
.ws > .card, .ws-side > .card { margin: 0; }
.ws-list, .ws-main { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.ws-search { padding: 12px 12px 6px; }
.ws-search input { width: 100%; }
.ws-boxes { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.ws-boxes button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 4px; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ws-boxes button.active { color: var(--accent); border-bottom-color: var(--accent); }
.ws-boxes .cnt:not(:empty) { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 3px; }
.ws-items { overflow-y: auto; flex: 1; }
.pad { padding: 14px; }
.ws-item { display: flex; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent;
  padding: 11px 12px; cursor: pointer; font: inherit; color: var(--text); }
.ws-item:hover { background: var(--accent-soft); }
.ws-item.active { background: var(--accent-soft); border-left-color: var(--accent); }
.ws-item.late { border-left-color: var(--bad); }
.ws-item.unread b { font-weight: 800; }
.ws-av { position: relative; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--grad); color: #fff; }
.ws-av i { position: absolute; right: -3px; bottom: -3px; font-style: normal; font-size: 12px; line-height: 1; }
.ws-av i.dot { width: 11px; height: 11px; border: 2px solid var(--panel); border-radius: 50%; }
.ws-av.big { width: 46px; height: 46px; font-size: 18px; }
.ws-av.sm { width: 30px; height: 30px; font-size: 13px; }
.ws-it { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ws-it-top { display: flex; justify-content: space-between; gap: 6px; }
.ws-it-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-it-top small, .ws-it-last { color: var(--muted); font-size: 12.5px; }
.ws-it-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-it-flags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ws-it-flags .pill { font-size: 11px; padding: 1px 7px; }
.ws-unread { margin-left: auto; background: #ff5d6c; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.ws-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ws-who { display: flex; flex-direction: column; min-width: 0; }
.ws-who small { color: var(--muted); }
.ws-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.tag { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 600; }
.tag a { margin-left: 4px; cursor: pointer; opacity: .6; }
.grow { flex: 1; }
.ws-actions { flex-wrap: wrap; }
.btn.ok { background: var(--ok); color: #fff; border-color: transparent; }
.btn.danger { background: var(--bad); color: #fff; border-color: transparent; }
.ws-timeline { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, transparent, var(--accent-soft) 300%); }
.ws-msg { max-width: 72%; padding: 9px 13px; border-radius: 14px; box-shadow: var(--shadow-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.ws-msg small { display: block; font-size: 11.5px; font-weight: 650; opacity: .75; margin-bottom: 2px; }
.ws-msg .ws-ts { font-weight: 400; margin: 4px 0 0; text-align: right; }
.ws-msg.them { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ws-msg.us { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.ws-msg.us.ai { background: linear-gradient(135deg, #1fa37a, #12a46b); }
.ws-msg.note { align-self: flex-end; background: #fff6c7; color: #4a3b00; border: 1px dashed #e0c33a; }
@media (prefers-color-scheme: dark) { html:not([data-mode="light"]) .ws-msg.note { background: #3a320f; color: #ffe58a; border-color: #8a7420; } }
html[data-mode="dark"] .ws-msg.note { background: #3a320f; color: #ffe58a; border-color: #8a7420; }
.ws-sys { align-self: center; font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.ws-callcard { align-self: flex-end; width: min(440px, 90%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.ws-callcard.in { align-self: flex-start; }
.ws-cc-head { font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ws-callcard audio { width: 100%; height: 34px; margin-bottom: 8px; }
.ws-cc-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 13px; margin-bottom: 8px; }
.ws-cc-times small { display: block; color: var(--muted); font-size: 11px; }
.ws-cc-sum { font-size: 13px; background: var(--accent-soft); border-radius: 10px; padding: 7px 10px; margin-bottom: 8px; }
.ws-callcard .ws-ts { display: block; text-align: right; color: var(--muted); font-size: 11px; margin-top: 6px; }
.ws-composer { border-top: 1px solid var(--line); padding: 8px 14px 12px; position: relative; }
.ws-composer.note textarea { background: #fffbe6; }
@media (prefers-color-scheme: dark) { html:not([data-mode="light"]) .ws-composer.note textarea { background: #2b260d; } }
html[data-mode="dark"] .ws-composer.note textarea { background: #2b260d; }
.ws-ctabs { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ws-ctabs button { background: none; border: 0; padding: 4px 8px; border-bottom: 2px solid transparent; font: inherit; font-size: 13px; font-weight: 650; color: var(--muted); cursor: pointer; }
.ws-ctabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.ws-composer textarea { width: 100%; resize: vertical; min-height: 64px; }
.ws-cfoot { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.small { font-size: 12px; }
.ws-slash { position: absolute; bottom: 100%; left: 14px; right: 14px; max-height: 260px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 10; }
.ws-slash button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; font: inherit; cursor: pointer; color: var(--text); }
.ws-slash button:hover { background: var(--accent-soft); }
.ws-slash small { display: block; color: var(--muted); }
.ws-side { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; min-height: 0; }
.ws-dnum { display: flex; gap: 6px; align-items: center; }
.ws-dnum .cc { font-weight: 700; color: var(--muted); }
.ws-dnum input { flex: 1; font-size: 18px; letter-spacing: .04em; }
.ws-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.ws-keys button { background: none; border: 1px solid var(--line); border-radius: 12px; padding: 7px 0; font: inherit; font-size: 20px; font-weight: 600; cursor: pointer; color: var(--text); line-height: 1.1; }
.ws-keys button:hover { background: var(--accent-soft); border-color: var(--accent); }
.ws-keys small { display: block; font-size: 9.5px; letter-spacing: .1em; color: var(--muted); min-height: 11px; }
.ws-dial-btns { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ws-call { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--ok); color: #fff; font-size: 22px; cursor: pointer; box-shadow: 0 6px 18px rgba(18, 164, 107, .35); }
.ws-call.hang { background: var(--bad); box-shadow: 0 6px 18px rgba(229, 72, 77, .35); transform: rotate(135deg); }
.ws-incall { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: var(--accent-soft); border-radius: 12px; padding: 8px 10px; margin-bottom: 10px; }
.ws-stats h3 { margin: 4px 0 8px; font-size: 14px; }
.ws-stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.ws-stat-row.one { grid-template-columns: 1fr; }
.ws-stat { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; }
.ws-stat.out { border-left-color: var(--accent-2); }
.ws-stat.chat { border-left-color: var(--ok); }
.ws-stat span { font-size: 11.5px; color: var(--muted); }
.ws-stat b { font-size: 20px; }
.ws-stat small { color: var(--muted); }
.ws-status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ws-status-grid .st { border-radius: 10px; padding: 6px 10px; border-left: 4px solid var(--ok); background: var(--accent-soft); display: flex; flex-direction: column; }
.ws-status-grid .st.busy { border-left-color: var(--bad); }
.ws-status-grid .st.wrapup { border-left-color: var(--accent-2); }
.ws-status-grid .st.break { border-left-color: var(--warn); }
.ws-status-grid span { font-size: 11.5px; color: var(--muted); }
.ws-pop { position: absolute; z-index: 30; width: 330px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 10px; }
.ws-pop-tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.ws-pop-tabs button { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.ws-pop-tabs button.active { background: var(--grad); color: #fff; border-color: transparent; }
.ws-pop-tabs label { margin: 0 0 0 auto; font-size: 12.5px; }
.ws-pop input[type=search] { width: 100%; margin-bottom: 6px; }
.ws-tlist { max-height: 260px; overflow-y: auto; }
.ws-tlist button { display: flex; gap: 10px; align-items: center; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 4px; cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.ws-tlist button:hover { background: var(--accent-soft); }
.ws-tlist small { display: block; color: var(--muted); font-size: 12px; }
.ws-tconfirm { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.ws-tconfirm .btn { width: 100%; }
.ws-contact h3 { margin: 4px 0 10px; }
.ws-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13.5px; margin: 0 0 10px; }
.ws-dl dt { color: var(--muted); }
.ws-dl dd { margin: 0; }
@media (max-width: 1250px) { .ws { grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: 640px auto; height: auto; } .ws-side { grid-column: 1 / -1; flex-direction: row; overflow: visible; } .ws-side > .card { flex: 1; } }
@media (max-width: 800px) { .ws { grid-template-columns: 1fr; height: auto; } .ws-list { max-height: 50vh; } .ws-main { min-height: 70vh; } .ws-side { flex-direction: column; } }

/* ---------- call intelligence ---------- */
:root { --m-pos: #1baf7a; --m-neu: #2a78d6; --m-neg: #eda100; --m-ang: #eb6834; }
@media (prefers-color-scheme: dark) { html:not([data-mode="light"]) { --m-pos: #199e70; --m-neu: #3987e5; --m-neg: #c98500; --m-ang: #d95926; } }
html[data-mode="dark"] { --m-pos: #199e70; --m-neu: #3987e5; --m-neg: #c98500; --m-ang: #d95926; }
.m-pos { --c: var(--m-pos); } .m-neu { --c: var(--m-neu); } .m-neg { --c: var(--m-neg); } .m-ang { --c: var(--m-ang); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 7px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--grad); color: #fff; }
.intel-filters { align-items: center; }
.intel-filters select { width: auto; }
.intel-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.kpi h3 { margin: 0; font-size: 13.5px; color: var(--muted); font-weight: 650; }
.kpi-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.kpi-pair > div { display: flex; flex-direction: column; }
.kpi-pair small { color: var(--muted); font-size: 12px; }
.kpi-mood { display: flex; gap: 12px; align-items: center; }
.big-emoji { font-size: 44px; }
.kpi-mood ul, .kpi-list { list-style: none; margin: 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.kpi-list li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; }
.kpi-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-list small { color: var(--muted); }
.chg { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.chg.up { color: var(--ok); } .chg.down { color: var(--bad); }
.est { font-size: 10.5px; border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; font-weight: 600; }
.kpi-ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center; margin: 0 auto;
  background: radial-gradient(closest-side, var(--panel) 74%, transparent 75%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); }
.kpi-ring b { font-size: 20px; } .kpi-ring small { font-size: 11px; color: var(--muted); }
.intel-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.intel-chart-head h2 { margin: 0; }
.intel-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin: 10px 0 4px; }
.intel-chart { position: relative; }
.intel-chart svg { display: block; overflow: visible; }
.intel-chart .g { stroke: var(--line); stroke-width: 1; }
.intel-chart .ax { fill: var(--muted); font-size: 11px; }
.intel-chart .ln { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.intel-chart .dt { fill: var(--c); stroke: var(--panel); stroke-width: 2; }
.intel-chart .lbl { fill: var(--text); font-size: 11.5px; font-weight: 600; }
.intel-chart .xh { stroke: var(--muted); stroke-dasharray: 3 3; }
.intel-chart .tip { position: absolute; top: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 8px 10px; font-size: 12.5px; pointer-events: none; min-width: 150px; }
.crit { display: flex; flex-direction: column; gap: 8px; }
.crit-row { display: grid; grid-template-columns: minmax(160px, 2fr) 3fr auto auto; gap: 10px; align-items: center; font-size: 13.5px; }
.crit .bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.crit .bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
@media (max-width: 800px) { .crit-row { grid-template-columns: 1fr; } }

/* WhatsApp templates */
.ws-search { display: flex; gap: 6px; }
.ws-search input { flex: 1; min-width: 0; }
.ws-composer.wa-closed textarea { background: var(--accent-soft); }
.tp-preview { background: #e7fbe4; color: #102a12; border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
@media (prefers-color-scheme: dark) { html:not([data-mode="light"]) .tp-preview { background: #10301a; color: #d9f7dc; } }
html[data-mode="dark"] .tp-preview { background: #10301a; color: #d9f7dc; }
.tp-preview mark { background: #ffe58a; border-radius: 4px; padding: 0 3px; }
.tp-btn { display: inline-block; margin: 8px 6px 0 0; padding: 4px 10px; border-radius: 8px; border: 1px solid rgba(0,0,0,.15); font-size: 13px; }

.est.ok { color: var(--ok); border-color: currentColor; }

/* files in conversations */
.ws-img { display: block; max-width: 260px; max-height: 260px; border-radius: 10px; margin: 4px 0; object-fit: cover; }
.ws-msg audio { width: 240px; height: 34px; margin: 4px 0; display: block; }
.ws-file { display: inline-flex; gap: 6px; align-items: center; background: rgba(127,127,127,.12); border-radius: 10px; padding: 6px 10px; margin: 4px 0; color: inherit; text-decoration: none; }
.ws-msg.us .ws-file { background: rgba(255,255,255,.18); }
.ws-filechip { background: var(--accent-soft); border-radius: 10px; padding: 6px 10px; margin-bottom: 6px; font-size: 13px; }
.ws-filechip a { cursor: pointer; margin-left: 6px; }

/* license */
.license-lock { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(700px 400px at 15% 10%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%), linear-gradient(160deg, #0c1124, #151c3a); }
.license-lock .login-box { max-width: 440px; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.license-banner { background: #fff4d6; color: #6b4b00; border: 1px solid #f0d38a; border-radius: 12px; padding: 8px 14px; margin-bottom: 14px; font-weight: 600; }
.license-banner.bad { background: #ffe1e1; color: #7a1212; border-color: #f2a3a3; }
@media (prefers-color-scheme: dark) { html:not([data-mode="light"]) .license-banner { background: #3a2f0f; color: #ffe08a; border-color: #6b5520; } html:not([data-mode="light"]) .license-banner.bad { background: #3a1414; color: #ffb3b3; border-color: #6b2020; } }
html[data-mode="dark"] .license-banner { background: #3a2f0f; color: #ffe08a; border-color: #6b5520; } html[data-mode="dark"] .license-banner.bad { background: #3a1414; color: #ffb3b3; border-color: #6b2020; }

/* customers */
.cu-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; }
.cu-list { padding: 12px; max-height: calc(100vh - 220px); overflow-y: auto; }
.cu-list input[type=search] { width: 100%; margin-bottom: 6px; }
.cu-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 9px 6px; cursor: pointer; font: inherit; color: var(--text); }
.cu-item:hover, .cu-item.active { background: var(--accent-soft); }
.cu-item small { display: block; }
.cu-history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cu-history li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
@media (max-width: 900px) { .cu-layout { grid-template-columns: 1fr; } }

/* call flow builder */
main:has(#page-flow.active) { max-width: none; }
.fl-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.fl-canvas { overflow: auto; padding: 20px; min-height: 480px; max-height: calc(100vh - 220px);
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.fl-panel { position: sticky; top: 12px; }
.fl-panel textarea, .fl-panel input, .fl-panel select { width: 100%; }
.fl-start { display: inline-block; background: var(--grad); color: #fff; border-radius: 999px; padding: 6px 16px; font-weight: 700; }
.fl-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 230px; }
.fl-add { position: relative; display: flex; flex-direction: column; align-items: center; width: 230px; }
.fl-add::before { content: ""; width: 2px; height: 10px; background: var(--line); }
.fl-plus { width: 24px; height: 24px; border-radius: 50%; border: 1px dashed var(--accent); background: var(--panel); color: var(--accent);
  cursor: pointer; font-size: 14px; line-height: 1; opacity: .55; }
.fl-plus:hover { opacity: 1; background: var(--accent-soft); }
.fl-add::after { content: ""; width: 2px; height: 10px; background: var(--line); }
.fl-node { width: 230px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px;
  padding: 8px 10px; cursor: pointer; box-shadow: var(--shadow-sm); }
.fl-node:hover { box-shadow: var(--shadow); }
.fl-node.sel { outline: 2px solid var(--accent); }
.fl-node-head { display: flex; align-items: center; gap: 6px; }
.fl-node-head button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 3px; font-size: 12px; opacity: 0; }
.fl-node:hover .fl-node-head button, .fl-node.sel .fl-node-head button { opacity: 1; }
.fl-node-sum { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.fl-node.t-menu { border-left-color: #2a78d6; } .fl-node.t-hours { border-left-color: #eda100; } .fl-node.t-transfer { border-left-color: #12a46b; }
.fl-node.t-ai { border-left-color: #8b5cf6; } .fl-node.t-hangup { border-left-color: #e5484d; } .fl-node.t-callback { border-left-color: #1baf7a; }
.fl-branches { display: flex; gap: 14px; margin: 8px 0 0 14px; padding-left: 12px; border-left: 2px solid var(--line); }
.fl-branch { border-top: 2px solid var(--line); padding-top: 6px; }
.fl-branch-head { font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.fl-key { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: #2a78d6; color: #fff; font-size: 12px; }
.fl-end { font-size: 12px; color: var(--muted); margin: 4px 0 0 6px; }
.fl-warn { font-size: 12px; color: var(--bad); margin: 4px 0; }
.fl-pick { position: absolute; top: 34px; left: 0; z-index: 20; width: 280px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px; }
.fl-pick button { display: grid; grid-template-columns: 26px 1fr; text-align: left; gap: 0 6px; border: 0; background: none; padding: 6px; border-radius: 8px;
  cursor: pointer; font: inherit; color: var(--text); }
.fl-pick button:hover { background: var(--accent-soft); }
.fl-pick button span { grid-row: span 2; font-size: 18px; } .fl-pick small { color: var(--muted); }
.fl-opt { display: grid; grid-template-columns: 44px 1fr auto; gap: 6px; margin-bottom: 6px; }
.fl-sim { border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; }
.fl-sim-log { height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.fl-sim-log .sim-ai { align-self: flex-start; background: var(--accent-soft); border-radius: 12px; padding: 6px 10px; max-width: 85%; }
.fl-sim-log .sim-you { align-self: flex-end; background: var(--grad); color: #fff; border-radius: 12px; padding: 6px 10px; }
.fl-sim-log .sim-sys { align-self: center; font-size: 12px; color: var(--muted); }
.fl-sim-log .sim-end { align-self: center; font-weight: 700; }
.fl-sim-ctl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (max-width: 1100px) { .fl-wrap { grid-template-columns: 1fr; } .fl-panel { position: static; } }

.appearance-link { display: block; padding: 6px 12px; font-size: 13px; color: var(--side-text); cursor: pointer; opacity: .85; }
.appearance-link:hover { opacity: 1; text-decoration: underline; }
