/*
 * Общий стиль сервиса (вариант B из макетов): тёмное боковое меню, светлое рабочее поле, синий акцент.
 * Подключается в templates/layout.html; страницы добавляют только свои мелочи.
 */
:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --border: #e6e8ec;
    --line: #f1f2f4;
    --head: #f9fafb;
    --hover: #f7f8fa;
    --text: #111827;
    --body: #374151;
    --muted: #6b7280;
    --faint: #9ca3af;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-bg: #eff4ff;
    --green: #16a34a;
    --green-bg: #ecfdf3;
    --amber: #b45309;
    --amber-bg: #fff4e0;
    --red: #dc2626;
    --red-bg: #fef2f2;
    --wb: #a3108a;
    --wb-bg: #fbeaf7;
    --ozon: #0050e0;
    --ozon-bg: #e8f0ff;
    --sb: #0f172a;
    --sb-active: #1e293b;
    --sb-text: #cbd5e1;
    --sb-icon: #94a3b8;
    --sb-section: #64748b;
    --sb-w: 248px;
    --sb-w-collapsed: 72px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-pop: 0 12px 32px rgba(15, 23, 42, .14);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overscroll-behavior-y: none; }
body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
    color: var(--body);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { color: var(--text); margin: 0; line-height: 1.25; }
img { max-width: 100%; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 14px; height: 14px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- каркас ---------- */
/* меню закреплено (position: fixed) — не уезжает и не «пружинит» вместе со страницей; место под него — отступ .app */
.app { display: flex; min-height: 100vh; padding-left: var(--sb-w); transition: padding-left .28s cubic-bezier(.4, 0, .2, 1); }
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 30;
    width: var(--sb-w); background: var(--sb); color: var(--sb-text);
    transition: width .28s cubic-bezier(.4, 0, .2, 1);
}
/* содержимое меню прокручивается внутри, а кнопка-«язычок» на правой границе не обрезается */
.sb-inner {
    height: 100%; display: flex; flex-direction: column; gap: 2px; padding: 20px 16px;
    overflow-y: auto; overflow-x: hidden; scrollbar-width: none; overscroll-behavior: contain;
}
.sb-inner::-webkit-scrollbar { display: none; }

/* Свёрнутое меню (72 px) — то же развёрнутое, только уже: иконки, аватар и знак логотипа остаются
   на своих местах (центр свёрнутой колонки — 36 px от левого края), подписи плавно гаснут и обрезаются. */
.sb-top { position: relative; height: 58px; flex: none; margin-bottom: 6px; }
.sb-logo { position: absolute; left: -3px; top: 0; display: block; width: 114px; height: 22px; }
.sb-logo img { position: absolute; top: 0; height: 22px; width: auto; display: block; }
.sb-logo .logo-letters { left: 0; }
.sb-logo .logo-mark { left: 11.2px; }  /* знак — ровно на месте буквы «A» в надписи */
.sb-sub {
    position: absolute; left: -2px; top: 30px; color: var(--sb-section); font-size: 11px; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}
.mobile-logo { height: 16px; width: auto; display: block; }

.sb-toggle {
    position: absolute; top: 19px; right: -12px; z-index: 2;
    width: 24px; height: 24px; border-radius: 50%; padding: 0; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--muted);
    display: grid; place-items: center; box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
    transition: color .15s, box-shadow .15s;
}
.sb-toggle:hover { color: var(--text); box-shadow: 0 2px 6px rgba(15, 23, 42, .18); }
.sb-toggle .icon { width: 14px; height: 14px; transition: transform .28s cubic-bezier(.4, 0, .2, 1); }

.sb-section { position: relative; height: 34px; flex: none; padding: 16px 0 0 11px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sb-section); white-space: nowrap; }
.sb-section::after { content: ""; position: absolute; left: 8px; top: 21px; width: 24px; height: 1px; background: var(--sb-active); opacity: 0; transition: opacity .2s; }
.sb-item {
    position: relative; display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 11px; flex: none;
    border-radius: 8px; color: var(--sb-text); font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden;
}
.sb-item .icon { color: var(--sb-icon); }
.sb-item:hover { background: #172033; color: #fff; }
.sb-item.active { background: var(--sb-active); color: #fff; }
.sb-item.active .icon, .sb-item:hover .icon { color: #fff; }
.sb-spacer { flex: 1; min-height: 16px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 10px 0 0 4px; flex: none; }
.sb-avatar { width: 32px; height: 32px; border-radius: 50%; background: #334155; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.sb-uname { flex: 1; min-width: 0; line-height: 1.25; white-space: nowrap; }
.sb-uname b { display: block; color: #fff; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.sb-uname span { color: var(--sb-section); font-size: 12px; }
.sb-logout { color: var(--sb-icon); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; flex: none; }
.sb-logout:hover { color: #fff; background: var(--sb-active); }

/* то, что гаснет при сворачивании */
.sb-fade, .sb-item span, .sb-section .sb-section-text, .sb-uname, .sb-logout, .sb-sub, .sb-logo .logo-letters {
    transition: opacity .2s ease;
}
@media (min-width: 901px) {
    html.sb-collapsed .sidebar { width: var(--sb-w-collapsed); }
    html.sb-collapsed .app { padding-left: var(--sb-w-collapsed); }
    html.sb-collapsed .sb-item span,
    html.sb-collapsed .sb-section .sb-section-text,
    html.sb-collapsed .sb-uname,
    html.sb-collapsed .sb-sub,
    html.sb-collapsed .sb-logo .logo-letters { opacity: 0; }
    html.sb-collapsed .sb-logout { opacity: 0; pointer-events: none; }
    html.sb-collapsed .sb-section::after { opacity: 1; }
    html.sb-collapsed .sb-toggle .icon { transform: rotate(180deg); }
}
/* невысокий экран (ноутбук): меню плотнее, чтобы помещалось целиком без прокрутки */
@media (min-width: 901px) and (max-height: 860px) {
    .sb-inner { padding-top: 16px; padding-bottom: 14px; gap: 1px; }
    .sb-top { height: 50px; margin-bottom: 2px; }
    .sb-sub { top: 28px; }
    .sb-toggle { top: 15px; }
    .sb-section { height: 28px; padding-top: 11px; }
    .sb-section::after { top: 15px; }
    .sb-item { height: 32px; }
    .sb-spacer { min-height: 10px; }
}
@media (min-width: 901px) and (max-height: 720px) {
    .sb-inner { padding-top: 14px; padding-bottom: 10px; }
    .sb-top { height: 46px; }
    .sb-toggle { top: 13px; }
    .sb-section { height: 22px; padding-top: 6px; font-size: 10px; }
    .sb-section::after { top: 11px; }
    .sb-item { height: 28px; font-size: 13px; }
    .sb-spacer { min-height: 6px; }
    .sb-user { padding-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar, .sb-toggle .icon, .sb-item span, .sb-section .sb-section-text, .sb-uname, .sb-logout, .sb-sub, .sb-logo .logo-letters { transition: none; }
}
.sb-tip {
    position: fixed; z-index: 1000; pointer-events: none; background: #111827; color: #fff; font-size: 13px; font-weight: 500;
    padding: 6px 10px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.18); white-space: nowrap; transform: translateY(-50%);
}

.main { flex: 1; min-width: 0; padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 20px; }
.mobile-bar { display: none; }

/* ---------- заголовок страницы ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: -8px; }

/* ---------- кнопки ---------- */
.btn, .button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover, .button:hover { background: var(--hover); color: var(--text); }
.btn .icon { width: 16px; height: 16px; color: var(--body); }
.btn-primary, .button { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover, .button:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-primary .icon { color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); padding: 0 8px; }
.btn-ghost:hover { background: var(--primary-bg); color: var(--primary-hover); }
.btn-ghost .icon { color: currentColor; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-bg); color: var(--red); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled, .button:disabled { opacity: .55; cursor: default; }
.icon-btn {
    width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--faint);
    display: inline-grid; place-items: center; cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--hover); color: var(--body); }
.icon-btn.danger:hover { background: var(--red-bg); color: var(--red); }

/* ---------- поля ---------- */
.input, .select, input.input, select.select, textarea.input {
    height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: 400 14px var(--font); outline: none; max-width: 100%;
}
textarea.input { height: auto; padding: 10px 12px; }
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.select {
    appearance: none; padding-right: 32px; cursor: pointer;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 13px; font-weight: 500; color: var(--body); }
.field .hint { font-size: 12px; color: var(--faint); }
.field .input, .field .select { width: 100%; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.search { position: relative; display: inline-flex; align-items: center; }
.search .icon { position: absolute; left: 11px; color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.search .input { padding-left: 34px; width: 260px; }
.labeled-select { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 0 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.labeled-select > span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.labeled-select .select { border: 0; height: 34px; padding-left: 0; font-weight: 600; font-size: 13px; box-shadow: none; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; margin: 0; }

/* переключатель (вкладки-сегменты) */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-sm); background: #eef0f3; }
.seg > a, .seg > button, .seg > label {
    border: 0; background: transparent; padding: 0 12px; height: 30px; display: inline-flex; align-items: center;
    border-radius: 6px; color: var(--muted); font: 500 13px var(--font); cursor: pointer; white-space: nowrap;
}
.seg > .active, .seg > a.active, .seg input:checked + span {
    background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.seg input { display: none; }

/* тумблер */
.switch { position: relative; display: inline-block; width: 32px; height: 18px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d1d5db; transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(14px); }

/* ---------- панели ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 18px 20px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .value { color: var(--text); font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .note { color: var(--muted); font-size: 13px; }
.kpi .note.red { color: var(--red); }
.kpi .note.green { color: var(--green); }
.progress { height: 6px; border-radius: 3px; background: #eef0f3; overflow: hidden; margin: 6px 0 2px; max-width: 220px; }
.progress > i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.progress.green > i { background: var(--green); }
.progress.amber > i { background: #d97706; }
.progress.red > i { background: var(--red); }

/* метки */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; background: #f1f3f5; color: var(--muted); }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.blue { background: var(--primary-bg); color: var(--primary); }
.pill.violet { background: #f3eeff; color: #6d28d9; }
.pill.wb { background: var(--wb-bg); color: var(--wb); }
.pill.ozon { background: var(--ozon-bg); color: var(--ozon); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.green { background: var(--green); }
.dot.amber { background: #d97706; }
.dot.red { background: var(--red); }

/* сообщения внутри страницы */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; }
.notice b { display: block; font-weight: 600; }
.notice.amber { background: #fff8eb; border-color: #f6dfb0; color: #7a4a06; }
.notice.red { background: var(--red-bg); border-color: #fbd5d5; color: #b91c1c; }
.notice.blue { background: var(--primary-bg); border-color: #cfdcfd; color: #1d4ed8; }
.notice.green { background: var(--green-bg); border-color: #bfe8cf; color: #166534; }
.notice .icon { margin-top: 1px; }

/* ---------- таблицы ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
    background: var(--head); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .03em;
    text-transform: uppercase; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
th a:hover { color: var(--text); }
th.sorted, th.sorted a { color: var(--text); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--body); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }
td.r, th.r { text-align: right; }
td ul { margin: 0; padding-left: 16px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* страницы */
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager a, .pager span.cur, .pager span.gap {
    min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
    display: inline-grid; place-items: center; color: var(--body); font-weight: 600; font-size: 13px;
}
.pager a:hover { background: var(--hover); }
.pager span.cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager span.gap { border: 0; background: none; color: var(--muted); min-width: 16px; padding: 0; }
.pager form { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; }
.pager .input { width: 72px; height: 32px; }

/* всплывающая панель (выбор колонок) */
.pop-anchor { position: relative; display: inline-block; }
.popover {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: 260px; max-height: 70vh; overflow: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 8px 6px;
}
.popover[hidden] { display: none; }
.popover .pop-title { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 10px 8px; }
.popover label.opt { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.popover label.opt:hover { background: var(--hover); }
.popover .pop-foot { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 8px 10px 2px; border-top: 1px solid var(--line); margin-top: 6px; }

/* всплывающие сообщения (showAlert из alerts.js) */
#AlertContainer { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; }
.alert {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 260px; max-width: 420px;
    padding: 10px 12px 10px 16px; border-radius: 10px; background: #111827; color: #fff; font-size: 13px; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .25s;
}
.alert.show { opacity: 1; transform: translateY(0); }
.alert.hide { opacity: 0; transform: translateY(12px); }
.alert.success { border-left: 4px solid #4ade80; }
.alert.danger, .alert.error { border-left: 4px solid #f87171; }
.alert.info { border-left: 4px solid #60a5fa; }
.alert.warning { border-left: 4px solid #fbbf24; }
.alert .close-btn { background: none; border: 0; color: #9ca3af; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.alert .close-btn:hover { color: #fff; }

/* ---------- вход и регистрация ---------- */
.auth { display: flex; min-height: 100vh; }
.auth-brand { width: 560px; flex: none; background: var(--sb); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand h2 { color: #fff; font-size: 34px; font-weight: 700; max-width: 440px; }
.auth-brand p { color: var(--sb-icon); font-size: 16px; max-width: 420px; margin: 14px 0 0; }
.auth-brand .foot { color: var(--sb-section); font-size: 13px; }
.auth-main { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px 32px 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { font-size: 24px; }
.auth-card .sub { color: var(--muted); margin-top: -10px; }
.auth-card .switch-link { text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- узкий экран ---------- */
@media (max-width: 900px) {
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s ease; width: var(--sb-w) !important; align-items: stretch !important; }
    html.sb-mobile-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .4); }
    .sb-toggle { display: none; }
    .mobile-bar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; background: var(--sb); color: #fff; padding: 10px 16px; }
    .mobile-bar button { background: none; border: 0; color: #fff; padding: 4px; display: grid; place-items: center; cursor: pointer; }
    .mobile-bar b { font-size: 16px; }
    .app { flex-direction: column; padding-left: 0; }
    .main { padding: 20px 16px 40px; }
    .grid-2 { grid-template-columns: 1fr; }
    .search .input { width: 100%; }
    .auth-brand { display: none; }
}

/* значение, которое копируется по клику (data-copy, app.js): курсор-рука, при наведении — иконка копирования,
   после клика — галочка */
.copyable { cursor: pointer; border-radius: 4px; transition: background-color .12s, color .12s; }
.copyable:hover { background: var(--primary-bg); color: var(--primary); }
.copyable::after {
    content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px;
    background-color: currentColor; opacity: 0; transition: opacity .12s;
    -webkit-mask: var(--copy-icon) center / contain no-repeat; mask: var(--copy-icon) center / contain no-repeat;
    --copy-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1'/%3E%3C/svg%3E");
}
.copyable:hover::after { opacity: .8; }
.copyable.copied { color: var(--green); background: var(--green-bg); }
.copyable.copied::after {
    opacity: 1;
    --copy-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E");
}

/* подсказка data-tip (app.js) и значок «есть подсказка» у заголовков */
.tip-pop {
    position: fixed; z-index: 1000; max-width: 280px; pointer-events: none;
    background: #111827; color: #fff; font: 500 12px/1.4 var(--font); text-transform: none; letter-spacing: 0;
    padding: 7px 10px; border-radius: 6px; box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
}
[data-tip] { cursor: help; }
.has-tip::after {
    content: "i"; display: inline-grid; place-items: center; width: 13px; height: 13px; margin-left: 4px; vertical-align: 1px;
    border: 1px solid currentColor; border-radius: 50%; font: 600 9px/1 var(--font); text-transform: none; opacity: .7;
}

/* модальное окно (<dialog>) */
.dialog {
    width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0; border: 0; border-radius: 16px;
    background: var(--surface); color: var(--body); box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
    display: none; flex-direction: column;
}
.dialog[open] { display: flex; }
.dialog::backdrop { background: rgba(15, 23, 42, .45); }
.dialog-head { padding: 20px 24px 12px; }
.dialog-head h2 { font-size: 18px; font-weight: 700; }
.dialog-head p { margin: 6px 0 0; }
.dialog > .notice { margin: 0 24px 12px; }
.dialog-body { overflow: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dialog-body thead th { position: sticky; top: 0; z-index: 1; }
.dialog-body tr.risky td { background: var(--red-bg); }
.dialog-body td .faint { font-size: 12px; }
.dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; flex-wrap: wrap; font-size: 13px; }
.dialog-actions { display: flex; gap: 8px; }
