:root {
  --bg: #f2f2f5; --surface: #ffffff; --surface-2: #f4f4f6; --text: #111113; --muted: #6e6e73;
  --line: rgba(0, 0, 0, .08); --glass: rgba(255, 255, 255, .72); --glass-line: rgba(0, 0, 0, .06);
  --hover: rgba(0, 0, 0, .05); --accent: #111113; --accent-text: #ffffff;
  --shadow: 0 10px 34px rgba(0, 0, 0, .10);
  --pending: #9a5b00; --pending-bg: #fff0d1; --approved: #13773a; --approved-bg: #dcf4e4;
  --rejected: #bd2a22; --rejected-bg: #fde3e1; --none: #5c5c62; --none-bg: #ebebee;
  --ok: #16a34a; --danger: #dc2626;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #121212; --surface-2: #1c1c1e; --text: #f2f2f2; --muted: #8e8e93;
  --line: rgba(255, 255, 255, .08); --glass: rgba(20, 20, 20, .66); --glass-line: rgba(255, 255, 255, .09);
  --hover: rgba(255, 255, 255, .07); --accent: #f2f2f2; --accent-text: #0b0b0b;
  --shadow: 0 10px 34px rgba(0, 0, 0, .55);
  --pending: #f5c451; --pending-bg: rgba(245, 196, 81, .14); --approved: #4ade80; --approved-bg: rgba(74, 222, 128, .13);
  --rejected: #f87171; --rejected-bg: rgba(248, 113, 113, .14); --none: #a1a1a6; --none-bg: rgba(255, 255, 255, .07);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #121212; --surface-2: #1c1c1e; --text: #f2f2f2; --muted: #8e8e93;
    --line: rgba(255, 255, 255, .08); --glass: rgba(20, 20, 20, .66); --glass-line: rgba(255, 255, 255, .09);
    --hover: rgba(255, 255, 255, .07); --accent: #f2f2f2; --accent-text: #0b0b0b;
    --shadow: 0 10px 34px rgba(0, 0, 0, .55);
    --pending: #f5c451; --pending-bg: rgba(245, 196, 81, .14); --approved: #4ade80; --approved-bg: rgba(74, 222, 128, .13);
    --rejected: #f87171; --rejected-bg: rgba(248, 113, 113, .14); --none: #a1a1a6; --none-bg: rgba(255, 255, 255, .07);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* Closed dropdowns stay in the layout; clipping keeps them from widening the page on phones. */
html { -ms-overflow-style: none; overflow-x: hidden; overflow-x: clip; }
body {
  overflow-x: hidden; overflow-x: clip;
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; transition: background-color .25s, color .25s;
}
a { color: inherit; text-decoration: none; }
input, textarea, button { font: inherit; color: inherit; }
input:focus, textarea:focus, button:focus, a:focus, :focus-visible { outline: none; box-shadow: none; }
form { margin: 0; }
.i { display: block; flex: none; }
[hidden] { display: none !important; }
::selection { background: rgba(122, 162, 255, .32); color: inherit; }

.glass {
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
}

/* Top bar with round buttons */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; gap: 10px;
  height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 16px; border-width: 0 0 1px;
}
.brand { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.topbar-title { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; flex: none;
  background: transparent; color: var(--text); cursor: pointer; transition: background .2s, transform .1s;
}
.icon-btn.round { border-radius: 50%; background: var(--hover); }
.icon-btn:hover, .icon-btn.on { background: var(--line); }
.icon-btn:active { transform: scale(.94); }
[data-theme-toggle] .sun { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .sun { display: block; }
:root[data-theme="dark"] [data-theme-toggle] .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-theme-toggle] .sun { display: block; }
  :root:not([data-theme="light"]) [data-theme-toggle] .moon { display: none; }
}

main { max-width: 760px; margin: 0 auto; padding: calc(74px + env(safe-area-inset-top)) 16px calc(116px + env(safe-area-inset-bottom)); }
main.bare { padding-bottom: 32px; }

/* Bottom tab bar */
.tabbar {
  position: fixed; z-index: 20; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(460px, calc(100% - 20px));
  padding: 6px; border-radius: 24px; box-shadow: var(--shadow);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; min-width: 0;
  border-radius: 18px; color: var(--muted); font-size: 11px; font-weight: 500; transition: color .2s, background .2s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); background: var(--hover); }
.tab-badge {
  position: absolute; top: 4px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
}

/* Cards and sections */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
/* minmax(0, 1fr): a long name must not stretch the column past the screen. */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 12px; }
.cards > .card { min-width: 0; margin: 0; }
h1 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.page-title { margin: 0 0 14px 2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 24px 4px 12px; }
.section-title, .day { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.day { margin: 16px 4px 8px; }
.section-head + .day { margin-top: 4px; }
.more { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 13px; font-weight: 500; }
.card .more { margin-top: 12px; }
.meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { padding: 32px 16px; color: var(--muted); text-align: center; }
.back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px 2px; color: var(--muted); font-size: 14px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row h2 { margin: 0; }
.card > .row + * { margin-top: 12px; }

/* Filters: «Все» row and four big tiles (2×2 on a phone, a row of four on a wide screen) */
.filter-all {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 16px; background: var(--surface); color: var(--muted); font-weight: 600; transition: background .2s, color .2s;
}
.filter-all span { flex: 1; color: var(--text); }
.filter-all b { color: var(--text); font-size: 15px; }
.filter-all.on { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.filter-all.on span, .filter-all.on b { color: var(--accent-text); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px; border: 1px solid var(--line);
  border-radius: 18px; background: var(--surface); transition: background .2s, border-color .2s, transform .1s;
}
.tile:active { transform: scale(.98); }
.tile b { font-size: 24px; line-height: 1.05; }
.tile.pending .stat-icon { background: var(--pending-bg); color: var(--pending); }
.tile.approved .stat-icon { background: var(--approved-bg); color: var(--approved); }
.tile.rejected .stat-icon { background: var(--rejected-bg); color: var(--rejected); }
.tile.on { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.tile.on .stat-label { color: var(--accent-text); opacity: .75; }
.tile.on .stat-icon { background: rgba(127, 127, 127, .2); color: var(--accent-text); }

/* Inputs */
.search { position: relative; margin-bottom: 10px; }
.search .i { position: absolute; top: 50%; left: 13px; color: var(--muted); transform: translateY(-50%); }
input[type=text], input[type=search], input[type=password], input:not([type]), textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  -webkit-appearance: none; appearance: none;
}
.search input[type=search] { padding-left: 40px; border-radius: 16px; background: var(--surface); }
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--line); }
.field-label { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 13px; }
.stack > * + * { margin-top: 10px; }
.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field input { flex: 1; min-width: 0; color: var(--muted); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px; cursor: pointer; }
.switch {
  position: relative; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 999px; background: var(--line);
  -webkit-appearance: none; appearance: none; cursor: pointer; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s ease;
}
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(18px); }

/* People rows (clients, backups) */
.person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; transition: background .15s; }
a.person:hover { background: var(--surface-2); }
.person-body { flex: 1; min-width: 0; }
.person-name, .person-body .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-name { font-weight: 600; }
.person-side { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Entries (requests, payments, broadcasts) */
.entry { padding: 14px 16px; }
.entry-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.entry-title { min-width: 0; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-amount { margin: 4px 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.entry-meta { color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.entry-meta a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.entry-meta + .entry-meta { margin-top: 2px; color: var(--muted); font-size: 13px; }
.entry-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.entry-foot span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-foot span:last-child { flex: none; }

.avatar { flex: none; width: 44px; height: 44px; overflow: hidden; border-radius: 50%; background: var(--none-bg); }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border: 0; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.pending { background: var(--pending-bg); color: var(--pending); }
.badge.approved { background: var(--approved-bg); color: var(--approved); }
.badge.rejected { background: var(--rejected-bg); color: var(--rejected); }
.badge.none { background: var(--none-bg); color: var(--none); }
.badge.chip { padding: 5px 10px 5px 12px; font-size: 13px; cursor: pointer; transition: filter .2s; }
.badge.chip:hover { filter: brightness(1.08); }
.dropdown.open .badge.chip .i { transform: rotate(180deg); }
.badge.chip .i { transition: transform .2s; }

/* Client card */
.profile { position: relative; }
.corner { position: absolute; z-index: 2; top: 12px; right: 12px; }
.profile-head { display: flex; align-items: center; gap: 14px; margin: 0 44px 18px 0; }
.profile-head > div { min-width: 0; }
.profile-head h1 {
  display: -webkit-box; margin-bottom: 8px; overflow: hidden; font-size: 18px; line-height: 1.25;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
@media (min-width: 640px) { .profile-head h1 { font-size: 20px; } }
@media (max-width: 420px) { .profile-head .avatar.lg { width: 60px; height: 60px; } .profile-head { gap: 12px; } }
.profile-head h1.placeholder { color: var(--muted); font-size: 16px; font-weight: 500; }
/* Data rows: label on the left, value on the right, one line; two columns of rows on a wide screen */
.facts { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 28px; margin: 0; }
.profile .facts { padding-top: 4px; border-top: 1px solid var(--line); }
.fact { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fact:last-child { border-bottom: 0; }
.fact dt { flex: none; color: var(--muted); }
.fact dd { min-width: 0; margin: 0; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.fact.wrap { flex-wrap: wrap; }
.fact.wrap dd { flex-basis: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
video { display: block; width: 100%; max-height: 65vh; margin: 12px 0 10px; border-radius: 14px; background: #000; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 14px; border: 0; border-radius: 12px;
  background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer; transition: transform .1s, opacity .2s, background .2s;
  white-space: nowrap;
}
.btn.ghost-neutral { margin-top: 8px; background: transparent; color: var(--muted); font-weight: 500; }
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { margin-top: 8px; background: transparent; color: var(--rejected); font-weight: 500; }
.btn.full { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }

/* Timeline */
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; top: 18px; bottom: -2px; left: 5px; width: 2px; border-radius: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.dot { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--none); }
.dot.pending { background: var(--pending); } .dot.approved { background: var(--approved); }
.dot.rejected { background: var(--rejected); } .dot.sent { background: var(--approved); } .dot.failed { background: var(--rejected); }
.t-title { font-size: 14px; font-weight: 600; }
.t-note { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 220px; padding: 6px; border-radius: 16px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-6px) scale(.98); transform-origin: top left;
  translate: var(--shift, 0px) 0;
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity .18s ease, transform .18s ease; }
.dropdown-menu.right { right: 0; left: auto; transform-origin: top right; }
.dropdown-menu.wide { width: min(300px, calc(100vw - 40px)); }
.dropdown.up .dropdown-menu { top: auto; bottom: calc(100% + 6px); transform-origin: bottom left; }
.dropdown.up .dropdown-menu.right { transform-origin: bottom right; }
.select .dropdown-menu { right: 0; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer; transition: background .15s; white-space: nowrap;
}
.menu-item:hover, .menu-item.selected { background: var(--hover); }
.menu-item .count { margin-left: auto; color: var(--muted); font-size: 13px; }
.menu-item.danger-text { color: var(--rejected); }
.menu-form { padding: 8px 6px 6px; }
.menu-form > * + * { margin-top: 8px; }
.menu-form textarea { min-height: 64px; }
.dropdown-menu form + .menu-form { margin-top: 4px; border-top: 1px solid var(--line); }
.menu-title { padding: 6px 12px 8px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.menu-form .menu-title { padding: 0 2px 2px; }
.select-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); text-align: left; cursor: pointer;
}

/* On a phone every dropdown slides up from the bottom as a sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .42); opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
@media (max-width: 640px) {
  .dropdown-menu, .dropdown-menu.right, .dropdown-menu.wide, .select .dropdown-menu {
    position: fixed; z-index: 70; top: auto; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); left: 8px;
    width: auto; min-width: 0; max-height: 78vh; overflow-y: auto; padding: 8px 8px 10px; border-radius: 24px;
    opacity: 1; translate: none; transform: translateY(calc(100% + 32px)); transform-origin: bottom;
    transition: transform .32s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .32s;
  }
  .dropdown.open .dropdown-menu, .dropdown.up .dropdown-menu { top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .dropdown.open .dropdown-menu { transform: none; transition: transform .32s cubic-bezier(.32, .72, 0, 1); }
  .dropdown-menu::before { content: ""; display: block; width: 38px; height: 5px; margin: 2px auto 10px; border-radius: 3px; background: var(--line); }
  .menu-item { padding: 14px 12px; font-size: 16px; }
  .menu-form { padding: 4px 6px 4px; }
}
.select-toggle .count { color: var(--muted); font-size: 13px; }
.select-toggle .chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
.dropdown.open .chev { transform: rotate(180deg); }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px 0 4px; }
.pg {
  display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; transition: background .2s;
}
a.pg:hover { background: var(--surface-2); }
.pg.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.pg.arrow { color: var(--muted); }
.pg.off { opacity: .4; }
.gap { color: var(--muted); padding: 0 2px; }
.pager-meta { margin-bottom: 8px; color: var(--muted); font-size: 12px; text-align: center; }

/* Confirm dialog */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, .38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s;
}
.modal-backdrop.show { opacity: 1; }
.modal { width: min(380px, 100%); padding: 20px; border-radius: 22px; box-shadow: var(--shadow); transform: translateY(10px) scale(.97); transition: transform .22s ease; }
.modal-backdrop.show .modal { transform: none; }
.modal h3 { margin: 0 0 6px; font-size: 17px; }
.modal p { margin: 0 0 18px; color: var(--muted); overflow-wrap: anywhere; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) {
  .modal-backdrop { place-items: end center; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* Toast */
.toast {
  position: fixed; z-index: 40; top: calc(68px + env(safe-area-inset-top)); left: 50%; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 14px; box-shadow: var(--shadow); font-size: 14px; transform: translateX(-50%); transition: opacity .3s, transform .3s;
}
.toast.hide { opacity: 0; transform: translate(-50%, -8px); pointer-events: none; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); transition: background .2s; }
.stat.compact { gap: 3px; padding: 12px; }
.stat.compact b { font-size: clamp(14px, 4.4vw, 19px); }
a.stat:hover { background: var(--surface-2); }
.stat-icon { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--none-bg); color: var(--none); }
.stat.pending .stat-icon { background: var(--pending-bg); color: var(--pending); }
.stat.approved .stat-icon { background: var(--approved-bg); color: var(--approved); }
.stat.rejected .stat-icon { background: var(--rejected-bg); color: var(--rejected); }
.stat b { font-size: 24px; line-height: 1.05; white-space: nowrap; }
/* Labels stay on one line; the count goes to its own line instead of wrapping. */
.stat-label, .stat-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-sub { margin-top: -4px; color: var(--muted); font-size: 12px; opacity: .8; }
.stat.compact .stat-sub { margin-top: 0; }

/* Operators */
.admin-card { padding: 0; }
.admin-card .person { padding: 12px 12px 10px 14px; }
.initials { display: grid; flex: none; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--none-bg); color: var(--text); font-weight: 700; }
.work { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 12px 12px; }
.work-item { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 7px 6px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; }
.work-item b { color: var(--text); font-size: 14px; }
.work-item.approved .i { color: var(--approved); } .work-item.rejected .i { color: var(--rejected); } .work-item.pending .i { color: var(--pending); }
.summary { padding-top: 6px; padding-bottom: 6px; }
/* Compact select in a section header, e.g. the period of admin stats */
.chip-select {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px 7px 14px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.chip-select:hover { background: var(--surface-2); }
.chip-select .i { color: var(--muted); transition: transform .2s; }
.dropdown.open .chip-select .i { transform: rotate(180deg); }
.menu-item .tick { margin-left: auto; color: var(--approved); }

/* Broadcast progress */
.progress { height: 6px; margin: 10px 0 0; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--approved); transition: width .4s ease; }
.message-text { margin: 8px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }

/* Welcome picture */
.welcome-preview { display: block; width: 100%; aspect-ratio: 16 / 9; margin: 12px 0; border-radius: 14px; object-fit: cover; background: var(--surface-2); }
.file-pick {
  display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px;
  color: var(--muted); font-size: 14px; cursor: pointer;
}
.file-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-pick.chosen { border-style: solid; color: var(--text); }

/* Login */
.login { max-width: 420px; margin: 12vh auto 0; text-align: center; }
.login .stat-icon { margin: 0 auto 14px; width: 48px; height: 48px; border-radius: 14px; }
.admin-card .meta .badge { margin-right: 6px; padding: 1px 8px; vertical-align: 1px; }
.manager-note { display: flex; gap: 10px; align-items: flex-start; }
.manager-note .i { flex: none; margin-top: 2px; color: var(--muted); }
