/* /admin only, on top of /lic/lic.css (the cabinet palette). No inline styles: the page stays CSP-friendly. */

.flush { margin: 0; }
.gap-top { margin-top: 12px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.02em; }
.hint { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.label { font-size: 0.9rem; color: var(--muted); }
.stack.tight { gap: 6px; }
.row.spread { justify-content: space-between; }
.row.tight { gap: 4px; flex-wrap: wrap; }
.search { max-width: 320px; }
select.auto { width: auto; }

/* Tabs, as in the cabinet */
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 20px; overflow-x: auto; }
.admin-tabs button {
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted);
  padding: 10px 16px; min-height: 44px; font-weight: 600; white-space: nowrap;
}
.admin-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.panel > section, .panel > div > section { margin-top: 28px; }

/* Forms */
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); align-items: start; }
fieldset.box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 16px; margin: 0; min-width: 0; }
fieldset.box legend { padding: 0 6px; font-weight: 600; color: var(--text); }
label.inline { flex-direction: row; align-items: center; gap: 10px; }
label.inline input { max-width: 180px; }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 1rem; cursor: pointer; }
label.check input { width: 22px; height: 22px; min-height: 0; flex: none; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 38px; padding: 6px 14px; border-radius: 99px; }
.chips button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.seg { flex-wrap: wrap; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
textarea.mono, #promo-created-codes { font-size: 0.92rem; }

/* Tables */
.table-wrap.tall { max-height: 560px; }
tr.click { cursor: pointer; }
tr.click:hover td, tr.click:focus-visible td { background: var(--accent-soft); }
tr.click:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
td .sub { display: block; font-size: 0.8rem; color: var(--muted); }
progress.meter { -webkit-appearance: none; appearance: none; vertical-align: middle; width: 60px; height: 6px; border: 0; border-radius: 99px; overflow: hidden; margin-right: 8px; background: var(--line); }
progress.meter::-webkit-progress-bar { background: var(--line); }
progress.meter::-webkit-progress-value { background: var(--ok); }
progress.meter::-moz-progress-bar { background: var(--ok); }

dialog { width: min(560px, calc(100vw - 32px)); max-width: min(560px, calc(100vw - 32px)); }
dialog .table-wrap { max-height: 300px; }

@media (max-width: 640px) {
  main { padding: 16px 12px 48px; }
  .search { max-width: none; }
  .card { padding: 16px; }
  .row > button { flex: 1 1 auto; }
}

/* «Гроші» (money.js, А5): the red line over the tabs, provider cards, the 28-day spend bars */
.money-alert { margin: 0 0 16px; }
.money-alert a { color: inherit; font-weight: 600; }
.money-card.critical { border-color: var(--danger); }
.money-card h3 { font-size: 1.1rem; }
.money-card .row.spread { gap: 8px; }
svg.spark { width: 100%; height: 48px; display: block; }
svg.spark rect { fill: var(--accent); }
svg.spark rect:hover { fill: var(--warn); }
.money-card .sub { display: block; font-size: 0.8rem; color: var(--muted); }

/* «Сигнали» (signals.js, А7): the tab's counter, groups by severity, rows already seen dimmed */
.tab-count { display: inline-block; min-width: 1.4em; margin-left: 6px; padding: 0 6px; border-radius: 99px; font-size: 0.75rem;
  line-height: 1.5; text-align: center; background: var(--warn-soft); color: var(--warn); }
.tab-count.bad { background: var(--danger); color: #fff; }
.tab-count[hidden] { display: none; }
.signal-group.bad { border-color: var(--danger); }
.signal-group tr.seen td { opacity: 0.6; }
.flag-badge { white-space: nowrap; }

/* «Пакети» (plans.js, А4): a card per plan, small number boxes, a plan not sold dimmed, the raw JSON box */
.plan-card.off { opacity: 0.75; border-style: dashed; }
.plan-card h3 input { font-size: 1rem; font-weight: 600; max-width: 100%; }
input.num-in { width: 7.5em; }
.plan-card td input[type="text"] { width: 100%; min-width: 12em; }
textarea.plans-raw { width: 100%; min-height: 360px; font-size: 0.85rem; }
.plans-actions { position: sticky; top: 0; z-index: 2; padding: 8px 0; background: var(--bg, #fff); }
label.check { display: inline-flex; align-items: center; gap: 4px; }

/* «Компанії» (companies.js, А6): a card per company, facts as two columns (one on a phone), a company off dimmed */
.org-card.off { opacity: 0.75; border-style: dashed; }
dl.facts { display: grid; grid-template-columns: minmax(8em, max-content) 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 0.9rem; }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
dl.facts dd .sub { display: block; font-size: 0.8rem; color: var(--muted); }
dl.facts input[type="password"] { max-width: 22em; }
.org-card h4 { font-size: 0.95rem; margin-top: 4px; }
.org-card dd > .stack.tight > span { align-self: flex-start; } /* a key's state badge, not a full-width bar */
@media (max-width: 640px) {
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dd { margin-bottom: 8px; }
}

/* «Релізи» (releases.js, А8): «Що нового» keeps its line breaks (Mac shows one <li> a line) */
.pre { white-space: pre-line; }

/* «Зараз важливо» (now.js, А0): red cards first, yellow under them; «Звернення та збої» (issues.js, А11): the record's dialog */
.now-card.critical { border-color: var(--danger); border-width: 2px; }
.now-card.warn { border-color: var(--warn); }
.now-card h3 { font-size: 1.05rem; }
dialog.wide { width: min(900px, calc(100vw - 32px)); max-width: min(900px, calc(100vw - 32px)); }
pre.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
