:root {
    --accent: #0f9f8f;
    --accent-strong: #087e72;
    --accent-soft: rgba(15, 159, 143, .12);
    --blue: #3468e8;
    --danger: #d94a61;
    --warning: #c98113;
    --success: #158f66;
    --bg: #f4f7f9;
    --surface: #ffffff;
    --surface-2: #eef3f5;
    --surface-3: #e6ecef;
    --text: #17242c;
    --muted: #6c7d87;
    --border: #dbe4e8;
    --shadow: 0 18px 55px rgba(26, 52, 66, .08);
    --sidebar: #102a31;
    --sidebar-text: #e9f3f4;
    --sidebar-muted: #91a8ae;
    --radius: 18px;
    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #0d1519;
    --surface: #131f24;
    --surface-2: #19282e;
    --surface-3: #213238;
    --text: #edf6f7;
    --muted: #95a7ad;
    --border: #2a3c43;
    --shadow: 0 18px 55px rgba(0, 0, 0, .28);
    --sidebar: #091216;
    --sidebar-text: #f3f8f9;
    --sidebar-muted: #84999f;
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        --bg: #0d1519;
        --surface: #131f24;
        --surface-2: #19282e;
        --surface-3: #213238;
        --text: #edf6f7;
        --muted: #95a7ad;
        --border: #2a3c43;
        --shadow: 0 18px 55px rgba(0, 0, 0, .28);
        --sidebar: #091216;
        --sidebar-text: #f3f8f9;
        --sidebar-muted: #84999f;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
code { font-family: "Cascadia Code", Consolas, monospace; font-size: .92em; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px 18px;
    background:
        radial-gradient(circle at 15% 0%, rgba(40, 191, 174, .18), transparent 34%),
        var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
    width: 42px; height: 42px; flex: 0 0 auto;
    border-radius: 13px;
    display: grid; place-items: center;
    font-weight: 800; letter-spacing: -.03em;
    color: #fff;
    background: linear-gradient(145deg, #19b6a2, #2879c9);
    box-shadow: 0 10px 30px rgba(16, 165, 148, .28);
}
.brand strong { display: block; font-size: 17px; letter-spacing: -.02em; }
.brand span { display: block; color: var(--sidebar-muted); font-size: 12px; }
.brand-large .brand-mark { width: 52px; height: 52px; border-radius: 16px; }
.brand-large strong { font-size: 20px; }

.nav { margin-top: 34px; display: flex; flex-direction: column; gap: 26px; }
.nav-group { display: flex; flex-direction: column; gap: 6px; }
.nav-label { padding: 0 12px 6px; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--sidebar-muted); }
.nav-link {
    min-height: 44px;
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #cfe0e3;
    transition: .18s ease;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-link.active { color: #fff; background: linear-gradient(90deg, rgba(28, 183, 163, .25), rgba(52, 104, 232, .12)); box-shadow: inset 3px 0 0 #2ac4ae; }
.nav-icon { width: 21px; text-align: center; font-size: 18px; opacity: .95; }
.nav-link .badge { margin-left: auto; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }
.system-state { display: flex; align-items: center; gap: 10px; padding: 13px; border-radius: 13px; background: rgba(255,255,255,.055); }
.system-state strong, .system-state span { display: block; }
.system-state strong { font-size: 12px; }
.system-state span { font-size: 11px; color: var(--sidebar-muted); }
.state-dot { width: 9px; height: 9px; border-radius: 50%; background: #32d296; box-shadow: 0 0 0 5px rgba(50,210,150,.1); }

.main-area { min-width: 0; }
.topbar {
    height: 78px;
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 0 30px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
}
.topbar-title strong { display: block; font-size: 17px; }
.eyebrow { display: block; color: var(--accent); font-weight: 800; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.theme-switcher { padding: 4px; display: inline-flex; gap: 2px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.theme-switcher button { width: 32px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted); }
.theme-switcher button:hover, .theme-switcher button.active { color: var(--text); background: var(--surface-2); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; }
.user-chip strong, .user-chip span { display: block; }
.user-chip strong { font-size: 12px; }
.user-chip span { color: var(--muted); font-size: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 10px; display: grid !important; place-items: center; color: #fff !important; font-weight: 800; background: linear-gradient(145deg, var(--accent), var(--blue)); }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); cursor: pointer; color: var(--muted); }
.icon-button:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.icon-button.small { width: 32px; height: 32px; }
.mobile-only { display: none; }

.content { max-width: 1500px; margin: 0 auto; padding: 32px 30px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head.compact { align-items: center; }
.page-head h1 { margin: 5px 0 4px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.04em; line-height: 1.1; }
.page-head p { max-width: 760px; margin: 0; color: var(--muted); }
.page-actions, .card-actions, .form-actions { display: flex; align-items: center; gap: 10px; }
.button { min-height: 40px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; border: 1px solid transparent; font-weight: 750; cursor: pointer; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--accent), #2689c8); box-shadow: 0 10px 24px rgba(15,159,143,.22); }
.button-secondary { color: var(--text); background: var(--surface); border-color: var(--border); }
.button-ghost { color: var(--muted); background: transparent; border-color: var(--border); }
.button-block { width: 100%; }
.text-link { color: var(--accent); font-weight: 750; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h2 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.02em; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { min-height: 144px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat-card span { color: var(--muted); font-weight: 650; }
.stat-card strong { margin-top: auto; font-size: clamp(25px, 2.5vw, 36px); line-height: 1; letter-spacing: -.04em; }
.stat-card small { margin-top: 8px; color: var(--muted); }
.accent-card { color: #fff; border-color: transparent; background: linear-gradient(140deg, #0f8e81, #286bbf); }
.accent-card span, .accent-card small { color: rgba(255,255,255,.78); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(320px,.75fr); gap: 18px; margin-bottom: 18px; }
.dashboard-grid > .panel { padding: 22px; }
.panel-wide { min-width: 0; }
.cabinet-cards { display: grid; gap: 10px; }
.cabinet-card { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); transition: .18s ease; }
.cabinet-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-1px); }
.cabinet-logo { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-size: 20px; font-weight: 900; background: linear-gradient(145deg, #2368e8, #7d4ed8); }
.cabinet-body { min-width: 0; }
.cabinet-body strong, .cabinet-body span { display: block; }
.cabinet-body strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cabinet-body span { color: var(--muted); font-size: 12px; }
.cabinet-kpi { margin-left: auto; text-align: right; }
.cabinet-kpi strong, .cabinet-kpi span { display: block; }
.cabinet-kpi strong { font-size: 18px; }
.cabinet-kpi span { color: var(--muted); font-size: 11px; }
.activity-list { display: grid; }
.activity-item { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.activity-item strong, .activity-item span { display: block; }
.activity-item span { color: var(--muted); font-size: 11px; }
.activity-item b { font-size: 12px; }
.roadmap-panel { padding: 22px; }
.roadmap { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.roadmap-item { min-height: 96px; display: flex; align-items: flex-start; gap: 12px; padding: 15px; border-radius: 14px; border: 1px dashed var(--border); background: var(--surface-2); opacity: .7; }
.roadmap-item.done { opacity: 1; border-style: solid; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--accent-soft); }
.roadmap-item > span { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--surface); font-weight: 850; }
.roadmap-item strong, .roadmap-item small { display: block; }
.roadmap-item small { margin-top: 3px; color: var(--muted); }

.cards-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.entity-card { padding: 20px; }
.entity-top { display: flex; justify-content: space-between; align-items: center; }
.entity-card h2 { margin: 18px 0 4px; font-size: 20px; }
.entity-card p { min-height: 42px; margin: 0; color: var(--muted); }
.entity-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 18px 0; }
.entity-facts div { padding: 11px; background: var(--surface-2); border-radius: 12px; }
.entity-facts span, .entity-facts strong { display: block; }
.entity-facts span { color: var(--muted); font-size: 10px; }
.entity-facts strong { margin-top: 4px; font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-active { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.status-archived { color: var(--muted); background: var(--surface-2); }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 10px; font-weight: 800; }
.badge-muted { color: var(--sidebar-muted); background: rgba(255,255,255,.06); }

.form-panel { padding: 24px; }
.form-section + .form-section { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--border); }
.section-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.section-title > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-soft); font-weight: 850; }
.section-title h2 { margin: 0; font-size: 19px; }
.section-title p { margin: 3px 0 0; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.field { display: grid; gap: 7px; }
.field > span { font-size: 12px; font-weight: 750; }
.field-wide { grid-column: 1 / -1; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); color: var(--text); padding: 11px 12px; outline: none; transition: .18s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
textarea { resize: vertical; }
.form-actions { justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-stack { display: grid; gap: 14px; }

.filter-bar { display: grid; grid-template-columns: minmax(280px,1fr) 220px 160px auto; gap: 10px; margin-bottom: 14px; }
.search-field { position: relative; }
.search-field > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-field input { padding-left: 36px; }
.table-panel { overflow: hidden; }
.table-panel .panel-head { padding: 20px 20px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); background: var(--surface-2); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
.table-title { display: block; font-weight: 800; }
.table-title:hover { color: var(--accent); }
.table-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.empty-state { padding: 34px; text-align: center; color: var(--muted); }

.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.breadcrumb a:hover { color: var(--accent); }
.product-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(320px,.65fr); gap: 18px; margin-bottom: 18px; }
.product-layout > .panel { padding: 22px; }
.summary-cost { padding: 22px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #0f8e81, #315bb1); }
.summary-cost span, .summary-cost strong, .summary-cost small { display: block; }
.summary-cost span, .summary-cost small { color: rgba(255,255,255,.78); }
.summary-cost strong { margin: 10px 0 5px; font-size: 38px; letter-spacing: -.04em; }
.summary-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 14px; }
.summary-grid div { padding: 13px; border-radius: 13px; background: var(--surface-2); }
.summary-grid span, .summary-grid strong { display: block; }
.summary-grid span { color: var(--muted); font-size: 11px; }
.summary-grid strong { margin-top: 5px; }
.note-box { margin-top: 14px; padding: 13px 14px; border-radius: 12px; color: var(--muted); background: var(--surface-2); border-left: 3px solid var(--accent); }

.coming-soon { max-width: 850px; margin: 60px auto; padding: 46px; text-align: center; }
.coming-icon { width: 72px; height: 72px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 22px; color: #fff; font-size: 32px; background: linear-gradient(145deg, var(--accent), var(--blue)); box-shadow: 0 15px 35px rgba(15,159,143,.2); }
.coming-soon h1, .coming-soon h2 { margin: 0 0 10px; }
.coming-soon p { max-width: 650px; margin: 0 auto; color: var(--muted); }
.check-list { margin: 24px auto 0; display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; max-width: 650px; text-align: left; }
.check-list span { padding: 12px; border-radius: 12px; background: var(--surface-2); }
.preview-disabled { opacity: .66; }
.fake-chart { padding: 22px; opacity: .7; }
.bars { height: 280px; display: flex; align-items: flex-end; gap: 10px; padding: 28px 18px 0; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); background: linear-gradient(to top, var(--surface-2), transparent); }
.bars span { flex: 1; min-width: 12px; border-radius: 7px 7px 0 0; background: linear-gradient(to top, var(--accent), #36a0db); }
.chart-labels { display: flex; justify-content: space-between; padding: 10px 10px 0; color: var(--muted); font-size: 11px; }

.theme-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 16px; }
.theme-cards button { display: grid; gap: 7px; place-items: center; padding: 18px 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); cursor: pointer; font-size: 22px; }
.theme-cards button strong { font-size: 12px; }
.theme-cards button.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.info-list { display: grid; gap: 12px; }
.info-list > div { display: grid; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.info-list span { color: var(--muted); font-size: 11px; }
.muted { color: var(--muted); }

.flash-stack { position: fixed; right: 22px; top: 92px; z-index: 50; display: grid; gap: 8px; max-width: 400px; }
.flash { padding: 13px 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; transition: .3s ease; }
.flash-success { border-left: 4px solid var(--success); }
.flash-error { border-left: 4px solid var(--danger); }
.flash-warning { border-left: 4px solid var(--warning); }
.flash-hide { opacity: 0; transform: translateX(30px); }

.login-page { background: var(--bg); }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(430px,.85fr); }
.login-visual { padding: clamp(34px,5vw,74px); color: #fff; display: flex; flex-direction: column; background: radial-gradient(circle at 90% 15%, rgba(46, 124, 209, .35), transparent 31%), radial-gradient(circle at 10% 90%, rgba(24, 187, 164, .27), transparent 32%), #0d2931; }
.login-copy { max-width: 760px; margin: auto 0; }
.login-copy h1 { margin: 10px 0 18px; font-size: clamp(42px,5vw,72px); line-height: .98; letter-spacing: -.06em; }
.login-copy p { max-width: 660px; margin: 0; color: #b8d0d5; font-size: 17px; }
.preview-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: auto; }
.preview-metrics div { padding: 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.055); backdrop-filter: blur(12px); }
.preview-metrics strong, .preview-metrics span { display: block; }
.preview-metrics strong { font-size: 18px; }
.preview-metrics span { margin-top: 4px; color: #a5c0c6; font-size: 11px; }
.login-panel { position: relative; padding: 34px; display: grid; place-items: center; background: var(--bg); }
.login-theme { position: absolute; right: 24px; top: 24px; }
.login-card { width: min(100%, 430px); padding: 34px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.login-card h2 { margin: 6px 0 6px; font-size: 30px; letter-spacing: -.04em; }
.login-card > p { margin: 0 0 22px; }
.login-hint { margin-top: 16px; padding: 11px; text-align: center; border-radius: 11px; color: var(--muted); background: var(--surface-2); font-size: 11px; }

@media (max-width: 1120px) {
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .cards-grid { grid-template-columns: repeat(2,1fr); }
    .roadmap { grid-template-columns: repeat(2,1fr); }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .login-layout { grid-template-columns: 1fr 440px; }
    .login-copy h1 { font-size: 48px; }
}

@media (max-width: 860px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: 270px; transition: .22s ease; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .mobile-only { display: inline-grid; }
    .topbar { padding: 0 16px; }
    .user-chip { display: none; }
    .content { padding: 24px 16px 50px; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .dashboard-grid, .product-layout { grid-template-columns: 1fr; }
    .cards-grid { grid-template-columns: 1fr; }
    .login-layout { grid-template-columns: 1fr; }
    .login-visual { min-height: 44vh; }
    .preview-metrics { margin-top: 40px; }
    .login-panel { min-height: 56vh; }
}

@media (max-width: 600px) {
    .stats-grid, .form-grid, .roadmap, .check-list, .summary-grid, .theme-cards, .preview-metrics { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: 1fr; }
    .page-actions, .card-actions, .form-actions { width: 100%; flex-wrap: wrap; }
    .page-actions .button, .card-actions .button { flex: 1; }
    .theme-switcher { display: none; }
    .login-theme { display: inline-flex; }
    .login-copy h1 { font-size: 38px; }
    .login-visual, .login-panel { padding: 24px; }
    .login-card { padding: 24px; }
    .entity-facts { grid-template-columns: 1fr; }
}

/* калькулятор прибыли */
.calculator-layout { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(360px,.95fr); gap: 18px; margin-bottom: 18px; }
.upload-panel, .how-panel, .compact-panel, .shipment-main, .shipment-info { padding: 22px; }
.step-badge { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 800; }
.file-drop { min-height: 225px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 16px; background: linear-gradient(145deg, var(--accent-soft), var(--surface-2)); text-align: center; cursor: pointer; transition: .18s ease; }
.file-drop:hover { transform: translateY(-1px); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.file-drop input { display: none; }
.file-drop-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(145deg, var(--accent), var(--blue)); font-size: 25px; box-shadow: 0 12px 28px rgba(15,159,143,.22); }
.file-drop strong { font-size: 18px; }
.file-drop > span:not(.file-drop-icon), .file-drop small { color: var(--muted); }
.flow-list { display: grid; gap: 12px; }
.flow-list > div { display: flex; gap: 12px; padding: 13px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.flow-list > div > span { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--surface); font-weight: 850; }
.flow-list p, .flow-list strong, .flow-list small { display: block; margin: 0; }
.flow-list small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.formula-box { margin-top: 15px; padding: 16px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #0c8c83, #2f68b5); }
.formula-box span, .formula-box strong { display: block; }
.formula-box span { color: rgba(255,255,255,.72); font-size: 11px; }
.formula-box strong { margin-top: 5px; }
.history-panel { margin-top: 18px; }
.muted-note { color: var(--muted); font-size: 12px; }
.profit-positive { color: var(--success) !important; }
.profit-negative { color: #d94c5c !important; }
.status-warning { color: #c78011; background: color-mix(in srgb, #f1a822 14%, transparent); }
.status-danger { color: #d94c5c; background: color-mix(in srgb, #d94c5c 12%, transparent); }
.button-danger { color: #fff; background: #c73c4d; }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.report-head { margin-top: 12px; }
.report-stats .stat-card strong { font-size: clamp(23px,2.2vw,32px); }
.attention-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid color-mix(in srgb, #e39d24 45%, var(--border)); border-radius: 16px; background: color-mix(in srgb, #e39d24 9%, var(--surface)); }
.attention-banner > span { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: #fff; background: #d58e16; font-weight: 900; }
.attention-banner p { margin: 3px 0 0; color: var(--muted); }
.attention-banner .button { margin-left: auto; }
.report-summary-grid { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 18px; margin-bottom: 18px; }
.progress-row > div:first-child { display: flex; justify-content: space-between; gap: 14px; }
.progress-track { height: 8px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--blue)); }
.mini-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 18px; }
.mini-facts div { padding: 12px; border-radius: 12px; background: var(--surface-2); }
.mini-facts span, .mini-facts strong { display: block; }
.mini-facts span { color: var(--muted); font-size: 10px; }
.mini-facts strong { margin-top: 4px; font-size: 18px; }
.operation-list { display: grid; max-height: 245px; overflow-y: auto; }
.operation-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.operation-list > div:last-child { border-bottom: 0; }
.operation-list span { color: var(--muted); }
.report-filter { grid-template-columns: minmax(280px,1fr) 230px auto; }
.shipments-table { min-width: 1120px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 20px; border-color: color-mix(in srgb, #d94c5c 28%, var(--border)); }
.danger-zone p { margin: 4px 0 0; color: var(--muted); }
.shipment-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(310px,.65fr); gap: 18px; margin-bottom: 18px; }
.calculation-lines { display: grid; }
.calculation-lines > div { display: flex; justify-content: space-between; gap: 22px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.calculation-lines > div:last-child { border-bottom: 0; }
.calculation-lines span { color: var(--muted); }
.calculation-lines strong { font-size: 17px; }
.calculation-lines .expense { color: #d06a4d; }
.calculation-lines .calculation-total { margin-top: 5px; padding: 19px 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); }
.calculation-lines .calculation-total span { color: var(--text); font-weight: 800; }
.calculation-lines .calculation-total strong { font-size: 25px; }
.inline-note { margin-top: 16px; padding: 14px; border-radius: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.details-list { margin: 0; }
.details-list > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.details-list > div:last-child { border-bottom: 0; }
.details-list dt { color: var(--muted); }
.details-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

@media (max-width: 1050px) {
    .calculator-layout, .report-summary-grid, .shipment-layout { grid-template-columns: 1fr; }
    .report-filter { grid-template-columns: 1fr 220px auto; }
}
@media (max-width: 720px) {
    .attention-banner, .danger-zone { align-items: flex-start; flex-direction: column; }
    .attention-banner .button { margin-left: 0; }
    .report-filter { grid-template-columns: 1fr; }
    .mini-facts { grid-template-columns: 1fr; }
    .calculation-lines > div { flex-direction: column; gap: 4px; }
}

/* уведомления и история обновлений */
.notification-button {
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--muted);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: .18s ease;
}
.notification-button:hover,
.notification-button.active {
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.notification-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.notification-button.has-notifications {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}
.notification-button.has-notifications svg {
    animation: bell-pulse 2.8s ease-in-out infinite;
}
.notification-dot {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border: 2px solid var(--bg);
    border-radius: 999px;
    color: #fff;
    background: var(--danger);
    font-size: 9px;
    font-weight: 850;
    line-height: 1;
}
@keyframes bell-pulse {
    0%, 82%, 100% { transform: rotate(0); }
    86% { transform: rotate(8deg); }
    90% { transform: rotate(-7deg); }
    94% { transform: rotate(4deg); }
}

.release-timeline { display: grid; gap: 16px; }
.release-card {
    position: relative;
    display: grid;
    grid-template-columns: 108px minmax(0,1fr);
    overflow: hidden;
}
.release-version {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 22px 14px;
    color: #fff;
    background: linear-gradient(150deg, var(--accent), var(--blue));
    font-size: 18px;
    font-weight: 850;
    letter-spacing: -.03em;
}
.release-content { padding: 24px; }
.release-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.release-card-head h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.03em; }
.release-card-head time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.release-summary { max-width: 920px; margin: 12px 0 0; color: var(--muted); }
.release-changes { display: grid; gap: 8px; margin: 17px 0 0; padding: 0; list-style: none; }
.release-changes li { position: relative; padding-left: 22px; }
.release-changes li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
    font-weight: 900;
}

body.modal-open { overflow: hidden; }
.update-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(5, 17, 22, .68);
    backdrop-filter: blur(9px);
    animation: modal-fade-in .18s ease both;
}
.update-modal-backdrop.is-closing { animation: modal-fade-out .18s ease both; }
.update-modal {
    position: relative;
    width: min(100%, 720px);
    max-height: min(84vh, 820px);
    overflow: auto;
    padding: 30px;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .34);
    animation: modal-rise-in .22s ease both;
}
.update-modal-backdrop.is-closing .update-modal { animation: modal-rise-out .18s ease both; }
.update-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    background: var(--surface-2);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}
.update-modal-close:hover { color: var(--text); }
.update-modal-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(145deg, var(--accent), var(--blue));
    box-shadow: 0 14px 34px rgba(15,159,143,.25);
    font-size: 28px;
    font-weight: 900;
}
.update-modal h2 { margin: 5px 0 18px; font-size: 31px; letter-spacing: -.04em; }
.update-modal-releases { display: grid; gap: 14px; }
.update-modal-releases article { padding: 17px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface-2); }
.update-modal-release-head { display: flex; justify-content: space-between; gap: 16px; }
.update-modal-release-head strong { font-size: 15px; }
.update-modal-release-head time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.update-modal-releases p { margin: 8px 0 0; color: var(--muted); }
.update-modal-releases ul { display: grid; gap: 7px; margin: 13px 0 0; padding-left: 20px; }
.update-modal-releases li::marker { color: var(--accent); }
.update-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes modal-rise-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes modal-rise-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(12px) scale(.985); } }

@media (max-width: 720px) {
    .release-card { grid-template-columns: 1fr; }
    .release-version { min-height: 58px; }
    .release-card-head, .update-modal-release-head { flex-direction: column; gap: 5px; }
    .update-modal { padding: 24px 20px; border-radius: 19px; }
    .update-modal-actions { flex-direction: column-reverse; }
    .update-modal-actions .button { width: 100%; }
}

/* импорт справочника товаров */
.catalog-import-layout {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
    gap: 18px;
    margin-bottom: 18px;
}
.catalog-import-layout > .panel { padding: 22px; }
.column-map { display: grid; gap: 10px; }
.column-map > div {
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
    gap: 13px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
}
.column-map > div > span {
    width: 42px;
    min-height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(145deg, var(--accent), var(--blue));
    font-weight: 850;
}
.column-map p, .column-map strong, .column-map small { display: block; margin: 0; }
.column-map small { color: var(--muted); margin-top: 2px; }
.catalog-preview-stats { margin-bottom: 18px; }
.warning-card {
    border-color: color-mix(in srgb, #d58e16 36%, var(--border));
    background: color-mix(in srgb, #d58e16 6%, var(--surface));
}
.catalog-warning { margin-top: 0; }
.import-confirm-panel { padding: 22px; margin-bottom: 18px; }
.check-card {
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
    cursor: pointer;
}
.check-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.check-card input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); }
.check-card strong, .check-card small { display: block; }
.check-card small { margin-top: 3px; color: var(--muted); }
.import-section-gap { margin-top: 18px; }
.section-description { margin: -4px 0 16px; color: var(--muted); }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }

@media (max-width: 980px) {
    .catalog-import-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .page-head .page-actions { width: 100%; flex-direction: column; }
    .page-head .page-actions .button { width: 100%; }
    .catalog-preview-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .catalog-preview-stats { grid-template-columns: 1fr; }
}

/* несколько маркетплейсов и управление историей отчётов */
.compact-grid { gap: 12px; }
.marketplace-state {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 13px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
}
.marketplace-state-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, var(--accent), var(--blue));
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
}
.marketplace-state strong,
.marketplace-state small { display: block; }
.marketplace-state small { margin-top: 3px; color: var(--muted); }
.marketplace-unavailable {
    padding: 15px 16px;
    border: 1px solid color-mix(in srgb, #d58e16 36%, var(--border));
    border-radius: 14px;
    background: color-mix(in srgb, #d58e16 7%, var(--surface));
}
.marketplace-unavailable strong { display: block; }
.marketplace-unavailable p { margin: 5px 0 0; color: var(--muted); line-height: 1.45; }
.file-drop.is-disabled { opacity: .55; cursor: not-allowed; transform: none; }
.file-drop.is-dragging { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.selected-file {
    min-height: 112px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
    border-radius: 16px;
    background: linear-gradient(145deg, var(--accent-soft), var(--surface-2));
}
.selected-file-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(145deg, var(--accent), var(--blue));
    font-size: 11px;
    font-weight: 900;
}
.selected-file-info { min-width: 0; }
.selected-file-info strong,
.selected-file-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-file-info strong { font-size: 15px; }
.selected-file-info span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.selected-file-actions { display: flex; gap: 8px; }
.button-small { min-height: 34px; padding: 7px 11px; border-radius: 10px; font-size: 12px; }
.status-neutral { color: var(--muted); background: var(--surface-2); }
.history-head { margin-bottom: 10px; }
.history-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.segmented-filter {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}
.segmented-filter a {
    padding: 8px 12px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
}
.segmented-filter a:hover { color: var(--text); }
.segmented-filter a.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.page-size-control label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.page-size-control select { min-width: 72px; padding: 8px 30px 8px 10px; }
.bulk-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 49px;
    padding: 9px 11px 9px 14px;
    border: 1px solid var(--border);
    border-radius: 13px 13px 0 0;
    background: var(--surface-2);
}
.bulk-actions > span { color: var(--muted); font-size: 12px; }
.bulk-actions > div { display: flex; flex-wrap: wrap; gap: 7px; }
.bulk-actions + .table-wrap { border-top-left-radius: 0; border-top-right-radius: 0; }
.history-table { min-width: 1180px; }
.checkbox-column { width: 42px; text-align: center; }
.table-checkbox { width: 22px; height: 22px; display: inline-grid; place-items: center; cursor: pointer; }
.table-checkbox input { position: absolute; opacity: 0; pointer-events: none; }
.table-checkbox span {
    width: 17px;
    height: 17px;
    display: block;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    background: var(--surface);
    transition: .15s ease;
}
.table-checkbox input:checked + span { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
.table-checkbox input:indeterminate + span { border-color: var(--accent); background: linear-gradient(var(--accent), var(--accent)) center/9px 2px no-repeat var(--surface); }
.sortable-column a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.sortable-column a:hover { color: var(--accent); }
.sort-indicator { color: var(--muted); font-size: 11px; }
.sortable-column.is-sorted .sort-indicator { color: var(--accent); }
.marketplace-line { margin-top: 5px; }
.marketplace-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 7px;
    border-radius: 7px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 10px;
    font-weight: 800;
}
.row-archived { opacity: .72; }
.row-archived:hover { opacity: 1; }
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 14px;
}
.pagination span { color: var(--muted); font-size: 12px; }
.button.disabled { opacity: .45; pointer-events: none; }

@media (max-width: 820px) {
    .history-controls,
    .bulk-actions { align-items: stretch; flex-direction: column; }
    .segmented-filter { width: 100%; }
    .segmented-filter a { flex: 1; text-align: center; }
    .page-size-control label { justify-content: space-between; }
    .selected-file { grid-template-columns: auto minmax(0, 1fr); }
    .selected-file-actions { grid-column: 1 / -1; }
    .selected-file-actions .button { flex: 1; }
    .pagination { justify-content: space-between; }
}

/* упрощённый калькулятор и динамическая история */
.field-hint {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}
.compact-secondary-field { margin-top: -4px; }
.custom-tax-field[hidden] { display: none; }
.tax-note {
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--muted);
    background: var(--surface-2);
    font-size: 11px;
    line-height: 1.45;
}
.file-drop {
    min-height: 190px;
    position: relative;
    padding: 0;
    overflow: hidden;
}
.file-drop input { display: none; }
.file-drop-empty {
    width: 100%;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
}
.file-drop-empty > span:not(.file-drop-icon),
.file-drop-empty small { color: var(--muted); }
.file-drop.has-file {
    min-height: 124px;
    border-style: solid;
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 11%, var(--surface)), var(--surface-2));
}
.file-drop.has-file:hover { transform: none; }
.file-drop-ready {
    width: 100%;
    min-height: 124px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    padding: 20px;
    text-align: left;
}
.file-drop-ready[hidden],
.file-drop-empty[hidden] { display: none; }
.file-ready-label {
    display: block;
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.how-result {
    margin-top: 18px;
    padding: 15px 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
    border-radius: 14px;
    background: linear-gradient(145deg, var(--accent-soft), var(--surface-2));
}
.how-result span,
.how-result strong { display: block; }
.how-result span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.how-result strong { margin-top: 5px; line-height: 1.4; }
.history-panel { position: relative; }
.history-panel > [data-history-root] { transition: opacity .16s ease; }
.history-panel > [data-history-root].is-loading { opacity: .48; pointer-events: none; }
.history-controls { justify-content: flex-start; padding: 0 20px; }
.bulk-actions[hidden] { display: none; }
.bulk-actions {
    margin: 0 20px 12px;
    border-radius: 13px;
}
.bulk-actions + .table-wrap { border-radius: 0; }
.history-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--border);
}
.page-size-control {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
}
.page-size-control select { min-width: 72px; padding: 8px 30px 8px 10px; }
.pagination { margin-top: 0; }
.favorite-star { margin-right: 6px; color: #d99a14; }
.history-message {
    position: absolute;
    z-index: 5;
    top: 14px;
    right: 20px;
    max-width: min(420px, calc(100% - 40px));
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    box-shadow: var(--shadow);
    background: var(--surface);
    font-size: 12px;
    font-weight: 700;
}
.history-message[hidden] { display: none; }
.history-message-success { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); color: var(--success); }
.history-message-warning { border-color: color-mix(in srgb, #d58e16 38%, var(--border)); color: #b6780e; }
.history-message-error { border-color: color-mix(in srgb, #d94c5c 38%, var(--border)); color: #d94c5c; }

@media (max-width: 820px) {
    .file-drop-ready { grid-template-columns: auto minmax(0, 1fr); }
    .file-drop-ready .selected-file-actions { grid-column: 1 / -1; }
    .history-footer { align-items: stretch; flex-direction: column; }
    .history-footer .pagination { justify-content: space-between; }
    .bulk-actions { margin-left: 12px; margin-right: 12px; }
    .history-controls { padding: 0 12px; }
}

/* точечная полировка калькулятора */
.compact-grid {
    align-items: start;
}
.compact-grid > .field {
    align-self: start;
}
.file-drop,
.file-drop.has-file,
.file-drop-empty,
.file-drop-ready {
    min-height: 190px;
}
.file-drop-ready {
    align-content: center;
}
.how-panel .panel-head {
    justify-content: center;
    text-align: center;
}
.how-panel .flow-list > div {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.how-panel .flow-list > div > span {
    margin: 0 auto;
}
.how-panel .how-result {
    text-align: center;
}
.history-footer {
    justify-content: flex-start;
}
.history-footer .pagination {
    margin-left: auto;
}
.page-size-control {
    margin-right: auto;
}

@media (max-width: 820px) {
    .history-footer .pagination {
        margin-left: 0;
    }
}


/* полировка базового калькулятора */
.calculator-layout-showcase {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 16px;
    align-items: stretch;
}
.showcase-panel {
    min-height: 326px;
    padding: 18px 18px 16px;
}
.upload-panel .panel-head h2,
.how-panel .panel-head h2 {
    font-size: 18px;
}
.upload-panel .panel-head,
.how-panel .panel-head {
    margin-bottom: 14px;
}
.upload-panel .eyebrow,
.how-panel .eyebrow {
    font-size: 10px;
}
.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.compact-grid .field > span {
    font-size: 11px;
}
.compact-grid select,
.compact-grid input {
    padding: 10px 12px;
    min-height: 42px;
}
.file-drop,
.file-drop.has-file,
.file-drop-empty,
.file-drop-ready {
    min-height: 138px;
}
.file-drop-ready {
    padding: 18px 20px;
}
.selected-file-icon {
    width: 48px;
    height: 48px;
    font-size: 13px;
}
.selected-file-info strong {
    font-size: 14px;
    line-height: 1.35;
}
.selected-file-info span {
    font-size: 11px;
}
.selected-file-actions {
    display: inline-flex;
    gap: 8px;
}
.button-danger-soft {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
}
.button-danger-soft:hover {
    color: #b44653;
    border-color: color-mix(in srgb, #d94c5c 40%, var(--border));
    background: color-mix(in srgb, #d94c5c 6%, var(--surface));
}
.button-danger-soft:active {
    color: #fff;
    background: #d45a68;
    border-color: #d45a68;
}
.how-panel .panel-head {
    margin-bottom: 10px;
}
.how-panel .flow-list {
    gap: 8px;
}
.how-panel .flow-list > div {
    min-height: 50px;
    padding: 8px 14px;
    border-radius: 12px;
}
.how-panel .flow-list > div > span {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    font-size: 10px;
}
.how-panel .flow-list strong {
    font-size: 12px;
}
.how-panel .flow-list small {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.3;
}
.how-panel .how-result {
    margin-top: 10px;
    padding: 12px 14px;
}
.how-panel .how-result strong {
    font-size: 13px;
}
.history-footer {
    justify-content: space-between;
}
.history-footer .pagination {
    margin-left: 0;
}
.page-size-control {
    margin-right: 0;
    margin-left: auto;
}
@media (max-width: 900px) {
    .calculator-layout-showcase {
        grid-template-columns: 1fr;
    }
    .showcase-panel {
        min-height: auto;
    }
}

/* товары: фильтры, массовые действия и импорт */
.products-panel { position: relative; }
.products-panel > [data-products-root] { transition: opacity .16s ease; }
.products-panel > [data-products-root].is-loading { opacity: .48; pointer-events: none; }
.products-table-head { padding-bottom: 12px !important; }
.products-filter-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 230px) auto;
    align-items: center;
    gap: 10px;
    padding: 0 20px 14px;
}
.products-state-filter { justify-self: end; }
.products-table { min-width: 1040px; }
.products-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--border);
}
.products-footer .page-size-control { margin-left: auto; }
.products-page-actions { flex-wrap: wrap; }
.editable-import-panel { overflow: hidden; }
.editable-preview-head {
    align-items: center;
    gap: 20px;
    padding-bottom: 14px !important;
}
.import-preview-search { width: min(320px, 100%); }
.editable-import-wrap { max-height: 610px; overflow: auto; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.editable-import-table { min-width: 1450px; }
.editable-import-table th { position: sticky; top: 0; z-index: 2; }
.editable-import-table td { padding: 8px; }
.table-input {
    min-width: 130px;
    padding: 8px 9px;
    border-radius: 9px;
    background: var(--surface);
}
.table-input.wide-input { min-width: 250px; }
.table-input.date-input { min-width: 145px; }
.table-input.money-input { min-width: 125px; text-align: right; }
.editable-import-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px 18px;
}
.editable-import-footer > span { color: var(--muted); font-size: 12px; }
.import-final-actions { margin: 0; padding: 0; border: 0; }
.import-options-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.editable-import-panel .section-description { padding: 0 20px 14px; margin: 0; }

@media (max-width: 1000px) {
    .products-filter-row { grid-template-columns: 1fr 220px; }
    .products-state-filter { grid-column: 1 / -1; justify-self: start; }
    .import-options-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .products-filter-row { grid-template-columns: 1fr; padding-left: 12px; padding-right: 12px; }
    .products-state-filter { width: 100%; overflow-x: auto; }
    .products-footer, .editable-import-footer, .editable-preview-head { align-items: stretch; flex-direction: column; }
    .products-footer .page-size-control { margin-left: 0; align-self: flex-end; }
    .import-preview-search { width: 100%; }
    .products-page-actions .button { flex: 1 1 100%; }
}

/* безопасная подготовка большого предпросмотра импорта */
.import-preparation-overlay {
    position: fixed;
    z-index: 10050;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    opacity: 1;
    visibility: visible;
    transition: opacity .24s ease, visibility .24s ease;
}
.import-preparation-overlay.is-finished {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.import-preparation-overlay.has-error .import-preparation-card {
    border-color: color-mix(in srgb, #d94c5c 45%, var(--border));
}
.import-preparation-card {
    width: min(460px, 100%);
    padding: 30px;
    border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 28px 90px rgba(11, 30, 50, .22);
    text-align: center;
}
.import-preparation-card h2 {
    margin: 9px 0 7px;
    font-size: 22px;
}
.import-preparation-card p {
    margin: 0 auto;
    max-width: 360px;
    color: var(--muted);
    line-height: 1.5;
}
.import-preparation-card > strong {
    display: block;
    margin-top: 11px;
    font-size: 13px;
}
.import-preparation-card > small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 10px;
}
.import-preparation-spinner {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}
.import-preparation-spinner span {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: import-ring 1.35s linear infinite;
}
.import-preparation-spinner span:nth-child(1) {
    border-top-color: var(--accent);
}
.import-preparation-spinner span:nth-child(2) {
    inset: 9px;
    border-right-color: var(--blue);
    animation-duration: 1s;
    animation-direction: reverse;
}
.import-preparation-spinner span:nth-child(3) {
    inset: 19px;
    border-bottom-color: color-mix(in srgb, var(--accent) 60%, var(--blue));
    animation-duration: .8s;
}
.import-preparation-progress {
    height: 8px;
    margin-top: 20px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.import-preparation-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--blue));
    transition: width .18s ease;
}
.import-preview-stage {
    transition: opacity .22s ease;
}
.import-preview-stage.is-preparing {
    opacity: .58;
    pointer-events: none;
    user-select: none;
}
body.import-preview-busy {
    overflow: hidden;
}
.editable-import-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}
.editable-import-pagination .pagination {
    margin: 0;
}
.editable-import-pagination .page-size-control {
    margin-left: auto;
}

@keyframes import-ring {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .import-preparation-spinner span { animation-duration: 2.4s; }
    .import-preparation-progress span,
    .import-preparation-overlay,
    .import-preview-stage { transition: none; }
}

@media (max-width: 720px) {
    .import-preparation-card { padding: 24px 18px; }
    .editable-import-pagination {
        align-items: stretch;
        flex-direction: column;
    }
    .editable-import-pagination .pagination { justify-content: space-between; }
    .editable-import-pagination .page-size-control { align-self: flex-end; }
}


/* надёжные массовые действия товаров */
.product-bulk-actions[hidden],
.product-bulk-status[hidden] {
    display: none;
}
.product-bulk-clear {
    margin-left: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.product-bulk-status {
    margin: 0 20px 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 12px;
    font-weight: 700;
}
.product-bulk-status[data-state="loading"] {
    color: var(--muted);
}
.product-bulk-status[data-state="success"] {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 35%, var(--border));
    background: color-mix(in srgb, var(--success) 7%, var(--surface));
}
.product-bulk-status[data-state="error"] {
    color: #d94c5c;
    border-color: color-mix(in srgb, #d94c5c 38%, var(--border));
    background: color-mix(in srgb, #d94c5c 7%, var(--surface));
}
.products-table tr.is-selected {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    box-shadow: inset 3px 0 0 var(--accent);
}

/* разовая подготовка предпросмотра и подтверждение импорта */
.import-validation-modal[hidden] {
    display: none;
}
.import-validation-modal {
    position: fixed;
    inset: 0;
    z-index: 2300;
    display: grid;
    place-items: center;
    padding: 24px;
}
.import-validation-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 18, 31, .58);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.import-validation-dialog {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(8, 18, 31, .26);
}
.import-validation-dialog h2 {
    margin: 6px 0 8px;
    font-size: 24px;
}
.import-validation-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}
.import-validation-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}
.import-validation-stat {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface-2);
}
.import-validation-stat span,
.import-validation-stat strong {
    display: block;
}
.import-validation-stat span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}
.import-validation-stat strong {
    margin-top: 8px;
    font-size: 32px;
    letter-spacing: -.04em;
}
.import-validation-stat.is-success {
    border-color: color-mix(in srgb, var(--success) 35%, var(--border));
    background: color-mix(in srgb, var(--success) 7%, var(--surface));
}
.import-validation-stat.is-success strong {
    color: var(--success);
}
.import-validation-stat.is-error {
    border-color: color-mix(in srgb, #d94c5c 35%, var(--border));
    background: color-mix(in srgb, #d94c5c 7%, var(--surface));
}
.import-validation-stat.is-error strong {
    color: #d94c5c;
}
.import-validation-errors {
    margin-top: 16px;
    padding: 15px 16px;
    border: 1px solid color-mix(in srgb, #d94c5c 25%, var(--border));
    border-radius: 14px;
    background: color-mix(in srgb, #d94c5c 5%, var(--surface));
}
.import-validation-errors[hidden] {
    display: none;
}
.import-validation-errors > strong {
    display: block;
    margin-bottom: 8px;
}
.import-validation-errors ul {
    display: grid;
    gap: 7px;
    max-height: 210px;
    margin: 0;
    padding-left: 20px;
    overflow: auto;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}
.import-validation-errors small {
    display: block;
    margin-top: 9px;
    color: #d94c5c;
    font-weight: 700;
}
.import-validation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}
body.import-validation-open {
    overflow: hidden;
}
body.import-validation-open .import-preview-stage {
    user-select: none;
}
@media (max-width: 620px) {
    .import-validation-modal {
        padding: 12px;
    }
    .import-validation-dialog {
        padding: 20px;
        border-radius: 16px;
    }
    .import-validation-stats {
        grid-template-columns: 1fr;
    }
    .import-validation-actions {
        flex-direction: column-reverse;
    }
    .import-validation-actions .button {
        width: 100%;
    }
}

/* выбор текущей страницы и всех строк по фильтру */
.report-bulk-actions[hidden],
[data-products-bulk-all-summary][hidden],
[data-products-bulk-page-summary][hidden],
[data-products-bulk-select-all-results][hidden],
[data-history-bulk-all-summary][hidden],
[data-history-bulk-page-summary][hidden],
[data-history-bulk-select-all-results][hidden] {
    display: none;
}
.bulk-selection-summary {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.product-bulk-select-all-results {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.product-bulk-select-all-results:hover {
    color: var(--blue);
}
.product-bulk-select-all-results:disabled,
.product-bulk-clear:disabled {
    cursor: wait;
    opacity: .55;
}
.report-bulk-actions {
    margin: 0 20px 12px;
    border-radius: 13px;
}
.history-table tr.is-selected {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    box-shadow: inset 3px 0 0 var(--accent);
}
@media (max-width: 820px) {
    .report-bulk-actions {
        margin-left: 12px;
        margin-right: 12px;
    }
    .bulk-selection-summary {
        width: 100%;
    }
}

/* история и график себестоимости */
.panel-help {
    margin: -4px 0 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}
.cost-entry-panel { padding: 22px; }
.scheduled-cost-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding: 13px 14px;
    border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--border));
    border-radius: 13px;
    background: color-mix(in srgb, var(--blue) 7%, var(--surface));
}
.scheduled-cost-note span { color: var(--muted); font-size: 11px; }
.scheduled-cost-note strong { color: var(--blue); }
.cost-chart-panel { margin-bottom: 18px; padding: 22px; }
.cost-chart-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.cost-chart-stats > div {
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-2);
}
.cost-chart-stats span,
.cost-chart-stats strong { display: block; }
.cost-chart-stats span { color: var(--muted); font-size: 10px; }
.cost-chart-stats strong { margin-top: 5px; font-size: 17px; }
.cost-chart-wrap {
    position: relative;
    overflow: hidden;
    padding: 10px 8px 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, var(--surface)), var(--surface));
}
.cost-chart { display: block; width: 100%; height: auto; min-height: 260px; }
.cost-chart circle { cursor: pointer; transition: r .15s ease; }
.cost-chart circle:hover,
.cost-chart circle:focus { r: 8; outline: none; }
.cost-chart-tooltip {
    position: absolute;
    z-index: 3;
    width: 180px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    background: var(--surface);
    pointer-events: none;
}
.cost-chart-tooltip[hidden] { display: none; }
.cost-chart-tooltip strong,
.cost-chart-tooltip span,
.cost-chart-tooltip small { display: block; }
.cost-chart-tooltip strong { color: var(--accent); font-size: 15px; }
.cost-chart-tooltip span { margin-top: 3px; font-size: 11px; }
.cost-chart-tooltip small { margin-top: 5px; color: var(--muted); line-height: 1.35; }
.cost-chart-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 11px;
}
.cost-chart-legend > span {
    width: 20px;
    height: 4px;
    border-radius: 999px;
    background: var(--accent);
}
.cost-history-panel .muted-note { max-width: 440px; text-align: right; }
.cost-history-table { min-width: 980px; }
.cost-delta { font-weight: 800; }
.cost-up { color: #d06a4d; }
.cost-down { color: var(--success); }
.cost-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.cost-row-actions form { margin: 0; }
.cost-modal-backdrop[hidden] { display: none; }
.cost-modal-backdrop {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(7, 18, 27, .58);
    backdrop-filter: blur(8px);
}
.cost-modal {
    position: relative;
    width: min(520px, 100%);
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
    background: var(--surface);
}
.cost-modal h2 { margin: 5px 0 7px; }
.cost-modal > p { margin: 0 0 20px; color: var(--muted); line-height: 1.5; }
.cost-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    background: var(--surface-2);
    font-size: 22px;
    cursor: pointer;
}
.cost-modal-close:hover { color: var(--text); }
.cost-modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
@media (max-width: 900px) {
    .cost-chart-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cost-history-panel .panel-head { align-items: flex-start; flex-direction: column; }
    .cost-history-panel .muted-note { text-align: left; }
}
@media (max-width: 560px) {
    .cost-chart-stats { grid-template-columns: 1fr; }
    .cost-modal-actions { flex-direction: column-reverse; }
    .cost-modal-actions .button { width: 100%; }
}


/* полировка блока калькулятора */
.upload-action-row[hidden] { display: none; }
.upload-action-row {
    margin-top: 12px;
}
.upload-submit-button {
    min-height: 48px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 800;
}
.how-panel .panel-head {
    justify-content: flex-start;
    text-align: left;
}
.how-panel .panel-head h2 {
    font-size: 15px;
}
.calculator-guide-list {
    gap: 10px;
}
.how-panel .calculator-guide-list > div {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    min-height: 88px;
    padding: 18px 18px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface-2) 92%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
}
.how-panel .calculator-guide-list > div > span {
    margin: 0;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 999px;
    font-size: 24px;
    font-weight: 900;
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    color: var(--accent);
}
.how-panel .calculator-guide-list p {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.how-panel .calculator-guide-list strong {
    font-size: 17px;
    line-height: 1.2;
}
.how-panel .calculator-guide-list small {
    margin-top: 0;
    font-size: 12px;
    line-height: 1.35;
}
.calculator-guide-result {
    margin-top: 12px;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 20px;
    text-align: left;
    border-radius: 16px;
}
.calculator-guide-result span {
    margin: 0;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .08em;
}
.calculator-guide-result strong {
    margin-top: 0;
    font-size: 17px;
    line-height: 1.3;
}
@media (max-width: 900px) {
    .how-panel .calculator-guide-list > div {
        min-height: 76px;
        padding: 14px;
    }
    .how-panel .calculator-guide-list > div > span {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        font-size: 20px;
    }
    .how-panel .calculator-guide-list strong,
    .calculator-guide-result strong {
        font-size: 15px;
    }
    .calculator-guide-result {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}


/* ошибки Excel остаются в предпросмотре */
.catalog-error-warning {
    border-color: color-mix(in srgb, #d94c5c 38%, var(--border));
    background: color-mix(in srgb, #d94c5c 7%, var(--surface));
}
.catalog-error-warning > span {
    background: #d94c5c;
}
.import-row-source-error {
    background: color-mix(in srgb, #d94c5c 5%, transparent);
}
.import-row-source-error:hover {
    background: color-mix(in srgb, #d94c5c 8%, var(--surface));
}
.import-row-source-error .table-input {
    border-color: color-mix(in srgb, #d94c5c 26%, var(--border));
}


/* название ЮнитФакт и текстовая полировка */
.replace-import-button {
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.replace-import-button:hover {
    color: var(--text);
    background: color-mix(in srgb, #fff 12%, var(--surface-2));
    border-color: color-mix(in srgb, #fff 28%, var(--border));
}
.replace-import-button:active {
    color: #111827;
    background: #fff;
    border-color: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, #fff 22%, transparent);
}
.replace-import-button:disabled {
    opacity: .7;
    cursor: wait;
}
.topbar-title > strong {
    display: block;
}

/* фотографии товаров */
.product-table-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 245px;
}
.product-table-photo {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: linear-gradient(145deg, var(--accent-soft), var(--surface-2));
}
.product-table-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.product-table-photo span {
    color: var(--accent);
    font-size: 20px;
    font-weight: 900;
}
.product-table-photo:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.product-photo-editor {
    display: grid;
    grid-template-columns: minmax(280px, 430px) minmax(220px, 1fr);
    align-items: center;
    gap: 24px;
}
.product-photo-picker {
    display: grid;
    gap: 12px;
    cursor: pointer;
}
.product-photo-picker input {
    display: none;
}
.product-photo-preview-wrap {
    min-height: 235px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1.5px dashed color-mix(in srgb, var(--accent) 48%, var(--border));
    border-radius: 18px;
    background: linear-gradient(145deg, var(--accent-soft), var(--surface-2));
    transition: .18s ease;
}
.product-photo-picker:hover .product-photo-preview-wrap,
.product-photo-picker:focus-within .product-photo-preview-wrap {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.product-photo-preview {
    width: 100%;
    height: 235px;
    display: block;
    object-fit: contain;
    background: var(--surface-2);
}
.product-photo-preview[hidden],
.product-photo-placeholder[hidden],
.product-photo-actions [hidden] {
    display: none;
}
.product-photo-placeholder {
    display: grid;
    place-items: center;
    gap: 7px;
    padding: 28px;
    text-align: center;
}
.product-photo-placeholder > span {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(145deg, var(--accent), var(--blue));
    font-size: 25px;
    box-shadow: 0 12px 28px rgba(15,159,143,.18);
}
.product-photo-placeholder strong {
    font-size: 16px;
}
.product-photo-placeholder small,
.product-photo-actions p {
    color: var(--muted);
    line-height: 1.45;
}
.product-photo-picker > .button {
    justify-self: start;
}
.product-photo-actions {
    display: grid;
    justify-items: start;
    gap: 14px;
}
.product-photo-actions p {
    max-width: 420px;
    margin: 0;
}

.product-detail-photo-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-2);
}
.product-detail-photo-card > img,
.product-detail-photo-placeholder {
    width: 150px;
    height: 112px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--surface);
}
.product-detail-photo-card > img {
    display: block;
    object-fit: contain;
}
.product-detail-photo-placeholder {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
}
.product-detail-photo-placeholder span {
    color: var(--accent);
    font-size: 34px;
    font-weight: 900;
}
.product-detail-photo-placeholder small {
    color: var(--muted);
    font-size: 10px;
}
.product-detail-photo-card .button {
    justify-self: start;
}

@media (max-width: 760px) {
    .product-photo-editor {
        grid-template-columns: 1fr;
    }
    .product-photo-preview,
    .product-photo-preview-wrap {
        min-height: 205px;
        height: 205px;
    }
    .product-detail-photo-card {
        grid-template-columns: 1fr;
    }
    .product-detail-photo-card > img,
    .product-detail-photo-placeholder {
        width: 100%;
        height: 190px;
    }
}
