:root {
    color-scheme: dark;
    --bg: #06101b;
    --sidebar: #071521;
    --surface: #0a1927;
    --surface-2: #0d2031;
    --surface-3: #10283b;
    --line: #17354a;
    --line-soft: #102b3e;
    --text: #eef8ff;
    --muted: #8ca7b9;
    --muted-2: #668397;
    --accent: #00a9e7;
    --accent-bright: #2cc5ff;
    --accent-soft: #062f46;
    --success: #43d49e;
    --warning: #f3bd62;
    --danger: #ff6f78;
    --radius: 14px;
    --shadow: 0 18px 42px rgba(0, 0, 0, .24);
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(0, 169, 231, .34); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1b3b50; border: 3px solid var(--bg); border-radius: 10px; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 15px 17px; background: var(--sidebar); border-right: 1px solid var(--line-soft); z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 23px; }
.brand-mark { position: relative; display: grid; width: 35px; height: 35px; place-items: center; flex: 0 0 auto; color: #fff; background: var(--accent); border-radius: 11px; box-shadow: 0 9px 20px rgba(0, 169, 231, .18); overflow: hidden; }
.brand-mark::after { content: ""; position: absolute; width: 22px; height: 22px; right: -9px; bottom: -9px; border: 5px solid rgba(255,255,255,.32); border-radius: 50%; }
.brand-mark span { position: relative; z-index: 1; font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand small { margin-top: 4px; color: var(--muted-2); font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.main-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 0 11px; color: var(--muted); border-radius: 11px; transition: color .18s ease, background .18s ease; }
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { color: var(--text); background: #0b1d2b; }
.nav-item.is-active { color: #fff; background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(0, 169, 231, .2); }
.nav-item.is-active svg { color: var(--accent-bright); }
.nav-item.is-disabled { opacity: .62; cursor: default; }
.nav-count { margin-left: auto; min-width: 22px; padding: 2px 7px; color: #aee7ff; background: #12374d; border-radius: 999px; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.soon { margin-left: auto; color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-foot { margin-top: auto; display: grid; gap: 14px; }
.store-switcher { display: grid; gap: 7px; padding: 12px; background: #081a27; border: 1px solid var(--line-soft); border-radius: 13px; }
.store-switcher-label { padding: 0 3px 3px; color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.store-switcher form { margin: 0; }
.store-option { width: 100%; display: grid; gap: 3px; padding: 9px 10px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 9px; cursor: pointer; text-align: left; }
.store-option > span { display: flex; align-items: center; gap: 8px; }
.store-option i { width: 7px; height: 7px; background: #557184; border-radius: 50%; }
.store-option strong { color: inherit; font-size: 12px; }
.store-option small { overflow: hidden; padding-left: 15px; color: var(--muted-2); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.store-option em { padding-left: 15px; color: #b99862; font-size: 9px; font-style: normal; }
.store-option:hover:not(:disabled) { color: var(--text); background: #0d2637; }
.store-option.is-active { color: #dffcf1; background: #0d2d31; border-color: #18504a; }
.store-option.is-active i { background: var(--success); box-shadow: 0 0 0 4px rgba(67,212,158,.1); }
.store-option:disabled { opacity: .72; cursor: not-allowed; }
.engine-state { display: flex; align-items: flex-start; gap: 9px; padding: 12px; background: #091c2a; border-radius: 12px; }
.status-dot { width: 8px; height: 8px; margin-top: 5px; flex: 0 0 auto; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(67, 212, 158, .1); }
.engine-state span:last-child { display: grid; }
.engine-state strong { color: #dffcf1; font-size: 12px; }
.engine-state small { margin-top: 2px; color: var(--muted-2); font-size: 12px; }
.logout-button { width: 100%; padding: 9px 12px; color: var(--muted-2); background: transparent; border: 0; border-radius: 9px; cursor: pointer; text-align: left; }
.logout-button:hover { color: var(--text); background: #0b1d2b; }

.workspace { min-width: 0; padding: 0 30px 44px; background: radial-gradient(circle at 85% 0%, rgba(0, 169, 231, .055), transparent 30%), var(--bg); }
.topbar { min-height: 102px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.route-path { margin: 0 0 5px; color: var(--muted-2); font-size: 13px; font-weight: 650; letter-spacing: .04em; }
.route-path span { padding: 0 5px; color: #315269; }
.topbar h1 { margin: 0; font-size: clamp(20px, 2.1vw, 29px); line-height: 1.15; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.environment { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.environment i { width: 7px; height: 7px; background: var(--warning); border-radius: 50%; }
.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; color: var(--text); background: #102537; border: 1px solid transparent; border-radius: 10px; font-weight: 650; cursor: pointer; transition: transform .18s cubic-bezier(.2,.8,.2,1), background .18s ease, color .18s ease, box-shadow .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.button-primary { color: #00151f; background: var(--accent-bright); box-shadow: 0 9px 24px rgba(0, 169, 231, .16); }
.button-primary:hover { background: #57d1ff; }
.button-ghost { border-color: var(--line); background: transparent; }
.button-ghost:hover { background: var(--surface-2); }
.button-quiet { min-height: 34px; color: #b6d9eb; background: #10283a; }
.button-wide { width: 100%; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.mobile-menu { display: none; width: 38px; height: 38px; padding: 9px; background: transparent; border: 1px solid var(--line); border-radius: 10px; }
.mobile-menu > span:not(.sr-only) { display: block; height: 1px; margin: 4px 0; background: var(--text); }

.flash { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding: 12px 15px; border-radius: 11px; animation: flash-in .35s cubic-bezier(.2,.8,.2,1); }
.flash-success { color: #dffcf1; background: #0b2e29; }
.flash-error { color: #ffe5e7; background: #381922; }
.flash button { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: inherit; background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
.flash button:hover { background: rgba(255,255,255,.07); }
.flash button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@keyframes flash-in { from { opacity: .25; transform: translateY(-7px); } }

.status-strip { min-height: 136px; display: grid; grid-template-columns: 1.15fr repeat(3, 1fr) 1.25fr; align-items: stretch; margin: 26px 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.status-strip > div { position: relative; min-width: 0; padding: 23px 24px; border-right: 1px solid var(--line-soft); }
.status-strip > div:last-child { border-right: 0; }
.status-strip span, .status-strip small { display: block; color: var(--muted); }
.status-strip strong { display: block; margin: 4px 0 1px; font-size: 30px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.status-strip small { font-size: 13px; }
.primary-stat { background: #0b2131; }
.primary-stat strong { color: var(--accent-bright); }
.api-pulse { display: flex; align-items: center; gap: 16px; }
.api-pulse strong { margin: 0; color: #dffcf1; font-size: 13px; letter-spacing: 0; }
.pulse-bars { height: 45px; display: flex !important; align-items: center; gap: 3px; }
.pulse-bars i { display: block; width: 3px; background: var(--success); border-radius: 4px; animation: pulse 1.6s ease-in-out infinite; }
.pulse-bars i:nth-child(1), .pulse-bars i:nth-child(5) { height: 12px; animation-delay: -.8s; }
.pulse-bars i:nth-child(2), .pulse-bars i:nth-child(4) { height: 25px; animation-delay: -.4s; }
.pulse-bars i:nth-child(3) { height: 39px; }
@keyframes pulse { 50% { transform: scaleY(.45); opacity: .55; } }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .7fr); gap: 20px; align-items: start; }
.rules-ledger, .activity-rail { min-width: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 21px; border-bottom: 1px solid var(--line-soft); }
.panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.campaign-heading { flex-wrap: wrap; }
.type-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.type-filter-label { color: var(--muted); font-size: 13px; margin-right: 4px; }
.type-filter-button { display: inline-grid; grid-template-rows: 26px auto; place-items: center; min-width: 68px; min-height: 58px; padding: 5px 8px 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.type-filter-button:hover { background: var(--surface-3); color: var(--text); }
.type-filter-button.is-active { border-color: var(--accent-bright); background: var(--accent-soft); color: var(--accent-bright); }
.type-filter-button .rule-type-icon { width: 24px; height: 24px; flex-basis: 24px; background: transparent; color: inherit; }
.type-filter-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.type-filter-button > span:last-child { max-width: 92px; overflow: hidden; color: inherit; font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.filter-tabs { display: flex; gap: 3px; padding: 3px; background: #071521; border-radius: 9px; }
.filter-tabs button { padding: 6px 9px; color: var(--muted-2); background: transparent; border: 0; border-radius: 7px; font-size: 12px; cursor: pointer; }
.filter-tabs button.is-active { color: var(--text); background: #153247; }
.rule-table { display: grid; }
.rule-row { display: grid; grid-template-columns: minmax(270px, 1.7fr) 110px 90px 100px 82px; min-height: 76px; align-items: center; gap: 14px; padding: 0 21px; border-bottom: 1px solid var(--line-soft); }
.rule-row:last-child { border-bottom: 0; }
.rule-row[hidden] { display: none; }
.rule-row:not(.rule-table-head):hover { background: #0b1d2c; }
.rule-table-head { min-height: 42px; color: var(--muted-2); background: #081724; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.rule-name { display: flex; align-items: center; gap: 13px; min-width: 0; }
.rule-name:hover strong { color: var(--accent-bright); }
.rule-name:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 4px; border-radius: 4px; }
.rule-name > span:last-child { display: grid; min-width: 0; }
.rule-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 400; }
.rule-name small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.rule-sigil { width: 37px; height: 37px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 8px; flex: 0 0 auto; background: #0c2b40; border-radius: 10px; }
.rule-sigil i { width: 4px; background: var(--accent); border-radius: 3px 3px 1px 1px; }
.rule-sigil i:nth-child(1) { height: 8px; opacity: .5; }.rule-sigil i:nth-child(2) { height: 14px; opacity: .75; }.rule-sigil i:nth-child(3) { height: 20px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; font-size: 12px; font-weight: 700; }
.status-badge i { width: 6px; height: 6px; border-radius: 50%; }
.status-active { color: #bff7df; background: #0c3029; }.status-active i { background: var(--success); }
.status-draft { color: #c2d6e2; background: #172b39; }.status-draft i { background: #839dad; }
.status-paused { color: #ffe3b2; background: #332817; }.status-paused i { background: var(--warning); }
.numeric { color: #c3d5df; font-size: 12px; font-variant-numeric: tabular-nums; }
.rule-actions { display: flex; justify-content: flex-end; gap: 4px; min-width: 140px; }
.rule-row { grid-template-columns: minmax(270px, 1.7fr) 110px 90px 100px 140px; }
.icon-button.icon-button-danger:hover { color: var(--danger); }
@media (max-width: 820px) { .rule-table .rule-row { grid-template-columns: minmax(180px, 1fr) 95px 140px; } }
.delete-confirmation { max-width: 640px; padding: 24px; }
.delete-confirmation p { line-height: 1.6; overflow-wrap: anywhere; }
.delete-confirmation form { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.button-danger { background: var(--danger); color: var(--bg); }
.button-danger:hover { background: var(--danger); filter: brightness(1.1); }
.rule-actions form { display: contents; }
.icon-button { width: 32px; height: 32px; display: inline-grid; place-items: center; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.icon-button:hover { color: var(--text); background: var(--surface-3); border-color: var(--line); }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rule-actions .icon-button { width: 44px; height: 44px; padding: 0; color: #eef8ff; }
.rule-actions .icon-button svg { width: 23.04px; height: 23.04px; stroke-width: 1; }
.live-label { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.live-label i { width: 6px; height: 6px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(67,212,158,.08); }
.activity-list { display: grid; }
.activity-item { position: relative; min-height: 75px; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; column-gap: 11px; row-gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.activity-mark { width: 7px; height: 7px; background: #517085; border-radius: 50%; }.activity-mark.has-match { background: var(--accent); }
.activity-item div { display: grid; min-width: 0; line-height: 1.5; }
.activity-item strong { font-size: 13px; }
.activity-item small { margin-top: 3px; color: var(--muted-2); font-size: 9px; font-variant-numeric: tabular-nums; }
.activity-item time { color: var(--muted-2); font-size: 9px; font-variant-numeric: tabular-nums; }
.activity-amount { grid-column: 2 / 4; margin: 0; color: var(--accent-bright); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rail-note { display: flex; gap: 11px; margin: 17px; padding: 14px; background: #0b2232; border-radius: 11px; }
.rail-note svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: var(--accent); stroke-width: 1.8; }
.rail-note span { display: grid; }.rail-note strong { font-size: 13px; }.rail-note small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.activity-empty, .empty-state { padding: 46px 24px; text-align: center; }
.filter-empty { margin: 0; padding: 34px 24px; color: var(--muted); text-align: center; }
.activity-empty p, .empty-state p { max-width: 330px; margin: 7px auto 18px; color: var(--muted); }
.empty-state h3 { margin: 13px 0 0; }.empty-glyph { width: 46px; height: 36px; display: inline-block; background: #0b2638; border: 1px solid #31536a; border-radius: 9px; }

.catalog-status { min-height: 112px; display: grid; grid-template-columns: 1.25fr 1fr 1fr .85fr; align-items: stretch; margin: 26px 0 20px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.catalog-status > div, .catalog-status > dl { min-width: 0; display: flex; align-items: center; gap: 13px; padding: 20px 22px; border-right: 1px solid var(--line-soft); }
.catalog-status > :last-child { border-right: 0; }
.integration-mark { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; color: var(--accent-bright); background: #0b2c41; border-radius: 11px; }
.integration-mark svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.integration-identity > span:last-child, .integration-health > span { display: grid; min-width: 0; }
.integration-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.integration-identity small, .integration-health small, .sync-time span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.integration-health .status-dot { margin-top: 0; }
.integration-health strong { color: #dffcf1; font-size: 12px; }
.catalog-totals { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 14px !important; margin: 0; }
.catalog-totals div { min-width: 0; }
.catalog-totals dt { color: var(--muted-2); font-size: 9px; }
.catalog-totals dd { margin: 3px 0 0; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.sync-time { display: grid !important; align-content: center; }
.sync-time strong { margin-top: 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.catalog-grid { display: grid; grid-template-columns: minmax(340px, .72fr) minmax(0, 1.68fr); gap: 20px; align-items: start; }
.category-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.category-search { position: relative; min-width: 0; }
.category-search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; fill: none; stroke: var(--muted-2); stroke-width: 1.8; transform: translateY(-50%); }
.category-search input { width: 100%; min-height: 36px; padding: 0 10px 0 34px; color: var(--text); background: #071724; border: 1px solid var(--line); border-radius: 9px; outline: none; }
.category-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,169,231,.1); }
.category-collapse { min-height: 36px; padding: 0 11px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.category-collapse:hover { color: var(--text); background: var(--surface-3); }
.category-tree { list-style: none; padding: 0; margin: 0; }
.category-tree .category-tree { margin-left: 25px; padding-left: 8px; border-left: 1px solid #17384c; }
.category-node[hidden] { display: none; }
.category-tree-row { min-height: 38px; display: flex; align-items: center; gap: 5px; padding: 2px 10px; color: var(--text); font-size: 13px; line-height: 1.35; border-radius: 8px; }
summary.category-tree-row { list-style: none; cursor: pointer; }
summary.category-tree-row::-webkit-details-marker { display: none; }
summary.category-tree-row:hover, .category-tree-leaf:hover { background: var(--surface-3); }
.category-caret { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; color: var(--muted); }
.category-caret::before { content: ''; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .18s ease; }
.category-branch[open] > summary .category-caret::before { transform: rotate(45deg) translate(-1px, -1px); }
.category-leaf-dot { width: 20px; height: 20px; position: relative; flex: 0 0 auto; }
.category-leaf-dot::after { content: ''; position: absolute; left: 8px; top: 8px; width: 4px; height: 4px; background: #31566d; border-radius: 50%; }
.category-link { min-width: 0; display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 10px; padding: 6px 8px; color: var(--text); text-decoration: none; border-radius: 7px; }
.category-name, .category-all span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-link b { min-width: 25px; padding: 2px 6px; color: var(--muted); background: #0d2535; border-radius: 999px; font-size: 10px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.category-link:hover { color: #fff; }
.category-link.is-active { background: #164863; color: #b9ecff; font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.category-link.is-active b { color: #c8f1ff; background: #0e344a; }
.category-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.category-all { position: relative; min-height: 42px; margin: 0 10px 8px; padding: 8px 12px; background: var(--surface); box-shadow: 0 8px 14px rgba(3,13,21,.2); }
.category-empty { margin: 20px; color: var(--muted); text-align: center; }
.category-footer { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 15px; color: var(--muted-2); border-top: 1px solid var(--line-soft); font-size: 10px; }
.catalog-products, .catalog-categories { min-width: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.catalog-heading { flex-direction: row; align-items: center; }
.catalog-search { width: min(290px, 44%); position: relative; flex: 0 0 auto; }
.catalog-search:has(button) { width: min(420px, 50%); display: flex; align-items: center; gap: 8px; }
.catalog-search > label { position: relative; flex: 1; min-width: 0; }
.catalog-search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; fill: none; stroke: var(--muted-2); stroke-width: 1.8; transform: translateY(-50%); }
.catalog-search input { width: 100%; min-height: 37px; padding: 0 11px 0 35px; color: var(--text); background: #071724; border: 1px solid var(--line); border-radius: 9px; outline: none; }
.catalog-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,169,231,.1); }
.product-list { display: grid; }
.product-row { min-height: 76px; display: grid; grid-template-columns: 47px minmax(190px, 1fr) 104px 88px; align-items: center; gap: 13px; padding: 10px 20px; border-bottom: 1px solid var(--line-soft); }
.product-row:last-child { border-bottom: 0; }
.product-row:hover { background: #0b1d2c; }
.product-row[hidden] { display: none; }
.product-image { width: 43px; height: 43px; display: grid; place-items: center; overflow: hidden; background: #fff; border-radius: 9px; }
.product-image img { width: 100%; height: 100%; object-fit: contain; }
.product-image svg { width: 20px; height: 20px; fill: none; stroke: #527185; stroke-width: 1.6; }
.product-info { display: grid; min-width: 0; }
.product-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.product-info small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.product-metric { display: grid; }
.product-metric small { color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.product-metric strong { margin-top: 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.stock-state { display: inline-flex; align-items: center; gap: 6px; font-size: 9px; font-weight: 700; }
.stock-state i { width: 6px; height: 6px; border-radius: 50%; }
.stock-state.in-stock { color: #bff7df; }.stock-state.in-stock i { background: var(--success); }
.stock-state.out-stock { color: #a9bcc8; }.stock-state.out-stock i { background: #668397; }
.category-list { display: grid; padding: 8px 4px 12px; }
.category-row { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); }
.category-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c6d8e2; font-size: 12px; }
.category-row b { min-width: 24px; padding: 3px 7px; color: #aee7ff; background: #12374d; border-radius: 7px; font-size: 9px; text-align: center; }

.coupon-panel { margin-top: 26px; overflow: hidden; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.coupon-heading { flex-direction: row; align-items: center; }
.coupon-search { width: min(340px, 42%); position: relative; flex: 0 0 auto; }
.coupon-search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; fill: none; stroke: var(--muted-2); stroke-width: 1.8; transform: translateY(-50%); }
.coupon-search input { width: 100%; min-height: 39px; padding: 0 11px 0 35px; color: var(--text); background: #071724; border: 1px solid var(--line); border-radius: 9px; outline: none; }
.coupon-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,169,231,.1); }
.coupon-table { display: grid; }
.coupon-row { min-height: 76px; display: grid; grid-template-columns: minmax(220px, 1.4fr) 110px minmax(190px, 1fr) 110px 110px; align-items: center; gap: 16px; padding: 10px 21px; border-bottom: 1px solid var(--line-soft); }
.coupon-row:last-child { border-bottom: 0; }
.coupon-row:not(.coupon-table-head):hover { background: #0b1d2c; }
.coupon-row[hidden] { display: none; }
.coupon-table-head { min-height: 42px; color: var(--muted-2); background: #081724; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.coupon-code { min-width: 0; display: grid; }
.coupon-code strong { overflow: hidden; color: #dff5ff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.coupon-code small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.coupon-value { color: var(--accent-bright); font-size: 15px; font-variant-numeric: tabular-nums; }
.coupon-conditions, .coupon-date { color: #b4c8d4; font-size: 12px; line-height: 1.5; }
.coupon-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 7px; font-size: 11px; font-style: normal; font-weight: 700; }
.coupon-status b { width: 6px; height: 6px; border-radius: 50%; }
.coupon-status.status-active { color: #bff7df; background: #0c3029; }.coupon-status.status-active b { background: var(--success); }
.coupon-status.status-disabled { color: #c2d6e2; background: #172b39; }.coupon-status.status-disabled b { background: #839dad; }
.coupon-status.status-expired { color: #ffe3b2; background: #332817; }.coupon-status.status-expired b { background: var(--warning); }
@media (max-width: 920px) { .coupon-heading { align-items: flex-start; flex-direction: column; }.coupon-search { width: 100%; }.coupon-table { overflow-x: auto; }.coupon-row { min-width: 820px; } }

.rule-builder { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; margin-top: 26px; align-items: start; }
.builder-main { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.builder-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 25px 27px 23px; background: #0a1d2c; border-bottom: 1px solid var(--line-soft); }
.mechanic-chip { display: inline-flex; padding: 4px 8px; margin-bottom: 11px; color: #bceaff; background: #0e344b; border-radius: 6px; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.builder-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.builder-heading p { max-width: 620px; margin: 7px 0 0; color: var(--muted); }
.save-state { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; padding-top: 5px; color: var(--muted-2); font-size: 12px; }.save-state span { width: 6px; height: 6px; background: var(--warning); border-radius: 50%; }
.form-section { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 13px; padding: 25px 27px 28px; border-bottom: 1px solid var(--line-soft); }
.form-section:last-child { border-bottom: 0; }
.section-index { width: 30px; height: 30px; display: grid; place-items: center; color: var(--accent-bright); background: #0b2c41; border-radius: 8px; font-size: 13px; font-weight: 800; }
.section-content { min-width: 0; }
.section-title { margin-bottom: 18px; }
.section-title.split { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.section-title h3 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.field-grid { display: grid; gap: 14px; margin-top: 14px; }.field-grid.two { grid-template-columns: repeat(2, 1fr); }.field-grid.three { grid-template-columns: 1fr 1fr .7fr; }
.field { display: grid; gap: 7px; color: #bed0db; font-size: 13px; font-weight: 650; }
.field input, .tier-row input { width: 100%; min-height: 42px; padding: 0 12px; color: var(--text); caret-color: var(--accent-bright); background: #071724; border: 1px solid #1a3b51; border-radius: 9px; outline: none; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.field input:hover, .tier-row input:hover { background: #081b29; }
.field input:focus, .tier-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,169,231,.1); }
.field small { color: var(--muted-2); font-size: 9px; font-weight: 500; }
.field-wide { max-width: none; }
.input-unit, .tier-row label { position: relative; display: block; }
.input-unit input, .tier-row label input { padding-right: 42px; }
.input-unit b, .tier-row label b { position: absolute; right: 12px; top: 50%; color: var(--muted-2); font-size: 12px; transform: translateY(-50%); }
.scope-banner { display: flex; align-items: center; gap: 12px; padding: 14px; background: #091e2d; border-radius: 11px; }
.scope-banner svg { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.scope-banner > span:nth-child(2) { display: grid; }.scope-banner strong { font-size: 13px; }.scope-banner small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.tag-muted { margin-left: auto; flex: 0 0 auto; padding: 5px 8px; color: var(--muted); background: #122b3b; border-radius: 7px; font-size: 9px; }
.tier-table { overflow-x: auto; }
.tier-row { display: grid; grid-template-columns: 130px 130px minmax(150px, 1fr) 34px; align-items: center; gap: 11px; min-width: 535px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.tier-row:last-child { border-bottom: 0; }
.tier-row input { min-height: 38px; }
.tier-head { min-height: 31px; color: var(--muted-2); font-size: 9px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.tier-row output { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.tier-row output i { position: relative; width: 56px; height: 6px; background: #143246; border-radius: 5px; overflow: hidden; }.tier-row output i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 58%; background: var(--accent); border-radius: inherit; }
.tier-row output strong { color: var(--accent-bright); }
.switch-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 63px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.switch-row:last-child { border-bottom: 0; }
.switch-row span { display: grid; }.switch-row strong { font-size: 13px; }.switch-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { position: relative; width: 39px; height: 22px; flex: 0 0 auto; background: #1a3547; border-radius: 999px; transition: background .2s ease; }
.switch-row i::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #7792a3; border-radius: 50%; transition: transform .24s cubic-bezier(.2,.8,.2,1), background .2s ease; }
.switch-row input:checked + i { background: var(--accent); }.switch-row input:checked + i::after { background: #fff; transform: translateX(17px); }
.switch-row input:focus-visible + i { outline: 2px solid var(--accent-bright); outline-offset: 3px; }
.builder-rail { position: sticky; top: 20px; display: grid; gap: 14px; }
.preview-panel, .publish-panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.preview-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; color: var(--muted); border-bottom: 1px solid var(--line-soft); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.preview-cart { display: grid; gap: 9px; padding: 17px; background: #081724; }
.preview-line { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }.preview-line b { color: #c3d6e1; }.preview-line em { font-style: normal; font-variant-numeric: tabular-nums; }
.preview-result { display: flex; align-items: center; justify-content: space-between; padding: 13px 17px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; }.preview-result strong { color: var(--text); font-size: 18px; font-variant-numeric: tabular-nums; }.preview-result.accent strong { color: var(--accent-bright); }
.preview-panel > p { margin: 0; padding: 14px 17px 17px; color: var(--muted-2); font-size: 9px; }
.publish-panel { padding: 18px; }.publish-panel h3 { margin: 0; font-size: 14px; }.publish-panel p { margin: 7px 0 16px; color: var(--muted); font-size: 12px; }.publish-panel .button + .button { margin-top: 8px; }

.login-page { display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 18% 30%, rgba(0,169,231,.11), transparent 32%), #050e17; }
.login-shell { width: min(940px, 100%); min-height: 540px; display: grid; grid-template-columns: 1.25fr .85fr; background: #071522; border-radius: 18px; box-shadow: 0 30px 90px rgba(0,0,0,.45); overflow: hidden; }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 58px; background: #071b2a; overflow: hidden; }
.login-brand::after { content: ""; position: absolute; width: 360px; height: 360px; right: -180px; bottom: -180px; border: 52px solid rgba(0,169,231,.08); border-radius: 50%; }
.login-brand > div:nth-child(2) { display: grid; margin: 13px 0 58px; }.brand-name { margin: 0; font-size: 14px; font-weight: 750; }.brand-note { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.login-brand h1 { margin: 0; font-size: clamp(36px, 4.4vw, 55px); line-height: 1.02; letter-spacing: -.04em; }.login-brand > p:last-child { max-width: 470px; margin: 19px 0 0; color: var(--muted); font-size: 13px; }
.login-signal { position: absolute; right: 35px; top: 40px; display: flex; align-items: end; gap: 5px; height: 46px; opacity: .7; }.login-signal span { width: 4px; background: var(--accent); border-radius: 4px; }.login-signal span:nth-child(1),.login-signal span:nth-child(5){height:12px}.login-signal span:nth-child(2),.login-signal span:nth-child(4){height:25px}.login-signal span:nth-child(3){height:42px}
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 43px; background: #091724; }
.login-panel-head { display: flex; align-items: center; gap: 9px; margin-bottom: 35px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.login-panel h2 { margin: 0; font-size: 23px; }.login-panel > p { margin: 7px 0 23px; color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 15px; }.login-form label { display: grid; gap: 7px; color: #bfd1dc; font-size: 12px; font-weight: 700; }.login-form input { min-height: 43px; padding: 0 12px; color: var(--text); background: #06131e; border: 1px solid var(--line); border-radius: 9px; outline: none; }.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,169,231,.1); }.login-form .button { margin-top: 4px; }
.notice { margin-bottom: 17px; padding: 11px 12px; border-radius: 9px; font-size: 12px; }.notice-error { color: #ffe2e5; background: #361a22; }
.login-meta { display: flex; gap: 14px; margin-top: 29px !important; }.login-meta span { color: var(--muted-2); font-size: 9px; font-variant-numeric: tabular-nums; }

@media (max-width: 1120px) {
    .status-strip { grid-template-columns: repeat(4, 1fr); }.api-pulse { grid-column: 1 / -1; min-height: 76px; border-top: 1px solid var(--line-soft); }.dashboard-grid, .catalog-grid { grid-template-columns: 1fr; }.activity-rail { display: grid; grid-template-columns: 1fr 1.4fr; }.activity-rail .panel-heading { grid-column: 1 / -1; }.rail-note { align-self: start; }.rule-builder { grid-template-columns: 1fr; }.builder-rail { position: static; grid-template-columns: 1fr 1fr; }.catalog-status { grid-template-columns: 1fr 1fr; }.catalog-status > :nth-child(2) { border-right: 0; }.catalog-status > :nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
}
@media (max-width: 820px) {
    .app-shell { grid-template-columns: 1fr; }.sidebar { position: fixed; left: 0; width: 238px; transform: translateX(-102%); transition: transform .28s cubic-bezier(.2,.8,.2,1); box-shadow: 20px 0 50px rgba(0,0,0,.35); }.sidebar.is-open { transform: translateX(0); }.workspace { padding: 0 18px 32px; }.mobile-menu { display: block; flex: 0 0 auto; }.topbar { min-height: 86px; }.topbar > div:nth-child(2) { margin-right: auto; }.route-path { display: none; }.environment { display: none; }.rule-row { grid-template-columns: minmax(180px, 1fr) 95px 65px; }.rule-row > :nth-child(4) { display: none; }.rule-row > :nth-child(5) { grid-column: 3; }.rule-table-head > :nth-child(5) { display:none; }.login-shell { grid-template-columns: 1fr; }.login-brand { min-height: 310px; padding: 38px; }.login-brand > div:nth-child(2) { margin-bottom: 38px; }.login-panel { padding: 38px; }
}
@media (max-width: 580px) {
    .workspace { padding-inline: 13px; }.topbar { gap: 10px; }.topbar h1 { font-size: 18px; }.topbar-actions .button { width: 39px; padding: 0; font-size: 0; }.topbar-actions .button svg { margin: 0; }.status-strip { grid-template-columns: repeat(2, 1fr); }.status-strip > div { padding: 18px; }.api-pulse { grid-column: 1 / -1; }.dashboard-grid, .catalog-grid { gap: 13px; }.panel-heading { align-items: flex-start; flex-direction: column; }.rule-table { overflow-x: auto; }.rule-row { min-width: 610px; }.activity-rail { grid-template-columns: 1fr; }.activity-rail .panel-heading { grid-column: auto; }.builder-heading { padding: 21px; }.save-state { display: none; }.form-section { grid-template-columns: 1fr; padding: 21px; }.section-index { margin-bottom: -3px; }.field-grid.two, .field-grid.three { grid-template-columns: 1fr; }.scope-banner { align-items: flex-start; }.tag-muted { display: none; }.builder-rail { grid-template-columns: 1fr; }.catalog-status { grid-template-columns: 1fr; }.catalog-status > :is(div, dl) { border-right: 0; border-bottom: 1px solid var(--line-soft); }.catalog-status > :last-child { border-bottom: 0; }.catalog-totals { grid-template-columns: repeat(3, 1fr); }.catalog-search { width: 100%; }.product-list { overflow-x: auto; }.product-row { min-width: 660px; }.login-page { padding: 0; }.login-shell { min-height: 100vh; border-radius: 0; }.login-brand { min-height: 270px; padding: 30px; }.login-brand h1 { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
