/* =============================================
   STRELKA DASHBOARD — style.css
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-main: #e9eeea;
  --bg-white: #ffffff;
  --sidebar-bg: #ffffff;
  --sidebar-width: 240px;
  --text-primary: #1c221d;
  --text-secondary: #5a6b5d;
  --text-muted: #8fa391;
  --border: #ccd8ce;
  --accent: #4d7a5c;
  --accent-hover: #3a6148;
  --accent-light: #e4ede7;
  --green: #3a9e6f;
  --green-light: #d0ead9;
  --red: #c0392b;
  --red-light: #f5dbd8;
  --orange: #b07d3a;
  --blue: #3a6b8a;
  --blue-light: #dce9f0;
  --shadow-sm: 0 2px 8px rgba(40,70,50,.06);
  --shadow: 0 8px 24px rgba(40,70,50,.09);
  --shadow-lg: 0 16px 40px rgba(40,70,50,.12);
  --radius: 18px;
  --radius-sm: 10px;
  --radius-xs: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #f5f8f5 0%, #eaf0eb 30%, #e0eae1 60%, #d5e2d7 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 16px; left: 16px; bottom: 16px;
  z-index: 100;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.8);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 16px;
}

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #4d7a5c, #6b9e7a);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(60,100,75,.25);
}
.logo-text { font-weight: 700; font-size: 17px; color: var(--text-primary); letter-spacing: -.3px; }

.sidebar-search {
  padding: 0 14px 12px;
}

.sidebar-search input {
  width: 100%;
  background: #f9f7fd;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  color: var(--text-primary);
  transition: border .15s;
}

.sidebar-search input:focus { border-color: var(--accent); background: #fff; }
.sidebar-search input { background: #f3f7f4; }

.sidebar-nav {
  flex: 1;
  padding: 4px 10px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 8px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover { background: #f0f5f1; color: var(--text-primary); }
.nav-item.active {
  background: linear-gradient(135deg, #dff0e6, #cce5d8);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(60,100,75,.12);
}

.nav-icon { font-size: 16px; min-width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 20px;
  text-align: center;
}

.nav-badge:empty, .nav-badge[data-count="0"] { display: none; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 4px;
}

.sidebar-footer {
  padding: 14px;
}

.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #4d7a5c, #6b9e7a);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(60,100,75,.25);
}
.user-name { font-weight: 600; font-size: 13px; }
.user-role { color: var(--text-muted); font-size: 11px; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: calc(var(--sidebar-width) + 32px);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.page-header {
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.7);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.page-subtitle { color: var(--text-secondary); font-size: 13px; display: block; margin-top: 2px; }

.header-right { display: flex; align-items: center; gap: 12px; }
.last-update { color: var(--text-muted); font-size: 12px; }

/* ===== SECTIONS ===== */
.sections-wrapper {
  padding: 24px 32px 32px;
  flex: 1;
}

.section { display: none; }
.section.active { display: block; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #7ab88a);
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-label { color: var(--text-secondary); font-size: 12px; font-weight: 500; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; margin-bottom: 6px; letter-spacing: -.5px; }
.stat-trend { font-size: 12px; font-weight: 500; }
.stat-trend.positive { color: var(--green); }
.stat-trend.negative { color: var(--red); }

/* ===== CHARTS ===== */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.chart-card {
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.chart-title { font-weight: 600; font-size: 14px; margin-bottom: 16px; }

/* ===== CARD ===== */
.section-card {
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header h3 { font-size: 15px; font-weight: 600; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, #4d7a5c, #6b9e7a);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(60,100,75,.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #3a6148, #4d7a5c);
  box-shadow: 0 5px 14px rgba(60,100,75,.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,.7);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
.btn-secondary:hover { background: #fff; border-color: #adc4b3; }

.btn-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #4d7a5c, #6b9e7a);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(60,100,75,.25);
}

/* ===== INPUTS ===== */
.input-group-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.input-field {
  flex: 1;
  background: rgba(255,255,255,.7);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  transition: all .15s;
  backdrop-filter: blur(4px);
}
.input-field:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(60,100,75,.1); }

.select-field {
  background: rgba(255,255,255,.7);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.textarea-field {
  width: 100%;
  background: rgba(255,255,255,.7);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  resize: vertical;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  transition: all .15s;
  backdrop-filter: blur(4px);
}
.textarea-field:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(60,100,75,.1); }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: rgba(60,100,75,.05);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(229,231,235,.5);
  color: var(--text-primary);
}
.data-table tr:hover td { background: rgba(60,100,75,.03); }
.table-empty { color: var(--text-muted); text-align: center; padding: 30px !important; }

/* ===== EVENTS LIST ===== */
.events-list { display: flex; flex-direction: column; gap: 8px; }
.event-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.event-item.info { background: var(--blue-light); }
.event-item.warning { background: #fef3c7; }
.event-item.error { background: var(--red-light); }
.event-item.success { background: var(--green-light); }
.event-time { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.event-text { flex: 1; }

/* ===== QUICK LINKS ===== */
.quick-links { display: flex; gap: 12px; flex-wrap: wrap; }
.quick-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all .15s;
}
.quick-link:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.quick-link.wb { color: #d01e2f; }
.quick-link.ozon { color: #005bff; }
.quick-link.avito { color: #00a843; }

/* ===== PRODUCT CARD ===== */
.product-card {
  display: flex;
  gap: 18px;
  padding: 16px;
  background: var(--bg-main);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.metric-item {
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.metric-value { font-size: 20px; font-weight: 700; }
.metric-label { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

.ai-analysis {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  line-height: 1.6;
}

/* ===== BADGES ===== */
.badge-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success {
  background: var(--green-light);
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
}

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-right: 6px;
}
.status-dot.green { background: var(--green); }
.status-dot.red { background: var(--red); }

.status-row {
  display: flex;
  align-items: center;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== TABS ===== */
.tabs-row {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-white);
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: fit-content;
}

.tab {
  padding: 7px 18px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .15s;
}

.tab.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(60,100,75,.2); }
.tab:hover:not(.active) { background: var(--bg-main); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== REVIEWS ===== */
.reviews-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.review-stat-card {
  text-align: center;
  padding: 16px;
  background: var(--bg-main);
  border-radius: var(--radius);
}
.rsc-value { font-size: 26px; font-weight: 700; }
.rsc-value.positive { color: var(--green); }
.rsc-value.neutral { color: var(--orange); }
.rsc-value.negative { color: var(--red); }
.rsc-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.reviews-list { display: flex; flex-direction: column; gap: 12px; }
.review-empty { color: var(--text-muted); text-align: center; padding: 30px; }

.review-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.review-item-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.review-stars { color: #f59e0b; }
.review-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.review-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ===== COMPETITOR ===== */
.competitor-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.recommendations-list { display: flex; flex-direction: column; gap: 12px; }
.rec-item {
  padding: 14px;
  background: var(--blue-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--blue);
  font-size: 13px;
  line-height: 1.6;
}

.ai-reply-result {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.ai-reply-result label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ===== AVITO ===== */
.photos-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 60px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  padding: 8px;
}
.avito-photo {
  width: 70px; height: 70px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ===== LOADING ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  gap: 14px;
}

.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: var(--text-secondary); }

/* ===== TOASTS ===== */
#toastContainer {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--text-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slideIn .25s ease;
  max-width: 320px;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.warning { background: var(--orange); }

@keyframes slideIn { from { transform: translateX(60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== UTILS ===== */
.mt-10 { margin-top: 10px; }
.section-desc { color: var(--text-secondary); font-size: 13px; margin-bottom: 14px; line-height: 1.5; }

/* ===== POSITION BADGES ===== */
.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
}
.pos-badge.top { background: var(--green-light); color: #065f46; }
.pos-badge.mid { background: #fef3c7; color: #92400e; }
.pos-badge.out { background: var(--red-light); color: #991b1b; }

.change-up { color: var(--red); font-weight: 600; }
.change-down { color: var(--green); font-weight: 600; }
.change-same { color: var(--text-muted); }

/* =============================================
   TOP-25 DUAL PLATFORM LAYOUT
   ============================================= */
.top25-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 1100px) {
  .top25-dual-grid { grid-template-columns: 1fr; }
}

.top25-platform-block {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s;
}
.top25-platform-block:hover {
  box-shadow: var(--shadow);
}

/* Platform headers */
.top25-platform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.wb-header { background: linear-gradient(135deg, #faf0f5 0%, #fff 100%); }
.ozon-header { background: linear-gradient(135deg, #eef4ff 0%, #fff 100%); }

.platform-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.platform-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.wb-dot { background: #cb11ab; box-shadow: 0 0 8px rgba(203,17,171,.3); }
.ozon-dot { background: #005bff; box-shadow: 0 0 8px rgba(0,91,255,.3); }

.platform-label {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.2px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all .15s;
}
.btn-scan-wb {
  background: #fce4ec;
  color: #9b0d6e;
}
.btn-scan-wb:hover { background: #f8bbd0; }
.btn-scan-wb:disabled { opacity: .5; cursor: not-allowed; }

.btn-scan-ozon {
  background: #e3f2fd;
  color: #0d47a1;
}
.btn-scan-ozon:hover { background: #bbdefb; }
.btn-scan-ozon:disabled { opacity: .5; cursor: not-allowed; }

/* Stats row */
.top25-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.top25-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-right: 1px solid var(--border);
}
.top25-stat:last-child { border-right: none; }
.top25-stat-val {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
.top25-stat.green .top25-stat-val { color: var(--green); }
.top25-stat.red .top25-stat-val { color: var(--red); }
.top25-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.top25-scan-time {
  padding: 6px 18px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  min-height: 10px;
}

/* Table */
.top25-table-wrap {
  overflow-x: auto;
  flex: 1;
  max-height: 620px;
  overflow-y: auto;
}
.top25-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.top25-table thead { position: sticky; top: 0; z-index: 2; }
.top25-table th {
  background: var(--accent-light);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
.top25-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f4f1;
  vertical-align: middle;
}
.top25-table tbody tr:hover { background: #f7faf7; }
.top25-table tbody tr.row-ours { background: #f0fdf4; font-weight: 600; }
.top25-table tbody tr.row-ours:hover { background: #dcfce7; }
.top25-table tbody tr.row-new td { border-left: 3px solid var(--green); }

.col-pos { width: 42px; text-align: center; }
.col-name { min-width: 120px; }
.col-price { width: 72px; text-align: right; }
.col-rating { width: 52px; text-align: center; }
.col-change { width: 60px; text-align: center; }

.top25-table .name-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Change indicators */
.chg-up { color: var(--green); font-weight: 600; }
.chg-down { color: var(--red); font-weight: 600; }
.chg-same { color: var(--text-muted); }
.chg-new {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .3px;
}

/* Dropped block */
.top25-dropped {
  border-top: 2px solid var(--red-light);
}
.dropped-header {
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  background: var(--red-light);
}
.dropped-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-bottom: 1px solid #f0f4f1;
  font-size: 12px;
}
.dropped-item:last-child { border-bottom: none; }
.dropped-pos {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: auto;
  white-space: nowrap;
}

/* ===== REVIEWS PLATFORM SWITCHER ===== */
.reviews-platform-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.rp-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg-white);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--shadow-sm);
}
.rp-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.rp-btn.active[data-rp="wb"] {
  border-color: #d01e2f;
  background: linear-gradient(135deg, #fff5f5, #fff);
  color: #d01e2f;
  box-shadow: 0 2px 12px rgba(208,30,47,.12);
}
.rp-btn.active[data-rp="ozon"] {
  border-color: #005bff;
  background: linear-gradient(135deg, #f0f5ff, #fff);
  color: #005bff;
  box-shadow: 0 2px 12px rgba(0,91,255,.12);
}
.rp-btn.active[data-rp="ym"] {
  border-color: #fc3f1d;
  background: linear-gradient(135deg, #fff5f0, #fff);
  color: #fc3f1d;
  box-shadow: 0 2px 12px rgba(252,63,29,.12);
}
.rp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rp-dot.wb-dot { background: #d01e2f; }
.rp-dot.ozon-dot { background: #005bff; }
.rp-dot.ym-dot { background: #fc3f1d; }

/* ===== ASSORTMENT (dashboard row) ===== */
.assortment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.assortment-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 28px 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.assortment-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.assortment-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.assortment-card.wb::before {
  background: linear-gradient(90deg, #d01e2f, #e84856);
}
.assortment-card.ozon::before {
  background: linear-gradient(90deg, #005bff, #4d8bff);
}
.assortment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.assortment-platform {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.3px;
}
.assortment-count {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -2px;
}
.assortment-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.assortment-updated {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.btn-assortment {
  margin-top: 12px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 7px 18px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: 0.2px;
}
.btn-assortment:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Assortment section */
.assort-count-badge {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  margin-left: 6px;
  min-width: 24px;
  text-align: center;
}
.info-tooltip {
  cursor: help;
  font-size: 14px;
  opacity: 0.5;
  transition: opacity .15s;
}
.info-tooltip:hover { opacity: 1; }

/* ===== CARD MONITOR ===== */
.cm-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.cm-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px;
  border-right: 1px solid var(--border);
  background: var(--bg-white);
  transition: background .15s;
}
.cm-stat:hover { background: #fafcfa; }
.cm-stat:last-child { border-right: none; }
.cm-stat.critical { background: linear-gradient(180deg, #fef2f2 0%, var(--bg-white) 100%); }
.cm-stat.warning { background: linear-gradient(180deg, #fffbeb 0%, var(--bg-white) 100%); }
.cm-stat-val {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}
.cm-stat.critical .cm-stat-val { color: var(--red); }
.cm-stat.warning .cm-stat-val { color: #d97706; }
.cm-stat.info .cm-stat-val { color: var(--text-primary); }
.cm-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Alert items */
.cm-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cm-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-xs);
  border-left: 4px solid transparent;
  transition: all .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.cm-alert:hover {
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.cm-alert.critical {
  background: #fef2f2;
  border-left-color: var(--red);
}
.cm-alert.warning {
  background: #fffbeb;
  border-left-color: #f59e0b;
}
.cm-alert.info {
  background: #f0f9ff;
  border-left-color: #3b82f6;
}
.cm-alert-icon { font-size: 18px; flex-shrink: 0; }
.cm-alert-text { font-size: 13px; flex: 1; }
.cm-alert-action {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}
.cm-badge-ours {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

/* Reasons */
.cm-reasons-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cm-reason {
  padding: 14px 18px;
  border-radius: var(--radius-xs);
  border-left: 4px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,.03);
  transition: transform .15s;
}
.cm-reason:hover { transform: translateX(2px); }
.cm-reason.critical { background: #fef2f2; border-left-color: var(--red); }
.cm-reason.high { background: #fff7ed; border-left-color: #f97316; }
.cm-reason.medium { background: #fffbeb; border-left-color: #f59e0b; }
.cm-reason.info { background: #f0f9ff; border-left-color: #3b82f6; }
.cm-reason-factor {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}
.cm-reason-detail {
  font-size: 12px;
  color: var(--text-secondary);
}
.cm-stock-info {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--accent-light);
  font-size: 13px;
  font-weight: 600;
}
.badge-info {
  font-size: 12px;
  background: #e0f2fe;
  color: #0369a1;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 600;
}
