/*
 * CashBot dashboard layout (loaded after ux.css). Roomier, card-based panel: a wider menu with icon tiles,
 * page titles with an accent bar and their main switch next to them, boxed tabs joined to the panel they open,
 * rounded cards and larger controls. Colors and brand stay CashBot's (tokens from theme.css).
 */
:root { --side: 250px; --r: 9px; --r-sm: 5px; --panel: #181a17; --panel-line: #2b2e29; --tile: rgba(255, 255, 255, .045); --tint: rgba(57, 230, 0, .08); }

body { font-size: 15px; }

/* ---------- top bar ---------- */
.top { min-height: 62px; padding: 8px 22px; background: #10110f; border-bottom: 1px solid var(--panel-line); }
.top .brand.mini strong, .top .brand strong { font-size: 19px; }

/* ---------- side menu ---------- */
.side { width: var(--side); padding: 0 10px 16px; background: #121411; border-inline-end: 1px solid var(--panel-line); }
@media (min-width: 821px) { .side { top: 62px; height: calc(100vh - 62px); } .layout { grid-template-rows: 62px; } }
.platform-indicator { justify-content: center; gap: 7px; margin: 0 -10px 8px; padding: 9px 10px; border: 0; border-bottom: 1px solid var(--panel-line); background: #161815; color: var(--muted); font-size: 13.5px; }
.platform-mark { width: 18px; height: 18px; font-size: 11px; border-radius: 4px; }
.nav-group { margin: 0; padding: 1px 0; border: 0; gap: 2px; }
.nav-group-title { display: none; }
.nav-item { min-height: 46px; padding: 7px 10px; gap: 12px; border-radius: 9px; font-size: 15.5px; color: #dfe2db; }
.nav-item .icon { flex: none; width: 31px; height: 31px; padding: 7px; border-radius: 5px; background: var(--tile); color: #dfe2db; }
.side .nav-item:hover:not(.active) { background: var(--tint); color: var(--text); }
.nav-item.active { background: var(--tint); color: var(--text); border-radius: 9px; box-shadow: inset 2px 0 0 var(--accent); }
[dir="rtl"] .nav-item.active { box-shadow: inset -2px 0 0 var(--accent); }
.nav-item.active::before { display: none; }
.nav-item.active .icon { color: var(--accent); background: rgba(57, 230, 0, .12); }
/* Keep the overlay canvas directly under its category; page tabs stay inside the page. */
.nav-subs { display: none; }
.nav-item[href="#/overlays"].active + .nav-subs { display: flex; }
.side-foot { border-top: 1px solid var(--panel-line); padding-top: 10px; }

/* ---------- page head: accent bar, title, the page's main switch right next to it ---------- */
.main { padding: 20px 24px 56px; }
.view { gap: 13px; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.category-card { min-width: 0; min-height: 150px; display: flex; align-items: center; gap: 18px; padding: 22px 24px; border: 1px solid var(--panel-line); border-radius: 16px; background: linear-gradient(115deg, rgba(255,255,255,.035), rgba(255,255,255,.01)), var(--panel); color: var(--text); text-decoration: none; transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.category-card:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--tile); box-shadow: 0 12px 28px rgba(0,0,0,.18); }
.category-icon { width: 70px; height: 70px; flex: none; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 16px; color: var(--accent); background: var(--tint); }
.category-content { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.category-content > strong { font-size: 19px; color: var(--accent); }
.category-content > small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.category-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.category-tags i { font-style: normal; font-size: 12px; padding: 3px 9px; border: 1px solid var(--panel-line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.035); }
.category-arrow { color: var(--muted); font-size: 30px; line-height: 1; }
.category-card.violet { --accent: #a982f2; --tint: rgba(169,130,242,.1); }
.category-card.green { --accent: #37d39a; --tint: rgba(55,211,154,.1); }
.category-card.blue { --accent: #62a9e8; --tint: rgba(98,169,232,.1); }
.category-card.amber { --accent: #e2ac4b; --tint: rgba(226,172,75,.1); }
.detail-head { display: flex; align-items: center; gap: 12px; }
.detail-head h1 { margin: 0; }
@media (max-width: 900px) { .category-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .voice-row.custom { grid-template-columns: minmax(0, 1fr) minmax(70px, 1fr); } .voice-row.custom .voice-id { grid-column: 1 / -1; } }
@media (max-width: 520px) { .category-card { min-height: 120px; padding: 16px; gap: 12px; } .category-icon { width: 54px; height: 54px; } }
.page-head { min-height: 44px; padding: 0 0 8px; border-bottom: 0; }
.page-head h1 { font-size: 23px; font-weight: 700; padding-inline-start: 12px; border-inline-start: 4px solid var(--accent); line-height: 1.15; }
.page-head > div:first-child h1 { margin: 0; }
.page-head:has(> h1 + .toggle:last-child) { justify-content: flex-start; gap: 16px; }
.page-head p.muted { font-size: 14px; padding-inline-start: 16px; }
.view > .notice { justify-content: flex-start; text-align: start; padding: 11px 14px; border-radius: var(--r-sm); background: #20221e; border-color: var(--panel-line); font-size: 14px; }
.notice code { padding: 3px 8px; border-radius: 5px; background: #121411; color: var(--warn); font-weight: 600; }

/* ---------- boxed tabs joined to the panel below ---------- */
.tabs { min-height: 0; padding: 0 12px; gap: 6px; border: 0; background: none; overflow: visible; flex-wrap: wrap; align-items: flex-end; }
.tab { min-height: 42px; padding: 9px 15px; border: 1px solid var(--panel-line); border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; background: #141613; color: #e3e6df; font-size: 14.5px; font-weight: 600; margin-bottom: 0; }
.tab:hover { background: #1d201b; color: #fff; }
.tab.active { background: var(--panel); color: var(--accent); border-color: var(--panel-line); border-bottom: 2px solid var(--accent); }
.tab::after { display: none; }
.tabs .tab > .icon { display: none; }
/* the panel the tabs open: one rounded block holding the section */
.view > .tabs { margin-bottom: -16px; position: relative; z-index: 1; }
.view > .tabs + * { background: #181a17; border: 1px solid var(--panel-line); border-radius: var(--r); padding: 15px; }
.view > .tabs + .stack { gap: 14px; }

/* ---------- cards ---------- */
.card { border-radius: var(--r); border-color: var(--panel-line); background: #191b18; }
.card-head { padding: 12px 16px; min-height: 44px; border-bottom-color: var(--panel-line); background: transparent; }
.card-head h2 { font-size: 16px; font-weight: 600; }
.card-head h2 .icon { width: 17px; height: 17px; color: var(--accent); }
.card-body { padding: 14px 16px; gap: 12px; }
.card.stat { padding: 16px 18px; }
.card.stat:hover, .ov-card:hover { border-color: #3d4238; }
.view > .tabs + * .card { background: #1b1d1a; }
.feature-bar { padding: 12px 16px; border-radius: var(--r); background: #1c1e1b; border-color: var(--panel-line); }
.dt { border-radius: var(--r); }
.dt-row { padding-block: 12px; }

/* ---------- forms and buttons: larger, rounder ---------- */
.btn { height: 38px; padding: 0 15px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.btn.icon-only { width: 38px; }
.btn.sm.icon-only { width: 32px; }
.btn.primary { color: #071300; }
.input, select.input, textarea.input { height: 39px; border-radius: var(--r-sm); background: #121411; border-color: #353932; font-size: 14.5px; }
textarea.input { height: auto; }
.input.sm, select.input.sm { height: 34px; font-size: 13.5px; }
.field > label, .field-label, label.label { font-size: 14px; font-weight: 600; }
.toggle .track { width: 42px; height: 24px; border-radius: 12px; }
.toggle .thumb { width: 18px; height: 18px; top: 3px; inset-inline-start: 3px; }
.toggle input:checked + .track .thumb { inset-inline-start: 21px; }
.pill { height: 22px; padding: 0 9px; border-radius: 5px; font-size: 12px; }

/* ---------- motion: content and panels ease in; hover lifts are subtle ---------- */
.view > .tabs + * { animation: panel-in .2s var(--ease, ease) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ov-card, .card.stat { transition: border-color .15s ease, transform .15s ease; }
.ov-card:hover, .card.stat:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .view > .tabs + * { animation: none; } .ov-card:hover, .card.stat:hover { transform: none; } }
body.pause-motion .ov-card:hover, body.pause-motion .card.stat:hover { transform: none; }

/* ---------- light contrast (accessibility menu) keeps working with the new surfaces ---------- */
body.contrast-light { --panel: #ffffff; --panel-line: #3d4138; --tile: #eef0eb; --tint: rgba(29, 107, 0, .1); }
body.contrast-light .top, body.contrast-light .side, body.contrast-light .platform-indicator, body.contrast-light .nav-group-title, body.contrast-light .tab { background: #f4f5f2 !important; color: #000; }
body.contrast-light .nav-item, body.contrast-light .nav-item .icon { color: #000; }
body.contrast-light .card, body.contrast-light .feature-bar, body.contrast-light .view > .notice, body.contrast-light .input { background: #fff; color: #000; }

/* ---------- phones and tablets ---------- */
@media (max-width: 820px) {
  .side { width: min(300px, 86vw); padding-top: 10px; }
  .main { padding: 16px 14px 48px; }
  .page-head h1 { font-size: 20px; }
  .tabs { padding: 0 4px; gap: 4px; }
  .tab { padding: 8px 12px; font-size: 13.5px; min-height: 38px; }
  .view > .tabs + * { padding: 12px; }
}

/* ---------- simpler screens: less text at first sight, advanced options open on demand ---------- */
/* advanced sections: closed by default, one click opens them in place */
details.card.adv > summary { list-style: none; cursor: pointer; border-bottom: 0; }
details.card.adv > summary::-webkit-details-marker { display: none; }
details.card.adv > summary h2 { flex: 1; }
details.card.adv > summary::after { content: ''; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); margin-inline: 4px 2px; transition: transform .18s ease; }
details.card.adv[open] > summary::after { transform: rotate(-135deg); }
details.card.adv[open] > summary { border-bottom: 1px solid var(--panel-line); }
details.card.adv > summary:hover { background: rgba(255, 255, 255, .02); }
.adv-tag { font-size: 12px; color: var(--muted); padding: 2px 8px; border: 1px solid var(--panel-line); border-radius: 999px; }
details.card.adv[open] .adv-tag { display: none; }
details.card.adv:not([open]) { background: transparent; }

/* helper text: one short line; the full text shows while you use the field */
.field .hint, .form > .hint, .card-body > .hint { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; }
.field:focus-within .hint, .field:hover .hint { -webkit-line-clamp: unset; display: block; }
/* page descriptions: one line under the title */
.page-head p.muted { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
/* overlay cards: one-line description, single status */
.ov-desc { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
/* overview: quick actions are a plain row under the status cards */
.view > .quick { display: flex; flex-wrap: wrap; gap: 8px; }
.view > .quick:empty { display: none; }

/* Keep the dashboard's health checks readable without turning every line into a separate card. */
.ready-list, .notes { gap: 0; }
.ready, .note { border: 0; border-bottom: 1px solid var(--panel-line); border-radius: 0; background: transparent; padding: 8px 2px; }
.ready:last-child, .note:last-child { border-bottom: 0; }
.ready-ic { border-radius: 6px; }
.overview-stream { max-height: 270px; overflow: auto; scrollbar-width: thin; }
.page-head > .toggle .toggle-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.feature-bar { min-height: 46px; border-radius: var(--r-sm); }
.feature-sched { border-top-style: solid; }

/* BotRix-inspired shell with CashBot's own palette and assets. */
.main-col { background-color: #0f100e; background-image:
  linear-gradient(135deg, transparent 48.8%, rgba(255,255,255,.012) 49.5%, rgba(255,255,255,.012) 50.5%, transparent 51.2%),
  linear-gradient(45deg, transparent 48.8%, rgba(255,255,255,.009) 49.5%, rgba(255,255,255,.009) 50.5%, transparent 51.2%);
  background-size: 34px 34px; }
.main { max-width: none; }
.page-head { border-bottom: 0; }
.tabs { gap: 5px; padding-inline: 8px; }
.tab { min-height: 40px; border-radius: 5px 5px 0 0; }
.view > .tabs + * { border-color: #252723; }
.view > .tabs + * .card { border-radius: 8px; background: #1b1d1a; }
.view > .tabs + * .card-head { background: transparent; }
.toolbar { gap: 8px; }
.toolbar .input, .toolbar select { min-height: 36px; }
.ready, .note { transition: background .15s ease; }
.ready:hover, .note:hover { background: rgba(255,255,255,.025); }
.act:hover { background: rgba(255,255,255,.02); }
.overview-stream { overscroll-behavior: contain; }
.ov-card-body { gap: 6px; padding: 10px 12px; }
.ov-desc { display: block; min-height: 0; max-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-card .ov-actions { padding-top: 2px; }
.ready-list { display: flex; flex-direction: column; }
.ready { align-items: center; gap: 8px; }
.ready > div { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; }
.ready > div strong { font-size: 13.5px; }
.ready > div small { max-width: 58%; text-align: end; }
.ready.ok > div small { display: none; }
@media (max-width: 700px) { .ready > div small { max-width: 55%; } }
@media (prefers-reduced-motion: reduce) { .ready, .note, .act { transition: none; } }
