/* Партнёрская программа: компактный реестр и личный кабинет. */
:root {
  color-scheme: light dark;
  --bg: #f7f7fb;
  --card: #fff;
  --text: #16161d;
  --muted: #6b6b76;
  --brand: #58cc02;
  --brand-text: #2f7a00;
  --line: #e5e5ec;
  --accent-bg: #f3faed;
  --danger: #c33;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1118; --card: #1a1d27; --text: #f2f3f7;
    --muted: #9a9aa6; --brand-text: #7ee03a; --line: #2a2e3a;
    --accent-bg: #202e1b; --danger: #ff8585;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.brandbar { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.logo { font-size: 26px; font-weight: 850; letter-spacing: -1.5px; color: var(--text); text-decoration: none; }
.logo span { color: var(--brand); }
.brand-caption { color: var(--muted); font-size: 12px; border-left: 1px solid var(--line); padding-left: 24px; }
main { max-width: 1440px; margin: 0 auto; padding: 20px 24px 40px; }
.partner-page main { max-width: 960px; }
header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
h1 { font-size: 27px; letter-spacing: -.7px; line-height: 1.2; margin: 4px 0; }
h2 { font-size: 18px; margin: 0 0 10px; }
p { margin: 8px 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.eyebrow { display: block; color: var(--muted); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.narrow { max-width: 380px; margin: 10vh auto 0; }
.narrow h1 { font-size: 22px; }
label { display: block; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); font: inherit; min-width: 0; }
button { padding: 8px 12px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; background: var(--brand); color: #153800; font: inherit; font-size: 12px; font-weight: 600; }
button.secondary { background: var(--card); color: var(--text); border-color: var(--line); }
button.link { background: none; color: var(--brand-text); padding: 0; border: 0; text-align: left; }
button.danger { background: none; color: var(--danger); padding: 0; border: 0; }
button:disabled, fieldset:disabled { opacity: .55; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.error { color: var(--danger); margin: 8px 0; }
.error:empty { display: none; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-width: 0; }
.tile .value { font-size: 23px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .label { font-size: 11px; color: var(--muted); }
.tile.accent .value { color: var(--brand-text); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; }
.metrics > div { padding: 12px 16px; border-right: 1px solid var(--line); }
.metrics > div:last-child { border-right: 0; }
.metrics strong { display: block; font-size: 25px; margin-top: 3px; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 4px 8px; margin-top: 7px; border-radius: 6px; font-size: 11px; color: var(--brand-text); background: var(--accent-bg); }
.linkbox { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.linkbox code { padding: 8px 10px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); word-break: break-all; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 12px; }
th { font-size: 10px; font-weight: 500; color: var(--muted); background: var(--bg); }
td.num, th.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); padding: 24px 8px; text-align: center; }
.registry-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.registry-toolbar input { flex: 1; min-width: 220px; }
.registry-toolbar select { width: auto; }
.registry-toolbar input, .registry-toolbar select { margin-top: 0; font-size: 12px; }
.registry td:first-child { min-width: 170px; position: sticky; left: 0; background: var(--card); }
.registry th:first-child { position: sticky; left: 0; z-index: 1; }
.registry td small { display: block; font-size: 10px; color: var(--muted); }
.registry td:last-child { color: var(--brand-text); font-weight: 600; }
.registry tbody tr:hover td { background: var(--accent-bg); }
.registry-hint { margin: 10px 0 0; }
.pagination { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 11px; color: var(--muted); }
.pagination label { display: flex; align-items: center; gap: 6px; margin: 0 0 0 auto; font-size: 11px; }
.pagination select { width: auto; margin-top: 0; padding: 6px; }
.page-controls { display: flex; align-items: center; gap: 6px; }
.page-controls button { padding: 6px 10px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.notice { border-color: var(--brand); }
pre.message { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 12px; font: inherit; }
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: 480px; max-width: calc(100% - 24px); max-height: calc(100dvh - 24px); overflow: auto; }
dialog::backdrop { background: #131b2466; }
body:has(dialog[open]) { overflow: hidden; }
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: 660px; max-width: 100%; height: 100dvh; max-height: 100dvh; padding: 0; border-radius: 0; box-shadow: -12px 0 60px #16231426; }
.drawer-heading { position: sticky; top: 0; z-index: 2; background: var(--card); padding: 14px 18px; margin: 0; border-bottom: 1px solid var(--line); }
.drawer-heading .actions { flex-wrap: nowrap; }
.drawer-body { padding: 16px 18px 24px; }
.drawer-body > h2 { font-size: 22px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.detail-section { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.detail-section > summary { cursor: pointer; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.tabs { display: flex; gap: 18px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.tab { padding: 0 0 8px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.sync-info { margin: -4px 0 14px; color: var(--muted); font-size: 11px; }
.sync-info summary { cursor: pointer; }
@media (max-width: 640px) {
  .brandbar { padding: 10px 12px; gap: 16px; }
  .brand-caption { padding-left: 16px; font-size: 10px; }
  main { padding: 16px 12px 24px; }
  h1 { font-size: 24px; }
  .page-heading { align-items: flex-start; }
  .card { padding: 12px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics > div { padding: 10px 12px; }
  .metrics > div:nth-child(2) { border-right: 0; }
  .metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metrics strong { font-size: 23px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .value { font-size: 21px; }
  .registry-toolbar input { min-width: 100%; }
  .registry-toolbar select { flex: 1; width: 0; }
  .registry td:first-child { min-width: 145px; }
  .registry td:first-child button { max-width: 145px; white-space: normal; }
  .pagination { flex-wrap: wrap; gap: 8px; }
  .page-controls { width: 100%; justify-content: space-between; }
  .drawer-heading { padding: 12px; flex-wrap: nowrap; }
  .drawer-body { padding: 14px 12px 24px; }
}
