/* DialClient admin panel */
.adm-tag { font-size: 11px; font-weight: 700; background: var(--warn-soft); color: var(--warn); padding: 2px 6px; border-radius: 6px; margin-left: 4px; vertical-align: middle; }
.top-title { font-size: 16px; }
.side-nav a[hidden], .side-nav .count[hidden] { display: none !important; }
.muted { color: var(--muted); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters .feed-search { flex: 1; min-width: 220px; }
.filters .feed-search input { width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
.tbl-wrap { overflow-x: auto; }
.biz-table td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.biz-table tr[data-u] { cursor: pointer; }
/* Users table: each cell is a short stack of lines, never one word per line (scrolls sideways on small screens) */
.users-table { min-width: 1080px; }
.users-table td { vertical-align: top; padding-top: 14px; padding-bottom: 14px; }
.users-table .chip { white-space: nowrap; }
.users-table td:nth-child(1) { min-width: 220px; }
.users-table td:nth-child(3) { min-width: 130px; }
.users-table td:nth-child(4) { min-width: 230px; }
.users-table td:nth-child(5) { min-width: 210px; }
.users-table td:nth-child(n+6) { white-space: nowrap; }
.ut-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ut-name .chip { height: 20px; font-size: 11px; padding: 0 7px; }
.ut-warn { color: var(--warn) !important; }
.ut-plan .chip { margin-bottom: 2px; }
.ut-leads { white-space: nowrap; }
.ut-stats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ut-st { font-size: 12px; color: var(--muted); background: var(--surface-2, rgba(127,127,127,.08)); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.ut-st b { color: var(--ink); font-weight: 600; }
.ut-agent { font-size: 12px; color: var(--muted); margin-top: 6px; }
.ut-meter { margin-bottom: 8px; }
.ut-mh { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ut-mh b { color: var(--ink); font-weight: 600; }
.ut-meter i { display: block; height: 5px; border-radius: 3px; background: var(--border); margin-top: 4px; overflow: hidden; }
.ut-meter em { display: block; height: 100%; background: var(--primary); border-radius: 3px; min-width: 2px; }
.ut-meter em.hi { background: var(--danger, #dc2626); }
.ut-lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td .ut-lbl:not(:first-child) { margin-top: 8px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0; color: var(--muted); font-size: 13px; }
.chart14 { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; height: 200px; align-items: end; }
.c14 { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.c14-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; gap: 2px; }
.c14-bars span { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.b-l, .lg-l { background: var(--primary); } .b-a, .lg-a { background: var(--success); } .b-s, .lg-s { background: var(--warn); }
.c14 small { color: var(--muted); font-size: 11px; }
.legend { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.sys { display: grid; gap: 0; padding: 4px 18px; }
.sys-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.sys-row:last-child { border-bottom: 0; }
.sys-row b.ok { color: var(--success); } .sys-row b.warn { color: var(--warn); }
.drawer .dr-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer .dr-h small { display: block; color: var(--muted); }
.drawer .dr-b { padding: 16px 18px; overflow: auto; }
.drawer h4 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 6px 0; font-size: 13.5px; border-bottom: 1px dashed var(--border); }
.kv span { color: var(--muted); } .kv b { font-weight: 600; word-break: break-word; }
.dr-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.adm-lead { margin-bottom: 12px; }
.adm-lead p { margin: 8px 0; white-space: pre-wrap; font-size: 14px; color: var(--ink-2); }
.al-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .al-top small { margin-left: auto; color: var(--muted); }
.al-meta { font-size: 13px; margin-top: 4px; } .al-meta a { color: var(--primary-text); font-weight: 600; }
.msg-row { margin-bottom: 10px; } .msg-row.unread { border-left: 3px solid var(--primary); }
.msg-row .msg-top span { float: right; color: var(--muted); font-size: 12.5px; } .msg-row p { white-space: pre-wrap; }
.tk { margin-bottom: 10px; } .tk summary { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; cursor: pointer; list-style: none; }
.tk summary small { margin-left: auto; color: var(--muted); }
.tk-thread { display: grid; gap: 10px; padding-top: 12px; }
.tk-msg { padding: 10px 12px; border-radius: 10px; background: var(--bg-soft); } .tk-msg.admin { background: var(--primary-soft); margin-left: 24px; }
.tk-msg small { color: var(--muted); } .tk-msg p { margin: 4px 0 0; }
.tpl-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.tpl-list { display: grid; padding: 6px; } .tpl-list a { padding: 9px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.tpl-list a.on, .tpl-list a:hover { background: var(--primary-soft); color: var(--ink); }
.tpl-edit { display: grid; gap: 12px; }
.textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.tpl-row { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
.tpl-prev { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tp-sub { padding: 8px 12px; font-size: 13px; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.tpl-prev iframe { width: 100%; height: 520px; border: 0; background: #fff; }
.mail-pre { white-space: pre-wrap; font-size: 12px; background: var(--bg-soft); padding: 8px; border-radius: 8px; max-width: 520px; }
.input.sm { height: 34px; max-width: 120px; }
.switch-l { position: relative; width: 42px; height: 24px; flex: none; }
.switch-l input { opacity: 0; width: 0; height: 0; }
.switch-l span { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong, #ccc); cursor: pointer; transition: .2s; }
.switch-l span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch-l input:checked + span { background: var(--primary); } .switch-l input:checked + span::before { transform: translateX(18px); }
@media (max-width: 900px) { .tpl-grid { grid-template-columns: minmax(0, 1fr); } .kv { grid-template-columns: 90px 1fr; } }
.ap-learned { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ap-learned .chip { height: auto; padding: 4px 6px 4px 10px; gap: 4px; }
.ap-x { all: unset; cursor: pointer; padding: 0 4px; color: var(--muted); font-size: 12px; } .ap-x:hover { color: var(--danger, #c0362c); }
/* Default keywords editor */
.dk-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dk-kw { height: auto; padding: 4px 6px 4px 10px; gap: 4px; }
.dk-x { all: unset; cursor: pointer; padding: 0 4px; color: var(--muted); font-size: 11px; } .dk-x:hover { color: var(--danger, #c0362c); }
/* locked admin pages (prices, limits, site rules, AI engine) */
.lock-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; border-color: var(--warn, #b45309); background: var(--warn-soft, #fff7e6); }
.lock-bar.open { border-color: var(--success, #1a7f37); background: var(--success-soft, #e6f4ea); }
.is-locked input:disabled, .is-locked select:disabled, .is-locked textarea:disabled { opacity: .75; cursor: not-allowed; }
/* Train the AI */
.tr-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; } .tr-row .select { max-width: 220px; } .tr-row .input { flex: 1; min-width: 160px; }
.tr-ex { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tr-ex p { flex-basis: 100%; margin: 4px 0 0; font-size: 13.5px; } .tr-ex small { flex-basis: 100%; } .tr-ex .btn { margin-left: auto; }
.lc-num { font-size: 16px; }
/* Leads by keyword */
.kw-bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--primary, #714b67); opacity: .55; vertical-align: middle; min-width: 2px; }
.kw-on { height: auto; padding: 6px 8px 6px 12px; margin-bottom: 12px; gap: 6px; display: inline-flex; align-items: center; }
.dk-n { font-size: 11px; font-weight: 700; color: var(--primary, #714b67); margin-left: 2px; }
.dk-kw.zero { opacity: .7; } .dk-kw.zero .dk-n { color: var(--muted); }

/* Admin → Website traffic */
.tr-list { display: grid; gap: 6px; }
.tr-row { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; overflow: hidden; font-size: 14px; }
.tr-row span, .tr-row b { position: relative; z-index: 1; } .tr-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-row i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary-soft); border-radius: 8px; z-index: 0; }
.chart14.tr-dense { gap: 2px; } .chart14.tr-dense small { font-size: 9px; } .chart14.tr-dense .c14:nth-child(odd) small { visibility: hidden; }
#tDays { margin: 0; }

/* Admin → AI engine → usage & billing */
.aiu-box { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.aiu-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.aiu-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.aiu-nums > div { background: var(--bg-soft); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.aiu-nums small { color: var(--muted); font-size: 12px; } .aiu-nums b { font-size: 20px; } .aiu-nums span { color: var(--muted); font-size: 12px; }
.aiu-err { color: var(--danger); font-size: 13px; margin: 10px 0 0; word-break: break-word; }
.aiu-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; } .aiu-act .input { width: 190px; }
.aiu-h { font-weight: 700; margin: 16px 0 8px; } .aiu-chart { height: 140px; } .aiu-note { font-size: 12.5px; margin-top: 12px; }
/* Website traffic: compact cards, line chart, thin bars, people online */
.tr-ctl { display: flex; gap: 8px; flex-wrap: wrap; }
.tr-kpis .kpi { padding: 14px 16px; }
.tr-kpis .kpi b { display: flex; align-items: center; gap: 8px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .45; margin-right: 6px; vertical-align: middle; flex: none; }
.dot.on { background: var(--success); opacity: 1; box-shadow: 0 0 0 3px var(--success-soft); }
.tr-card { margin-bottom: 16px; }
.tr-card .card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tr-card .card-h h3 { font-size: 15px; }
.tr-sub { font-size: 12.5px; }
.tr-top { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; }
.tr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tr-grid .tr-card, .tr-top .tr-card { margin-bottom: 0; }
.tr-grid { margin-bottom: 16px; } .tr-top { margin-bottom: 16px; }
@media (max-width: 1100px) { .tr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tr-top { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .tr-grid { grid-template-columns: 1fr; } }
.tb { margin-bottom: 10px; }
.tb-h { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.tb-h span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-h b { font-weight: 600; white-space: nowrap; }
.tb-h small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; display: inline-block; min-width: 34px; text-align: right; }
.tb i { display: block; height: 6px; border-radius: 3px; background: var(--bg-soft, rgba(127,127,127,.1)); margin-top: 4px; overflow: hidden; }
.tb em { display: block; height: 100%; border-radius: 3px; background: var(--primary); opacity: .8; }
.tb-more { font-size: 12px; margin: 4px 0 0; }
.tr-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tr-tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.tr-tbl td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tr-tbl tr:last-child td { border-bottom: 0; }
.tr-tbl th:not(:first-child), .tr-tbl td:not(:first-child) { text-align: right; }
.tr-tbl td small { display: block; color: var(--muted); font-size: 12px; }
.tr-people th, .tr-people td { text-align: left !important; }
.tr-people tr[data-u] { cursor: pointer; } .tr-people tr[data-u]:hover td { background: var(--bg-soft); }
.tr-days { max-height: 320px; overflow-y: auto; }
.tr-note { font-size: 12px; margin: 10px 0 0; }
.tc { width: 100%; height: auto; display: block; }
.tc-grid { stroke: var(--border); stroke-width: 1; }
.tc-ax { fill: var(--muted); font-size: 11px; }
.tc-area { fill: var(--success); opacity: .08; }
.tc-a { fill: none; stroke: var(--success); stroke-width: 2.2; stroke-linejoin: round; }
.tc-l { fill: none; stroke: var(--primary); stroke-width: 1.6; stroke-dasharray: 4 3; stroke-linejoin: round; }
.tc-sign { fill: var(--warn); }
.tc-hit rect { fill: transparent; }
.tc-hit .tc-cur, .tc-hit circle { opacity: 0; }
.tc-hit:hover .tc-cur { opacity: 1; stroke: var(--border); }
.tc-hit:hover circle { opacity: 1; }
.tc-dot-a { fill: var(--success); } .tc-dot-l { fill: var(--primary); }
/* "Show all": the full list as a table or a gallery, the card then takes the whole row */
.tr-more { margin-top: 4px; }
.tr-openbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tr-grid .tr-wide { grid-column: 1 / -1; }
.tr-scroll { max-height: 420px; overflow-y: auto; }
.tr-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tr-tile { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-tile > span { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-tile > b { font-size: 20px; }
.tr-tile small { color: var(--muted); font-size: 11.5px; }
.tr-tile i { display: block; height: 4px; border-radius: 2px; background: var(--bg-soft, rgba(127,127,127,.1)); margin-top: 6px; overflow: hidden; }
.tr-tile em { display: block; height: 100%; background: var(--primary); opacity: .8; }
.tr-gal.tr-people { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tr-person { cursor: pointer; } .tr-person:hover { border-color: var(--primary); }
.tr-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-st { font-size: 13px; margin-top: 6px; } .tr-st small { display: inline; margin-left: 6px; }
.tr-pm { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; margin-top: 6px; }
