/* The admin.html page's base styles, loaded before theme.css. */
:root { --bg:#f4f5f7; --panel:#fff; --line:#e3e5ea; --text:#1c1f26; --muted:#6b7280; --accent:#5b3fd6; --accent-soft:#efeaff; --cust:#eef1f6; --danger:#d9364c; --ok:#178a4c; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#14161a; --panel:#1d2026; --line:#2c3038; --text:#e8eaee; --muted:#9aa1ad; --accent:#9d87ff; --accent-soft:#2a2545; --cust:#272b33; --danger:#ff6b7f; --ok:#4cc38a; }
}
* { box-sizing:border-box; }
body { margin:0; font:14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background:var(--bg); color:var(--text); height:100vh; display:flex; }
nav { width:210px; background:var(--panel); border-right:1px solid var(--line); padding:14px 10px; display:flex; flex-direction:column; gap:4px; flex-shrink:0; }
nav h1 { font-size:15px; margin:4px 8px 12px; }
nav button, nav a { text-align:left; border:0; background:none; color:var(--text); padding:9px 10px; border-radius:8px; font:inherit; cursor:pointer; text-decoration:none; display:block; }
nav button.on { background:var(--accent-soft); color:var(--accent); font-weight:600; }
nav .sp { flex:1; }
nav small { color:var(--muted); padding:0 10px 6px; }
#acctTable th, #acctTable td { width:auto; padding:8px 14px 8px 0; white-space:nowrap; vertical-align:middle; } #acctTable select, #acctTable button { padding:5px 9px; font-size:13px; }
main { flex:1; min-width:0; padding:16px; overflow:auto; display:flex; flex-direction:column; }
.tab { display:none; flex:1; min-height:0; flex-direction:column; gap:12px; }
.tab.on { display:flex; }
h2 { font-size:18px; margin:0; }
p.hint { color:var(--muted); margin:0; max-width:820px; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:12px; }
.row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.split { display:grid; grid-template-columns:340px 1fr; gap:12px; flex:1; min-height:0; }
.list { overflow:auto; }
.item { padding:10px 14px; border-bottom:1px solid var(--line); cursor:pointer; }
.item:hover, .item.sel { background:var(--accent-soft); }
.item b { display:block; }
.item small { color:var(--muted); display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pill { display:inline-block; font-size:11px; padding:1px 7px; border-radius:10px; background:var(--cust); color:var(--muted); margin-left:6px; font-weight:400; }
.pill.human { background:var(--accent-soft); color:var(--accent); } .pill.queued { background:#fde9c8; color:#8a5a00; }
button { font:inherit; border:1px solid var(--line); background:var(--panel); color:var(--text); border-radius:8px; padding:7px 12px; cursor:pointer; }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button.danger { color:var(--danger); border-color:var(--danger); }
input, textarea, select { font:inherit; color:var(--text); background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:8px 10px; }
textarea { width:100%; resize:vertical; }
label { display:block; font-weight:600; margin:10px 0 4px; }
label small { font-weight:400; color:var(--muted); }
.pad { padding:14px; }
.msgs { flex:1; overflow:auto; padding:14px; display:flex; flex-direction:column; gap:8px; }
.m { max-width:76%; padding:8px 11px; border-radius:12px; white-space:pre-wrap; overflow-wrap:anywhere; }
.m small { display:block; color:var(--muted); font-size:11px; margin-bottom:2px; }
.m.customer { background:var(--cust); align-self:flex-start; }
.m.bot { align-self:flex-end; border:1px solid var(--line); }
.m.agent { align-self:flex-end; background:var(--accent); color:#fff; } .m.agent small { color:#e6e0ff; }
.m.system { align-self:center; color:var(--muted); font-size:12px; text-align:center; max-width:90%; }
.m.note { align-self:flex-end; background:#fff8e1; border:1px dashed #f0dfa8; color:#3d3413; } .m.note small { color:#7a6a2f; }
.m img { max-width:260px; border-radius:8px; display:block; margin-top:4px; }
.empty { color:var(--muted); text-align:center; margin:auto; padding:24px; }
#msg { min-height:1.3em; } #msg.err { color:var(--danger); } #msg.ok { color:var(--ok); }
table { border-collapse:collapse; width:100%; } td, th { text-align:left; padding:4px 6px 4px 0; vertical-align:top; } th { color:var(--muted); font-weight:500; font-size:12px; }
td input, td select { width:100%; }
table.grid { table-layout:fixed; } table.grid tr { cursor:pointer; } table.grid th, table.grid td { padding:12px 16px !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
table.grid th:nth-child(1) { width:22%; } table.grid th:nth-child(2) { width:34%; } table.grid tr:hover td { background:var(--accent-soft); }
/* API connector editor: one section at a time, parameters as a compact table */
#tab-tools.editing > .pagehead, #tab-tools.editing > p.hint, #tab-tools.editing #toolList, #tab-bots.editing > .pagehead, #tab-bots.editing > p.hint, #tab-bots.editing #botList, #tab-bots.editing #botCreate { display:none; }
#tab-tools .split, #tab-bots .split { grid-template-columns:1fr; }
#tab-tools:not(.editing) .editor, #tab-bots:not(.editing) #botEdit { display:none; }
.editor { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.editor .crumb { padding:16px 20px 0; font-size:15px; } .editor .crumb span { color:var(--muted); }
.editor .subtabs { display:flex; gap:4px; padding:12px 16px 0; border-bottom:1px solid var(--line); }
.editor .subtabs button { border:0; border-bottom:2px solid transparent; border-radius:0; padding:8px 12px 10px; color:var(--muted); background:none; }
.editor .subtabs button.on { color:var(--text); border-bottom-color:var(--text); font-weight:500; }
.editor .panes { flex:1; overflow:auto; padding:8px 20px 20px; }
.editor .pane { max-width:980px; }
.editor .foot { display:flex; gap:8px; padding:12px 20px; border-top:1px solid var(--line); }
.editor .two { display:grid; grid-template-columns:140px 1fr; gap:12px; } .editor .two select { width:100%; }
.editor .sect { font-size:11.5px; font-weight:500; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:22px 0 4px; }
.editor .sect:first-child { margin-top:12px; }
.editor p.hint { margin:0 0 10px; }
.editor .code { font-family:ui-monospace,Menlo,monospace; font-size:12.5px; line-height:1.5; }
.editor .foot a { align-self:center; font-size:13.5px; }
.pbox { border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.prow { display:grid; grid-template-columns:minmax(120px,1.1fr) minmax(130px,1.1fr) 120px 70px minmax(160px,2.4fr) 32px; gap:8px; align-items:center; padding:6px 10px; }
.phead { background:var(--bg); color:var(--muted); font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; padding:9px 10px; border-bottom:1px solid var(--line); }
.pitem { border-bottom:1px solid var(--line); } .pitem:last-child { border-bottom:0; }
.prow input:not([type=checkbox]), .prow select { width:100%; padding:6px 8px; font-size:13px; border-color:transparent; background:transparent; }
.prow input:not([type=checkbox]):hover, .prow select:hover, .prow input:not([type=checkbox]):focus, .prow select:focus { border-color:var(--line); background:var(--panel); }
.prow .c { text-align:center; }
.prow .preview { border:0; background:none; text-align:left; padding:6px 8px; font-weight:400; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; width:100%; }
.prow .preview.muted { color:var(--muted); }
.prow .x { border:0; background:none; color:var(--muted); font-size:18px; line-height:1; padding:2px 6px; } .prow .x:hover { color:var(--danger); background:none; }
.pdetail { padding:0 10px 10px; } .pdetail textarea { font-size:13px; }
button.link { border:0; background:none; padding:8px 0; color:var(--text); font-weight:500; } button.link:hover { background:none; text-decoration:underline; }
.call { padding:12px 0; border-bottom:1px solid var(--line); } .call pre { margin-top:6px; max-height:160px; }
#info th { width:45%; } #info td { width:auto; }
#agentTable th, #agentTable td { width:auto; padding:6px 14px 6px 0; white-space:nowrap; vertical-align:middle; } #agentTable tr:hover td { background:var(--accent-soft); }
#usage th, #usage td { width:auto; padding-right:14px; white-space:nowrap; }
pre { background:var(--cust); padding:10px; border-radius:8px; overflow:auto; max-height:240px; white-space:pre-wrap; margin:8px 0 0; }
/* attendance report and team settings */
.tiles { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; flex:none; }
.tile { border:1px solid var(--line); border-radius:12px; padding:14px 16px; min-width:0; }
.tile .n { font-size:26px; font-weight:600; line-height:1.1; } .tile .l { color:var(--muted); font-size:12.5px; margin-top:2px; display:flex; align-items:center; gap:6px; }
.tile .names { color:var(--muted); font-size:12.5px; margin-top:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dot { width:8px; height:8px; border-radius:50%; display:inline-block; background:var(--muted); flex:none; } .dot.ok { background:var(--ok); } .dot.br { background:#d39a2c; } .dot.id { background:var(--danger); }
.cardhead { display:flex; align-items:center; gap:12px; padding:14px 16px; border-bottom:1px solid var(--line); flex-wrap:wrap; } .cardhead .hint { color:var(--muted); font-size:13px; }
table.report th, table.report td { padding:10px 12px !important; white-space:nowrap; vertical-align:middle; } table.report td.num, table.report th.num { text-align:right; font-variant-numeric:tabular-nums; }
table.report tbody tr { cursor:pointer; } table.report tbody tr:hover td, table.report tbody tr.sel td { background:var(--accent-soft); }
table.report .who { display:flex; align-items:center; gap:10px; } table.report .who .avatar { width:28px; height:28px; font-size:11px; } table.report .who small { display:block; color:var(--muted); font-size:12px; }
.stack { display:flex; height:8px; width:84px; border-radius:999px; overflow:hidden; background:var(--accent-soft); } .stack i { display:block; height:100%; } .stack .ok, .key.ok { background:var(--ok); } .stack .br, .key.br { background:#d39a2c; } .stack .id, .key.id { background:var(--danger); }
.key { display:inline-block; width:10px; height:10px; border-radius:3px; margin:0 2px 0 8px; vertical-align:-1px; }
.state { display:inline-flex; align-items:center; gap:6px; }
.detail { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(260px,1fr); } .detail > div:first-child { border-right:1px solid var(--line); }
.timeline { padding:14px 16px; } .tl-title { font-weight:600; margin-bottom:10px; }
.tl { display:grid; grid-template-columns:104px 1fr auto; gap:10px; padding:7px 0; border-bottom:1px solid var(--line); font-size:13.5px; align-items:center; } .tl:last-child { border-bottom:0; } .tl time { color:var(--muted); font-variant-numeric:tabular-nums; } .tl small { color:var(--muted); }
.cards2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; max-width:1100px; } .cards2 .wide { grid-column:1 / -1; } .cards2 .card { display:flex; flex-direction:column; gap:12px; } .cards2 p.hint { margin:0; }
.field { display:grid; grid-template-columns:minmax(110px, 190px) 1fr; gap:12px; align-items:center; } .field > span { color:var(--muted); font-size:13px; }
.row.end { justify-content:flex-end; margin-top:auto; }
.daychip { border-radius:999px; padding:5px 12px; font-size:13px; color:var(--muted); } .daychip.on { background:var(--accent); border-color:var(--accent); color:var(--on-accent, #fff); }
.tag { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); border-radius:999px; padding:4px 6px 4px 12px; font-size:13px; } .tag button { border:0; background:none; padding:0 6px; color:var(--muted); font-size:16px; line-height:1; } .tag button:hover { color:var(--danger); background:none; }
.switch { display:flex; align-items:center; gap:10px; font-weight:400; margin:0; cursor:pointer; } .switch input { position:absolute; opacity:0; width:0; height:0; }
.switch i { width:34px; height:20px; border-radius:999px; background:var(--line); position:relative; flex:none; transition:background .15s; } .switch i::after { content:""; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%; background:var(--panel); transition:left .15s; }
.switch input:checked + i { background:var(--ok); } .switch input:checked + i::after { left:16px; } .switch input:disabled + i { opacity:.5; }
.switchlist { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 28px; } .switchlist .switch { padding:9px 0; border-bottom:1px solid var(--line); }
.bars { display:grid; grid-template-columns:minmax(160px,280px) 1fr 48px; gap:8px 14px; align-items:center; font-size:13.5px; max-width:820px; } .bars .b { height:8px; border-radius:999px; background:var(--accent-soft); overflow:hidden; } .bars .b i { display:block; height:100%; background:var(--text); border-radius:999px; opacity:.75; } .bars .n { text-align:right; font-variant-numeric:tabular-nums; color:var(--muted); }
@media (max-width:1100px) { .tiles { grid-template-columns:repeat(2,1fr); } .cards2, .detail, .switchlist { grid-template-columns:1fr; } .detail > div:first-child { border-right:0; border-bottom:1px solid var(--line); } }
.hidden { display:none !important; }
/* WhatsApp balance banner (balance.ts): red when messages are not going out, amber when the balance is low. */
.wabanner { margin:0 0 12px; padding:10px 14px; border-radius:10px; font-weight:600; background:#fde8e8; color:#8a1c1c; border:1px solid #f3b4b4; }
.wabanner.warn { background:#fff4e0; color:#7a4a00; border-color:#f1d29a; }
@media (max-width: 900px) { body { flex-direction:column; height:auto; } nav { width:auto; flex-direction:row; flex-wrap:wrap; } .split { grid-template-columns:1fr; } }
.m .quote { border-left:3px solid var(--accent, #7c83ff); background:rgba(127,127,127,.12); border-radius:6px; padding:4px 8px; margin:2px 0 6px; font-size:12.5px; color:var(--muted); cursor:pointer; white-space:normal; }
.m .quote b { font-weight:600; }
.m.flash { outline:2px solid var(--accent, #7c83ff); outline-offset:2px; }
