:root {
  color-scheme: light;
  --font-sans: "Geist", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --color-bg: #f4f7fb;
  --color-surface: #ffffff;
  --color-surface-subtle: #f8fafc;
  --color-surface-accent: #eff6ff;
  --color-text: #172033;
  --color-text-muted: #667085;
  --color-border: #dce3ee;
  --color-border-strong: #cbd5e1;
  --color-primary: #0b63f6;
  --color-primary-hover: #0954d8;
  --color-primary-soft: #eaf2ff;
  --color-success: #138a55;
  --color-success-soft: #ecfdf3;
  --color-warning: #a66300;
  --color-warning-soft: #fff7e6;
  --color-danger: #c4323c;
  --color-danger-soft: #fff1f2;
  --radius-control: 8px;
  --radius-panel: 12px;
  --radius-dialog: 16px;
  --shadow-panel: 0 5px 18px rgba(23, 32, 51, 0.06);
  --shadow-dialog: 0 24px 64px rgba(23, 32, 51, 0.2);
  --focus-ring: 0 0 0 3px rgba(11, 99, 246, 0.18);

  --bg: var(--color-bg);
  --panel: var(--color-surface);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --blue: var(--color-primary);
  --blue-dark: var(--color-primary-hover);
  --green: var(--color-success);
  --amber: var(--color-warning);
  --red: var(--color-danger);
  --shadow: var(--shadow-panel);
  --lte-sidebar-bg: #172033;
  --lte-sidebar-active-bg: var(--color-primary);
  --competitor-ink: var(--color-text);
  --competitor-muted: var(--color-text-muted);
  --competitor-line: var(--color-border);
  --competitor-blue: var(--color-primary);
  --competitor-blue-soft: var(--color-primary-soft);
  --ue-green: var(--color-primary);
  --ue-green-dark: var(--color-primary-hover);
  --ue-line: var(--color-border);
  --ue-muted: var(--color-text-muted);
  --ue-text: var(--color-text);
  --ue-soft: var(--color-surface-subtle);
}

html {
  background: var(--color-bg);
}

body,
button,
input,
select,
textarea,
.ue-page,
.ue-settings,
.ue-product-dialog,
.ue-bulk-bar {
  font-family: var(--font-sans) !important;
}

body {
  background: var(--color-bg) !important;
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 750;
  letter-spacing: -0.02em;
}

p,
small,
.text-muted {
  color: var(--color-text-muted);
}

a {
  color: var(--color-primary);
  text-underline-offset: 2px;
}

button,
.btn,
input,
select,
textarea,
summary,
a {
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease, transform 150ms ease;
}

button,
.btn,
.primary,
.secondary,
.ghost,
.danger,
.ue-primary,
.ue-outline,
.ue-secondary {
  border-radius: var(--radius-control) !important;
  font-weight: 700;
  letter-spacing: 0;
}

.btn-primary,
.primary,
.ue-primary {
  border-color: var(--color-primary) !important;
  background: var(--color-primary) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.btn-primary:hover,
.primary:hover,
.ue-primary:hover {
  border-color: var(--color-primary-hover) !important;
  background: var(--color-primary-hover) !important;
  color: #fff !important;
}

.secondary,
.ghost,
.ue-secondary,
.ue-outline,
.btn-secondary,
.btn-outline-primary,
.btn-outline-secondary {
  border: 1px solid var(--color-border-strong) !important;
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

.secondary:hover,
.ghost:hover,
.ue-secondary:hover,
.ue-outline:hover,
.btn-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-secondary:hover {
  border-color: #9db7db !important;
  background: var(--color-primary-soft) !important;
  color: var(--color-primary-hover) !important;
}

.danger,
.btn-danger,
.btn-outline-danger {
  border: 1px solid #fecdd3 !important;
  background: var(--color-danger-soft) !important;
  color: var(--color-danger) !important;
}

.danger:hover,
.btn-danger:hover,
.btn-outline-danger:hover {
  border-color: #f4a6ae !important;
  background: #ffe4e6 !important;
  color: #a81f2c !important;
}

button:disabled,
.btn:disabled,
[aria-disabled="true"] {
  cursor: not-allowed !important;
  opacity: 1 !important;
  box-shadow: none !important;
  transform: none !important;
}

button:focus-visible,
.btn:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary) !important;
  outline-offset: 2px !important;
  box-shadow: var(--focus-ring) !important;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.form-control,
.form-select {
  border-color: var(--color-border-strong) !important;
  border-radius: var(--radius-control) !important;
  background-color: var(--color-surface) !important;
  color: var(--color-text) !important;
  box-shadow: none;
}

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover,
.form-control:hover,
.form-select:hover {
  border-color: #aebdd0 !important;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary) !important;
  box-shadow: var(--focus-ring) !important;
  outline: 0;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--color-primary) !important;
}

::placeholder {
  color: #98a2b3 !important;
  opacity: 1;
}

.panel,
.card,
.login-panel,
.removed-stocks-panel,
.recommendation-cluster,
.pulse-guide,
.pulse-summary,
.pulse-chart-card,
.pulse-report-card,
.pulse-products-panel,
.competitor-upload-card,
.competitor-guide,
.competitor-results,
.trafarety-chart-card,
.cluster-sales-product,
.ue-summary-card,
.ue-empty,
.ue-table-shell,
.stock-product-overview {
  border-color: var(--color-border) !important;
  border-radius: var(--radius-panel) !important;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.app-header {
  border-color: var(--color-border) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.06) !important;
  backdrop-filter: blur(10px);
}

.sidebar-toggle,
.header-profile,
.header-logout {
  border-radius: var(--radius-control) !important;
  color: #475467 !important;
}

.sidebar-toggle:hover,
.header-profile:hover,
.header-profile.active,
.header-logout:hover {
  background: var(--color-primary-soft) !important;
  color: var(--color-primary-hover) !important;
}

.global-products-refresh,
.active-cabinet-control {
  border-color: var(--color-border) !important;
  border-radius: var(--radius-control) !important;
  background: var(--color-surface-subtle) !important;
}

.app-sidebar .service-nav .nav-link,
.app-sidebar .service-nav .service-tab {
  border-radius: var(--radius-control) !important;
  font-family: var(--font-sans);
}

.app-sidebar .service-nav .nav-link.active,
.app-sidebar .service-nav .service-tab.active {
  background: rgba(11, 99, 246, 0.28) !important;
  box-shadow: inset 3px 0 0 #6ea8ff;
}

.app-content,
.content-wrapper,
.app-main {
  background: var(--color-bg);
}

.eyebrow,
.panel-label,
.active-cabinet-label,
th {
  letter-spacing: 0.03em;
}

table {
  color: var(--color-text);
}

th {
  color: #475467;
  background-color: #f1f5f9;
  font-size: 12px;
  font-weight: 700 !important;
}

td {
  border-color: #e8edf3 !important;
}

tbody tr:hover > td {
  background-color: #f8fbff;
}

.badge,
.pill,
.status-badge,
.discontinued-badge {
  border-radius: 999px !important;
  font-weight: 700;
}

.competitor-hero,
.pulse-hero {
  border-radius: var(--radius-dialog) !important;
  background: linear-gradient(135deg, #15418e, var(--color-primary) 68%, #4c8df8) !important;
  box-shadow: none !important;
}

[data-service-panel="competitors"] {
  --competitor-ink: var(--color-text);
  --competitor-muted: var(--color-text-muted);
  --competitor-line: var(--color-border);
  --competitor-blue: var(--color-primary);
  --competitor-blue-soft: var(--color-primary-soft);
}

[data-service-panel="pulse"] {
  --pulse-ink: var(--color-text);
  --pulse-muted: var(--color-text-muted);
  --pulse-border: var(--color-border);
  --pulse-surface: var(--color-surface);
  --pulse-soft: var(--color-surface-subtle);
}

.pulse-kicker,
.pulse-guide > summary .bi-play-btn,
.pulse-guide-chevron,
.pulse-empty-state i {
  color: var(--color-primary) !important;
}

.pulse-kpi::before,
.pulse-legend span::before {
  background: var(--color-primary);
}

.competitor-hero h1,
.competitor-hero h2,
.competitor-hero p,
.pulse-hero h1,
.pulse-hero h2,
.pulse-hero p {
  color: #fff;
}

.competitor-filters,
.trafarety-filters,
.recommendation-period,
.stock-product-total-metrics,
.ue-table .ue-group-row th,
.ue-filters button,
.ue-presets button,
.ue-column-group h3 {
  border-color: var(--color-border) !important;
  background: var(--color-surface-subtle) !important;
}

.ue-page {
  color: var(--color-text);
}

.ue-primary,
.ue-outline,
.ue-secondary {
  min-height: 40px;
}

.ue-filters button.active,
.ue-switch input:checked + span,
.ue-column-group input:checked {
  background: var(--color-primary) !important;
}

.ue-table tbody tr,
.ue-table tbody tr td,
.ue-table .ue-pinned-column {
  background: var(--color-surface) !important;
}

.ue-settings,
.ue-product-dialog,
.trafarety-dialog {
  border-radius: var(--radius-dialog) !important;
  box-shadow: var(--shadow-dialog) !important;
}

.login-body {
  background: radial-gradient(circle at 50% 0%, #e9f2ff 0, transparent 38%), var(--color-bg) !important;
}

.login-panel {
  padding: 30px;
}

.login-panel .brand-mark {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.error-line,
.is-error,
.negative {
  color: var(--color-danger) !important;
}

@media (max-width: 760px) {
  .panel,
  .card,
  .login-panel,
  .competitor-upload-card,
  .competitor-guide,
  .competitor-results,
  .pulse-chart-card,
  .pulse-report-card {
    border-radius: 10px !important;
  }

  .app-header .container-fluid {
    gap: 6px;
  }

  .global-products-refresh,
  .active-cabinet-control {
    min-width: 0;
  }
}

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

.mobile-service-brand { display: none; }
.ozon-refresh-icon { width: 26px; height: 24px; object-fit: contain; }
.app-header .btn-primary .ozon-refresh-icon { filter: brightness(0) invert(1); }
.profit-calendar-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 14px 0; }
.profit-calendar-controls > label { min-width: 130px; flex: 1 1 150px; }
.profit-calendar-controls input, .profit-calendar-controls select { width: 100%; }
#ownOzonCredentialsForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#ownOzonCredentialsForm .user-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#ownOzonCredentialsForm .user-actions button { white-space: nowrap; }

@media (max-width: 640px) {
  #ownOzonCredentialsForm { grid-template-columns: 1fr; }
  .app-header .container-fluid { flex-wrap: wrap; }
  .app-header .sidebar-toggle, .header-account-actions { flex-shrink: 0; }
  .header-logout span { display: none; }
  .header-logout { justify-content: center; width: 40px; padding-inline: 0; white-space: nowrap; }
  .active-cabinet-control { flex: 0 1 118px; }
  .active-cabinet-control select { width: 100%; }
  .global-products-refresh { flex: 1 1 44px; }
  .global-products-refresh .products-refresh-time { display: none; }
}
@media (max-width: 767px) {
  .app-header .container-fluid { display: flex; flex-wrap: nowrap; gap: 6px; padding: 5px 10px; min-height: 48px; }
  .mobile-service-brand { display: block; order: 0; font-size: 24px; font-weight: 650; white-space: nowrap; color: #3656f4; margin-right: auto; padding-left: 8px; }
  .app-header .container-fluid > .navbar-nav { order: 3; flex: 0 0 auto; }
  .app-header .sidebar-toggle { padding: 4px; min-width: 42px; width: 42px; font-size: 34px; justify-content: center; }
  .app-header .global-products-refresh { order: 2; display: flex; flex: 0 1 auto; gap: 6px; padding: 0; margin: 0; border: 0; background: transparent !important; }
  .app-header .global-products-refresh[hidden] { display: none !important; }
  .app-header .global-products-refresh .products-refresh-time { display: block; order: 0; flex: 0 1 auto; font-size: 13px; white-space: nowrap; color: #16713d; }
  .app-header #globalRefreshOzon { order: 1; min-width: 36px; min-height: 36px; padding: 4px; border: 0; background: transparent !important; box-shadow: none; color: #3656f4; }
  .app-header #globalRefreshOzon span { display: none; }
  .app-header .btn-primary .ozon-refresh-icon { filter: none; }
  #mobileAccountMenu { display: grid; gap: 12px; padding: 12px; border-bottom: 1px solid #ffffff30; }
  #mobileAccountMenu .active-cabinet-control { max-width: none; flex: initial; width: 100%; }
  #mobileAccountMenu .active-cabinet-control strong, #mobileAccountMenu .active-cabinet-control select { max-width: 100%; }
  #mobileAccountMenu .header-account-actions { margin: 0 !important; display: flex; flex-wrap: wrap; gap: 12px; color: inherit; }
  #mobileAccountMenu .header-logout span, #mobileAccountMenu .header-profile span { display: inline; }
  #mobileAccountMenu .header-logout { width: auto; }
  #mobileAccountMenu .nav-link { color: inherit; }
}
@media (min-width: 768px) { #mobileAccountMenu { display: none; } }
.mobile-menu-close { display: none; }
@media (max-width: 767px) {
  .app-sidebar { left: auto; right: 0; width: min(280px, calc(100vw - 48px)); transform: translateX(100%); box-shadow: -10px 0 28px #12203320; }
  .sidebar-open .app-sidebar { transform: translateX(0); }
  .app-sidebar .sidebar-brand { position: relative; min-height: 48px; height: 48px; border: 0; }
  .app-sidebar .sidebar-brand .brand-link { display: none; }
  .mobile-menu-close { display: flex; align-items: center; justify-content: center; position: absolute; right: 10px; top: 4px; width: 42px; height: 40px; border: 0; background: transparent !important; color: #dfe8f6; font-size: 30px; box-shadow: none; }
  .app-sidebar .app-version { position: static; padding: 12px 18px; }
  #mobileAccountMenu { border-bottom: 0; border-top: 1px solid #ffffff20; margin-top: 12px; }
  #mobileAccountMenu .header-account-actions { flex-direction: column; align-items: stretch; order: 0; }
  #mobileAccountMenu .active-cabinet-control { order: 1; }
  #mobileAccountMenu .header-profile, #mobileAccountMenu .header-logout { display: flex; align-items: center; justify-content: flex-start; gap: 11px; padding: 10px 11px; width: 100%; font-size: 15px; color: #dfe8f6 !important; text-align: left; }
}
.supply-manual-quantity {
  background: #fff3cd !important;
  border-color: #b77900 !important;
  color: #704600 !important;
}
.supply-quantity-note {
  display: block;
  flex-basis: 100%;
  white-space: pre !important;
  font-size: 11px !important;
  line-height: 1.35;
  text-transform: none !important;
  color: #64748b;
}
.supply-quantity-note.is-manual { color: #855200; font-weight: 600; }
.supply-quantity-edit { flex-wrap: wrap; }
.supply-summary-column-heading { padding: 8px 12px 0; text-align: right; color: #64748b; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.supply-summary-cluster-row { grid-template-columns: minmax(150px, 1fr) minmax(210px, 250px) 124px; }
@media (max-width: 760px) {
  .supply-summary-cluster-row { grid-template-columns: minmax(0, 1fr) 124px; }
  .supply-summary-column-heading { padding-right: 10px; }
}
@media (max-width: 374px) {
  .app-header .container-fluid { gap: 2px; padding-inline: 4px; }
  .mobile-service-brand { padding-left: 4px; letter-spacing: -0.3px; }
  .app-header .global-products-refresh { gap: 2px; }
  .app-header .global-products-refresh .products-refresh-time { max-width: 52px; white-space: normal; text-align: center; line-height: 1.15; }
}
