/*
 * CashBot control-panel theme (loaded last). Dark, restrained and dense, made for use during a live stream:
 * flat surfaces, thin borders, small radii, no gradients / glass / glow. One accent; fixed colors for
 * on / off / saving / warning / error.
 */
:root {
  --bg: #10110f; --bg-2: #171916; --surface: #1c1e1b; --surface-2: #252823; --row-hover: #22251f;
  --border: #30332d; --border-2: #41463c;
  --text: #f0f1ed; --muted: #a5aaa0; --faint: #73796e;
  --accent: #39e600; --accent-ink: #071300; --accent-soft: rgba(57, 230, 0, .11);
  --warn: #f2b23e; --warn-soft: rgba(242, 178, 62, .12); --bad: #f0566a; --bad-soft: rgba(240, 86, 106, .12);
  --info: #7c9cff; --info-soft: rgba(124, 156, 255, .12); --violet: #9d8cff; --live: #f0566a;
  --r: 5px; --r-sm: 4px; --shadow: none;
  --side: 236px;
}
body { font-size: 14px; background: var(--bg); }
h1 { font-size: 20px; font-weight: 600; }
h2 { font-size: 14px; font-weight: 600; }
h1 .icon { color: var(--muted); }

/* ---------- shell ---------- */
.side { background: #141613; padding: 14px 10px; overflow-y: auto; border-inline-end-color: #292c27; }
.brand { padding: 2px 8px 14px; }
.brand small { display: none; }
.nav { gap: 1px; }
.nav-group { padding: 6px 0; border-top: 1px solid #292c27; }
.nav-group:first-child { border-top: 0; padding-top: 0; }
.nav-group-title { font-size: 10.5px; letter-spacing: .09em; color: var(--faint); padding: 4px 10px 4px; font-weight: 600; text-transform: uppercase; }
.nav-item { padding: 7px 10px; border-radius: var(--r-sm); font-size: 13.5px; gap: 10px; color: #aab2bf; position: relative; }
.nav-item .icon { width: 17px; height: 17px; }
.nav-item:hover { background: var(--surface); }
.nav-item.active { background: #20231d; color: var(--text); border-radius: 4px; }
.nav-item.active::before { content: ''; position: absolute; inset-block: 6px; inset-inline-start: 0; width: 3px; border-radius: 2px; background: var(--accent); }
.nav-item.active .icon { color: var(--accent); }
.nav-subs { display: flex; flex-direction: column; margin: 2px 0 6px; padding-inline-start: 37px; }
.nav-sub { padding: 5px 10px; border-radius: var(--r-sm); color: var(--muted); font-size: 13px; }
.nav-sub:hover { color: var(--text); background: var(--surface); }
.nav-sub.active { color: var(--accent); background: rgba(57, 230, 0, .09); }
.top { background: #141613; backdrop-filter: none; padding: 8px 24px; min-height: 52px; border-bottom-color: #292c27; }
.main { padding: 20px 24px 56px; max-width: 1360px; }
.view { gap: 14px; }
.demo-banner { padding: 7px 24px; font-size: 13px; background: var(--info-soft); color: #c9d4ff; border-bottom-color: rgba(124, 156, 255, .25); }
.demo-banner.warn { background: var(--warn-soft); color: #ffd99a; border-bottom-color: rgba(242, 178, 62, .25); }
.global-search .input { height: 34px; }
.page-head { gap: 12px; padding-bottom: 2px; }
.page-head p.muted { font-size: 13px; }

/* ---------- surfaces ---------- */
.card { border-radius: var(--r); background: var(--surface); box-shadow: none; }
.card-head { padding: 10px 14px; min-height: 44px; }
.card-head h2 .icon { color: var(--muted); width: 16px; height: 16px; }
.card-body { padding: 12px 14px; gap: 12px; }
.card.stat { padding: 12px 14px; gap: 8px; }
.card.stat:hover { transform: none; border-color: var(--border-2); }
.stat-ic { width: 26px; height: 26px; border-radius: 6px; }
.stat-value { font-size: 18px; }
.stat-value .dot, .stat-value.ok .dot, .stat-value.bad .dot { box-shadow: none; }
.grid { gap: 14px; }
.stack { gap: 14px; }
.panel-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.card.widget.highlight { background: var(--surface); border-color: var(--border-2); }
.widget-ic { background: var(--surface-2); color: var(--accent); border-radius: 8px; }
.conn-dot, .conn-dot.bad { box-shadow: none; }

/* ---------- controls ---------- */
.btn { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.icon-only { width: 32px; }
.btn.sm.icon-only { width: 28px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #58f522; border-color: #58f522; }
.btn:hover { background: #20262f; }
.input { height: 34px; font-size: 13.5px; border-radius: var(--r-sm); }
.input:focus { box-shadow: 0 0 0 2px var(--accent-soft); }
.field > label { font-size: 12.5px; }
.toggle .track { width: 34px; height: 20px; }
.toggle .thumb { width: 14px; height: 14px; }
.toggle input:checked + .track .thumb { inset-inline-start: 17px; }
.pill { height: 20px; padding: 0 8px; font-size: 11.5px; border-radius: 4px; }
.notice { padding: 9px 12px; font-size: 13px; border-radius: var(--r-sm); }
.tabs { gap: 2px; }
.tab { padding: 8px 12px; font-size: 13px; }
.chip { height: 28px; border-radius: 6px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.chip-n { font-size: 11px; color: var(--faint); }
.chip.active .chip-n { color: var(--accent); }
.save-state.saved { color: var(--accent); }
.save-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.toast { box-shadow: none; border-color: var(--border-2); }
.modal { box-shadow: none; }

/* lists & tables: compact rows */
.act { padding: 7px 2px; gap: 9px; }
.act-ic { width: 24px; height: 24px; border-radius: 6px; }
.tr { padding: 8px 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.toolbar .search { position: relative; display: flex; align-items: center; flex: 1 1 240px; max-width: 360px; }
.toolbar .search .icon, .perm-tools .search .icon { position: absolute; inset-inline-start: 10px; color: var(--faint); pointer-events: none; }
.toolbar .search .input, .perm-tools .search .input { padding-inline-start: 32px; }
.tb-sep { width: 1px; height: 22px; background: var(--border-2); margin: 0 4px; }

/* ---------- overlay library ---------- */
.ov-list-head, .ov-row { display: grid; grid-template-columns: minmax(0, 1fr) 230px 300px; gap: 12px; align-items: center; padding: 9px 14px; }
.ov-list-head { color: var(--faint); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.ov-row { border-bottom: 1px solid var(--border); }
.ov-row:last-child { border-bottom: 0; }
.ov-row:hover { background: var(--row-hover); }
.ov-row.off .ov-title, .ov-row.off .ov-ic { opacity: .55; }
.ov-name { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.ov-ic { width: 30px; height: 30px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); flex: none; }
.ov-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.ov-title { color: var(--text); font-weight: 600; }
.ov-title:hover { color: var(--accent); }
.ov-facts { color: var(--faint); font-size: 11.5px; }
.ov-status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ov-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.url-row.compact { flex: none; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
dl.facts dt { color: var(--faint); }
dl.facts dd { margin: 0; }
.pin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pin-list li { display: flex; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.preview-frame { border-radius: var(--r-sm); }

/* ---------- All-in-One ---------- */
.cv-toolbar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 12px; }
.cv-toolbar select.input { width: auto; min-width: 120px; height: 30px; }
.canvas.show-grid { background-image: linear-gradient(to right, rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(to bottom, rgba(255, 255, 255, .06) 1px, transparent 1px); }
.cv-item { border-radius: 3px; border-color: rgba(47, 210, 143, .55); background: rgba(47, 210, 143, .08); }
.cv-item.sel { box-shadow: none; outline: 2px solid var(--accent); outline-offset: 1px; }
.cv-handle { border-radius: 2px; }
.layer-list { display: flex; flex-direction: column; }
.layer { padding: 3px 4px; border-bottom: 1px solid var(--border); border-radius: 0; gap: 4px; }
.layer:last-child { border-bottom: 0; }
.layer.off .layer-name { opacity: .55; }
.layer .toggle-text { display: none; }
.layer-pos { white-space: nowrap; }

/* ---------- staff ---------- */
.staff-layout { display: grid; grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.staff-side .card-head { border-bottom: 1px solid var(--border); }
.member-list { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.member-row { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 9px 10px; border: 1px solid transparent; background: transparent; color: var(--text); border-radius: var(--r); cursor: pointer; text-align: start; font: inherit; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.member-row:hover { background: var(--row-hover); border-color: var(--accent); transform: translateY(-1px); }
.member-row.sel { background: var(--surface-2); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.member-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.member-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 28px; height: 28px; font-size: 13px; }
.member-editor .card-head { flex-wrap: wrap; min-height: 76px; }
.perm-editor { display: flex; flex-direction: column; gap: 10px; }
.perm-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.perm-tools .search { position: relative; display: flex; align-items: center; flex: 1 1 220px; max-width: 340px; }
.perm-summary { font-size: 13px; }
.staff-permissions, .staff-ceiling { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.staff-permissions > h3, .staff-ceiling > h3 { margin: 0; font-size: 15px; }
.staff-ceiling { padding-top: 14px; border-top: 1px solid var(--border); }
.perm-cats { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px 14px; border: 0; overflow: visible; }
.pcat { min-width: 0; border: 0; border-radius: 0; overflow: visible; background: transparent; }
.pcat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 6px; background: transparent; font-size: 12px; color: var(--muted); }
.pcat-toggle { flex: 1; display: flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 4px 0; text-align: start; }
.chev { width: 12px; color: var(--faint); font-size: 11px; }
.pcat-count { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; margin-inline-start: 4px; }
.pcat-count.on { color: var(--accent); }
.pcat-head .toggle-text, .prow .toggle-text { display: none; }
.pcat-rows { display: flex; flex-direction: column; padding: 0 4px 6px; }
.prow { display: flex; align-items: center; gap: 7px; padding: 2px 4px; border: 0; }
.perm-choice { width: 100%; min-height: 27px; padding: 2px 4px; border: 1px solid transparent; border-inline-start: 0; border-radius: 4px; background: transparent; color: var(--text); text-align: start; font: inherit; font-size: 13px; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.perm-choice:hover:not(:disabled) { background: var(--row-hover); transform: translateY(-1px); }
.perm-choice.selected { border-color: transparent; border-inline-start-color: transparent; background: transparent; }
.perm-choice:disabled { cursor: not-allowed; opacity: .62; }
.perm-choice-mark { display: grid; place-items: center; flex: 0 0 16px; width: 16px; height: 16px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg-2); }
.perm-choice.selected .perm-choice-mark { border-color: var(--accent); background: var(--accent); color: var(--on-accent, #101010); }
[dir="rtl"] .prow { padding: 2px 4px; }
.prow:hover { background: var(--row-hover); }
.prow-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.prow-text code { font-size: 11px; background: none; border: 0; padding: 0; color: var(--faint); }
.prow-text small { flex-basis: 100%; }
.prow.locked .prow-text > span { color: var(--muted); }
.invite-card > .card-head { border-bottom: 1px solid var(--border); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .ov-list-head { display: none; }
  .ov-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ov-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 900px) {
  .staff-layout { grid-template-columns: minmax(0, 1fr); }
  .member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .perm-cats { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
}
@media (max-width: 820px) {
  .top { padding: 8px 14px; }
  .main { padding: 14px 14px 44px; }
  .demo-banner { padding: 7px 14px; }
}
@media (max-width: 560px) {
  .perm-cats { grid-template-columns: minmax(0, 1fr); }
  .ov-row { grid-template-columns: minmax(0, 1fr); }
  .ov-status { order: 2; }
  .prow { padding-inline: 12px; }
  .toolbar .search, .perm-tools .search { max-width: none; }
  .cv-toolbar { gap: 6px; }
  .layer-pos { display: none; }
}
[dir="rtl"] .chev { display: inline-block; transform: scaleX(-1); }

/* BotRix-like screen structure: a fixed product sidebar, a clear page header,
   horizontal feature tabs, then one dense settings surface with direct controls. */
.main { max-width: none; padding: 18px 22px 48px; }
.view { gap: 12px; }
.page-head { min-height: 42px; padding: 0 0 10px; border-bottom: 1px solid #30332d; }
.page-head h1 { font-size: 21px; }
.tabs { width: 100%; min-height: 42px; gap: 2px; padding: 4px; border: 1px solid #30332d; background: #222420; }
.tab { min-height: 32px; padding: 7px 13px; border: 0; border-radius: 3px; color: #b6bbb1; }
.tab:hover { background: #30332d; color: #fff; }
.tab.active { background: var(--accent); color: #071300; border: 0; }
.tts-tabs { display: flex; gap: 4px; width: fit-content; max-width: 100%; padding: 4px; margin: 0 0 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-2); }
.tts-tabs .tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 150px; }
.tts-tab-panel[hidden] { display: none !important; }
.card { border-radius: 4px; background: #20221f; border-color: #343731; }
.card-head { min-height: 40px; padding: 9px 13px; background: #2b2d29; }
.card-body { padding: 12px 13px; }
.feature-bar { min-height: 48px; padding: 9px 13px; border-radius: 4px; background: #292b27; border-color: #3a3d37; }
.feature-bar > .toggle { min-width: 180px; padding-inline-end: 12px; border-inline-end: 1px solid #41443d; }
.feature-bar > .pill { margin-inline-start: auto; }
.feature-sched { padding-top: 12px; }
.notice { border-radius: 3px; }
.notice.info { background: #292b27; color: #c9cbc5; border-color: #3a3d37; }
.notice.info .icon { color: var(--warn); }
.tr { border-bottom-color: #353832; }
.tr:hover:not(.th) { background: #272a25; }
.input, select.input, textarea.input { border-radius: 3px; }
.btn { border-radius: 3px; }
.toggle .track { border-radius: 12px; }
.toggle .thumb { border-radius: 50%; }
.side { width: 208px; }
.platform-indicator { display: flex; align-items: center; gap: 9px; margin: 0 6px 12px; padding: 8px 9px; border: 1px solid #30332d; background: #1b1d19; color: #d8dbd4; font-size: 13px; }
.platform-mark { width: 21px; height: 21px; display: grid; place-items: center; background: var(--accent); color: #071300; font-size: 12px; font-weight: 800; }
.nav-item.active::before { width: 3px; }
.nav-sub { border-radius: 3px; }
.member-row.sel { border-radius: 3px; }
.pcat-head { padding: 5px 6px; }
.prow { min-height: 28px; }
.as-panel { border-radius: 5px; }
.as-fab { width: 42px; height: 42px; background: #20231d; color: var(--accent); border: 1px solid #454a3f; box-shadow: none; }
.as-fab:hover { background: #2b3026; border-color: var(--accent); }
.settings-rows { gap: 0; }
.settings-rows > .toggle,
.settings-rows > .field,
.settings-rows > .row { padding: 10px 12px; border-bottom: 1px solid #353832; }
.settings-rows > .toggle { min-height: 52px; align-items: center; justify-content: space-between; }
.settings-rows > .toggle .toggle-text { flex: 1; }
.settings-rows > .field { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr); align-items: center; gap: 8px 18px; }
.settings-rows > .field > label { color: var(--text); font-size: 13px; }
.settings-rows > .field > .hint { grid-column: 1 / -1; }
.settings-rows > .field:has(textarea) { grid-template-columns: 1fr; }
.settings-rows > .field:has(textarea) > textarea { grid-column: 1 / -1; }
.settings-rows > .row { margin: 0; gap: 10px 18px; }
.settings-rows > .row > .toggle { flex: 1 1 220px; align-items: center; justify-content: space-between; }
.settings-rows > .row > .field { flex: 1 1 220px; }
.settings-rows > :last-child { border-bottom: 0; }

@media (max-width: 820px) {
  .main { padding: 14px 14px 44px; }
  .page-head { align-items: flex-start; }
  .feature-bar > .toggle { min-width: 0; border-inline-end: 0; }
  .settings-rows > .field { grid-template-columns: 1fr; }
  .settings-rows > .field > .hint { grid-column: 1; }
}

@media (min-width: 821px) {
  /* banners (demo, test mode, staff, bot off) and the page each take their own auto-height row next to the menu,
     so a banner never stretches to the menu's height and pushes the page down */
  .layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); grid-template-rows: 54px; grid-auto-rows: auto; align-items: start; }
  .side { grid-column: 1; grid-row: 2 / span 12; align-self: start; position: sticky; top: 54px; height: calc(100vh - 54px); }
  .side > .brand { display: none; }
  .main-col { display: contents; }
  .top { grid-column: 1 / -1; grid-row: 1; position: sticky; top: 0; z-index: 30; }
  .top .brand.mini { display: inline-flex; }
  .demo-banner { grid-column: 2; }
  .main { grid-column: 2; }
}
