:root {
    --navy: #0b1220;
    --navy-soft: #121d31;
    --ink: #172033;
    --ink-soft: #445069;
    --muted: #748097;
    --line: #e4e9f1;
    --line-strong: #d6dde8;
    --paper: #ffffff;
    --surface: #f5f7fb;
    --surface-blue: #eef4ff;
    --blue: #2563eb;
    --blue-dark: #1749b5;
    --cyan: #24d3ee;
    --green: #07875b;
    --red: #c43227;
    --amber: #ad7200;
    --violet: #7656d8;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 4px 18px rgba(23, 32, 51, .06);
    --shadow: 0 18px 50px rgba(12, 24, 47, .10);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
    margin: 0;
    background:
        radial-gradient(circle at 8% 3%, rgba(37, 99, 235, .07), transparent 26rem),
        var(--surface);
    color: var(--ink);
    font: 15px/1.5 Inter, Manrope, "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: none; }
svg { display: block; width: 1.25em; height: 1.25em; fill: currentColor; }
[hidden] { display: none !important; }
::selection { color: #fff; background: var(--blue); }

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 76px;
    color: #fff;
    background: rgba(11, 18, 32, .96);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(18px);
}
.header-inner {
    display: flex;
    align-items: center;
    width: min(100% - 40px, 1380px);
    height: 100%;
    margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 220px; color: #fff; }
.brand-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    overflow: hidden;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 12px;
    box-shadow: 0 7px 20px rgba(37, 99, 235, .35);
}
.brand-mark::before, .brand-mark::after, .brand-mark span {
    position: absolute;
    content: "";
    background: #fff;
    border-radius: 20px;
    transform: rotate(-45deg);
}
.brand-mark::before { width: 4px; height: 22px; left: 13px; top: 8px; }
.brand-mark::after { width: 4px; height: 17px; left: 21px; top: 12px; opacity: .66; }
.brand-mark span { width: 14px; height: 4px; left: 13px; top: 21px; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-size: 17px; letter-spacing: .06em; }
.brand-copy small { margin-top: 5px; color: #8290a8; font-size: 8px; font-weight: 800; letter-spacing: .19em; }
.main-nav { display: flex; align-self: stretch; gap: 7px; margin: 0 auto; }
.main-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 17px;
    color: #9ba8bd;
    font-size: 14px;
    font-weight: 680;
    transition: .2s ease;
}
.main-nav a::after {
    position: absolute;
    right: 16px;
    bottom: -1px;
    left: 16px;
    height: 3px;
    content: "";
    background: var(--cyan);
    border-radius: 4px 4px 0 0;
    opacity: 0;
    transform: scaleX(.4);
    transition: .2s ease;
}
.main-nav a:hover, .main-nav a.active { color: #fff; background: rgba(255, 255, 255, .045); }
.main-nav a.active::after { opacity: 1; transform: scaleX(1); }
.main-nav svg { width: 19px; height: 19px; }
.logout-form { min-width: 220px; margin: 0; text-align: right; }
.icon-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #aeb9c9;
    cursor: pointer;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 12px;
    transition: .2s ease;
}
.icon-button:hover { color: #fff; background: rgba(255, 255, 255, .12); }

.app-main { width: min(100% - 40px, 1380px); min-height: calc(100vh - 76px); margin: 0 auto; padding: 36px 0 80px; }
.section-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--blue);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .17em;
    text-transform: uppercase;
}
.section-kicker.light { color: #80dff2; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

.launch-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(430px, .82fr);
    gap: clamp(36px, 6vw, 92px);
    align-items: center;
    min-height: 400px;
    padding: clamp(34px, 5vw, 70px);
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(115deg, rgba(11, 18, 32, .98), rgba(17, 44, 92, .96)),
        var(--navy);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 30px;
    box-shadow: 0 26px 70px rgba(11, 18, 32, .20);
}
.launch-panel::before {
    position: absolute;
    top: -190px;
    left: 26%;
    width: 520px;
    height: 520px;
    content: "";
    background: radial-gradient(circle, rgba(37, 99, 235, .32), transparent 68%);
}
.launch-panel::after {
    position: absolute;
    right: -80px;
    bottom: -120px;
    width: 350px;
    height: 350px;
    content: "";
    background: radial-gradient(circle, rgba(36, 211, 238, .14), transparent 65%);
}
.launch-copy, .launch-form-card { position: relative; z-index: 1; }
.launch-copy h1 { max-width: 650px; margin: 0; font-size: clamp(39px, 5vw, 64px); font-weight: 780; letter-spacing: -.045em; line-height: .99; }
.launch-copy h1 span { color: #6ee7f5; }
.launch-copy p { max-width: 640px; margin: 23px 0 0; color: #aebbd0; font-size: 16px; line-height: 1.7; }
.launch-form-card {
    padding: 26px;
    color: var(--ink);
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 21px;
    box-shadow: 0 22px 55px rgba(0, 0, 0, .22);
}
.launch-form-head { display: flex; align-items: center; gap: 12px; margin-bottom: 21px; }
.launch-form-head > div { display: grid; }
.launch-form-head strong { font-size: 17px; }
.launch-form-head small { color: var(--muted); }
.launch-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--blue); background: var(--surface-blue); border-radius: 12px; }
.parse-form { display: grid; gap: 13px; }
.url-field, .filters label, .login-form label { display: grid; gap: 7px; }
.url-field > span, .filters label > span, .login-form label > span { color: var(--ink-soft); font-size: 11px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
input, select {
    width: 100%;
    min-width: 0;
    padding: 12px 13px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder { color: #a5afbf; }
input:focus, select:focus { border-color: #75a1f7; box-shadow: 0 0 0 4px rgba(37, 99, 235, .10); }
.url-field input { height: 51px; padding: 0 15px; background: #f8fafc; }
.form-hint { margin: 16px 2px 0; color: var(--muted); font-size: 12px; }
.form-hint span, .section-note i, .pulse-dot, .login-security span { display: inline-block; width: 7px; height: 7px; margin-right: 5px; background: #16b981; border-radius: 50%; box-shadow: 0 0 0 4px rgba(22, 185, 129, .12); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 43px;
    padding: 10px 16px;
    color: var(--ink);
    font-weight: 740;
    cursor: pointer;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 11px;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button svg { width: 18px; height: 18px; }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 6px 16px rgba(37, 99, 235, .2); }
.button.primary:hover { background: var(--blue-dark); box-shadow: 0 8px 22px rgba(37, 99, 235, .28); }
.button.accent { color: #071326; background: linear-gradient(110deg, #62e6f5, #54c5f7); box-shadow: 0 9px 25px rgba(36, 211, 238, .22); }
.button.accent:hover { background: linear-gradient(110deg, #7beaf7, #6bcdf8); box-shadow: 0 11px 30px rgba(36, 211, 238, .3); }
.button.light { color: var(--navy); background: #fff; box-shadow: var(--shadow-sm); }
.button.subtle { color: var(--ink-soft); background: #fff; border-color: var(--line); }
.button.subtle:hover { color: var(--blue); border-color: #bfd0f3; }
.button.danger { color: #fff; background: var(--red); box-shadow: 0 6px 16px rgba(196, 50, 39, .18); }
.button.danger:hover { background: #a9271f; box-shadow: 0 8px 22px rgba(196, 50, 39, .25); }
.button:disabled { pointer-events: none; opacity: .45; box-shadow: none; transform: none; }
.button.text-danger { min-height: 34px; padding-inline: 8px; color: var(--red); background: transparent; }
.button.small { min-height: 35px; padding: 7px 12px; font-size: 12px; border-radius: 9px; }
.button-wide { width: 100%; min-height: 51px; }
.button.is-loading { pointer-events: none; opacity: .72; }

.alert { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0; padding: 15px 18px; border: 1px solid; border-radius: 13px; }
.alert strong { flex: 0 0 auto; }
.alert.success { color: #076b49; background: #eaf8f2; border-color: #bcebd9; }
.alert.danger { color: #9e261e; background: #fff1f0; border-color: #ffd3cf; }
.alert.warning { color: #8a5b00; background: #fff8e6; border-color: #f9dfa5; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 0; }
.metric-card { display: flex; align-items: center; gap: 15px; min-width: 0; padding: 20px 21px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.metric-card > div { display: grid; min-width: 0; }
.metric-card strong { font-size: 25px; font-weight: 780; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-card div span { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.metric-icon { display: grid; flex: 0 0 43px; place-items: center; width: 43px; height: 43px; border-radius: 13px; }
.metric-icon.blue { color: var(--blue); background: #eaf1ff; }
.metric-icon.violet { color: var(--violet); background: #f0edff; }
.metric-icon.green { color: var(--green); background: #e6f8f1; }
.metric-icon.amber { color: var(--amber); background: #fff5dc; }

.content-section { margin-top: 46px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-size: 26px; letter-spacing: -.025em; }
.section-note { margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.section-note i { width: 6px; height: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.job-list { display: grid; gap: 12px; }
.job-card { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s; }
.job-card:hover { border-color: #d5ddea; box-shadow: 0 10px 30px rgba(23, 32, 51, .08); }
.job-primary { display: grid; grid-template-columns: 55px minmax(220px, 1fr) 150px; gap: 18px; align-items: center; padding: 19px 21px 15px; }
.job-id { display: grid; place-items: center; width: 46px; height: 46px; color: var(--blue); font: 750 12px/1 "SFMono-Regular", Consolas, monospace; background: var(--surface-blue); border-radius: 13px; }
.job-source { min-width: 0; }
.job-source-line { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.job-source > a { display: block; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.job-source > a:hover { color: var(--blue); }
.job-source > small { display: block; margin-top: 3px; overflow: hidden; color: #8994a6; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.job-date { color: var(--muted); font-size: 11px; }
.type-badge { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 7px; color: #4c6082; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; background: #eef2f8; border-radius: 6px; }
.job-state { display: grid; justify-items: end; gap: 5px; }
.job-state small { color: var(--muted); font-size: 11px; }
.status, .availability { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 5px 9px; font-size: 10px; font-weight: 820; letter-spacing: .035em; text-transform: uppercase; border-radius: 999px; }
.status::before, .availability::before { width: 6px; height: 6px; content: ""; background: currentColor; border-radius: 50%; }
.status-running, .status-queued { color: #245fc4; background: #eaf2ff; }
.status-completed, .availability-in_stock { color: var(--green); background: #e8f7f1; }
.status-partial, .status-failed, .status-cancelled, .availability-out_of_stock { color: var(--red); background: #fff0ef; }
.availability-on_order, .availability-unknown { color: var(--amber); background: #fff6df; }
.job-progress-grid { display: grid; grid-template-columns: 1fr 1fr 160px; gap: 28px; padding: 14px 21px 17px 94px; background: #fbfcfe; border-top: 1px solid #eef1f5; border-bottom: 1px solid #eef1f5; }
.progress-block > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.progress-block span, .image-counter span { color: var(--muted); font-size: 11px; }
.progress-block strong { color: var(--ink-soft); font-size: 12px; }
.progress-track { display: block; height: 5px; overflow: hidden; background: #e8edf4; border-radius: 10px; }
.progress-track i { display: block; width: var(--progress, 0%); height: 100%; background: linear-gradient(90deg, var(--blue), #49b9ed); border-radius: inherit; transition: width .45s ease; }
.image-counter { display: flex; align-items: center; gap: 10px; }
.image-counter svg { color: #70809a; }
.image-counter div { display: grid; }
.image-counter strong { font-size: 15px; }
.job-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 11px 18px; }
.job-actions form, .source-actions form { margin: 0; }

.source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.source-card { display: flex; flex-direction: column; min-width: 0; min-height: 258px; padding: 21px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.source-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.source-top { display: flex; align-items: center; justify-content: space-between; }
.source-icon { display: grid; place-items: center; width: 40px; height: 40px; color: var(--blue); background: var(--surface-blue); border-radius: 12px; }
.source-icon.box { color: var(--violet); background: #f1edff; }
.source-body { min-height: 73px; margin-top: 15px; }
.source-body h3 { display: -webkit-box; margin: 0 0 5px; overflow: hidden; font-size: 15px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.source-body a { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.source-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.source-stats div { display: grid; padding: 10px 12px; background: #f8fafc; border-radius: 10px; }
.source-stats strong { font-size: 18px; }
.source-stats span { color: var(--muted); font-size: 10px; }
.source-actions { display: flex; gap: 8px; margin-top: auto; }
.source-actions .button, .source-actions form { flex: 1; }
.source-actions form .button { width: 100%; }

.empty-state { grid-column: 1 / -1; display: grid; justify-items: center; padding: 55px 24px; color: var(--muted); text-align: center; background: #fff; border: 1px dashed #cfd8e6; border-radius: var(--radius); }
.empty-state.compact { padding: 30px; }
.empty-state h3 { margin: 13px 0 3px; color: var(--ink); }
.empty-state p { margin: 0 0 16px; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; color: var(--blue); background: var(--surface-blue); border-radius: 15px; }
.empty-icon svg { width: 25px; height: 25px; }

.page-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 205px; padding: 38px 45px; overflow: hidden; color: #fff; background: linear-gradient(120deg, #0c1729, #17396f); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.page-hero::after { position: absolute; right: -90px; width: 350px; height: 350px; content: ""; background: radial-gradient(circle, rgba(36, 211, 238, .2), transparent 65%); }
.page-hero > * { position: relative; z-index: 1; }
.page-hero h1 { margin: 0; font-size: clamp(34px, 4vw, 48px); letter-spacing: -.04em; }
.page-hero p { max-width: 690px; margin: 11px 0 0; color: #adbbd0; }
.compact-hero .button { flex: 0 0 auto; }

.catalog-toolbar { position: relative; z-index: 2; margin-top: -18px; padding: 0 22px; }
.filters { display: grid; grid-template-columns: 1.35fr .9fr 1fr .7fr .9fr auto; gap: 11px; align-items: end; padding: 18px; background: rgba(255, 255, 255, .98); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filter-search > div, .input-with-icon { position: relative; }
.filter-search svg, .input-with-icon svg { position: absolute; top: 50%; left: 12px; z-index: 1; width: 18px; height: 18px; color: #8d98aa; transform: translateY(-50%); }
.filter-search input, .input-with-icon input { padding-left: 39px; }
.filter-actions { display: flex; align-items: center; gap: 10px; min-height: 43px; }
.reset-link { color: var(--muted); font-size: 11px; font-weight: 700; }
.reset-link:hover { color: var(--red); }
.catalog-control-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 29px 2px 13px; }
.catalog-summary { display: flex; flex: 1; align-items: center; justify-content: space-between; margin: 0; }
.catalog-summary div { display: flex; align-items: baseline; gap: 8px; }
.catalog-summary strong { font-size: 25px; }
.catalog-summary span { color: var(--muted); font-size: 12px; }
.bulk-actions { display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 5px 6px 5px 13px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.select-page, .product-select { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.select-page input, .product-select input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.select-page > span, .product-select > span { display: grid; flex: 0 0 18px; place-items: center; width: 18px; height: 18px; background: #fff; border: 1px solid #c8d1df; border-radius: 5px; transition: .18s ease; }
.select-page input:checked + span, .product-select input:checked + span { background: var(--blue); border-color: var(--blue); box-shadow: inset 0 0 0 4px var(--blue); }
.select-page input:checked + span::after, .product-select input:checked + span::after { width: 8px; height: 4px; content: ""; border-bottom: 2px solid #fff; border-left: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.select-page input:indeterminate + span { background: var(--blue); border-color: var(--blue); }
.select-page input:indeterminate + span::after { width: 8px; height: 2px; content: ""; background: #fff; border-radius: 2px; }
.select-page input:focus-visible + span, .product-select input:focus-visible + span { box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }
.select-page b { color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.selected-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.selected-count strong { color: var(--ink); font-size: 12px; }

.product-list { display: grid; gap: 10px; }
.product-row { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 3px 13px rgba(23, 32, 51, .04); transition: border-color .2s, box-shadow .2s; }
.product-row:hover { border-color: #d2dbe8; box-shadow: 0 8px 24px rgba(23, 32, 51, .07); }
.product-row.is-selected { border-color: #8eb0f4; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.product-summary-row { display: grid; grid-template-columns: 22px 84px minmax(280px, 1fr) 220px 125px 78px; gap: 15px; align-items: center; width: 100%; padding: 14px 17px; color: inherit; text-align: left; background: #fff; }
.product-summary-row:hover, .product-row.is-expanded .product-summary-row { background: #fbfcff; }
.product-select { align-self: stretch; justify-content: center; }
.product-thumb { display: grid; place-items: center; width: 76px; height: 76px; overflow: hidden; color: #a0aabb; background: linear-gradient(145deg, #f5f7fa, #eef2f7); border: 1px solid #edf0f4; border-radius: 12px; }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.product-thumb svg { width: 27px; height: 27px; }
.product-main { display: grid; min-width: 0; gap: 4px; }
.product-open { width: 100%; padding: 4px 0; color: inherit; text-align: left; cursor: pointer; background: transparent; border: 0; }
.product-open:focus-visible { outline: 3px solid rgba(37, 99, 235, .18); outline-offset: 4px; border-radius: 5px; }
.product-name { display: -webkit-box; overflow: hidden; font-size: 14px; font-weight: 750; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-code { width: max-content; padding: 2px 6px; color: #53617a; font-size: 10px; background: #f0f3f8; border-radius: 5px; }
.variant-summary { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.variant-summary b { color: var(--violet); }
.product-offer { display: grid; justify-items: start; gap: 8px; }
.product-price { display: flex; align-items: baseline; gap: 8px; }
.product-price strong { font-size: 18px; white-space: nowrap; }
.product-price del { color: #9aa4b4; font-size: 11px; }
.product-price small { color: var(--amber); font-size: 10px; }
.product-updated { display: grid; color: var(--muted); font-size: 10px; }
.product-updated strong { color: var(--ink-soft); font-size: 12px; }
.product-updated small { font-size: 10px; }
.product-updated em { margin-top: 3px; color: var(--red); font-size: 9px; font-style: normal; }
.product-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.product-row-actions form { margin: 0; }
.expand-button, .product-delete { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; cursor: pointer; border: 0; border-radius: 10px; transition: transform .2s, color .2s, background .2s; }
.expand-button { color: #718098; background: #f3f6fa; }
.product-delete { color: #9aa5b6; background: transparent; }
.product-delete:hover { color: var(--red); background: #fff0ef; }
.product-row.is-expanded .expand-button { color: var(--blue); background: #eaf2ff; transform: rotate(180deg); }
.product-detail { padding: 27px; background: #f8fafd; border-top: 1px solid var(--line); }
.detail-loading { display: flex; align-items: center; justify-content: center; gap: 13px; min-height: 120px; color: var(--muted); }
.detail-loading > span { width: 28px; height: 28px; border: 3px solid #dce4f0; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.detail-loading > div { display: grid; }
.detail-loading strong { color: var(--ink); }
.detail-loading small { font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }

.detail-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 34px; }
.detail-grid h3 { margin: 24px 0 10px; font-size: 15px; }
.gallery { display: flex; gap: 9px; overflow: auto; padding: 2px 2px 10px; scrollbar-width: thin; }
.gallery a { flex: 0 0 118px; height: 118px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, transform .2s; }
.gallery a:hover { border-color: #91b1ed; transform: translateY(-2px); }
.gallery img { width: 100%; height: 100%; object-fit: contain; }
.description { max-height: 250px; overflow: auto; color: var(--ink-soft); font-size: 13px; white-space: pre-line; }
.features { margin: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.features div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; padding: 9px 12px; border-bottom: 1px solid #edf0f4; }
.features div:last-child { border: 0; }
.features dt { color: var(--muted); font-size: 11px; }
.features dd { margin: 0; font-size: 11px; font-weight: 650; text-align: right; }
.categories { color: var(--muted); font-size: 11px; }
.categories strong { color: var(--ink-soft); }
.history { max-height: 240px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.history table { width: 100%; border-collapse: collapse; }
.history th, .history td { padding: 8px 10px; font-size: 10px; text-align: left; border-bottom: 1px solid #edf0f4; }
.history th { position: sticky; top: 0; color: var(--muted); background: #f8fafc; }
.detail-links { margin-top: 17px; }
.detail-links a { display: inline-flex; padding: 8px 11px; color: var(--blue); font-size: 11px; font-weight: 750; background: var(--surface-blue); border-radius: 8px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 27px; }
.pagination a { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; color: var(--ink-soft); font-size: 12px; font-weight: 720; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.pagination a:hover { color: var(--blue); border-color: #a9c1ef; }
.pagination a.active { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 6px 16px rgba(37, 99, 235, .22); }
.pagination > span { color: var(--muted); }

.system-hero { min-height: 230px; }
.system-orbit { position: relative; display: grid; flex: 0 0 110px; place-items: center; width: 110px; height: 110px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; }
.system-orbit::before, .system-orbit::after { position: absolute; content: ""; border: 1px solid rgba(255, 255, 255, .12); border-radius: 50%; }
.system-orbit::before { width: 76px; height: 76px; }
.system-orbit::after { width: 140px; height: 140px; }
.system-orbit b { display: grid; place-items: center; width: 48px; height: 48px; color: #06261d; font-size: 22px; background: #6ee7c2; border-radius: 50%; }
.system-orbit span, .system-orbit i { position: absolute; width: 9px; height: 9px; background: var(--cyan); border-radius: 50%; }
.system-orbit span { top: 7px; left: 20px; }
.system-orbit i { right: -13px; bottom: 27px; opacity: .7; }
.diagnostic-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 19px 0; padding: 16px 20px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); }
.diagnostic-summary > div { display: flex; align-items: center; }
.diagnostic-summary p { margin: 0; color: var(--muted); font-size: 11px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.check-card { position: relative; display: grid; grid-template-columns: 43px 1fr auto; gap: 14px; align-items: center; min-height: 92px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.check-card .check-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; }
.check-card.is-ok .check-icon { color: var(--green); background: #e6f8f1; }
.check-card.is-warning .check-icon { color: var(--amber); background: #fff5dc; }
.check-card.is-bad .check-icon { color: var(--red); background: #fff0ef; }
.check-card strong { display: block; font-size: 13px; }
.check-card p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.check-label { padding: 4px 8px; font-size: 9px; font-weight: 800; text-transform: uppercase; border-radius: 6px; }
.is-ok .check-label { color: var(--green); background: #e8f7f1; }
.is-warning .check-label { color: var(--amber); background: #fff5dc; }
.is-bad .check-label { color: var(--red); background: #fff0ef; }

.login-page { background: var(--navy); }
.login-shell { width: 100%; max-width: none; min-height: 100vh; padding: 0; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); min-height: 100vh; }
.login-visual { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(32px, 5vw, 72px); overflow: hidden; color: #fff; background: linear-gradient(145deg, #08111f, #122c5a); }
.login-visual::after { position: absolute; right: -200px; bottom: -220px; width: 700px; height: 700px; content: ""; background: radial-gradient(circle, rgba(36, 211, 238, .18), transparent 65%); }
.login-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 11px; }
.login-message { position: relative; z-index: 2; max-width: 720px; margin: auto 0; }
.login-message h1 { margin: 0; font-size: clamp(44px, 6vw, 78px); letter-spacing: -.055em; line-height: .96; }
.login-message h1 span { color: #6ee7f5; }
.login-message p { max-width: 610px; margin: 25px 0 0; color: #a8b7ce; font-size: 16px; line-height: 1.7; }
.login-feature-row { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 27px; color: #98a9c1; font-size: 11px; }
.login-feature-row span { display: flex; align-items: center; gap: 8px; }
.login-feature-row b { color: var(--cyan); font-family: Consolas, monospace; }
.visual-grid { position: absolute; inset: 0; opacity: .12; background-image: linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px); background-size: 70px 70px; mask-image: linear-gradient(to bottom right, #000, transparent 75%); }
.login-form-side { display: grid; place-items: center; padding: 40px; background: #f8fafc; }
.login-card { width: min(430px, 100%); }
.login-lock { display: grid; place-items: center; width: 48px; height: 48px; color: var(--blue); background: var(--surface-blue); border-radius: 14px; }
.login-heading { margin: 24px 0; }
.login-heading h2 { margin: 0; font-size: 32px; letter-spacing: -.035em; }
.login-heading p { margin: 8px 0 0; color: var(--muted); }
.login-form { display: grid; gap: 16px; }
.input-with-icon input { height: 49px; }
.login-security { margin: 22px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.login-security span { width: 6px; height: 6px; }

@media (max-width: 1120px) {
    .brand, .logout-form { min-width: 175px; }
    .launch-panel { grid-template-columns: 1fr minmax(380px, .85fr); gap: 38px; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters { grid-template-columns: 1.3fr 1fr 1fr; }
    .filters .filter-search { grid-column: span 2; }
    .filter-actions { justify-content: flex-end; }
    .product-summary-row { grid-template-columns: 22px 76px minmax(220px, 1fr) 190px 78px; }
    .product-updated { display: none; }
}

@media (max-width: 840px) {
    .app-header { height: 68px; }
    .header-inner, .app-main { width: min(100% - 24px, 1380px); }
    .brand { min-width: 0; }
    .brand-copy { display: none; }
    .logout-form { min-width: 40px; }
    .main-nav a { padding: 0 12px; }
    .app-main { min-height: calc(100vh - 68px); padding-top: 22px; }
    .launch-panel { grid-template-columns: 1fr; padding: 36px; }
    .launch-copy h1 { font-size: 44px; }
    .launch-form-card { max-width: 620px; }
    .job-primary { grid-template-columns: 50px 1fr; }
    .job-state { grid-column: 2; justify-items: start; }
    .job-progress-grid { grid-template-columns: 1fr 1fr; padding-left: 89px; }
    .image-counter { grid-column: 1 / -1; }
    .catalog-control-row { align-items: stretch; flex-direction: column; }
    .bulk-actions { align-self: flex-end; }
    .product-summary-row { grid-template-columns: 22px 72px minmax(190px, 1fr) 170px 78px; }
    .detail-grid { grid-template-columns: 1fr; }
    .check-grid { grid-template-columns: 1fr; }
    .login-layout { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-form-side { min-height: 100vh; }
}

@media (max-width: 620px) {
    .header-inner { width: calc(100% - 18px); }
    .brand-mark { width: 35px; height: 35px; }
    .main-nav { margin: 0 auto; }
    .main-nav a { gap: 0; padding: 0 13px; }
    .main-nav a span { display: none; }
    .main-nav svg { width: 21px; height: 21px; }
    .icon-button { width: 36px; height: 36px; }
    .app-main { width: calc(100% - 20px); padding-bottom: 50px; }
    .launch-panel { min-height: 0; padding: 28px 21px; border-radius: 22px; }
    .launch-copy h1 { font-size: 37px; }
    .launch-copy p { margin-top: 17px; font-size: 14px; }
    .launch-form-card { padding: 19px; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .metric-card { gap: 10px; padding: 14px; }
    .metric-icon { flex-basis: 37px; width: 37px; height: 37px; }
    .metric-card strong { font-size: 20px; }
    .metric-card div span { font-size: 10px; }
    .content-section { margin-top: 35px; }
    .section-heading { align-items: flex-start; }
    .section-heading h2 { font-size: 22px; }
    .section-note { display: none; }
    .job-primary { grid-template-columns: 42px 1fr; gap: 12px; padding: 15px; }
    .job-id { width: 40px; height: 40px; }
    .job-state { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-start; }
    .job-progress-grid { grid-template-columns: 1fr; gap: 17px; padding: 15px; }
    .image-counter { grid-column: auto; }
    .job-actions { justify-content: space-between; }
    .source-grid { grid-template-columns: 1fr; }
    .page-hero { min-height: 190px; padding: 29px 23px; border-radius: 20px; }
    .page-hero h1 { font-size: 34px; }
    .compact-hero { align-items: flex-start; flex-direction: column; }
    .catalog-toolbar { margin-top: 10px; padding: 0; }
    .filters, .filters .filter-search { grid-template-columns: 1fr; grid-column: auto; }
    .filter-actions { justify-content: flex-start; }
    .catalog-control-row { margin-top: 20px; }
    .catalog-summary { width: 100%; }
    .bulk-actions { align-self: stretch; justify-content: space-between; padding-left: 10px; }
    .select-page b { display: none; }
    .product-summary-row { grid-template-columns: 22px 62px minmax(0, 1fr) 70px; gap: 10px; padding: 12px; }
    .product-thumb { width: 62px; height: 62px; }
    .product-name { font-size: 12px; }
    .product-offer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding-top: 9px; border-top: 1px solid #edf0f4; }
    .product-row-actions { grid-column: 4; grid-row: 1; }
    .product-delete, .expand-button { width: 32px; height: 32px; }
    .product-price strong { font-size: 16px; }
    .product-detail { padding: 18px 13px; }
    .gallery a { flex-basis: 96px; height: 96px; }
    .features div { grid-template-columns: 1fr; gap: 3px; }
    .features dd { text-align: left; }
    .system-orbit { display: none; }
    .diagnostic-summary { align-items: flex-start; flex-direction: column; }
    .check-card { grid-template-columns: 38px 1fr; }
    .check-label { grid-column: 2; width: max-content; }
    .login-form-side { padding: 25px 20px; }
    .login-heading h2 { font-size: 29px; }
}
