:root {
  --ink: #14273d;
  --ink-2: #203850;
  --pale: #f3f6fa;
  --paper: #ffffff;
  --line: #dce5ee;
  --slate: #6f8198;
  --blue: #216bff;
  --blue-dark: #1556d5;
  --cyan: #17a7a0;
  --amber: #d89528;
  --danger: #c84f58;
  --success: #20836f;
  --display: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  --body: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  --utility: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow-sm: 0 1px 2px rgba(20, 39, 61, .05), 0 8px 24px rgba(35, 58, 83, .05);
  --shadow-lg: 0 28px 80px rgba(14, 29, 47, .24);
  --sidebar: 244px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--pale); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--pale); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled, textarea:disabled, select:disabled { cursor: not-allowed; opacity: .58; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid rgba(33, 107, 255, .28); outline-offset: 2px; }

.boot-screen { position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--ink); color: #fff; transition: opacity .24s ease; }
.boot-screen p { margin: 0; color: #bbcad9; font-size: 13px; letter-spacing: .08em; }
.boot-screen.is-leaving { opacity: 0; pointer-events: none; }
.brand-mark { width: 32px; height: 28px; display: inline-grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; flex: 0 0 auto; }
.brand-mark i { display: block; background: var(--blue); border-radius: 2px 2px 0 0; }
.brand-mark i:nth-child(1) { height: 42%; }
.brand-mark i:nth-child(2) { height: 72%; background: #4d8cff; }
.brand-mark i:nth-child(3) { height: 100%; background: var(--cyan); }
.brand-mark--large { width: 45px; height: 39px; gap: 4px; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 520px) minmax(460px, 1fr); background: var(--paper); }
.login-card { width: min(100%, 440px); align-self: center; justify-self: center; padding: 48px; }
.login-brand { display: flex; align-items: center; gap: 18px; }
.eyebrow { margin: 0 0 8px; color: var(--slate); font-family: var(--utility); font-size: 10px; font-weight: 700; line-height: 1.2; letter-spacing: .14em; }
.login-brand h1 { margin: 0; font-family: var(--display); font-size: 30px; line-height: 1; letter-spacing: -.06em; }
.login-brand h1 span { color: var(--blue); }
.login-intro { margin: 36px 0 28px; max-width: 360px; color: var(--slate); font-size: 15px; line-height: 1.65; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label, .label-row { font-size: 12px; font-weight: 750; letter-spacing: .01em; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #cfdbe7; border-radius: 10px; background: #fff; color: var(--ink); padding: 12px 13px; outline: none; transition: border-color .16s, box-shadow .16s; }
.field textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33, 107, 255, .1); }
.field small { color: var(--slate); font-size: 11px; line-height: 1.5; }
.form-error { margin: 0 0 16px; border-left: 3px solid var(--danger); background: #fff0f1; color: #973841; padding: 10px 12px; border-radius: 0 8px 8px 0; font-size: 12px; line-height: 1.5; }
.button { min-height: 42px; border: 0; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 16px; font-size: 12px; font-weight: 780; transition: transform .16s, background .16s, box-shadow .16s; }
.button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button:not(:disabled):active { transform: translateY(1px); }
.button--primary { background: var(--blue); color: #fff; box-shadow: 0 7px 18px rgba(33, 107, 255, .18); }
.button--primary:hover:not(:disabled) { background: var(--blue-dark); }
.button--secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.button--secondary:hover:not(:disabled) { background: var(--pale); }
.button--wide { width: 100%; }
.login-note { margin: 18px 0 0; text-align: center; color: var(--slate); font-size: 11px; }
.login-note span { color: var(--cyan); font-size: 8px; }
.login-aside { position: relative; overflow: hidden; display: grid; place-items: center; background: var(--ink); }
.login-aside::before { content: ""; position: absolute; inset: 0; opacity: .15; background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(to bottom right, transparent, #000); }
.login-aside::after { content: ""; position: absolute; width: 420px; height: 420px; border: 1px solid rgba(64, 135, 255, .25); border-radius: 50%; box-shadow: 0 0 0 70px rgba(33,107,255,.04), 0 0 0 140px rgba(33,107,255,.03); }
.route-line { position: absolute; top: 14%; left: 10%; right: 10%; display: flex; align-items: center; gap: 12px; color: #91a6ba; font-family: var(--utility); font-size: 10px; letter-spacing: .08em; }
.route-line i { flex: 1; height: 1px; background: linear-gradient(90deg, #698097, var(--cyan)); }
.route-line b { color: #fff; font-weight: 600; }
.aside-card { position: relative; z-index: 1; width: 310px; min-height: 360px; padding: 42px; border: 1px solid rgba(255,255,255,.12); border-radius: 24px 24px 24px 7px; color: #fff; background: linear-gradient(145deg, rgba(40, 67, 95, .94), rgba(20, 39, 61, .88)); box-shadow: 0 35px 90px rgba(5, 14, 24, .35); backdrop-filter: blur(8px); transform: rotate(-2deg); }
.aside-signal { display: block; width: 13px; height: 13px; margin-bottom: 62px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 8px rgba(23,167,160,.12); }
.aside-card small { color: #9db0c4; font-family: var(--utility); font-size: 9px; letter-spacing: .14em; }
.aside-card > strong { display: block; margin-top: 12px; font-family: var(--display); font-size: 28px; line-height: 1.23; letter-spacing: -.04em; }
.aside-price { position: absolute; right: -18px; bottom: 42px; width: 136px; padding: 15px 18px; border-radius: 14px; background: var(--blue); box-shadow: 0 16px 34px rgba(9, 37, 87, .34); }
.aside-price span { display: block; font-family: var(--utility); font-size: 9px; opacity: .72; }
.aside-price b { font-family: var(--display); font-size: 36px; letter-spacing: -.05em; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; padding: 22px 16px 18px; color: #d9e3ed; background: var(--ink); }
.sidebar::after { content: ""; position: absolute; right: 0; bottom: 0; width: 1px; height: 34%; background: linear-gradient(transparent, var(--blue)); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 26px; }
.sidebar-brand strong { display: block; color: #fff; font-family: var(--display); font-size: 16px; letter-spacing: -.03em; }
.sidebar-brand small { display: block; margin-top: 3px; color: #8196ab; font-size: 9px; letter-spacing: .06em; }
.main-nav { min-height: 0; display: grid; gap: 4px; overflow-y: auto; }
.nav-item { position: relative; width: 100%; min-height: 43px; border: 0; border-radius: 8px; display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: #9eb0c2; background: transparent; font-size: 12px; font-weight: 650; text-align: left; }
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.is-active { color: #fff; background: rgba(33,107,255,.18); }
.nav-item.is-active::before { content: ""; position: absolute; left: 0; width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: #5d92ff; }
.sidebar-status { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgba(216,149,40,.1); }
.status-dot.is-connected { background: var(--cyan); box-shadow: 0 0 0 5px rgba(23,167,160,.1); }
.sidebar-status small { display: block; margin-bottom: 4px; color: #6f859b; font-family: var(--utility); font-size: 8px; letter-spacing: .11em; }
.sidebar-status strong { display: block; color: #d8e2ec; font-size: 10px; font-weight: 650; }
.logout-button { margin-top: 5px; }
.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 20; top: 0; height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); }
.breadcrumb { display: flex; align-items: center; gap: 9px; font-size: 11px; }
.breadcrumb span { color: var(--slate); }
.breadcrumb i { color: #b8c4d1; font-style: normal; }
.breadcrumb strong { font-weight: 750; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.sync-label { display: inline-flex; align-items: center; gap: 7px; color: var(--slate); font-size: 10px; }
.sync-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }
.sync-label.is-loading i { background: var(--blue); animation: pulse 1s infinite; }
.sync-label.is-error i { background: var(--danger); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; display: inline-grid; place-items: center; background: #fff; }
.icon-button:hover { border-color: #c6d4e2; background: var(--pale); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bot-pill { height: 40px; display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.bot-pill > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: #e9f1ff; color: var(--blue); font-size: 13px; }
.bot-pill small, .bot-pill strong { display: block; }
.bot-pill small { color: var(--slate); font-family: var(--utility); font-size: 7px; letter-spacing: .1em; }
.bot-pill strong { margin-top: 2px; font-size: 9px; font-weight: 750; }
.mobile-menu { display: none; }
.content { padding: 32px clamp(22px, 3vw, 48px) 56px; }
.page { width: min(100%, 1400px); margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; min-height: 95px; margin-bottom: 26px; }
.page-heading h1 { margin: 0; font-family: var(--display); font-size: clamp(27px, 3vw, 38px); line-height: 1.08; letter-spacing: -.055em; }
.page-heading > div > p:last-child { margin: 9px 0 0; color: var(--slate); font-size: 12px; line-height: 1.55; }
.page-heading--action { align-items: center; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 14px; }
.metric-card { min-height: 132px; border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: var(--paper); box-shadow: var(--shadow-sm); }
.metric-card small { display: block; color: var(--slate); font-family: var(--utility); font-size: 9px; letter-spacing: .08em; }
.metric-card strong { display: block; margin-top: 25px; font-family: var(--display); font-size: 27px; line-height: 1; letter-spacing: -.045em; }
.metric-card strong span { color: var(--slate); font-family: var(--body); font-size: 10px; letter-spacing: 0; }
.metric-card p { margin: 8px 0 0; color: var(--slate); font-size: 10px; }
.metric-card--blue { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 13px 35px rgba(33,107,255,.16); }
.metric-card--blue small, .metric-card--blue p, .metric-card--blue strong span { color: rgba(255,255,255,.7); }
.overview-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 14px; }
.panel-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.panel-card__heading { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-card__heading h2 { margin: 0; font-family: var(--display); font-size: 16px; letter-spacing: -.035em; }
.text-button { border: 0; padding: 7px 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 750; }
.loading-block { padding: 28px 20px; color: var(--slate); font-size: 12px; }
.system-row, .catalog-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; border-top: 1px solid #edf1f5; }
.system-row:first-child, .catalog-row:first-child { border-top: 0; }
.system-row > div, .catalog-row > div { min-width: 0; }
.system-row strong, .catalog-row strong { display: block; font-size: 12px; }
.system-row p, .catalog-row p { margin: 4px 0 0; color: var(--slate); font-size: 10px; line-height: 1.5; }

.catalog-toolbar { min-height: 61px; display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; background: #fff; }
.search-field { flex: 1 1 300px; min-width: 180px; display: flex; align-items: center; gap: 9px; padding: 0 10px; }
.search-field svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: var(--slate); stroke-width: 1.7; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-field input::placeholder { color: #9aabba; }
.toolbar-select select { min-height: 36px; max-width: 190px; border: 1px solid var(--line); border-radius: 8px; padding: 0 30px 0 10px; color: var(--ink-2); background: #fff; font-size: 10px; font-weight: 700; }
.segmented { display: flex; padding: 3px; border-radius: 8px; background: var(--pale); }
.segmented button { min-height: 30px; border: 0; border-radius: 6px; padding: 6px 11px; color: var(--slate); background: transparent; font-size: 10px; font-weight: 700; }
.segmented button.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(20,39,61,.08); }
.record-count { min-width: 54px; color: var(--slate); font-family: var(--utility); font-size: 9px; text-align: center; }
.table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.product-table-card { border-radius: 0 0 14px 14px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { height: 43px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--slate); background: #f9fbfd; font-family: var(--utility); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-align: left; white-space: nowrap; }
td { height: 64px; padding: 10px 16px; border-bottom: 1px solid #edf1f5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdff; }
.product-cell { display: flex; align-items: center; gap: 11px; min-width: 210px; }
.provider-avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #cfe0ff; border-radius: 9px; color: var(--blue); background: #eff5ff; font-family: var(--utility); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.provider-avatar.azure { border-color: #cceae8; color: #127d78; background: #eaf8f7; }
.product-cell strong { display: -webkit-box; max-width: 360px; overflow: hidden; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.product-cell > div { min-width: 0; }
.product-cell small { display: block; margin-top: 4px; color: var(--slate); font-family: var(--utility); font-size: 8px; }
.product-cell.is-withdrawn strong { color: #697b8d; }
.product-cell .catalog-withdrawn-label { width: max-content; border-radius: 4px; padding: 3px 5px; color: #7e5b21; background: #fbf1df; font-family: var(--body); font-weight: 750; }
.money { font-family: var(--utility); font-size: 10px; font-weight: 700; white-space: nowrap; }
.money strong { font-family: var(--display); font-size: 15px; letter-spacing: -.025em; }
.mobile-stock-state { display: none; }
.stock-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--slate); white-space: nowrap; }
.stock-badge i { width: 6px; height: 6px; border-radius: 50%; background: #c5d0dc; }
.stock-badge.has-stock { color: var(--success); }
.stock-badge.has-stock i { background: var(--cyan); }
.region-code { display: inline-flex; min-width: 46px; justify-content: center; border: 1px solid #d9e3ed; border-radius: 6px; padding: 5px 7px; color: #526880; background: #f8fafc; font-family: var(--utility); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 8px; color: #526880; background: #edf2f6; font-size: 9px; font-weight: 750; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #8495a7; }
.badge--live { color: #167462; background: #e7f6f2; }
.badge--live::before { background: var(--cyan); }
.badge--warn { color: #8d611c; background: #fbf1df; }
.badge--warn::before { background: var(--amber); }
.badge--danger { color: #9b3e47; background: #fdecee; }
.badge--danger::before { background: var(--danger); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-button { min-height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; color: var(--ink-2); background: #fff; font-size: 9px; font-weight: 700; white-space: nowrap; }
.row-button:hover { border-color: #b9c9d9; background: var(--pale); }
.row-button--icon { width: 30px; padding: 0; }
.row-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.table-state { padding: 30px 18px; color: var(--slate); font-size: 11px; text-align: center; }
.table-state:empty { display: none; }

.inventory-layout { display: grid; grid-template-columns: minmax(310px, .75fr) minmax(360px, 1.25fr); gap: 14px; align-items: start; }
.inventory-import, .settings-form { padding-bottom: 20px; }
.inventory-import > .field, .inventory-import form, .settings-form > .field, .settings-form > .button, .settings-form > .form-error { margin-left: 20px; margin-right: 20px; }
.inventory-import > .field { margin-top: 20px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.label-row span { color: var(--slate); font-family: var(--utility); font-size: 8px; font-weight: 600; }
.stock-total { min-width: 50px; border-radius: 8px; padding: 7px 9px; color: var(--success); background: #e7f6f2; font-family: var(--utility); font-size: 10px; font-weight: 700; text-align: center; }
.inventory-totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.stock-total--sale { border: 1px solid #cce9e2; }
.stock-kind-field { display: flex; align-items: center; gap: 11px; border: 1px solid #cce9e2; border-radius: 10px; padding: 12px; background: #f1fbf8; }
.stock-kind-field .sale-lock { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--cyan); font-weight: 800; }
.stock-kind-field strong, .stock-kind-field small { display: block; }
.stock-kind-field strong { color: #146b5b; font-size: 10px; }
.stock-kind-field small { margin-top: 3px; color: #55756f; font-size: 8px; line-height: 1.45; }
.inventory-unit__title { display: flex; align-items: center; gap: 8px; }
.inventory-order-link { color: var(--blue) !important; font-family: var(--utility); }
.inventory-list { min-height: 260px; max-height: 510px; overflow-y: auto; }
.inventory-unit { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #edf1f5; }
.inventory-unit:last-child { border-bottom: 0; }
.inventory-unit strong { display: block; font-family: var(--utility); font-size: 10px; }
.inventory-unit small { display: block; margin-top: 4px; color: var(--slate); font-size: 9px; }
.inventory-unit.is-archived { opacity: .55; }
.empty-state { display: grid; place-items: center; align-content: center; min-height: 230px; padding: 30px; text-align: center; }
.empty-state.compact { min-height: 260px; }
.empty-state strong { font-size: 12px; }
.empty-state p { max-width: 340px; margin: 7px auto 0; color: var(--slate); font-size: 10px; line-height: 1.55; }

.payment-banner { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; padding: 17px 19px; border: 1px solid #ecd5ab; border-radius: 13px; background: #fff9ef; }
.payment-banner__icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: #9a671a; background: #f8e9cd; }
.payment-banner__icon svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.payment-banner strong { font-size: 12px; }
.payment-banner p { margin: 5px 0 0; color: #795f37; font-size: 10px; line-height: 1.5; }
.payment-banner[data-status="healthy"] { border-color: #b9ded5; background: #f1fbf8; }
.payment-banner[data-status="healthy"] .payment-banner__icon { color: #146b5b; background: #dff4ef; }
.payment-banner[data-status="healthy"] p { color: #55756f; }
.watcher-strip { position: relative; overflow: hidden; display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 6px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 13px; padding: 12px 18px; background: #172c42; color: #fff; box-shadow: var(--shadow-sm); }
.watcher-strip::after { content: ""; position: absolute; right: -50px; width: 190px; height: 1px; background: linear-gradient(90deg, transparent, rgba(23,167,160,.7)); transform: rotate(-18deg); }
.watcher-pulse { position: relative; width: 34px; height: 34px; display: grid; place-items: center; }
.watcher-pulse i:first-child { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 7px rgba(216,149,40,.12); }
.watcher-pulse i:last-child { position: absolute; width: 30px; height: 30px; border: 1px solid rgba(216,149,40,.3); border-radius: 50%; animation: pulse 1.8s ease-in-out infinite; }
.watcher-pulse[data-status="healthy"] i:first-child { background: var(--cyan); box-shadow: 0 0 0 7px rgba(23,167,160,.12); }
.watcher-pulse[data-status="healthy"] i:last-child { border-color: rgba(23,167,160,.4); }
.watcher-strip dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 0; }
.watcher-strip dl > div { min-width: 0; }
.watcher-strip dt { color: #8298ad; font-family: var(--utility); font-size: 7px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.watcher-strip dd { margin: 4px 0 0; overflow: hidden; color: #eef5fb; font-family: var(--utility); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.payment-layout { display: grid; grid-template-columns: minmax(330px, .8fr) minmax(430px, 1.2fr); gap: 14px; align-items: start; }
.settings-form > .field:first-of-type { margin-top: 20px; }
.payment-state { border-radius: 999px; padding: 6px 8px; color: #8d611c; background: #fbf1df; font-size: 8px; font-weight: 750; }
.payment-state[data-status="healthy"] { color: #167462; background: #e7f6f2; }
.input-suffix { display: flex; align-items: stretch; border: 1px solid #cfdbe7; border-radius: 10px; overflow: hidden; background: #fff; }
.input-suffix:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33,107,255,.1); }
.input-suffix input { border: 0; border-radius: 0; box-shadow: none !important; }
.input-suffix span { display: flex; align-items: center; padding: 0 12px; border-left: 1px solid var(--line); color: var(--slate); background: #f8fafc; font-family: var(--utility); font-size: 9px; }
.input-suffix--prefix span { border-right: 1px solid var(--line); border-left: 0; }
.settings-facts { margin: 4px 20px 20px; border-top: 1px solid var(--line); }
.settings-facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #edf1f5; font-size: 9px; }
.settings-facts dt { color: var(--slate); }
.settings-facts dd { margin: 0; max-width: 65%; overflow: hidden; text-overflow: ellipsis; font-weight: 700; white-space: nowrap; }
.auto-credit-control { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 2px 20px 18px; border: 1px solid #cfe0ff; border-radius: 11px; padding: 13px; background: #f5f8ff; }
.auto-credit-control strong, .auto-credit-control small { display: block; }
.auto-credit-control strong { font-size: 10px; }
.auto-credit-control small { max-width: 330px; margin-top: 4px; color: var(--slate); font-size: 8px; line-height: 1.5; }
.deposits-panel { overflow: hidden; }
.deposit-table { min-width: 900px; }
.deposit-reference { display: block; max-width: 150px; overflow: hidden; font-family: var(--utility); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.deposit-meta, .deposit-review-reason { display: block; max-width: 190px; margin-top: 4px; color: var(--slate); font-size: 8px; line-height: 1.4; }
.chain-link { color: var(--blue); font-family: var(--utility); font-size: 9px; font-weight: 750; text-decoration: none; }
.chain-link:hover { text-decoration: underline; }
.deposit-actions { display: flex; gap: 5px; }
.is-unassigned-transfer { background: #fffbf3; }
.is-unassigned-transfer:hover { background: #fff7e8; }
.unassigned-customer { color: #8d611c; font-weight: 750; }

.category-layout { display: grid; grid-template-columns: minmax(560px, 1fr) minmax(250px, .36fr); gap: 14px; align-items: start; }
.category-list-panel { overflow: hidden; }
.category-order-note { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); color: #526880; background: #f8fbfd; }
.category-order-note > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: var(--blue); background: #eaf1ff; font-family: var(--utility); font-weight: 800; }
.category-order-note p { margin: 0; font-size: 9px; line-height: 1.45; }
.category-list { min-height: 260px; }
.category-row { position: relative; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 94px; padding: 14px 20px 14px 0; border-bottom: 1px solid #edf1f5; background: #fff; }
.category-row:last-child { border-bottom: 0; }
.category-row::before { content: ""; position: absolute; top: 0; bottom: 0; left: 36px; width: 1px; background: #dfe7ef; }
.category-row:first-child::before { top: 50%; }
.category-row:last-child::before { bottom: 50%; }
.category-row.is-hidden { background: #fbfcfd; }
.category-order { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; padding-left: 17px; }
.category-order > span { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #cfe0ff; border-radius: 10px; color: var(--blue); background: #eff5ff; font-family: var(--utility); font-size: 9px; font-weight: 800; }
.category-order > div { display: grid; gap: 2px; }
.category-order button { width: 20px; height: 17px; border: 0; border-radius: 4px; color: var(--slate); background: transparent; font-size: 10px; line-height: 1; }
.category-order button:hover:not(:disabled) { color: var(--blue); background: #eaf1ff; }
.category-order button:disabled { opacity: .25; }
.category-copy { min-width: 0; }
.category-copy > div { display: flex; align-items: center; gap: 8px; }
.category-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); font-size: 13px; letter-spacing: -.02em; }
.category-copy p { max-width: 600px; margin: 6px 0; overflow: hidden; color: var(--slate); font-size: 9px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.category-copy small { color: #8293a4; font-family: var(--utility); font-size: 8px; }
.category-actions { display: flex; gap: 6px; }
.category-guide { overflow: hidden; }
.category-guide__body { padding: 23px 20px; }
.category-guide__body p { margin: 20px 0 13px; color: var(--slate); font-size: 10px; line-height: 1.65; }
.category-guide__glyph { display: flex; align-items: flex-end; gap: 5px; height: 38px; }
.category-guide__glyph i { width: 9px; border-radius: 3px 3px 1px 1px; background: var(--blue); }
.category-guide__glyph i:nth-child(1) { height: 19px; opacity: .35; }
.category-guide__glyph i:nth-child(2) { height: 30px; opacity: .65; }
.category-guide__glyph i:nth-child(3) { height: 38px; }

.quote-table-card { border-radius: 0 0 14px 14px; }
.quote-buyer, .quote-product { display: block; max-width: 210px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.quote-meta { display: block; margin-top: 4px; color: var(--slate); font-family: var(--utility); font-size: 8px; }
.quote-message { max-width: 330px; overflow: hidden; color: #4e6276; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.quote-reply-row > td { height: auto; padding: 0; background: #f7fafe; }
.quote-reply-row:hover { background: transparent; }
.quote-reply-panel { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.2fr); gap: 22px; padding: 18px 20px 20px 90px; border-top: 1px solid #dfe8f2; border-bottom: 1px solid #dfe8f2; box-shadow: inset 3px 0 0 var(--blue); }
.quote-context small { color: var(--slate); font-family: var(--utility); font-size: 8px; font-weight: 750; letter-spacing: .08em; }
.quote-context p { margin: 7px 0 0; color: var(--ink-2); font-size: 10px; line-height: 1.6; white-space: pre-wrap; }
.quote-reply-form { display: grid; gap: 8px; }
.quote-reply-label { font-size: 9px; font-weight: 750; }
.quote-reply-form textarea { min-height: 76px; resize: vertical; }
.quote-reply-form textarea:disabled { color: #526880; background: #edf2f6; opacity: 1; }
.quote-reply-form small { font-size: 8px; line-height: 1.45; }
.quote-retry-note { color: #9b3e47; }
.quote-sent-note { color: var(--success); }
.quote-submit { justify-self: end; min-width: 148px; }

.drawer-layer { position: fixed; z-index: 100; inset: 0; }
.drawer-backdrop { position: absolute; inset: 0; border: 0; background: rgba(12, 25, 40, .47); backdrop-filter: blur(2px); animation: fade-in .2s ease; }
.product-drawer { position: absolute; inset: 0 0 0 auto; width: min(1040px, 96vw); display: grid; grid-template-rows: auto 1fr auto; background: var(--pale); box-shadow: var(--shadow-lg); animation: drawer-in .28s cubic-bezier(.2,.8,.2,1); }
.category-drawer { width: min(520px, 92vw); }
.category-drawer__body { display: block; padding: 16px; }
.drawer-header, .drawer-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.drawer-header h2 { margin: 0; font-family: var(--display); font-size: 21px; letter-spacing: -.045em; }
.drawer-body { min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(430px, 1.05fr) minmax(370px, .95fr); gap: 16px; padding: 16px; }
#productForm { min-width: 0; }
.form-section { margin-bottom: 13px; border: 1px solid var(--line); border-radius: 12px; padding: 18px 18px 2px; background: #fff; }
.form-section h3 { margin: 0 0 16px; font-family: var(--display); font-size: 12px; letter-spacing: -.02em; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-grid--3 { grid-template-columns: .5fr 1fr 1fr; }
.visibility-section { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 18px; }
.visibility-section h3 { margin-bottom: 5px; }
.visibility-section p { margin: 0; color: var(--slate); font-size: 9px; line-height: 1.5; }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { position: relative; width: 37px; height: 21px; border-radius: 999px; background: #b9c5d0; transition: background .17s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.16); transition: transform .17s; }
.switch input:checked + span { background: var(--cyan); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 3px solid rgba(33,107,255,.25); outline-offset: 2px; }
.switch b { min-width: 44px; font-size: 9px; }
.telegram-preview { position: sticky; top: 0; align-self: start; overflow: hidden; border-radius: 15px; color: #dce9f2; background: #172c42; box-shadow: 0 18px 42px rgba(20,39,61,.14); }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.preview-heading > div { display: flex; align-items: center; gap: 9px; }
.telegram-logo { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: #229ed9; }
.telegram-logo svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.preview-heading small, .preview-heading strong { display: block; }
.preview-heading small { color: #7f9ab1; font-family: var(--utility); font-size: 7px; letter-spacing: .09em; }
.preview-heading strong { margin-top: 2px; color: #fff; font-size: 9px; }
.preview-live { color: #91a8bc; font-size: 7px; white-space: nowrap; }
.preview-live i { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: var(--cyan); }
.preview-live b { font: inherit; }
.preview-live.is-withdrawn { color: #d9b16f; }
.preview-live.is-withdrawn i { background: var(--amber); }
.telegram-chat { min-height: 390px; padding: 34px 15px 20px; background-color: #18334c; background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px); background-size: 14px 14px; }
.chat-bubble { position: relative; border-radius: 13px 13px 13px 3px; padding: 15px; color: var(--ink); background: #fff; box-shadow: 0 12px 32px rgba(3,15,27,.2); }
.chat-bubble::before { content: ""; position: absolute; left: -5px; bottom: 0; border: 7px solid transparent; border-right-color: #fff; transform: rotate(12deg); }
.provider-chip { display: inline-block; border-radius: 5px; padding: 5px 7px; color: var(--blue); background: #eaf1ff; font-family: var(--utility); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.preview-category { display: inline-block; margin-top: 13px; color: var(--blue); font-family: var(--utility); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.preview-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preview-stock { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 7px; color: #146b5b; background: #e7f6f2; font-size: 10px; font-weight: 800; }
.preview-stock::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); }
.preview-stock--out { color: #8d611c; background: #fbf1df; }
.preview-stock--out::before { background: var(--amber); }
.chat-bubble h3 { margin: 14px 0 8px; font-family: var(--display); font-size: 18px; line-height: 1.25; letter-spacing: -.035em; overflow-wrap: anywhere; }
.chat-bubble > p { min-height: 31px; margin: 0; color: #526880; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.preview-specifications { margin-top: 15px; border-top: 1px solid #e9eef3; padding-top: 12px; }
.preview-specifications > span { color: var(--slate); font-family: var(--utility); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.preview-specifications > p { margin: 7px 0 0; color: #526880; font-family: var(--utility); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.preview-facts { display: grid; gap: 9px; margin: 15px 0 0; }
.preview-facts > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; font-size: 11px; line-height: 1.5; }
.preview-facts dt { color: var(--slate); }
.preview-facts dd { margin: 0; max-width: 68%; color: var(--ink-2); font-family: var(--utility); font-weight: 700; text-align: right; overflow-wrap: anywhere; white-space: normal; }
.credit-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 10px; padding-top: 10px; border-top: 1px solid #e9eef3; }
.credit-line span { color: var(--slate); font-size: 11px; }
.credit-line strong { font-family: var(--utility); font-size: 11px; }
.preview-price-row { width: 100%; border-radius: 7px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px; color: #fff; background: var(--blue); font-size: 11px; font-weight: 700; }
.preview-price-row b { flex: 0 0 auto; font-family: var(--utility); font-size: 11px; }
.telegram-chat > p { margin: 7px 0 0 4px; color: #8ca1b4; font-size: 7px; }
.drawer-footer { border-top: 1px solid var(--line); border-bottom: 0; }
.drawer-footer > span { color: var(--slate); font-family: var(--utility); font-size: 8px; }
.drawer-footer > div { display: flex; gap: 8px; }

.toast-region { position: fixed; z-index: 200; right: 22px; bottom: 22px; width: min(360px, calc(100vw - 32px)); display: grid; gap: 8px; }
.toast { display: flex; align-items: flex-start; gap: 10px; border: 1px solid #c8ddd8; border-radius: 11px; padding: 13px 15px; color: #145e50; background: #f1fbf8; box-shadow: 0 16px 42px rgba(20,39,61,.14); animation: toast-in .22s ease; font-size: 11px; line-height: 1.45; }
.toast::before { content: "✓"; font-weight: 800; }
.toast.is-error { border-color: #efc9cc; color: #933a43; background: #fff5f6; }
.toast.is-error::before { content: "!"; }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes drawer-in { from { transform: translateX(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer-body { grid-template-columns: 1fr; }
  .telegram-preview { position: relative; }
  .telegram-chat { min-height: 300px; }
  .payment-layout { grid-template-columns: 1fr; }
  .category-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --sidebar: 228px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 22px 0 55px rgba(10,24,38,.22); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 25; inset: 0; border: 0; background: rgba(8,20,33,.4); }
  .workspace { margin-left: 0; }
  .mobile-menu { display: inline-grid; }
  .breadcrumb { display: none; }
  .topbar { padding: 0 18px; }
  .content { padding: 24px 18px 44px; }
  .overview-grid, .inventory-layout { grid-template-columns: 1fr; }
  .login-screen { grid-template-columns: 1fr; }
  .login-card { padding: 40px 28px; }
  .login-aside { display: none; }
  .watcher-strip dl { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
}

@media (max-width: 580px) {
  .topbar { height: 58px; padding: 0 12px; }
  .sync-label, .bot-pill small { display: none; }
  .bot-pill { height: 38px; max-width: 130px; padding-right: 9px; }
  .bot-pill strong { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content { padding: 17px 12px 38px; }
  .page-heading { min-height: auto; align-items: flex-start; gap: 16px; margin: 18px 2px 22px; }
  .page-heading--action { align-items: flex-start; }
  .page-heading h1 { font-size: 29px; }
  .page-heading > div > p:last-child { max-width: 280px; }
  .page-heading .button span { display: none; }
  .page-heading .button { width: 42px; padding: 0; flex: 0 0 auto; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 112px; padding: 15px; }
  .metric-card strong { margin-top: 22px; font-size: 22px; }
  .catalog-toolbar { flex-wrap: wrap; padding: 8px; }
  .search-field { flex-basis: 100%; min-height: 37px; }
  .toolbar-select { flex: 1 1 100%; }
  .toolbar-select select { width: 100%; max-width: none; }
  .segmented { flex: 1; }
  .segmented button { flex: 1; padding-inline: 7px; }
  .record-count { min-width: 45px; }
  th, td { padding-inline: 12px; }
  .product-table-card table { min-width: 0; table-layout: fixed; }
  .product-table-card th:nth-child(2),
  .product-table-card td:nth-child(2),
  .product-table-card th:nth-child(3),
  .product-table-card td:nth-child(3),
  .product-table-card th:nth-child(5),
  .product-table-card td:nth-child(5),
  .product-table-card th:nth-child(6),
  .product-table-card td:nth-child(6) { display: none; }
  .product-table-card th:nth-child(1), .product-table-card td:nth-child(1) { width: 56%; }
  .product-table-card th:nth-child(4), .product-table-card td:nth-child(4) { width: 27%; }
  .product-table-card th:nth-child(7), .product-table-card td:nth-child(7) { width: 17%; }
  .product-table-card th, .product-table-card td { padding-inline: 8px; }
  .product-table-card .product-cell { min-width: 0; gap: 8px; }
  .product-table-card .provider-avatar { width: 30px; height: 30px; }
  .product-table-card .product-cell strong { max-width: 100%; }
  .product-table-card .money strong { font-size: 13px; }
  .product-table-card .mobile-stock-state { display: block; width: max-content; margin-top: 5px; color: var(--success); font-size: 8px; font-weight: 800; white-space: nowrap; }
  .product-table-card .mobile-stock-state.is-out { color: #9a681d; }
  .product-table-card .row-actions { justify-content: center; }
  .product-table-card .row-actions .row-button:not(.row-button--icon) { display: none; }
  .product-drawer { width: 100%; }
  .drawer-header, .drawer-footer { padding: 14px 13px; }
  .drawer-body { padding: 10px; }
  .field-grid, .field-grid--3 { grid-template-columns: 1fr; gap: 0; }
  .visibility-section { align-items: flex-start; }
  .drawer-footer > span { display: none; }
  .drawer-footer > div { width: 100%; }
  .drawer-footer .button { flex: 1; }
  .payment-banner { padding: 14px; }
  .watcher-strip { grid-template-columns: 38px 1fr; padding: 12px; }
  .watcher-strip dl { grid-template-columns: 1fr 1fr; gap: 12px; }
  .auto-credit-control { margin-inline: 14px; align-items: flex-start; }
  .category-row { grid-template-columns: 66px minmax(0, 1fr); gap: 10px; padding-right: 12px; }
  .category-actions { grid-column: 2; }
  .category-copy p { white-space: normal; }
  .quote-toolbar .segmented { width: 100%; overflow-x: auto; }
  .quote-table-card table { min-width: 580px; }
  .quote-table-card th:nth-child(3), .quote-table-card td:nth-child(3),
  .quote-table-card th:nth-child(5), .quote-table-card td:nth-child(5) { display: none; }
  .quote-reply-row td { display: table-cell !important; }
  .quote-reply-panel { grid-template-columns: 1fr; padding: 16px; }
  .quote-submit { justify-self: stretch; }
  .inventory-import > .field, .inventory-import form, .settings-form > .field, .settings-form > .button, .settings-form > .form-error { margin-left: 14px; margin-right: 14px; }
  .settings-facts { margin-inline: 14px; }
  .toast-region { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
