/* MOS-CLIENT-CABINET-1 -- Marketing OS client cabinet. Self-contained (the cabinet host serves nothing else). */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6470;
  --line: #e1e4ea;
  --accent: #2f5bea;
  --accent-text: #ffffff;
  --accent-soft: #e8eefe;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn-soft: #fff6e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --text: #e9ebef;
    --muted: #9aa1ad;
    --line: #2b3039;
    --accent: #7b9cff;
    --accent-text: #0d1020;
    --accent-soft: #1e2740;
    --danger: #ff8a80;
    --danger-soft: #3a1d1c;
    --warn-soft: #3a3220;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }

.cab-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.cab-brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.cab-brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.cab-brand-sub { color: var(--muted); font-size: 13px; }
.cab-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cab-who-name { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

.cab-page { max-width: 1040px; margin: 0 auto; padding: 24px; }
.cab-h1 { font-size: 22px; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.01em; }
.cab-lead { color: var(--muted); margin: 0 0 20px; }

.cab-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.cab-page .cab-card { margin-top: 16px; }
.cab-page .cab-lead + .cab-card { margin-top: 0; }

.cab-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.cab-btn:hover { border-color: var(--muted); }
.cab-btn:focus-visible, .cab-input:focus-visible, .cab-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cab-btn[disabled] { opacity: .6; cursor: default; }
.cab-btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.cab-btn-accent:hover { border-color: var(--accent); filter: brightness(1.05); }
.cab-btn-quiet { border-color: transparent; background: transparent; color: var(--muted); padding: 0 8px; }

/* sign-in */
.cab-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.cab-login { width: 100%; max-width: 380px; }
.cab-login .cab-brand-name { font-size: 24px; }
.cab-login-sub { color: var(--muted); margin: 2px 0 22px; }
.cab-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.cab-field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.cab-input, .cab-select {
  width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
}
.cab-login .cab-btn { width: 100%; margin-top: 6px; }
.cab-note { border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; font-size: 14px; }
.cab-note-warn { background: var(--warn-soft); }
.cab-note-error { background: var(--danger-soft); color: var(--danger); }
.cab-login-foot { color: var(--muted); font-size: 13px; margin: 16px 0 0; }

/* controls */
.cab-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.cab-controls .cab-field { margin: 0; min-width: 150px; }
.cab-controls .cab-grow { flex: 1 1 220px; }
.cab-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.cab-chip { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13px; }
.cab-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.cab-controls + .cab-controls { margin-top: 12px; }
.cab-static { min-height: 42px; display: flex; align-items: center; font-weight: 600; }

/* report */
.cab-total { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cab-total-value { font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.cab-total-label { color: var(--muted); }
.cab-meta { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.cab-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.cab-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cab-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cab-table tr:last-child td { border-bottom: 0; }
.cab-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cab-src { font-weight: 600; }
.cab-detail { color: var(--muted); font-size: 13px; word-break: break-word; }
.cab-bar { height: 6px; border-radius: 3px; background: var(--accent-soft); margin-top: 6px; overflow: hidden; }
.cab-bar > i { display: block; height: 100%; background: var(--accent); }
.cab-zero td { color: var(--muted); }
.cab-h2 { font-size: 16px; margin: 0 0 12px; }

/* states */
.cab-empty { text-align: center; padding: 36px 16px; }
.cab-empty-title { font-weight: 700; font-size: 17px; margin: 0 0 6px; }
.cab-empty-text { color: var(--muted); margin: 0 auto; max-width: 460px; }
.cab-empty .cab-btn { margin-top: 16px; }
.cab-loading { color: var(--muted); padding: 28px 0; text-align: center; }

@media (max-width: 640px) {
  .cab-top { padding: 12px 16px; }
  .cab-brand-sub { display: none; }
  .cab-who-name { max-width: 140px; }
  .cab-page { padding: 16px; }
  .cab-card { padding: 16px; }
  .cab-controls .cab-field, .cab-controls .cab-grow { flex: 1 1 100%; min-width: 0; }
  .cab-controls .cab-date { flex: 1 1 calc(50% - 6px); }
  .cab-controls .cab-btn { width: 100%; }
  .cab-total-value { font-size: 34px; }
  .cab-table thead { display: none; }
  .cab-table, .cab-table tbody, .cab-table tr, .cab-table td { display: block; width: 100%; }
  .cab-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
  .cab-table tr:last-child { border-bottom: 0; }
  .cab-table td { padding: 0; border: 0; }
  .cab-table td:first-child { grid-column: 1; grid-row: 1 / span 2; }
  .cab-table td.cab-num { grid-column: 2; grid-row: 1; }
  .cab-table td.cab-share { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 13px; }
}
/* FIX-1: «Выход не подтверждён» has two actions side by side (stacked on a phone) */
.cab-logout-failed .cab-btn { margin: 16px 6px 0; }
