/* GSC Backlink Monitor — собственные стили на CSS-переменных.
   Стиль: современный GitHub (светлая тема) — белый фон, тонкие рамки, скругление 6px,
   системный шрифт, зелёные основные кнопки, синий акцент. Без фирменных элементов GitHub. */

:root {
  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --bg-hover: #f3f5f7;
  --bg-active: rgba(129, 139, 152, 0.12);
  --surface: #ffffff;
  --text: #1f2328;
  --heading: #1f2328;
  --muted: #59636e;
  --subtle: #818b98;
  --line: #d1d9e0;
  --line-muted: #e5e9ed;

  --accent: #0969da;
  --accent-subtle: #ddf4ff;
  --accent-line: rgba(84, 174, 255, 0.4);
  --primary: #1f883d;           /* основная кнопка — зелёная */
  --primary-hover: #1c8139;

  --green-fg: #1a7f37;  --green-bg: #dafbe1;  --green-line: rgba(74, 194, 107, 0.4);
  --yellow-fg: #9a6700; --yellow-bg: #fff8c5; --yellow-line: rgba(212, 167, 44, 0.4);
  --red-fg: #d1242f;    --red-bg: #ffebe9;    --red-line: rgba(255, 129, 130, 0.4);
  --purple-fg: #8250df; --purple-bg: #fbefff; --purple-line: rgba(194, 151, 255, 0.4);
  --gray-fg: #59636e;   --gray-bg: #f6f8fa;   --gray-line: #d1d9e0;

  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 0 rgba(31, 35, 40, 0.04);
  --shadow-overlay: 0 8px 24px rgba(140, 149, 159, 0.25), 0 0 0 1px var(--line);
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --row-h: 40px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); }
h1, h2, h3, h4 { color: var(--heading); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: 16px; } h3 { font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: 12px; background: var(--bg-active); padding: .15em .4em; border-radius: var(--radius); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.icon { width: 16px; height: 16px; flex: none; vertical-align: -3px; }

/* --- раскладка --- */
.layout { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--bg-subtle); padding: 16px; display: flex; flex-direction: column; gap: 16px; z-index: 40; border-right: 1px solid var(--line); overflow-y: auto; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px 32px 96px; max-width: 1400px; width: 100%; }

.brand { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.brand-mark { width: 32px; height: 32px; border-radius: var(--radius); background: var(--text); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.brand-mark.lg { width: 48px; height: 48px; border-radius: 10px; }
.brand-mark.lg .icon { width: 24px; height: 24px; }
.brand-name { font-weight: 600; color: var(--heading); font-size: 14px; }
.brand .sidebar-close { margin-left: auto; display: none; }

.project-switcher { position: relative; }
.project-switcher > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius); background: var(--surface); cursor: pointer; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.project-switcher > summary::-webkit-details-marker { display: none; }
.project-switcher > summary:hover { background: var(--bg-hover); }
.ps-avatar { width: 28px; height: 28px; border-radius: var(--radius); background: var(--accent-subtle); color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: inset 0 0 0 1px var(--accent-line); }
.ps-avatar.sm { width: 22px; height: 22px; font-size: 11px; }
.ps-text { display: flex; flex-direction: column; min-width: 0; flex: 1; text-align: left; line-height: 1.3; }
.ps-name { font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-site { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-chevron { color: var(--muted); }
.ps-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); padding: 8px; z-index: 50; max-height: 60vh; overflow-y: auto; }
.ps-menu form { margin: 0; }
.ps-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; background: none; border-radius: var(--radius); cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.ps-item:hover { background: var(--bg-active); text-decoration: none; }
.ps-item.is-current { font-weight: 600; }
.ps-item .icon { color: var(--accent); }
.ps-manage { border-top: 1px solid var(--line-muted); margin-top: 6px; padding-top: 10px; border-radius: 0 0 var(--radius) var(--radius); color: var(--accent); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 8px; min-height: 32px; border-radius: var(--radius); color: var(--text); }
.nav-item .icon { color: var(--muted); }
.nav-item:hover { background: var(--bg-active); text-decoration: none; }
.nav-item.is-active { background: var(--bg-active); font-weight: 600; }
.nav-item.is-active::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 4px; border-radius: 6px; background: var(--accent); }
.nav-item.is-active .icon { color: var(--text); }
.nav-item.is-disabled { color: var(--subtle); cursor: default; }
.nav-item.is-disabled:hover { background: none; }
.nav-item.is-disabled .icon { color: var(--subtle); }
.nav-item .soon { margin-left: auto; font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 2em; border: 1px solid var(--line); color: var(--muted); }

.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 32px; background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-title { font-size: 20px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar .burger { display: none; }

.user-menu { position: relative; }
.user-menu > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.dropdown { position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); min-width: 200px; padding: 8px; z-index: 60; }
.dropdown form { margin: 0; }
.dropdown-head { padding: 6px 8px; font-weight: 600; color: var(--heading); border-bottom: 1px solid var(--line-muted); margin-bottom: 6px; }
.dropdown-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; min-height: 32px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; border-radius: var(--radius); text-align: left; }
.dropdown-item:hover { background: var(--bg-active); text-decoration: none; }
.dropdown-item .icon { color: var(--muted); }

/* --- коробки (Box) --- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card, .card + .grid, .grid + .card, .stack > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; flex: 1; font-size: 16px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: 12px 16px; margin: 0; background: var(--bg-subtle); border-bottom: 1px solid var(--line); }
.card-flush > .card-head h2 { font-size: 14px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > .card { margin-top: 0; }

.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.metrics > .card { margin-top: 0; }
.metric { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
a.metric-link { color: inherit; transition: border-color .12s, background .12s; }
a.metric-link:hover { text-decoration: none; border-color: var(--accent-line); background: var(--bg-subtle); }
.metric > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.metric-icon { width: 36px; height: 36px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.metric-icon .icon { width: 18px; height: 18px; }
.metric-value { font-size: 24px; font-weight: 600; color: var(--heading); line-height: 1.2; font-variant-numeric: tabular-nums; }
.small-value { font-size: 14px !important; }
.metric-label { color: var(--muted); font-size: 12px; }
.mi-violet, .mi-teal { background: var(--purple-bg); color: var(--purple-fg); }
.mi-blue { background: var(--accent-subtle); color: var(--accent); }
.mi-yellow { background: var(--yellow-bg); color: var(--yellow-fg); }
.mi-green { background: var(--green-bg); color: var(--green-fg); }
.mi-red { background: var(--red-bg); color: var(--red-fg); }
.mi-gray { background: var(--bg-subtle); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-muted); }

/* --- кнопки и поля --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-subtle); color: var(--text); font: inherit; font-weight: 500; line-height: 1; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s; }
.btn:hover { text-decoration: none; background: var(--bg-hover); border-color: var(--line); }
.btn .icon { color: var(--muted); }
.btn-primary { background: var(--primary); border-color: rgba(31, 35, 40, 0.15); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-primary .icon { color: #fff; }
.btn-danger { color: var(--red-fg); }
.btn-danger .icon { color: var(--red-fg); }
.btn-danger:hover { background: #cf222e; border-color: rgba(31, 35, 40, 0.15); color: #fff; }
.btn-danger:hover .icon { color: #fff; }
.btn-success { color: var(--green-fg); }
.btn-success .icon { color: var(--green-fg); }
.btn-mine { color: var(--purple-fg); }
.btn-mine .icon { color: var(--purple-fg); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--bg-active); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 40px; padding: 0 16px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.icon-btn { width: 32px; height: 32px; border-radius: var(--radius); border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: var(--bg-active); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.ok:hover, .icon-btn.ok.is-on { color: var(--green-fg); background: var(--green-bg); }
.icon-btn.bad:hover, .icon-btn.bad.is-on { color: var(--red-fg); background: var(--red-bg); }
.icon-btn.mine:hover, .icon-btn.mine.is-on { color: var(--purple-fg); background: var(--purple-bg); }
.icon-btn.has-comment { color: var(--accent); background: var(--accent-subtle); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row > .field { flex: 1 1 220px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--heading); font-size: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.field-label { display: flex; gap: 6px; align-items: baseline; }
input[type=text], input[type=password], input[type=search], input:not([type]), input[type=url], select, textarea {
  height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); font: inherit; color: var(--text); width: 100%; box-shadow: inset 0 1px 0 rgba(208, 215, 222, 0.2); }
textarea { height: auto; padding: 8px 12px; min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--text); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 14px; height: 14px; }
.check strong { color: var(--heading); }
input[type=file] { font: inherit; font-size: 13px; }

/* --- сообщения (Flash) --- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; color: var(--text); }
.alert .icon { margin-top: 2px; }
.alert-warning { background: var(--yellow-bg); border-color: var(--yellow-line); }
.alert-warning .icon { color: var(--yellow-fg); }
.alert-error { background: var(--red-bg); border-color: var(--red-line); }
.alert-error .icon { color: var(--red-fg); }
.alert-info { background: var(--accent-subtle); border-color: var(--accent-line); }
.alert-info .icon { color: var(--accent); }
.alert-success { background: var(--green-bg); border-color: var(--green-line); }
.alert-success .icon { color: var(--green-fg); }
.site-alert { border-width: 2px; }
.site-confirm { padding: 10px 12px; border: 1px solid var(--red-line); background: var(--red-bg); border-radius: var(--radius); }
.toasts { position: fixed; top: 68px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--surface); box-shadow: var(--shadow-overlay); border-radius: var(--radius); padding: 10px 14px 10px 12px; border-left: 4px solid var(--green-fg); color: var(--text); animation: toast-in .18s ease-out; }
.toast-error { border-left-color: var(--red-fg); }
.toast-warning { border-left-color: var(--yellow-fg); }
.toast.is-leaving { opacity: 0; transform: translateX(16px); transition: all .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* --- метки (Label) --- */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 2em; font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap; border: 1px solid transparent; }
.pill-pending { background: var(--yellow-bg); color: var(--yellow-fg); border-color: var(--yellow-line); }
.pill-keep, .pill-done { background: var(--green-bg); color: var(--green-fg); border-color: var(--green-line); }
.pill-reject, .pill-failed { background: var(--red-bg); color: var(--red-fg); border-color: var(--red-line); }
.pill-mine { background: var(--purple-bg); color: var(--purple-fg); border-color: var(--purple-line); }
.pill-running, .pill-new-domain { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent-line); }
.pill-new-url, .pill-gray { background: transparent; color: var(--muted); border-color: var(--line); }
.pill-inherited { border-style: dashed; background: transparent; }
.pill-inherited.pill-pending { border-color: #d4a72c; }
.pill-inherited.pill-keep { border-color: #4ac26b; }
.pill-inherited.pill-reject { border-color: #ff8182; }
.pill-inherited.pill-mine { border-color: #c297ff; }
.pill-note { font-weight: 400; opacity: .85; }
.pill-icon { width: 12px; height: 12px; vertical-align: -1px; }
a.pill:hover { text-decoration: none; filter: brightness(.97); }

/* --- таблицы --- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll { max-height: 560px; overflow: auto; }
.table-scroll thead th { position: sticky; top: 0; z-index: 1; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 16px; background: var(--bg-subtle); white-space: nowrap; border-bottom: 1px solid var(--line); }
.table td { padding: 0 16px; height: var(--row-h); border-top: 1px solid var(--line-muted); vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: var(--bg-subtle); }
.table td.wrap { white-space: normal; padding-top: 8px; padding-bottom: 8px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-compact td { height: 36px; }
.table tbody tr.is-selected td { background: var(--accent-subtle); }
.url-cell { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-head-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; gap: 12px; background: var(--bg-subtle); border-bottom: 1px solid var(--line); }
.links-table th, .links-table td { padding-left: 10px; padding-right: 10px; }
.links-table td { white-space: nowrap; }
.links-table .flex-cell { width: 100%; max-width: 0; min-width: 150px; }
.links-table .url-cell.flex-cell { max-width: 0; }
.cell-check { width: 36px; padding-right: 0 !important; }
.cell-check input { width: 14px; height: 14px; accent-color: var(--accent); vertical-align: middle; }
.comment-cell { max-width: 180px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.row-actions { white-space: nowrap; text-align: right; }
.donor-cell { white-space: nowrap; }
.donor-link { color: var(--heading); font-weight: 600; }
.date-cell { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sort-link { color: inherit; }
.sort-link.is-active { color: var(--text); }
.sort-link:hover { text-decoration: none; color: var(--accent); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 12px; border-top: 1px solid var(--line-muted); }
.icon-link { color: var(--muted); margin-left: 6px; }
.icon-link .icon { width: 14px; height: 14px; }
.icon-link:hover { color: var(--accent); }

/* --- фильтры --- */
.filters { display: flex; flex-direction: column; gap: 10px; }
.filters-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters-row { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.filters-label { color: var(--muted); font-size: 12px; font-weight: 600; margin-left: 2px; }
.search { position: relative; flex: 1 1 280px; }
.search .icon { position: absolute; left: 10px; top: 8px; color: var(--muted); }
.search input { padding-left: 32px; }
.chips { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-subtle); }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; color: var(--text); font-size: 13px; cursor: pointer; white-space: nowrap; user-select: none; border-right: 1px solid var(--line); }
.chips > .chip:last-child { border-right: 0; }
.chip:hover { background: var(--bg-hover); text-decoration: none; }
.chip.is-on { background: var(--bg); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.chip input { display: none; }
span.chip.is-on { border: 1px solid var(--line); border-radius: var(--radius); }
.select-sm { height: 28px; width: auto; max-width: 280px; font-size: 13px; padding: 0 8px; }

/* --- меню строки и уровни адреса --- */
.row-menu { display: inline-block; position: relative; }
.row-menu > summary { list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-dropdown { width: 300px; padding: 12px; white-space: normal; text-align: left; }
.menu-sep { height: 1px; background: var(--line-muted); margin: 8px -8px; }
.menu-label { font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12px; max-height: 200px; overflow-y: auto; }
.host-levels { display: inline-flex; align-items: baseline; white-space: nowrap; font-weight: 600; color: var(--heading); }
.lvl { display: inline; position: relative; }
.lvl > summary { list-style: none; display: inline; }
.lvl > summary::-webkit-details-marker { display: none; }
.lvl-seg { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-decoration-color: var(--subtle); text-underline-offset: 3px; border-radius: 4px; padding: 1px 2px; }
.lvl-seg:hover, .lvl[open] > .lvl-seg { background: var(--accent-subtle); color: var(--accent); text-decoration-color: var(--accent); }
.lvl-seg.st-reject { color: var(--red-fg); text-decoration-color: var(--red-fg); text-decoration-style: solid; }
.lvl-seg.st-keep { color: var(--green-fg); text-decoration-color: var(--green-fg); text-decoration-style: solid; }
.lvl-seg.st-mine { color: var(--purple-fg); text-decoration-color: var(--purple-fg); text-decoration-style: solid; }
.lvl-dot { color: var(--subtle); }
.lvl-suffix { color: var(--muted); font-weight: 400; }
.lvl-dropdown { width: 300px; padding: 8px; white-space: normal; text-align: left; font-weight: 400; color: var(--text); }
.lvl-name { font-weight: 600; color: var(--heading); word-break: break-all; }
.lvl-menu-head { padding: 2px 8px; }

/* --- плавающая панель массовых действий --- */
.bulk-bar { position: fixed; left: 50%; bottom: 24px; transform: translateX(calc(-50% + var(--sidebar-w) / 2)); background: var(--surface); color: var(--text); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); padding: 8px 8px 8px 16px; display: flex; gap: 6px; align-items: center; z-index: 45; flex-wrap: nowrap; white-space: nowrap; max-width: calc(100vw - var(--sidebar-w) - 32px); }
.bulk-bar[hidden] { display: none; }
.bulk-count { margin-right: 6px; }

/* --- пустые состояния (Blankslate) --- */
.empty { text-align: center; padding: 40px 24px; }
.empty-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-subtle); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; box-shadow: inset 0 0 0 1px var(--line-muted); }
.empty-icon .icon { width: 24px; height: 24px; }
.empty h2 { margin-bottom: 4px; font-size: 20px; }
.empty p { color: var(--muted); max-width: 520px; margin: 0 auto 16px; }

/* --- вход --- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: var(--bg-subtle); }
.auth-card { width: 100%; max-width: 340px; padding: 0; border: 0; background: transparent; }
.auth-card .form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.auth-title { font-size: 24px; font-weight: 300; text-align: center; margin-bottom: 4px; letter-spacing: -0.3px; }
.auth-card > .muted { margin-bottom: 0; }
.auth-card.card.center { padding: 24px; background: var(--surface); border: 1px solid var(--line); }

/* --- загрузка, отчёт импорта --- */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 40px 24px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg-subtle); cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-subtle); }
.dropzone .empty-icon { margin: 0; background: var(--bg); }
.dropzone strong { color: var(--heading); font-size: 16px; font-weight: 600; }
.dropzone input[type=file] { display: none; }
.dropzone .file-name { font-weight: 600; color: var(--accent); }
.progress { height: 8px; background: var(--line-muted); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--heading); }
.stat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stat-value { font-size: 20px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-accent { border-color: var(--accent-line); background: var(--accent-subtle); }
.stat-accent .stat-value { color: var(--accent); }
.mapping-select { min-width: 160px; height: 28px; font-size: 12px; }
.preview th { vertical-align: bottom; }
.preview th .mapping-select { margin-top: 6px; font-weight: 400; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.steps strong { color: var(--heading); }
.plain-list { margin: 6px 0 0; padding-left: 18px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- disavow: diff в стиле code review --- */
.diff-h { font-size: 14px; }
.diff-h.add { color: var(--green-fg); }
.diff-h.del { color: var(--red-fg); }
.diff-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--mono); font-size: 12px; }
.diff-list li { padding: 3px 10px; word-break: break-all; border-top: 1px solid var(--line-muted); }
.diff-list li:first-child { border-top: 0; }
.diff-list li.add { background: #e6ffec; }
.diff-list li.add::before { content: "+ "; color: var(--green-fg); }
.diff-list li.del { background: #ffebe9; }
.diff-list li.del::before { content: "− "; color: var(--red-fg); }
.diff-list li code { background: none; padding: 0; }
.warn-text { color: var(--red-fg); font-weight: 600; }

/* --- адаптив --- */
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-overlay); }
  body.sidebar-open .sidebar { transform: none; }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(31, 35, 40, .4); z-index: 35; }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .brand .sidebar-close { display: inline-flex; }
  .main { margin-left: 0; }
  .topbar .burger { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .content { padding: 16px 12px 96px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .bulk-bar { transform: translateX(-50%); max-width: calc(100vw - 24px); bottom: 12px; flex-wrap: wrap; white-space: normal; }
}
@media (max-width: 560px) { .hide-sm { display: none; } .card:not(.card-flush) { padding: 12px; } .metric-value { font-size: 20px; } }
