:root {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f6f7fb;
  font-synthesis: none;
  --ink: #172033;
  --muted: #68738a;
  --line: #e3e7f0;
  --surface: rgba(255,255,255,.94);
  --brand: #3457e5;
  --brand-strong: #2945bf;
  --brand-soft: #edf1ff;
  --success: #13845f;
  --shadow: 0 12px 34px rgba(31, 42, 68, .07);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(77, 109, 255, .09), transparent 24rem),
    radial-gradient(circle at 92% 18%, rgba(145, 84, 238, .07), transparent 27rem),
    #f6f7fb;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(217, 222, 234, .9);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
}
.header-inner {
  max-width: 1240px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 26px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; margin-right: auto; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 13px; position: relative; display: grid; place-items: center;
  background: linear-gradient(145deg, #4669f2, #6f3fd6); box-shadow: 0 8px 20px rgba(62, 82, 210, .25);
}
.brand-mark::before { content: ""; width: 16px; height: 16px; border: 3px solid #fff; border-radius: 50%; }
.brand-mark i { position: absolute; width: 8px; height: 3px; background: #fff; transform: rotate(45deg); right: 8px; bottom: 9px; border-radius: 4px; }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { letter-spacing: -.025em; font-size: 16px; }
.brand-copy small { color: #8a94aa; font-size: 10px; margin-top: 5px; text-transform: uppercase; letter-spacing: .12em; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a { color: #68738a; text-decoration: none; font-weight: 650; font-size: 14px; padding: 10px 12px; border-radius: 10px; transition: .18s ease; }
.main-nav a:hover { color: var(--ink); background: #f2f4f9; }
.main-nav a.active { color: var(--brand); background: var(--brand-soft); }
.logout-form { margin: 0; }
.ghost-button { background: transparent; color: #778198; border: 1px solid var(--line); }

.app-main { max-width: 1240px; margin: 0 auto; padding: 34px 26px 70px; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.025em; }
h1 { font-size: clamp(28px, 3vw, 38px); margin: 4px 0 8px; line-height: 1.1; }
h2 { margin: 36px 0 8px; font-size: 23px; }
h3 { margin: 6px 0 8px; }
p { line-height: 1.62; }
.eyebrow { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.hero {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 25px 27px; border: 1px solid rgba(220,225,239,.9); border-radius: 22px;
  background: linear-gradient(130deg, rgba(255,255,255,.98), rgba(248,249,255,.94));
  box-shadow: var(--shadow);
}
.hero p { margin: 0; color: var(--muted); }
.sync { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.sync form, nav form { margin: 0; }

.channel-switch, .status-switch {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px;
  margin: 19px 0; padding: 5px; border: 1px solid #e0e5ef; border-radius: 14px;
  background: rgba(235,238,246,.78);
}
.status-switch { margin-top: 0; }
.channel-switch a, .status-switch a {
  color: #68738a; padding: 9px 13px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 14px; transition: .18s ease;
}
.channel-switch a:hover, .status-switch a:hover { color: var(--ink); }
.channel-switch a.active, .status-switch a.active { background: #fff; color: var(--brand); box-shadow: 0 4px 12px rgba(30, 45, 80, .09); }
.channel-switch span, .status-switch span {
  display: inline-flex; min-width: 23px; justify-content: center; margin-left: 5px; padding: 2px 7px;
  border-radius: 20px; background: #dce1ec; font-size: 11px; color: #657088;
}
.channel-switch a.active span, .status-switch a.active span { background: var(--brand-soft); color: var(--brand); }

.cards { display: grid; gap: 14px; }
article, .empty, .product-form, .login, .site-chat, .rag-form {
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 8px 26px rgba(32, 43, 67, .045);
}
article, .empty, .site-chat { padding: 22px; }
.question-card { position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.question-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #97a3b8; }
.question-card.channel-card-ozon::before { background: #1769ff; }
.question-card.channel-card-wildberries::before { background: linear-gradient(#8c2ee8,#d126a9); }
.question-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.question-sent { opacity: 0; transform: translateY(-8px); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: #8a94a8; font-size: 12px; }
.channel { padding: 4px 9px; border-radius: 999px; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; }
.channel.ozon { color: #075ee5; background: #eaf2ff; }
.channel.wildberries { color: #9a269b; background: #faeafd; }
.channel.site { color: #087659; background: #e6f7f1; }
.question-status { padding: 4px 9px; border-radius: 999px; background: #f0f2f6; color: #69748a; font-weight: 700; }
.status-new { color: #8a5b00; background: #fff5d9; }
.status-draft { color: #245fc4; background: #eaf2ff; }
.status-sent { color: #087659; background: #e5f7ef; }
.status-error, .status-send_failed, .status-send_unknown { color: #af2938; background: #ffebee; }
.status-batch_queued, .status-batch_generating, .status-batch_generated, .status-batch_sending {
  color: #6841c6; background: #f0eaff;
}
.product-ids { display: inline-flex; color: #69758b; background: #f5f7fa; border-radius: 8px; padding: 6px 9px; font-size: 12px; }
.customer-question { margin: 16px 0; padding: 15px 17px; border-radius: 13px; background: #f7f8fb; color: #2a354a; font-size: 15px; }

button, .button-link {
  border: 0; border-radius: 10px; padding: 10px 15px; cursor: pointer; font-weight: 700;
  background: #edf0f5; color: #374158; transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
button:hover:not(:disabled), .button-link:hover { transform: translateY(-1px); background: #e4e8f0; }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: linear-gradient(135deg, #3f63e8, #5b46d8); color: #fff; box-shadow: 0 7px 16px rgba(61, 79, 207, .19); }
.primary:hover { background: linear-gradient(135deg, #3457d8, #4f3ac8); }
.sync-button { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); }
.button-dot { width: 8px; height: 8px; border-radius: 50%; background: #8b96aa; }
.sync-button.ozon .button-dot { background: #1769ff; }
.sync-button.wildberries .button-dot { background: #be2bb3; }

textarea, input, select {
  width: 100%; margin-top: 6px; padding: 11px 12px; color: var(--ink); background: #fbfcfe;
  border: 1px solid #d9deea; border-radius: 10px; outline: none; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea:focus, input:focus, select:focus { background: #fff; border-color: #7289ea; box-shadow: 0 0 0 3px rgba(77, 105, 225, .11); }
textarea { min-height: 108px; resize: vertical; }
label { display: block; color: #4e5a70; font-weight: 650; font-size: 13px; }
.answer { margin-top: 12px; padding: 14px 16px; border: 1px solid #caebdf; border-radius: 12px; background: #edf9f4; color: #185d49; white-space: pre-wrap; line-height: 1.55; }
.error { color: #b32234; }
.draft-actions { margin-top: 10px; }
.regenerate-form { margin-top: 8px; }

.batch-panel {
  display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: center; gap: 18px;
  margin: 0 0 19px; padding: 18px 20px; border: 1px solid #d9e0f2; border-radius: 17px;
  background: linear-gradient(135deg, rgba(239,244,255,.96), rgba(247,242,255,.96));
  box-shadow: 0 8px 24px rgba(53, 70, 145, .055);
}
.wb-discount-panel {
  display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: center; gap: 14px 18px;
  margin: 0 0 14px; padding: 17px 20px; border: 1px solid #ead7ec; border-radius: 17px;
  background: linear-gradient(135deg, rgba(253,245,255,.97), rgba(255,249,252,.97));
  box-shadow: 0 8px 24px rgba(125, 48, 133, .05);
}
.wb-discount-copy { display: grid; gap: 4px; }
.wb-discount-copy strong { color: #512a58; font-size: 16px; }
.wb-discount-copy span { color: #786b7d; font-size: 13px; line-height: 1.45; }
.wb-discount-reset { color: #fff; background: linear-gradient(135deg, #8c2ee8, #c62aa4); white-space: nowrap; }
.wb-discount-reset:hover:not(:disabled) { background: linear-gradient(135deg, #7b24d2, #b42192); }
.wb-discount-panel small { grid-column: 1/-1; min-height: 17px; color: #77697a; }
.wb-discount-panel small.success { color: #17704f; }
.wb-discount-panel small.error { color: #b32234; }
.batch-copy { display: grid; gap: 4px; }
.batch-copy strong { color: #273552; font-size: 16px; }
.batch-copy span { color: #717c91; font-size: 13px; line-height: 1.45; }
.batch-controls { display: flex; align-items: end; gap: 10px; }
.batch-controls label { min-width: 150px; }
.batch-controls select { margin-top: 4px; background: #fff; }
.batch-start { min-height: 42px; white-space: nowrap; }
.batch-progress { grid-column: 1/-1; padding-top: 15px; border-top: 1px solid rgba(93,108,159,.15); }
.batch-progress-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: #34415d; }
.batch-progress-head span { color: var(--brand); font-weight: 800; }
.batch-progress progress { width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: #dfe5f3; }
.batch-progress progress::-webkit-progress-bar { background: #dfe5f3; border-radius: 999px; }
.batch-progress progress::-webkit-progress-value { background: linear-gradient(90deg, #4169e1, #7254dd); border-radius: 999px; }
.batch-progress progress::-moz-progress-bar { background: linear-gradient(90deg, #4169e1, #7254dd); border-radius: 999px; }
.batch-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 9px; color: #68748b; font-size: 12px; }
.batch-stats b { color: #33415d; }
.batch-progress small { display: block; min-height: 17px; margin-top: 8px; color: #7b6570; }

.site-chat { padding: 19px; }
.chat-messages { height: 500px; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: #f5f7fb; border-radius: 14px; }
.chat-bubble { max-width: 78%; padding: 12px 15px; border-radius: 15px; white-space: pre-wrap; box-shadow: 0 3px 10px rgba(30,42,65,.05); }
.chat-bubble small { display: block; margin-bottom: 5px; font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.chat-bubble.user { align-self: flex-end; background: #e5edff; border-bottom-right-radius: 5px; }
.chat-bubble.assistant { align-self: flex-start; background: #fff; border-bottom-left-radius: 5px; }
.chat-welcome { margin: auto; color: #8791a5; }
.chat-form { display: flex; gap: 10px; margin-top: 13px; align-items: flex-end; }
.chat-form textarea { min-height: 51px; max-height: 150px; }
.chat-form button { height: 46px; }

.message-sync { justify-content: flex-end; }
.message-sync small { flex-basis: 100%; min-height: 17px; color: var(--success); text-align: right; }
.message-sync small.error { color: #b32234; }
.message-desk {
  min-height: 650px; display: grid; grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface);
  box-shadow: var(--shadow);
}
.conversation-list { max-height: 720px; overflow-y: auto; border-right: 1px solid var(--line); background: #f8f9fc; }
.conversation-item { display: block; padding: 15px 17px; border-bottom: 1px solid #e8ebf2; color: inherit; text-decoration: none; transition: .16s ease; }
.conversation-item:hover { background: #f0f3fa; }
.conversation-item.active { background: #fff; box-shadow: inset 4px 0 0 var(--brand); }
.conversation-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #8b95a8; font-size: 11px; }
.conversation-item strong { display: block; margin: 9px 0 3px; font-size: 14px; }
.conversation-product { display: block; overflow: hidden; color: #69758a; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.conversation-item p { margin: 7px 0 0; overflow: hidden; color: #4d596e; font-size: 13px; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.conversation-item em { display: inline-block; margin-top: 7px; color: #2865c9; font-size: 11px; font-style: normal; font-weight: 750; }
.conversation-empty { padding: 30px 20px; color: #818ba0; text-align: center; }
.conversation-panel { min-width: 0; display: flex; flex-direction: column; background: #fff; }
.conversation-header { display: flex; justify-content: space-between; gap: 18px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.conversation-header h3 { margin: 7px 0 4px; font-size: 17px; }
.conversation-header small { color: #7b869b; }
.conversation-state { align-self: flex-start; padding: 6px 10px; border-radius: 999px; background: #fff4d6; color: #8b6100; font-size: 12px; font-weight: 750; white-space: nowrap; }
.conversation-state.status-sent { background: #e9f8f1; color: #137251; }
.direct-messages { min-height: 360px; max-height: 490px; flex: 1; display: flex; flex-direction: column; gap: 11px; overflow-y: auto; padding: 22px; background: #f5f7fb; }
.direct-message { max-width: 82%; padding: 11px 14px; border-radius: 15px; white-space: pre-wrap; line-height: 1.5; box-shadow: 0 3px 10px rgba(30,42,65,.05); }
.direct-message small { display: block; margin-bottom: 5px; color: #7c879a; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.direct-message.buyer { align-self: flex-start; border-bottom-left-radius: 5px; background: #fff; }
.direct-message.seller { align-self: flex-end; border-bottom-right-radius: 5px; background: #e4ecff; }
.direct-message.system { align-self: center; max-width: 92%; background: #eceff5; color: #69748a; font-size: 12px; }
.attachment-note { display: inline-block; margin-top: 7px; color: #5c6880; font-size: 11px; font-weight: 700; }
.direct-reply { padding: 17px 20px 20px; border-top: 1px solid var(--line); }
.direct-reply textarea { min-height: 105px; max-height: 220px; margin-top: 12px; }
.direct-reply-actions, .direct-send-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.direct-reply-actions span { color: #7a8599; font-size: 12px; }
.direct-send-row { margin-top: 10px; }
.direct-send-row small { min-height: 17px; color: var(--success); }
.direct-send-row small.error { color: #b32234; }
.conversation-placeholder { margin: auto; color: #8791a5; }
.conversation-placeholder.success { max-width: 430px; padding: 24px; color: var(--success); text-align: center; line-height: 1.55; }

.product-form, .rag-form { padding: 22px; }
.product-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.wide { grid-column: 1/-1; }
.login { max-width: 430px; margin: 10vh auto; padding: 30px; }
.login::before { content: "QuestionMarket"; display: block; color: var(--brand); font-weight: 850; letter-spacing: -.02em; }
.login form { display: grid; gap: 15px; }
.empty { text-align: center; color: #7c879b; padding: 36px; border-style: dashed; box-shadow: none; }

.sales-hero { margin-bottom: 20px; }
.sales-auto-note { min-width: 255px; display: grid; gap: 4px; padding: 15px 17px; border: 1px solid rgba(75,94,180,.13); border-radius: 14px; background: rgba(255,255,255,.72); }
.sales-auto-note strong { color: #31436d; font-size: 13px; }
.sales-auto-note span { color: #77839a; font-size: 11px; }
.sales-channel-switch { display: inline-flex; gap: 5px; margin: 0 0 18px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 4px 14px rgba(31,45,82,.04); }
.sales-channel-switch a { padding: 8px 14px; border-radius: 9px; color: #66738b; font-size: 13px; font-weight: 750; text-decoration: none; }
.sales-channel-switch a.active { color: #fff; background: linear-gradient(135deg, #3f63e8, #6548d8); box-shadow: 0 5px 12px rgba(66,74,190,.18); }
.sales-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.sales-kpi { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 5px 16px rgba(31,45,82,.04); }
.sales-kpi > span { display: block; min-height: 31px; color: #738096; font-size: 11px; line-height: 1.35; }
.sales-kpi strong { display: block; margin: 7px 0 3px; overflow: hidden; color: #263652; font-size: 23px; letter-spacing: -.03em; text-overflow: ellipsis; }
.sales-kpi small { color: #8a94a7; font-size: 10px; }
.sales-kpi.danger { border-color: #f3c7cb; background: linear-gradient(145deg, #fff, #fff4f5); }
.sales-kpi.danger strong { color: #b42c3e; }
.sales-kpi.success { border-color: #c8e8da; background: linear-gradient(145deg, #fff, #f1fbf6); }
.sales-kpi.success strong { color: #187052; }
.month-close-panel, .daily-sales-panel, .storage-risk-panel { margin-bottom: 18px; }
.month-close-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.month-close-card { position: relative; overflow: hidden; padding: 17px; border: 1px solid #e4e8f1; border-radius: 14px; background: #fafbfe; }
.month-close-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #1769ff; }
.month-close-card.channel-wildberries::before { background: #b72aa6; }
.month-close-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.month-close-title small { color: #8893a7; font-size: 10px; }
.month-close-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 15px; }
.month-close-main div { min-width: 0; }
.month-close-main span, .month-close-main small { display: block; color: #7b879b; font-size: 10px; }
.month-close-main strong { display: block; margin: 3px 0; overflow: hidden; color: #273650; font-size: 22px; text-overflow: ellipsis; }
.month-close-progress { height: 7px; margin: 15px 0 9px; overflow: hidden; border-radius: 999px; background: #e8ebf2; }
.month-close-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #426bea, #6f4dda); }
.month-close-card.channel-wildberries .month-close-progress i { background: linear-gradient(90deg, #852de2, #cf2c9f); }
.month-close-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; color: #7d889d; font-size: 10px; }
.daily-chart-legend { display: flex; flex-wrap: wrap; gap: 10px 15px; color: #6f7b91; font-size: 11px; }
.daily-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.daily-chart-legend i { width: 9px; height: 9px; border-radius: 3px; }
.daily-chart-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 10px; }
.daily-chart-summary > div { position: relative; min-width: 0; padding: 11px 12px 11px 16px; overflow: hidden; border: 1px solid #e7eaf1; border-radius: 11px; background: #fafbfe; }
.daily-chart-summary > div:only-child { grid-column: 1 / -1; }
.daily-chart-summary > div::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--channel-color); }
.daily-chart-summary span, .daily-chart-summary small { display: block; color: #7c889c; font-size: 9px; }
.daily-chart-summary strong { display: block; margin: 3px 0; color: #2e3e5b; font-size: 17px; }
.daily-chart { display: flex; align-items: stretch; gap: 3px; min-height: 260px; padding: 15px 9px 0; border-bottom: 1px solid #e7eaf1; background: linear-gradient(to top, rgba(232,235,242,.7) 1px, transparent 1px); background-size: 100% 25%; }
.daily-chart-day { display: grid; grid-template-rows: 230px 20px; flex: 1 1 0; min-width: 0; }
.daily-chart-bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 230px; }
.daily-bar { position: relative; width: min(10px, 42%); min-width: 2px; max-width: 10px; height: 100%; }
.daily-bar i { position: absolute; inset: auto 0 0; height: var(--bar-height); min-height: 2px; border-radius: 4px 4px 0 0; opacity: .88; transition: opacity .15s, transform .15s; }
.daily-bar:hover i { opacity: 1; transform: scaleX(1.25); }
.daily-bar b { display: none; position: absolute; bottom: calc(var(--bar-height) + 4px); left: 50%; z-index: 1; padding: 2px 4px; border-radius: 5px; color: #4d5b72; background: rgba(255,255,255,.9); font-size: 8px; font-weight: 750; line-height: 1; transform: translateX(-50%); white-space: nowrap; }
.daily-chart.show-values .daily-bar b { display: block; }
.daily-chart-day > span { color: #929bad; font-size: 9px; text-align: center; }
.sales-dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-bottom: 18px; }
.sales-panel { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 7px 22px rgba(31,45,82,.045); }
.sales-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 17px; }
.sales-panel-head h2 { margin: 4px 0 0; font-size: 19px; }
.sales-panel-head p { margin: 6px 0 0; color: #758198; font-size: 12px; }
.sales-context { padding: 6px 10px; border-radius: 999px; color: #4d5e83; background: #eef2fb; font-size: 11px; font-weight: 750; white-space: nowrap; }
.sales-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.sales-bar-row { display: grid; grid-template-columns: 56px minmax(100px, 1fr) 58px 50px; align-items: center; gap: 9px; font-size: 11px; }
.sales-bar-row > span { color: #7b879b; }
.sales-bar-row > strong { color: #33415d; text-align: right; }
.sales-bar-row > small { color: #8290a6; text-align: right; }
.sales-bar-track { height: 9px; overflow: hidden; border-radius: 999px; background: #edf0f6; }
.sales-bar-track i { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #456de6, #7654dd); }
.sales-bar-row.partial .sales-bar-track i { background: repeating-linear-gradient(135deg, #9da9c4 0 4px, #c3cada 4px 8px); }
.sales-caption { margin: 12px 0 0; color: #8a94a6; font-size: 10px; }
.sales-mini-table-wrap { overflow: visible; }
.sales-mini-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.sales-mini-table th { padding: 9px 8px; color: #79859a; background: #f7f8fb; text-align: right; }
.sales-mini-table th:first-child, .sales-mini-table td:first-child { text-align: left; }
.sales-mini-table td { padding: 10px 8px; border-bottom: 1px solid #edf0f5; color: #39465e; text-align: right; vertical-align: top; }
.sales-mini-table td strong, .sales-mini-table td small { display: block; }
.sales-mini-table td strong { color: #33415d; font-size: 11px; }
.sales-mini-table td small { margin-top: 2px; color: #8b96a8; font-size: 9px; line-height: 1.3; }
.sales-mini-table td em { display: block; color: #9a7480; font-size: 9px; font-style: normal; }
.sales-mini-table tr.partial td { background: #faf8fb; }
.production-panel { margin-bottom: 18px; padding: 0; overflow: hidden; }
.production-panel.is-loading { position: relative; pointer-events: none; opacity: .62; }
.production-panel.is-loading::after { content: "Пересчитываю…"; position: absolute; inset: 0; display: grid; place-items: center; color: #34456d; background: rgba(255,255,255,.7); font-size: 14px; font-weight: 800; backdrop-filter: blur(1px); }
.production-head { padding: 20px 20px 0; }
.sales-table-controls { min-width: 750px; display: grid; grid-template-columns: 140px minmax(180px, 1fr) 180px auto; gap: 8px; }
.sales-table-controls input, .sales-table-controls select { margin: 0; background: #f8f9fc; }
.sales-export-needs { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; white-space: nowrap; }
.sales-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0 20px 15px; color: #78849a; font-size: 10px; }
.sales-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sales-legend i { width: 8px; height: 8px; border-radius: 50%; }
.sales-legend i.critical { background: #c82d42; }
.sales-legend i.need { background: #dc7180; }
.sales-legend i.healthy { background: #39a078; }
.sales-legend i.excess { background: #4c75d8; }
.sales-legend i.unknown { background: #9aa4b5; }
.production-table-wrap { max-height: 650px; overflow: auto; border-top: 1px solid var(--line); }
.production-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.production-table thead th { position: sticky; top: 0; z-index: 2; padding: 11px 9px; color: #68758d; background: #f5f7fb; text-align: right; white-space: nowrap; }
.production-table thead th:nth-child(-n+3) { text-align: left; }
.production-table tbody td { padding: 11px 9px; border-bottom: 1px solid #edf0f5; color: #445069; text-align: right; vertical-align: top; }
.production-table tbody td:nth-child(-n+3) { text-align: left; }
.production-table tbody tr { box-shadow: inset 4px 0 transparent; }
.production-table tbody tr:hover td { background: #fafbfe; }
.production-table tbody tr.inventory-critical { box-shadow: inset 4px 0 #c82d42; }
.production-table tbody tr.inventory-need { box-shadow: inset 4px 0 #dc7180; }
.production-table tbody tr.inventory-healthy { box-shadow: inset 4px 0 #39a078; }
.production-table tbody tr.inventory-excess { box-shadow: inset 4px 0 #4c75d8; }
.production-table tbody tr.inventory-unknown { box-shadow: inset 4px 0 #9aa4b5; }
.production-table td > strong, .production-table td > span, .production-table td > small { display: block; }
.production-table td > strong { color: #273650; }
.production-table td:nth-child(2) > span { max-width: 330px; margin-top: 2px; color: #516078; line-height: 1.35; }
.production-table td small { margin-top: 3px; color: #929bad; font-size: 9px; }
.inventory-badge { display: inline-block !important; padding: 5px 7px; border-radius: 7px; color: #69758b; background: #f0f2f6; font-size: 9px; font-weight: 750; white-space: nowrap; }
.inventory-critical .inventory-badge { color: #a91f33; background: #ffe8eb; }
.inventory-need .inventory-badge { color: #a54855; background: #fff0f1; }
.inventory-healthy .inventory-badge { color: #147052; background: #e8f8f1; }
.inventory-excess .inventory-badge { color: #315ebc; background: #eaf0ff; }
.production-value { color: #a9273a !important; font-size: 13px; font-weight: 850; }
.inventory-healthy .production-value, .inventory-excess .production-value { color: #44705f !important; }
.trend-up { color: #19845f; }
.trend-down { color: #b33a4b; }
.trend-flat { color: #748096; }
.sales-empty-filter { margin: 0; padding: 25px; color: #7e899c; text-align: center; }
.empty-inline { color: #8792a5; }
.storage-risk-panel .sales-panel-head { align-items: center; margin-bottom: 12px; }
.storage-channel-switch { display: inline-flex; flex: 0 0 auto; gap: 3px; padding: 4px; border: 1px solid #e1e6f0; border-radius: 10px; background: #f4f6fa; }
.storage-channel-switch button { min-height: 30px; padding: 5px 12px; border: 0; border-radius: 7px; color: #6b7890; background: transparent; box-shadow: none; font-size: 11px; }
.storage-channel-switch button.active { color: #fff; background: #4d63d8; }
.storage-risk-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-bottom: 9px; }
.storage-summary-card { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; padding: 9px 11px; border: 1px solid #e6eaf1; border-radius: 10px; background: #fafbfe; }
.storage-summary-card > span { color: #7b879b; font-size: 9px; line-height: 1.2; }
.storage-summary-card > strong { overflow: hidden; color: #293955; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.storage-summary-card > strong b { font: inherit; }
.storage-summary-card.danger { border-color: #f2ced3; background: #fff7f8; }
.storage-summary-card.danger > strong { color: #ae273b; }
.storage-summary-card.warning { border-color: #f1dec0; background: #fffaf1; }
.storage-summary-card.warning > strong { color: #94601f; }
.storage-summary-card.muted > strong { color: #68748b; }
.storage-summary-card.accent { border-color: #d6e0f8; background: #f6f8ff; }
.storage-summary-card.accent > strong { color: #355ebd; }
.storage-risk-controls { display: grid; grid-template-columns: minmax(190px, 1.4fr) repeat(2, minmax(145px, .8fr)); gap: 7px; padding: 8px; border: 1px solid #e8ebf2; border-radius: 11px; background: #f8f9fc; }
.storage-risk-controls label { min-width: 0; }
.storage-risk-controls label > span { display: block; margin: 0 0 5px 2px; color: #768299; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.storage-risk-controls input, .storage-risk-controls select { width: 100%; min-width: 0; margin: 0; background: #fff; }
.storage-result-line { display: flex; align-items: baseline; gap: 5px; margin: 8px 2px 6px; color: #7a869a; font-size: 10px; }
.storage-result-line strong { color: #34435f; font-size: 13px; }
.storage-risk-table-wrap { max-height: 410px; overflow: auto; border: 1px solid #e8ebf2; border-radius: 11px; }
.storage-risk-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; font-size: 10px; }
.storage-risk-table th { position: sticky; top: 0; z-index: 2; padding: 8px 9px; color: #77839a; background: #f6f7fa; text-align: right; }
.storage-risk-table th:first-child, .storage-risk-table td:first-child { text-align: left; }
.storage-risk-table td { padding: 8px 9px; border-bottom: 1px solid #edf0f5; color: #445069; text-align: right; vertical-align: middle; }
.storage-risk-table tbody tr { box-shadow: inset 4px 0 #d99530; }
.storage-risk-table tbody tr[data-risk="high"] { box-shadow: inset 4px 0 #c83247; }
.storage-risk-table tbody tr:hover td { background: #fbfcff; }
.storage-risk-table td > strong, .storage-risk-table td > span, .storage-risk-table td > small, .storage-risk-table td > em { display: block; }
.storage-risk-table td:first-child > span { max-width: 500px; margin-top: 2px; overflow: hidden; color: #6b768b; text-overflow: ellipsis; white-space: nowrap; }
.storage-risk-table td small { margin-top: 3px; color: #929bad; font-size: 9px; }
.storage-risk-table td em { max-width: 500px; margin-top: 3px; color: #69758b; font-size: 8px; font-style: normal; line-height: 1.25; }
.storage-product-title { display: flex; align-items: center; gap: 7px; }
.storage-product-title strong { color: #2d3e5c; }
.storage-risk-badge { display: inline-block !important; width: max-content; padding: 4px 7px; border-radius: 7px; font-size: 9px; font-weight: 800; }
.storage-risk-badge.high { color: #a91f33; background: #ffe7ea; }
.storage-risk-badge.elevated { color: #9a5c15; background: #fff2dc; }
.storage-cover-track { width: 100%; min-width: 85px; height: 5px; margin-top: 4px; overflow: hidden; border-radius: 999px; background: #eceff5; }
.storage-cover-track i { display: block; height: 100%; border-radius: inherit; background: #d99530; }
.storage-cover-track i.high { background: #c83247; }
.storage-risk-toggle { margin-top: 8px; padding: 7px 11px; font-size: 10px; }
.storage-empty { margin: 0; padding: 24px; color: #7c879a; text-align: center; }
.storage-empty.hidden, .storage-risk-toggle.hidden { display: none; }
.sales-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sales-report-card { position: relative; overflow: hidden; }
.sales-report-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: #1769ff; }
.sales-report-card.channel-card-wildberries::before { background: linear-gradient(#8c2ee8, #d126a9); }
.sales-report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.sales-report-head h2 { margin: 12px 0 4px; }
.sales-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0 14px; }
.sales-stats div { padding: 13px; border-radius: 12px; background: #f6f8fc; }
.sales-stats strong { display: block; color: #273552; font-size: 20px; }
.sales-stats span { color: #778299; font-size: 11px; }
.sales-updated { color: #7d879b; font-size: 12px; }
.sales-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.sales-progress { display: flex; gap: 22px; margin-top: 16px; padding: 12px 14px; border-radius: 11px; background: #eef3ff; color: #56647e; font-size: 12px; }
.sales-progress.hidden { display: none; }
.sales-message { display: block; min-height: 18px; margin-top: 10px; color: #68748b; }
.sales-method { margin-top: 18px; }
.sales-method p { margin-bottom: 0; color: #667289; }

/* Advertising bidder */
.advertising-hero { align-items: flex-end; }
.advertising-alert { margin-top: 14px; padding: 12px 15px; border: 1px solid #dfe5ef; border-radius: 12px; color: #56627a; background: #fff; font-size: 13px; }
.advertising-alert.success { border-color: #cce9dd; color: #176b50; background: #effaf5; }
.advertising-alert.error { border-color: #f0ccd2; color: #a8283b; background: #fff4f5; }
.advertising-alert.warning { border-color: #eeddbb; color: #865914; background: #fff9ed; }
.advertising-toast { position: fixed; z-index: 1000; right: 22px; bottom: 22px; max-width: min(430px, calc(100vw - 28px)); padding: 12px 15px; border: 1px solid #cce9dd; border-radius: 12px; color: #176b50; background: #effaf5; box-shadow: 0 14px 38px rgba(28,42,68,.18); font-size: 13px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .18s ease, transform .18s ease; }
.advertising-toast.visible { opacity: 1; transform: translateY(0); }
.advertising-toast.error { border-color: #f0ccd2; color: #a8283b; background: #fff4f5; }
.advertising-card button.is-busy { cursor: wait; opacity: .7; }
.advertising-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin: 18px 0; }
.advertising-kpis > div { min-width: 0; padding: 14px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 6px 20px rgba(31,42,68,.035); }
.advertising-kpis span, .advertising-kpis strong { display: block; }
.advertising-kpis span { color: #7c879b; font-size: 10px; }
.advertising-kpis strong { margin-top: 4px; overflow: hidden; color: #283851; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.advertising-filters { display: grid; grid-template-columns: auto 175px 205px 190px minmax(190px,1fr) auto; align-items: center; gap: 9px; margin: 0 0 18px; }
.advertising-filters .channel-switch { margin: 0; }
.advertising-filters input, .advertising-filters select { margin: 0; background: #fff; }
.advertising-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 13px; }
.advertising-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 8px 26px rgba(32,43,67,.045); transition: box-shadow .18s ease, transform .18s ease; }
.advertising-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #1769ff; }
.advertising-card.channel-card-wildberries::before { background: linear-gradient(#8c2ee8,#d126a9); }
.advertising-card.is-inactive { opacity: .76; }
.advertising-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.advertising-card-summary { position: relative; display: flex; min-height: 218px; padding: 18px 20px 17px; flex-direction: column; cursor: pointer; list-style: none; }
.advertising-card-summary::-webkit-details-marker { display: none; }
.advertising-card-summary > div:first-child { min-width: 0; }
.advertising-card-summary h2 { display: -webkit-box; margin: 12px 0 4px; overflow: hidden; font-size: 17px; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.advertising-subline { margin: 0; color: #7a8599; font-size: 12px; }
.advertising-tile-kpis { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin-top: auto; padding-top: 18px; }
.advertising-tile-kpis span { min-width: 0; padding: 8px 9px; border-radius: 9px; background: #f6f7fa; }
.advertising-tile-kpis small, .advertising-tile-kpis strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.advertising-tile-kpis small { color: #8b95a7; font-size: 8px; text-transform: uppercase; }
.advertising-tile-kpis strong { margin-top: 2px; color: #34435e; font-size: 13px; }
.tile-chevron { position: absolute; top: 18px; right: 17px; width: 9px; height: 9px; border-right: 2px solid #8b95a8; border-bottom: 2px solid #8b95a8; transform: rotate(45deg); transition: transform .18s ease; }
.advertising-card-body { padding: 0 20px 20px; border-top: 1px solid #e8ebf1; }
.advertising-modal { width: min(920px, calc(100vw - 40px)); max-width: none; max-height: min(86vh, 820px); padding: 0; overflow: hidden; border: 0; border-radius: 18px; color: #283851; background: #fff; box-shadow: 0 28px 90px rgba(17,29,52,.28); }
.advertising-modal::backdrop { background: rgba(20,31,51,.52); backdrop-filter: blur(2px); }
.advertising-modal-shell { display: flex; max-height: min(86vh, 820px); flex-direction: column; }
.advertising-modal-header { z-index: 2; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 21px; border-bottom: 1px solid #e7ebf1; background: #fff; }
.advertising-modal-header .eyebrow { font-size: 9px; }
.advertising-modal-header h2 { margin: 3px 0 0; font-size: 19px; }
.advertising-modal-close { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; color: #657187; background: #f0f3f7; font-size: 25px; font-weight: 400; line-height: 1; }
.advertising-modal-close:hover { color: #263750; background: #e5eaf1; }
.advertising-modal-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.advertising-modal .advertising-card-body { padding: 0 21px 21px; border-top: 0; }
.advertising-modal .bidder-settings { margin-top: 15px; }
.advertising-card-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 15px; }
.advertising-card-toolbar p { margin: 0; color: #7d8799; font-size: 11px; }
.advertising-card-toolbar form { flex: 0 0 auto; }
.bidder-mode { padding: 4px 9px; border-radius: 999px; color: #3264b9; background: #eaf1ff; font-size: 11px; font-weight: 800; }
.bidder-mode.automatic { color: #187054; background: #e7f7f0; }
.query-count-badge { padding: 4px 8px; border-radius: 999px; color: #7b2ca1; background: #f4e9fb; font-size: 10px; font-weight: 800; }
.management-badge { padding: 4px 8px; border-radius: 999px; color: #28644f; background: #e8f6f0; font-size: 10px; font-weight: 800; }
.management-badge.platform-auto { color: #87570e; background: #fff2d7; }
.management-badge.monitor-only { color: #68758b; background: #edf0f5; }
.platform-auto-note { border: 1px solid #f0d9aa; color: #76501b; background: #fff8e9; }
.advertising-metrics { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 7px; margin-top: 16px; }
.advertising-metrics > div { min-width: 0; padding: 10px 11px; border-radius: 10px; background: #f7f8fb; }
.advertising-metrics span, .advertising-metrics strong { display: block; }
.advertising-metrics span { color: #8791a4; font-size: 9px; text-transform: uppercase; }
.advertising-metrics strong { margin-top: 3px; color: #33425d; font-size: 13px; }
.advertising-inline-error, .advertising-note { margin: 10px 0 0; padding: 9px 11px; border-radius: 9px; font-size: 11px; }
.advertising-inline-error { color: #a92a3c; background: #fff0f2; }
.advertising-note { color: #6d7890; background: #f3f5f9; }
.bidder-settings { margin-top: 13px; border-top: 1px solid #e8ebf1; }
.bidder-settings summary { padding-top: 13px; color: #506079; cursor: pointer; font-size: 12px; font-weight: 800; }
.autopilot-panel > summary { display: flex; align-items: center; gap: 8px; color: #263750; font-size: 14px; }
.autopilot-panel > summary::after { content: "настроить один раз"; padding: 3px 7px; border-radius: 999px; color: #3264b9; background: #eaf1ff; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.autopilot-form { display: grid; gap: 15px; margin-top: 13px; padding: 16px; border: 1px solid #e3e8f0; border-radius: 15px; background: #f8f9fc; }
.autopilot-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px; border: 1px solid #dce5f2; border-radius: 13px; background: #fff; }
.autopilot-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.autopilot-switch > input { position: absolute; opacity: 0; pointer-events: none; }
.autopilot-switch-control { position: relative; flex: 0 0 auto; width: 46px; height: 26px; border-radius: 999px; background: #c8d0dc; transition: .18s ease; }
.autopilot-switch-control::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px #26375033; transition: .18s ease; }
.autopilot-switch > input:checked + .autopilot-switch-control { background: #2e8b68; }
.autopilot-switch > input:checked + .autopilot-switch-control::after { transform: translateX(20px); }
.autopilot-switch strong, .autopilot-switch small, .query-bid-enabled strong, .query-bid-enabled small, .query-drr-guard strong, .query-drr-guard small, .auto-confirm strong, .auto-confirm small { display: block; }
.autopilot-switch strong { color: #24344d; font-size: 14px; }
.autopilot-switch small { margin-top: 2px; color: #7a8699; font-size: 10px; font-weight: 500; }
.autopilot-state { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; color: #69758a; background: #edf0f4; font-size: 10px; font-weight: 800; }
.autopilot-state.is-on { color: #176e51; background: #e5f7ef; }
.autopilot-goals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin: 0; padding: 0; border: 0; }
.autopilot-goals legend { grid-column: 1 / -1; margin-bottom: 8px; color: #34445f; font-size: 13px; font-weight: 800; }
.autopilot-goal { position: relative; display: flex; min-height: 94px; padding: 13px; border: 1px solid #dfe4ed; border-radius: 12px; background: #fff; cursor: pointer; transition: .16s ease; }
.autopilot-goal:hover { border-color: #9eb6e2; }
.autopilot-goal:has(input:checked) { border-color: #5d83d2; background: #f2f6ff; box-shadow: inset 0 0 0 1px #5d83d2; }
.autopilot-goal input { width: auto; margin: 2px 9px 0 0; accent-color: #346cc7; }
.autopilot-goal strong, .autopilot-goal small { display: block; }
.autopilot-goal strong { color: #30415c; font-size: 12px; }
.autopilot-goal small { margin-top: 6px; color: #7a8699; font-size: 10px; font-weight: 500; line-height: 1.4; }
.autopilot-goal em { position: absolute; top: -8px; right: 8px; padding: 3px 6px; border-radius: 999px; color: #176e51; background: #dcf4e9; font-size: 8px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.autopilot-section-title { display: flex; align-items: baseline; gap: 8px; color: #34445f; }
.autopilot-section-title strong { font-size: 13px; }
.autopilot-section-title small { color: #8993a4; font-size: 10px; }
.autopilot-limits { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.autopilot-limits > label, .autopilot-wb-grid > label { color: #53627a; font-size: 10px; font-weight: 700; }
.autopilot-limits > label > small { display: block; margin-top: 4px; color: #939dad; font-size: 9px; font-weight: 500; line-height: 1.3; }
.field-with-unit { display: flex; align-items: center; margin-top: 5px; overflow: hidden; border: 1px solid #dfe4ed; border-radius: 9px; background: #fff; }
.field-with-unit input { min-width: 0; margin: 0 !important; border: 0; box-shadow: none; }
.field-with-unit b { padding: 0 10px; color: #7d899b; font-size: 10px; }
.autopilot-wb { display: grid; gap: 10px; padding: 13px; border: 1px solid #e2d9ed; border-radius: 12px; background: #fdfaff; }
.autopilot-wb-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.autopilot-wb-grid select { margin-top: 5px; background: #fff; }
.autopilot-wb-grid .query-bid-enabled, .autopilot-wb-grid .query-drr-guard { grid-column: auto; min-height: 0; margin: 0; padding: 10px; }
.query-bid-enabled small, .query-drr-guard small, .auto-confirm small { margin-top: 3px; color: #7f8a9c; font-size: 9px; font-weight: 500; line-height: 1.3; }
.autopilot-summary { padding: 12px 14px; border-left: 4px solid #5d83d2; border-radius: 9px; color: #4e5e75; background: #eef4ff; font-size: 11px; line-height: 1.5; }
.autopilot-summary strong { color: #2d4264; }
.autopilot-form .auto-confirm { grid-column: auto; margin: 0; border-color: #d7e3f2; color: #40516c; background: #fff; }
.autopilot-form .auto-confirm:has(input:checked) { border-color: #b9decf; background: #f2fbf7; }
.autopilot-advanced { border-top: 1px solid #e3e7ee; }
.autopilot-advanced > summary { padding-top: 12px; color: #7a8699; font-size: 10px; font-weight: 700; }
.autopilot-advanced-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 10px; padding: 12px; border-radius: 10px; background: #f0f2f6; }
.autopilot-advanced-grid input { margin-top: 5px; background: #fff; }
.bidder-settings-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-top: 13px; padding: 14px; border-radius: 12px; background: #f7f8fb; }
.bidder-target-note { grid-column: span 3; align-self: end; margin: 0; padding: 9px 11px; border-radius: 9px; color: #657187; background: #eef2f8; font-size: 11px; line-height: 1.4; }
.bidder-settings-grid input, .bidder-settings-grid select { margin-top: 5px; background: #fff; }
.bidder-enabled, .auto-confirm { display: flex; grid-column: span 2; align-items: center; gap: 8px; min-height: 42px; padding: 9px 11px; border: 1px solid #e0e5ef; border-radius: 10px; background: #fff; }
.bidder-enabled input, .auto-confirm input { width: auto; margin: 0; }
.query-settings-title { grid-column: 1 / -1; margin-top: 5px; padding-top: 12px; border-top: 1px solid #e1e5ed; color: #3b4c67; font-size: 13px; font-weight: 800; }
.query-bid-enabled { display: flex; grid-column: span 2; align-items: center; gap: 8px; min-height: 42px; padding: 9px 11px; border: 1px solid #e0d5ed; border-radius: 10px; color: #673083; background: #fcf8ff; }
.query-bid-enabled input { width: auto; margin: 0; }
.query-settings-note, .query-settings-warning { grid-column: span 2; margin: 0; padding: 9px 11px; border-radius: 9px; font-size: 11px; line-height: 1.4; }
.query-drr-guard { display: flex; align-items: center; gap: 8px; }
.query-drr-guard input { width: auto; margin: 0; }
.query-settings-note { color: #657187; background: #eef2f8; }
.query-settings-warning { color: #845615; background: #fff4df; }
.auto-confirm { border-color: #efcfd3; color: #9b2c3d; background: #fff7f8; }
.auto-confirm.hidden { display: none; }
.bidder-actions { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 16px; padding-top: 6px; }
.bidder-actions p { max-width: 620px; margin: 0; color: #66738a; font-size: 11px; line-height: 1.4; }
.bidder-actions button { flex: 0 0 auto; min-width: 190px; }
.wb-query-panel { margin-top: 18px; padding-top: 0; border: 1px solid #e3e7ee; border-radius: 12px; background: #fff; }
.wb-query-disclosure { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 15px; cursor: pointer; list-style-position: inside; }
.wb-query-disclosure strong, .wb-query-disclosure small { display: block; }
.wb-query-disclosure strong { color: #33425d; font-size: 12px; }
.wb-query-disclosure small { margin-top: 3px; color: #8b95a6; font-size: 9px; }
.wb-query-content { padding: 0 14px 14px; border-top: 1px solid #edf0f4; }
.wb-query-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.wb-query-heading h3 { margin: 0; color: #33425d; font-size: 14px; }
.wb-query-heading p, .wb-query-summary, .wb-query-footnote { margin: 4px 0 0; color: #7d8799; font-size: 10px; }
.wb-query-search { display: block; margin-top: 12px; color: #637087; font-size: 10px; }
.wb-query-search input { margin-top: 4px; background: #fff; }
.wb-query-table-wrap { margin-top: 9px; overflow: auto; border: 1px solid #e1e6ee; border-radius: 11px; max-height: 390px; }
.wb-query-table-wrap table { width: 100%; min-width: 1120px; border-collapse: collapse; font-size: 10px; }
.wb-query-table-wrap thead { position: sticky; z-index: 1; top: 0; }
.wb-query-table-wrap th { padding: 9px 10px; color: #727f94; background: #f3f5f8; text-align: left; white-space: nowrap; }
.wb-query-table-wrap td { max-width: 260px; padding: 9px 10px; border-top: 1px solid #edf0f4; color: #526077; vertical-align: top; }
.wb-query-table-wrap td strong, .wb-query-table-wrap td small { display: block; }
.wb-query-table-wrap td small { margin-top: 3px; color: #929cad; line-height: 1.3; }
.wb-query-table-wrap .query-decision-increase strong { color: #176e51; }
.wb-query-table-wrap .query-decision-decrease strong { color: #a92a3c; }
.wb-query-footnote { line-height: 1.4; }
.advertising-history { margin-top: 30px; }
.advertising-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.advertising-table-wrap table { width: 100%; min-width: 970px; border-collapse: collapse; font-size: 11px; }
.advertising-table-wrap th { padding: 10px 11px; color: #7a8699; background: #f6f7fa; text-align: left; }
.advertising-table-wrap td { padding: 10px 11px; border-top: 1px solid #edf0f4; color: #526077; vertical-align: top; }
.advertising-table-wrap td strong, .advertising-table-wrap td small { display: block; }
.advertising-table-wrap td small { margin-top: 2px; color: #929cad; }
.decision-action { display: inline-block; padding: 4px 7px; border-radius: 7px; font-weight: 800; }
.decision-action.increase { color: #176e51; background: #e5f7ef; }
.decision-action.decrease { color: #a92a3c; background: #ffeaed; }
.decision-action.hold { color: #6e788b; background: #eef0f4; }

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .brand { flex: 1; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .main-nav a { white-space: nowrap; }
  .hero { align-items: flex-start; }
  .message-desk { grid-template-columns: 300px minmax(0, 1fr); }
  .sales-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sales-dashboard-grid { grid-template-columns: 1fr; }
  .production-head { display: block; }
  .sales-table-controls { min-width: 0; margin-top: 14px; }
  .storage-risk-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .storage-risk-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .advertising-kpis, .advertising-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .advertising-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bidder-settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .autopilot-goals { grid-template-columns: 1fr; }
  .autopilot-limits, .autopilot-advanced-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bidder-target-note, .query-settings-note, .query-settings-warning { grid-column: 1 / -1; }
  .advertising-filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .app-main { padding: 20px 14px 50px; }
  .brand-copy small { display: none; }
  .hero { display: block; padding: 20px; }
  .sync { margin-top: 18px; }
  .sales-report-grid { grid-template-columns: 1fr; }
  .sales-stats { grid-template-columns: 1fr; }
  .sales-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-auto-note { margin-top: 15px; }
  .sales-channel-switch { display: flex; overflow-x: auto; }
  .sales-table-controls { grid-template-columns: 1fr; }
  .month-close-grid { grid-template-columns: 1fr; }
  .month-close-main strong { font-size: 19px; }
  .daily-sales-panel { overflow: hidden; }
  .daily-chart { min-height: 220px; padding-right: 0; padding-left: 0; }
  .daily-chart-day { grid-template-rows: 190px 20px; }
  .daily-chart-bars { height: 190px; }
  .sales-bars { grid-template-columns: 1fr; }
  .sales-mini-table, .sales-mini-table tbody, .sales-mini-table tr, .sales-mini-table td { display: block; width: 100%; }
  .sales-mini-table thead { display: none; }
  .sales-mini-table tbody { display: grid; gap: 10px; }
  .sales-mini-table tr { padding: 5px 12px; border: 1px solid #e7eaf1; border-radius: 12px; background: #fff; }
  .sales-mini-table td { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(0, 1.2fr); gap: 2px 14px; padding: 8px 0; border-bottom: 1px solid #eef0f5; text-align: right; }
  .sales-mini-table td:last-child { border-bottom: 0; }
  .sales-mini-table td::before { content: attr(data-label); grid-row: 1 / span 3; color: #7b879b; font-size: 10px; font-weight: 700; text-align: left; }
  .sales-mini-table td > strong, .sales-mini-table td > small, .sales-mini-table td > span, .sales-mini-table td > em { grid-column: 2; }
  .storage-risk-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .storage-risk-controls { grid-template-columns: 1fr; }
  .storage-risk-panel .sales-panel-head { align-items: stretch; flex-direction: column; }
  .storage-channel-switch { width: 100%; }
  .storage-channel-switch button { flex: 1; }
  .storage-risk-table-wrap { max-height: none; overflow: visible; border: 0; }
  .storage-risk-table, .storage-risk-table tbody, .storage-risk-table tr, .storage-risk-table td { display: block; width: 100%; min-width: 0; }
  .storage-risk-table thead { display: none; }
  .storage-risk-table tbody { display: grid; gap: 10px; }
  .storage-risk-table tr { padding: 5px 12px; border: 1px solid #e7eaf1; border-radius: 12px; }
  .storage-risk-table td { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(0, 1.2fr); gap: 2px 12px; padding: 8px 0; text-align: right !important; }
  .storage-risk-table td::before { content: attr(data-label); grid-row: 1 / span 3; color: #7b879b; font-size: 10px; font-weight: 700; text-align: left; }
  .storage-risk-table td > strong, .storage-risk-table td > span, .storage-risk-table td > small, .storage-risk-table td > em { grid-column: 2; margin-left: auto; }
  .storage-risk-table td > em { max-width: 190px; text-align: right; }
  .storage-risk-table td:first-child > span { max-width: 190px; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; text-align: right; }
  .storage-product-title { flex-wrap: wrap; justify-content: flex-end; }
  .storage-cover-track { width: min(130px, 100%); }
  .channel-switch { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); width: 100%; }
  .channel-switch a { text-align: center; }
  .product-form { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .chat-bubble { max-width: 92%; }
  .chat-form { display: block; }
  .chat-form button { width: 100%; margin-top: 8px; }
  .batch-panel { grid-template-columns: 1fr; }
  .batch-controls { align-items: stretch; flex-direction: column; }
  .batch-controls label { min-width: 0; }
  .batch-start { width: 100%; }
  .message-desk { display: block; }
  .advertising-hero, .advertising-card-toolbar { display: block; }
  .advertising-sync, .advertising-card-toolbar form { margin-top: 14px; }
  .advertising-kpis, .advertising-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .advertising-list { grid-template-columns: 1fr; }
  .advertising-modal { width: calc(100vw - 20px); max-height: 92vh; border-radius: 14px; }
  .advertising-modal-shell { max-height: 92vh; }
  .advertising-modal-header { padding: 14px 15px; }
  .advertising-modal .advertising-card-body { padding: 0 15px 15px; }
  .advertising-filters, .bidder-settings-grid { grid-template-columns: 1fr; }
  .autopilot-form { padding: 11px; }
  .autopilot-switch-row, .autopilot-section-title { align-items: flex-start; flex-direction: column; }
  .autopilot-limits, .autopilot-wb-grid, .autopilot-advanced-grid { grid-template-columns: 1fr; }
  .advertising-filters .channel-switch, .bidder-enabled, .auto-confirm, .query-bid-enabled, .bidder-actions, .bidder-target-note, .query-settings-note, .query-settings-warning { grid-column: auto; }
  .wb-query-heading { display: block; }
  .bidder-actions { display: block; }
  .bidder-actions button { margin-top: 10px; }
  .bidder-actions button, .advertising-card-toolbar button { width: 100%; }
  .conversation-list { max-height: 290px; border-right: 0; border-bottom: 1px solid var(--line); }
  .direct-messages { min-height: 310px; }
  .direct-reply-actions, .direct-send-row { align-items: stretch; flex-direction: column; }
  .direct-reply-actions button, .direct-send-row button { width: 100%; }
}
.answered-statistics{margin:18px 0;padding:20px;border:1px solid rgba(113,128,150,.2);border-radius:22px;background:rgba(255,255,255,.72)}
.answered-statistics-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px}.answered-statistics-head>div:first-child{display:grid;gap:4px}.answered-statistics-head strong{font-size:20px}.answered-statistics-head small,.answered-statistics-summary small{color:var(--muted)}
.answered-period-controls{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap}.answered-period-controls label{display:grid;gap:5px;font-size:12px;color:var(--muted)}.answered-period-controls select{min-height:38px;padding:0 30px 0 10px;border:1px solid rgba(113,128,150,.25);border-radius:11px;background:#fff;color:var(--ink)}.answered-period-controls button{min-height:38px}
.answered-statistics-summary{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:9px;margin-top:18px;padding-top:16px;border-top:1px solid rgba(113,128,150,.14)}.answered-statistics-summary>div{display:grid;gap:4px;padding:12px;border-radius:14px;background:rgba(245,247,250,.9)}.answered-statistics-summary>div.service{background:rgba(35,103,242,.08)}.answered-statistics-summary>div.marketplace{background:rgba(139,92,246,.08)}.answered-statistics-summary span{font-size:11px;color:var(--muted)}.answered-statistics-summary strong{font-size:26px;line-height:1}.answered-statistics-status{display:block;margin-top:10px;color:var(--muted)}
.answered-months{display:grid;gap:8px;margin-top:16px;max-height:360px;overflow:auto;padding-right:4px}.answered-month-row{display:grid;grid-template-columns:minmax(125px,160px) minmax(120px,1fr) minmax(265px,auto);align-items:center;gap:10px 14px;padding:11px;border-radius:13px;background:rgba(245,247,250,.85)}.answered-month-row>strong{font-size:13px}.answered-month-bar{height:8px;border-radius:999px;background:rgba(113,128,150,.12);overflow:hidden}.answered-month-bar span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#2367f2,#23b18a)}.answered-month-values{display:flex;justify-content:flex-end;gap:10px;font-size:12px;color:var(--muted)}.answered-month-values b{min-width:70px;color:var(--ink);font-size:14px;text-align:right}.answered-month-published{grid-column:2/-1;color:var(--muted);font-size:11px}
@media(max-width:980px){.answered-statistics-summary{grid-template-columns:repeat(3,1fr)}}@media(max-width:760px){.answered-statistics-head{align-items:stretch;flex-direction:column}.answered-period-controls{display:grid;grid-template-columns:1fr 1fr}.answered-period-controls select{width:100%}.answered-period-controls button{grid-column:1/-1}.answered-statistics-summary{grid-template-columns:1fr 1fr}.answered-month-row{grid-template-columns:105px 1fr}.answered-month-values,.answered-month-published{grid-column:1/-1;justify-content:flex-start}}
