/**
 * PMW Price Stats - Statystyki cenowe
 * @since 2.2.0
 */

/* ==================== SUB-TABS ==================== */

.pmw-sub-tabs {
  display: inline-flex;
  gap: 2px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  vertical-align: middle;
}

.pmw-sub-tab {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.3;
}

.pmw-sub-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
}

.pmw-sub-tab-active {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  font-weight: 500;
}

/* Upewnij się, że grupa widoków pozwala na inline sub-taby */
.pmw-group-views {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}

/* ==================== CONTAINER ==================== */

.pmw-price-stats-root {
  padding: 16px;
  min-height: 500px;
  background: #020617;
  /* Pozycjonowanie fixed ustawiane dynamicznie przez JS (initStickyHeader) */
}

.pmw-stats-container {
  max-width: 100%;
  color: #e2e8f0;
  font-size: 13px;
}

/* ==================== HEADER BAR ==================== */

.pmw-stats-header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pmw-stats-header-bar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  flex-shrink: 0;
}

.pmw-stats-header-info {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==================== DATA MODE SWITCHER ==================== */

.pmw-data-mode-switcher {
  display: inline-flex;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  overflow: hidden;
}

.pmw-data-mode-btn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.pmw-data-mode-btn:last-child {
  border-right: none;
}

.pmw-data-mode-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.05);
}

.pmw-data-mode-btn-active {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.2);
}

.pmw-data-mode-btn-active:hover {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.25);
}

/* ==================== DATA MODE INFO BAR ==================== */

.pmw-datamode-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-bottom: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(59, 130, 246, 0.04);
  border: 1px solid rgba(59, 130, 246, 0.08);
  border-radius: 6px;
}

.pmw-datamode-info-icon {
  flex-shrink: 0;
}

/* ==================== COVERAGE BANNER ==================== */

.pmw-coverage-banner {
  margin-bottom: 12px;
  padding: 12px 16px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 8px;
}

.pmw-coverage-banner-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.pmw-coverage-stats {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.pmw-coverage-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.pmw-coverage-stat strong {
  color: #e2e8f0;
  font-weight: 600;
}

.pmw-coverage-stat-clickable {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.pmw-coverage-stat-clickable:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pmw-coverage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pmw-coverage-dot-with {
  background: #3b82f6;
}

.pmw-coverage-dot-without {
  background: rgba(255, 255, 255, 0.2);
}

.pmw-coverage-bar {
  flex: 1;
  min-width: 120px;
  height: 20px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.pmw-coverage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.5s ease;
  min-width: 0;
}

.pmw-coverage-bar-label {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.pmw-coverage-bar-label-outside {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}

/* ==================== NO-DATA ROW (show all mode) ==================== */

.pmw-stats-nodata-badge {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

.pmw-stats-row-nodata .pmw-stats-nodata-cell {
  color: rgba(255, 255, 255, 0.2);
}

/* ==================== FILTERS ==================== */

.pmw-stats-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  margin-bottom: 16px;
}

.pmw-stats-filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pmw-stats-filter-group label {
  font-size: 10px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.5px;
  font-weight: 500;
}

.pmw-stats-input,
.pmw-stats-select {
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 120px;
  height: 32px;
  box-sizing: border-box;
  line-height: 1.4;
}

.pmw-stats-input:focus,
.pmw-stats-select:focus {
  border-color: rgba(59, 130, 246, 0.5);
}

.pmw-stats-input-date {
  min-width: 130px;
}

.pmw-stats-select {
  min-width: 140px;
  cursor: pointer;
}

.pmw-stats-select option {
  background: #1e293b;
  color: #e2e8f0;
}

.pmw-stats-filter-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-self: flex-end;
}

/* ==================== MULTI-SELECT ==================== */

.pmw-multiselect {
  position: relative;
  min-width: 140px;
}

.pmw-multiselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  text-align: left;
  gap: 6px;
  height: 32px;
  box-sizing: border-box;
  line-height: 1.4;
  font-family: inherit;
}

.pmw-multiselect-trigger:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.pmw-multiselect-trigger:focus,
.pmw-multiselect-open .pmw-multiselect-trigger {
  border-color: rgba(59, 130, 246, 0.5);
}

.pmw-multiselect-active {
  border-color: rgba(59, 130, 246, 0.4) !important;
  background: rgba(59, 130, 246, 0.08);
}

.pmw-multiselect-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.pmw-multiselect-arrow {
  font-size: 8px;
  opacity: 0.5;
  flex-shrink: 0;
}

.pmw-multiselect-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-width: 280px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  overflow: hidden;
}

.pmw-multiselect-search {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pmw-multiselect-search-input {
  width: 100%;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 11px;
  outline: none;
  box-sizing: border-box;
}

.pmw-multiselect-search-input:focus {
  border-color: rgba(59, 130, 246, 0.5);
}

.pmw-multiselect-options {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}

.pmw-multiselect-options::-webkit-scrollbar {
  width: 6px;
}

.pmw-multiselect-options::-webkit-scrollbar-track {
  background: transparent;
}

.pmw-multiselect-options::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.pmw-multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  color: #cbd5e1;
  transition: background 0.15s;
  user-select: none;
}

.pmw-multiselect-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pmw-multiselect-option-selected {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.08);
}

.pmw-multiselect-option-selected:hover {
  background: rgba(59, 130, 246, 0.15);
}

.pmw-multiselect-option-all {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 2px;
  padding-bottom: 8px;
  font-weight: 500;
}

.pmw-multiselect-check {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  font-size: 10px;
  flex-shrink: 0;
  transition: all 0.15s;
}

.pmw-multiselect-option-selected .pmw-multiselect-check {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.6);
  color: #93c5fd;
}

.pmw-multiselect-footer {
  padding: 6px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
}

.pmw-multiselect-clear-btn {
  padding: 3px 10px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 4px;
  color: #fca5a5;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.pmw-multiselect-clear-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ==================== BUTTONS ==================== */

.pmw-stats-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.pmw-stats-btn-primary {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.pmw-stats-btn-primary:hover {
  background: rgba(59, 130, 246, 0.3);
}

.pmw-stats-btn-send {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.pmw-stats-btn-send:hover {
  background: rgba(16, 185, 129, 0.35);
}

.pmw-stats-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.pmw-stats-btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* ==================== SEND DROPDOWN ==================== */

.pmw-send-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.pmw-send-btn-main {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-right: none !important;
}

.pmw-send-btn-arrow {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
  min-width: 28px;
  font-size: 10px;
}

.pmw-send-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 300px;
  max-width: 400px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
}

.pmw-send-dropdown-header {
  padding: 10px 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pmw-send-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #e2e8f0;
  transition: background 0.12s;
}

.pmw-send-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pmw-send-dropdown-item-default {
  color: #6ee7b7;
}

.pmw-send-dropdown-item-manage {
  color: #93c5fd;
}

.pmw-send-dropdown-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.pmw-send-dropdown-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pmw-send-dropdown-owner {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 8px;
}

.pmw-send-dropdown-badge {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pmw-send-dropdown-filters {
  font-size: 10px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  padding: 1px 6px;
  border-radius: 8px;
  white-space: nowrap;
}

.pmw-send-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 2px 0;
}

/* ==================== TEMPLATE MANAGER MODAL ==================== */

.pmw-tpl-manager-modal {
  max-width: 700px !important;
}

.pmw-tpl-manager-actions {
  margin-bottom: 16px;
  display: flex;
  justify-content: flex-end;
}

.pmw-tpl-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.pmw-tpl-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.pmw-tpl-card-default {
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.04);
}

.pmw-tpl-card-shared {
  border-color: rgba(96, 165, 250, 0.2);
}

.pmw-tpl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.pmw-tpl-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
}

.pmw-tpl-card-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pmw-tpl-card-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.pmw-tpl-badge-builtin {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.pmw-tpl-badge-public {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
}

.pmw-tpl-badge-private {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
}

.pmw-tpl-badge-owner {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.pmw-tpl-card-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
  line-height: 1.4;
}

.pmw-tpl-card-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.pmw-tpl-info-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.55);
}

.pmw-tpl-info-excluded {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}

.pmw-tpl-info-cols {
  background: rgba(96, 165, 250, 0.1);
  color: #93c5fd;
}

.pmw-tpl-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pmw-tpl-btn-sm {
  font-size: 11px !important;
  padding: 4px 10px !important;
}

.pmw-tpl-empty {
  text-align: center;
  padding: 30px 20px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
}

/* ==================== TEMPLATE EDITOR MODAL ==================== */

.pmw-tpl-editor-modal {
  max-width: 660px !important;
  max-height: 90vh !important;
}

.pmw-tpl-editor-body {
  max-height: calc(90vh - 120px);
  overflow-y: auto;
}

.pmw-tpl-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pmw-tpl-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.pmw-tpl-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0 0 12px 0;
}

.pmw-tpl-field {
  margin-bottom: 12px;
}

.pmw-tpl-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.pmw-tpl-textarea {
  resize: vertical;
  min-height: 48px;
  width: 100%;
  box-sizing: border-box;
}

.pmw-tpl-field-hint {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 4px;
}

.pmw-tpl-field-row {
  display: flex;
  gap: 12px;
}

.pmw-tpl-field-half {
  flex: 1;
}

.pmw-tpl-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 13px;
  color: #cbd5e1;
}

.pmw-tpl-checkbox-label input[type="checkbox"] {
  accent-color: #3b82f6;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Wykluczanie sklepów */
.pmw-tpl-shop-excluded-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 28px;
}

.pmw-tpl-shop-none {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  padding: 4px 0;
}

.pmw-tpl-shop-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 10px;
  font-size: 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 14px;
  color: #fca5a5;
}

.pmw-tpl-shop-tag-remove {
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  line-height: 1;
}

.pmw-tpl-shop-tag-remove:hover {
  color: #f87171;
}

.pmw-tpl-shop-search-wrap {
  position: relative;
}

.pmw-tpl-shop-search {
  width: 100%;
  box-sizing: border-box;
}

.pmw-tpl-shop-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.pmw-tpl-shop-list-empty {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
}

.pmw-tpl-shop-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 13px;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.1s;
}

.pmw-tpl-shop-list-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pmw-tpl-shop-list-item-excluded {
  background: rgba(239, 68, 68, 0.06);
  color: #fca5a5;
}

.pmw-tpl-shop-list-status {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
}

.pmw-tpl-shop-list-add {
  color: #6ee7b7;
}

/* Kolumny */
.pmw-tpl-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 6px;
}

.pmw-tpl-col-item {
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.pmw-tpl-col-item-active {
  background: rgba(59, 130, 246, 0.05);
  border-color: rgba(59, 130, 246, 0.15);
}

.pmw-tpl-col-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.1s;
  user-select: none;
}

.pmw-tpl-col-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
}

.pmw-tpl-col-option-active {
  color: #e2e8f0;
}

.pmw-tpl-col-option-locked {
  opacity: 0.6;
  cursor: default;
}

.pmw-tpl-col-option input[type="checkbox"] {
  accent-color: #3b82f6;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.pmw-tpl-col-lock {
  font-size: 10px;
  margin-left: auto;
}

.pmw-tpl-col-label-text {
  flex: 1;
  min-width: 0;
}

.pmw-tpl-col-custom-indicator {
  color: #60a5fa;
  font-weight: 600;
}

.pmw-tpl-col-original-label {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
}

.pmw-tpl-col-rename {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px 6px 30px;
}

.pmw-tpl-col-rename-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #e2e8f0;
  padding: 3px 8px;
  font-size: 11px;
  outline: none;
  transition: border-color 0.15s;
}

.pmw-tpl-col-rename-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
  font-style: italic;
}

.pmw-tpl-col-rename-input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.pmw-tpl-col-rename-clear {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.1s;
  line-height: 1;
}

.pmw-tpl-col-rename-clear:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.pmw-tpl-section-hint {
  display: block;
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  margin-bottom: 8px;
}

.pmw-stats-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
}

.pmw-stats-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
}

/* ==================== TABLE ==================== */

.pmw-stats-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.pmw-stats-table {
  width: 100%;
  min-width: 1900px;
  border-collapse: collapse;
}

.pmw-stats-th {
  padding: 10px 6px;
  text-align: center;
  vertical-align: middle;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
  white-space: normal;
  line-height: 1.3;
  transition: color 0.2s;
}

.pmw-stats-th:hover {
  color: rgba(255, 255, 255, 0.7);
}

.pmw-stats-th[title] {
  cursor: help;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.2);
}

.pmw-stats-th-sorted {
  color: #93c5fd;
}

.pmw-stats-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}

.pmw-stats-row {
  cursor: pointer;
}

.pmw-stats-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.pmw-stats-row-selected {
  background: rgba(59, 130, 246, 0.08) !important;
}

.pmw-stats-row-nodata {
  opacity: 0.55;
  cursor: default;
  background: rgba(255, 255, 255, 0.01);
}

.pmw-stats-row-nodata:hover {
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.03) !important;
}

.pmw-stats-table td {
  padding: 8px 6px;
  font-size: 12px;
  vertical-align: middle;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Poniżej min. - wyróżnienie */
.pmw-stats-below-min-yes {
  background: rgba(248, 113, 113, 0.06);
}

/* Lider cenowy - wyróżnienie */
.pmw-stats-leader-yes {
  background: rgba(74, 222, 128, 0.06);
}

.pmw-stats-pct-label {
  font-size: 10px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Product cell */
.pmw-stats-product-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pmw-stats-product-name {
  font-weight: 500;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pmw-stats-sku {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  font-family: monospace;
}

/* Prices */
.pmw-stats-price {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.pmw-stats-price-down {
  color: #f87171;
}

.pmw-stats-price-up {
  color: #4ade80;
}

.pmw-stats-price-same {
  color: rgba(255, 255, 255, 0.5);
}

.pmw-stats-price-total {
  font-weight: 600;
}

/* Shop name in min competitor column */
.pmw-stats-shop {
  font-size: 11px;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pmw-stats-shop-name {
  color: rgba(255, 255, 255, 0.85);
  cursor: default;
}

/* Top shops in summary row */
.pmw-stats-top-shops {
  padding: 2px 4px !important;
  vertical-align: middle !important;
}

.pmw-stats-top-shops-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pmw-stats-top-shop {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 9px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
}

.pmw-stats-top-shop-rank {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 10px;
}

.pmw-stats-top-shop-name {
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65px;
}

.pmw-stats-top-shop-count {
  color: #60a5fa;
  font-weight: 600;
  flex-shrink: 0;
  font-size: 9px;
}

.pmw-stats-margin-low {
  color: #fbbf24;
  font-weight: 500;
}

/* Policy */
.pmw-stats-policy {
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  white-space: nowrap;
}

/* Offers */
.pmw-stats-offers {
  white-space: nowrap;
}

.pmw-stats-offers-accepted {
  color: #4ade80;
  font-weight: 500;
}

.pmw-stats-offers-total {
  color: rgba(255, 255, 255, 0.5);
}

.pmw-stats-nodata-label {
  font-style: italic;
  color: rgba(255, 255, 255, 0.3);
}

/* ==================== BADGES ==================== */

.pmw-stats-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.pmw-stats-badge-success {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.pmw-stats-badge-danger {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.pmw-stats-badge-warning {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.pmw-stats-badge-info {
  background: rgba(147, 197, 253, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.25);
}

/* ==================== PAGINATION ==================== */

.pmw-stats-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-top: 8px;
  gap: 12px;
}

.pmw-stats-per-page {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pmw-stats-per-page-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.pmw-stats-per-page-options {
  display: flex;
  gap: 3px;
}

.pmw-stats-per-page-btn {
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 28px;
  text-align: center;
}

.pmw-stats-per-page-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.pmw-stats-per-page-active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.pmw-stats-pagination-info {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.pmw-stats-page-buttons {
  display: flex;
  gap: 4px;
}

.pmw-stats-page-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.pmw-stats-page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.pmw-stats-page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.pmw-stats-page-active {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

/* ==================== DETAIL PANEL ==================== */

.pmw-stats-detail-row td {
  padding: 0 !important;
  background: rgba(0, 0, 0, 0.15);
}

.pmw-stats-detail {
  padding: 16px;
  border-top: 2px solid rgba(59, 130, 246, 0.3);
}

.pmw-stats-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pmw-stats-detail-title h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: #f1f5f9;
}

.pmw-stats-detail-meta {
  display: inline-block;
  margin-right: 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.pmw-stats-detail-close {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.pmw-stats-detail-close:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.pmw-stats-detail-loading {
  padding: 32px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

/* Summary */
.pmw-stats-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.pmw-stats-summary-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pmw-stats-summary-item label {
  font-size: 10px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.5px;
}

.pmw-stats-summary-item span {
  font-size: 13px;
  color: #e2e8f0;
}

.pmw-stats-reason {
  font-size: 12px !important;
  color: rgba(255, 255, 255, 0.6) !important;
  line-height: 1.4;
}

/* ==================== HISTORY TIMELINE ==================== */

.pmw-stats-section {
  margin-bottom: 20px;
}

.pmw-stats-section h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #f1f5f9;
  font-weight: 500;
}

.pmw-stats-timeline {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 8px;
}

.pmw-stats-tl-item {
  flex-shrink: 0;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 160px;
}

.pmw-stats-tl-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.pmw-stats-tl-active {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}

.pmw-stats-tl-date {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 4px;
}

.pmw-stats-tl-prices {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-family: monospace;
  margin-bottom: 4px;
}

.pmw-stats-tl-arrow {
  color: rgba(255, 255, 255, 0.3);
}

.pmw-stats-tl-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pmw-stats-tl-meta small {
  color: rgba(255, 255, 255, 0.35);
  font-size: 10px;
}

.pmw-stats-tl-down .pmw-stats-tl-prices span:last-child {
  color: #f87171;
}

.pmw-stats-tl-up .pmw-stats-tl-prices span:last-child {
  color: #4ade80;
}

.pmw-stats-tl-same .pmw-stats-tl-prices span:last-child {
  color: rgba(255, 255, 255, 0.5);
}

/* ==================== OFFERS TABLE ==================== */

.pmw-stats-offers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pmw-stats-offers-header h4 {
  margin: 0;
}

.pmw-stats-offers-summary {
  display: flex;
  gap: 12px;
  font-size: 11px;
}

.pmw-stats-offers-summary .pmw-stats-offers-accepted {
  color: #4ade80;
}

.pmw-stats-offers-summary .pmw-stats-offers-rejected {
  color: #f87171;
}

.pmw-stats-source-count {
  color: rgba(255, 255, 255, 0.4);
}

.pmw-stats-offers-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

.pmw-stats-offers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pmw-stats-offers-table th {
  padding: 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.pmw-stats-offers-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.pmw-stats-offer-accepted {
  background: rgba(74, 222, 128, 0.03);
}

.pmw-stats-offer-rejected {
  background: rgba(248, 113, 113, 0.03);
  opacity: 0.7;
}

.pmw-stats-offer-rejected:hover {
  opacity: 1;
}

.pmw-stats-shop-cell {
  display: flex;
  flex-direction: column;
}

.pmw-stats-shop-name {
  font-weight: 500;
  color: #e2e8f0;
}

.pmw-stats-shop-domain {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
}

.pmw-stats-offer-title {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  max-width: 250px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pmw-stats-source {
  white-space: nowrap;
  font-size: 11px;
}

.pmw-stats-rejection-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pmw-stats-rejection-info small {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  max-width: 200px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pmw-stats-ai-check {
  color: #f87171;
  font-style: italic;
}

.pmw-stats-ai-passed {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
}

/* ==================== LOADING & EMPTY ==================== */

.pmw-stats-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px;
  color: rgba(255, 255, 255, 0.4);
}

.pmw-stats-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: pmw-stats-spin 0.8s linear infinite;
}

@keyframes pmw-stats-spin {
  to { transform: rotate(360deg); }
}

.pmw-stats-empty {
  color: rgba(255, 255, 255, 0.35);
  font-style: italic;
  font-size: 12px;
}

.pmw-stats-empty-state {
  text-align: center;
  padding: 48px;
  color: rgba(255, 255, 255, 0.4);
}

.pmw-stats-empty-state p {
  font-size: 14px;
  margin: 0;
}

/* ==================== COLUMN GROUPS ==================== */

/* Group header row */
.pmw-stats-group-row {
  border-bottom: none !important;
}

.pmw-stats-group-th {
  padding: 6px 8px !important;
  text-align: center !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  border-bottom: none !important;
  cursor: default !important;
  white-space: nowrap;
}

/* Group colors */
.pmw-stats-group-product {
  background: rgba(148, 163, 184, 0.08);
  color: rgba(148, 163, 184, 0.8);
  border-bottom: 2px solid rgba(148, 163, 184, 0.3) !important;
}

.pmw-stats-group-prices {
  background: rgba(59, 130, 246, 0.1);
  color: rgba(96, 165, 250, 0.9);
  border-bottom: 2px solid rgba(59, 130, 246, 0.35) !important;
}

.pmw-stats-group-ai {
  background: rgba(168, 85, 247, 0.1);
  color: rgba(192, 132, 252, 0.9);
  border-bottom: 2px solid rgba(168, 85, 247, 0.35) !important;
}

.pmw-stats-group-competition {
  background: rgba(245, 158, 11, 0.08);
  color: rgba(251, 191, 36, 0.85);
  border-bottom: 2px solid rgba(245, 158, 11, 0.3) !important;
}

.pmw-stats-group-margins {
  background: rgba(6, 182, 212, 0.1);
  color: rgba(34, 211, 238, 0.9);
  border-bottom: 2px solid rgba(6, 182, 212, 0.35) !important;
}

.pmw-stats-group-status {
  background: rgba(99, 102, 241, 0.1);
  color: rgba(129, 140, 248, 0.9);
  border-bottom: 2px solid rgba(99, 102, 241, 0.35) !important;
}

/* Group separators (right border between groups) */
.pmw-stats-group-product { border-right: 1px solid rgba(255, 255, 255, 0.06); }
.pmw-stats-group-prices { border-right: 1px solid rgba(255, 255, 255, 0.06); }
.pmw-stats-group-ai { border-right: 1px solid rgba(255, 255, 255, 0.06); }
.pmw-stats-group-competition { border-right: 1px solid rgba(255, 255, 255, 0.06); }
.pmw-stats-group-margins { border-right: 1px solid rgba(255, 255, 255, 0.06); }

/* ==================== COLUMN HEADER TINTS (class-based for dynamic columns) ==================== */

.pmw-stats-columns-row .pmw-stats-th.pmw-stats-col-product { background: rgba(148, 163, 184, 0.04); }
.pmw-stats-columns-row .pmw-stats-th.pmw-stats-col-prices { background: rgba(59, 130, 246, 0.04); }
.pmw-stats-columns-row .pmw-stats-th.pmw-stats-col-ai { background: rgba(168, 85, 247, 0.04); }
.pmw-stats-columns-row .pmw-stats-th.pmw-stats-col-competition { background: rgba(245, 158, 11, 0.04); }
.pmw-stats-columns-row .pmw-stats-th.pmw-stats-col-margins { background: rgba(6, 182, 212, 0.04); }
.pmw-stats-columns-row .pmw-stats-th.pmw-stats-col-status { background: rgba(99, 102, 241, 0.04); }

/* ==================== VERTICAL SEPARATORS (class-based for dynamic columns) ==================== */

.pmw-stats-col-group-first-prices,
.pmw-stats-columns-row .pmw-stats-th.pmw-stats-col-group-first-prices {
  border-left: 2px solid rgba(59, 130, 246, 0.18) !important;
}

.pmw-stats-col-group-first-ai,
.pmw-stats-columns-row .pmw-stats-th.pmw-stats-col-group-first-ai {
  border-left: 2px solid rgba(168, 85, 247, 0.18) !important;
}

.pmw-stats-col-group-first-competition,
.pmw-stats-columns-row .pmw-stats-th.pmw-stats-col-group-first-competition {
  border-left: 2px solid rgba(245, 158, 11, 0.18) !important;
}

.pmw-stats-col-group-first-margins,
.pmw-stats-columns-row .pmw-stats-th.pmw-stats-col-group-first-margins {
  border-left: 2px solid rgba(6, 182, 212, 0.18) !important;
}

.pmw-stats-col-group-first-status,
.pmw-stats-columns-row .pmw-stats-th.pmw-stats-col-group-first-status {
  border-left: 2px solid rgba(99, 102, 241, 0.18) !important;
}

/* ==================== ZEBRA STRIPING ==================== */

.pmw-stats-table tbody tr:nth-child(even):not(.pmw-stats-detail-row) {
  background-color: rgba(255, 255, 255, 0.025);
}

/* ==================== STICKY FIRST COLUMN ==================== */

.pmw-stats-columns-row .pmw-stats-th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #0a0f1f;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.pmw-stats-table tbody .pmw-stats-row td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #020617;
  border-right: 1px solid rgba(148, 163, 184, 0.08);
  text-align: left;
}

/* Sticky column: zebra stripe override */
.pmw-stats-table tbody tr:nth-child(even):not(.pmw-stats-detail-row) td:first-child {
  background: #080c1c;
}

/* Sticky column: hover override */
.pmw-stats-table tbody .pmw-stats-row:hover td:first-child {
  background: #0d1325;
}

/* Sticky column: selected override */
.pmw-stats-table tbody .pmw-stats-row-selected td:first-child {
  background: #0a1232 !important;
}

/* Sticky column: shadow separator when scrolling */
/* Note: position:sticky already creates positioning context for ::after */
.pmw-stats-table tbody .pmw-stats-row td:first-child::after,
.pmw-stats-columns-row .pmw-stats-th:first-child::after {
  content: '';
  position: absolute;
  top: 0;
  right: -6px;
  bottom: 0;
  width: 6px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.15), transparent);
  pointer-events: none;
}

/* ==================== SUMMARY ROW (TFOOT) ==================== */

.pmw-stats-table tfoot .pmw-stats-summary-row {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.04) 100%);
  border-top: 2px solid rgba(59, 130, 246, 0.35);
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.pmw-stats-table tfoot .pmw-stats-summary-row td {
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  color: #93c5fd;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  border-top: 2px solid rgba(59, 130, 246, 0.3);
  background: rgba(2, 6, 23, 0.95);
  backdrop-filter: blur(8px);
}

.pmw-stats-summary-label {
  text-align: left !important;
  color: #60a5fa !important;
  font-size: 13px !important;
}

.pmw-stats-summary-label small {
  color: #64748b;
  font-weight: 400;
}

.pmw-stats-summary-val {
  color: #e2e8f0 !important;
  font-weight: 600 !important;
}

/* Sticky first column in summary row */
.pmw-stats-table tfoot .pmw-stats-summary-row td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: rgba(2, 6, 23, 0.98);
  border-right: 1px solid rgba(148, 163, 184, 0.08);
}

.pmw-stats-table tfoot .pmw-stats-summary-row td:first-child::after {
  content: '';
  position: absolute;
  top: 0;
  right: -6px;
  bottom: 0;
  width: 6px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.15), transparent);
  pointer-events: none;
}

/* Group separators in summary row (class-based) */
.pmw-stats-table tfoot .pmw-stats-summary-row td.pmw-stats-col-group-first-prices { border-left: 2px solid rgba(59, 130, 246, 0.18); }
.pmw-stats-table tfoot .pmw-stats-summary-row td.pmw-stats-col-group-first-ai { border-left: 2px solid rgba(168, 85, 247, 0.18); }
.pmw-stats-table tfoot .pmw-stats-summary-row td.pmw-stats-col-group-first-competition { border-left: 2px solid rgba(245, 158, 11, 0.18); }
.pmw-stats-table tfoot .pmw-stats-summary-row td.pmw-stats-col-group-first-margins { border-left: 2px solid rgba(6, 182, 212, 0.18); }
.pmw-stats-table tfoot .pmw-stats-summary-row td.pmw-stats-col-group-first-status { border-left: 2px solid rgba(99, 102, 241, 0.18); }

/* Konkurencja poniżej detalu - nowa kolumna */
.pmw-stats-below-catalog-cell {
  font-size: 11px;
  vertical-align: top;
  padding: 4px 6px !important;
}

.pmw-stats-below-catalog-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pmw-stats-below-catalog-shops {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 3px;
  max-height: 120px;
  overflow-y: auto;
}

.pmw-stats-below-catalog-shop {
  display: flex;
  flex-direction: column;
  padding: 2px 4px;
  background: rgba(248, 113, 113, 0.08);
  border-radius: 3px;
  border-left: 2px solid rgba(248, 113, 113, 0.4);
}

.pmw-stats-below-catalog-shop-name {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.pmw-stats-below-catalog-shop-diff {
  font-size: 10px;
  color: #f87171;
  font-weight: 600;
}

/* Podsumowanie: konk. poniżej detalu */
.pmw-stats-below-catalog-summary-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}

.pmw-stats-below-catalog-top-shops {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 3px;
  width: 100%;
}

.pmw-stats-below-catalog-top-shop {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  line-height: 1.3;
}

.pmw-stats-below-catalog-top-shop-stats {
  color: #f87171;
  font-weight: 600;
  font-size: 9px;
  white-space: nowrap;
}

/* ==================== ALERTS SECTION ==================== */

.pmw-alerts-section {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.pmw-alert {
  flex: 1 1 0%;
  min-width: 0;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  line-height: 1 !important;
  font-size: inherit !important;
  height: auto !important;
  max-height: fit-content !important;
}

.pmw-alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: filter 0.15s;
  height: 52px;
  box-sizing: border-box;
  overflow: hidden;
  flex-wrap: nowrap;
  border-radius: 8px;
  border-left: 4px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.pmw-alert-header:hover {
  filter: brightness(0.95);
}

.pmw-alert-danger .pmw-alert-header {
  background: #fef2f2;
  border-left-color: #ef4444;
}

.pmw-alert-warning .pmw-alert-header {
  background: #fffbeb;
  border-left-color: #f59e0b;
}

.pmw-alert-info .pmw-alert-header {
  background: #eff6ff;
  border-left-color: #3b82f6;
}

.pmw-alert-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.pmw-alert-title {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pmw-alert-danger .pmw-alert-title { color: #dc2626; }
.pmw-alert-warning .pmw-alert-title { color: #d97706; }
.pmw-alert-info .pmw-alert-title { color: #2563eb; }

.pmw-alert-count {
  font-weight: 700;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pmw-alert-danger .pmw-alert-count {
  background: #fecaca;
  color: #991b1b;
}

.pmw-alert-warning .pmw-alert-count {
  background: #fde68a;
  color: #92400e;
}

.pmw-alert-info .pmw-alert-count {
  background: #bfdbfe;
  color: #1e40af;
}

.pmw-alert-desc {
  font-size: 11px;
  color: #6b7280;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pmw-alert-toggle {
  font-size: 10px;
  color: #9ca3af;
  flex-shrink: 0;
}

.pmw-alert-details {
  padding: 8px 14px 12px 18px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.06);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  margin-top: -8px;
  max-height: 200px;
  overflow-y: auto;
}

.pmw-alert-product {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.pmw-alert-product:last-child {
  border-bottom: none;
}

.pmw-alert-product-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #374151;
  font-weight: 500;
}

.pmw-alert-product-sku {
  font-size: 10px;
  color: #9ca3af;
  flex-shrink: 0;
}

.pmw-alert-product-val {
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.pmw-alert-leader-summary {
  font-size: 12px;
  color: #374151;
  line-height: 1.6;
}

/* ==================== DATE SLIDER ==================== */

.pmw-date-slider-container {
  padding: 14px 16px 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 10px;
  margin-bottom: 12px;
  transition: opacity 0.2s ease;
  position: relative;
}

.pmw-date-slider-container.pmw-date-slider-loading {
  opacity: 0.7;
}

.pmw-date-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pmw-date-slider-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pmw-date-slider-icon {
  font-size: 16px;
}

.pmw-date-slider-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 600;
}

.pmw-date-slider-current {
  font-size: 14px;
  font-weight: 700;
  color: #93c5fd;
  padding: 2px 10px;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.25s ease;
}

.pmw-date-slider-current.pmw-date-slider-latest {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.2);
}

.pmw-date-slider-info {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.pmw-date-slider-loading-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  animation: pmw-slider-pulse 0.8s ease-in-out infinite;
}

@keyframes pmw-slider-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Slider track wrapper */
.pmw-date-slider-track-wrapper {
  position: relative;
  padding: 4px 0 18px;
}

/* Custom range input */
.pmw-date-slider-input {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.3) 0%, rgba(59, 130, 246, 0.4) 70%, rgba(74, 222, 128, 0.3) 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  margin: 0;
  position: relative;
  z-index: 2;
}

/* Webkit thumb */
.pmw-date-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: 2px solid #93c5fd;
  cursor: grab;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.pmw-date-slider-input::-webkit-slider-thumb:hover {
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
  transform: scale(1.1);
}

.pmw-date-slider-input::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.7), 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Firefox thumb */
.pmw-date-slider-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: 2px solid #93c5fd;
  cursor: grab;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.pmw-date-slider-input::-moz-range-thumb:hover {
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.pmw-date-slider-input::-moz-range-track {
  height: 6px;
  background: transparent;
  border: none;
}

/* Activity dots */
.pmw-date-slider-dots {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  height: 10px;
  pointer-events: none;
}

.pmw-date-slider-dot {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  bottom: 0;
  transition: all 0.2s ease;
}

.pmw-date-slider-dot.has-data {
  background: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 3px rgba(59, 130, 246, 0.3);
}

.pmw-date-slider-dot.active {
  background: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}

.pmw-date-slider-dot.active.has-data {
  background: #60a5fa;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.7);
}

/* Date range labels */
.pmw-date-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
  margin-top: 2px;
  padding: 0 2px;
}

.pmw-date-slider-label-latest {
  color: rgba(74, 222, 128, 0.5);
  font-weight: 500;
}

.pmw-date-slider-label-all {
  color: rgba(168, 85, 247, 0.4);
  font-weight: 500;
  transition: color 0.2s ease;
}

.pmw-date-slider-label-all.active {
  color: rgba(168, 85, 247, 0.8);
}

.pmw-date-slider-current.pmw-date-slider-all {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.pmw-date-slider-dot-all {
  background: rgba(168, 85, 247, 0.45) !important;
  box-shadow: 0 0 3px rgba(168, 85, 247, 0.3) !important;
}

.pmw-date-slider-dot-all.active {
  background: #a855f7 !important;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.7) !important;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1200px) {
  .pmw-stats-filters {
    gap: 8px;
  }
  
  .pmw-stats-filter-group {
    flex: 1 1 calc(33% - 8px);
    min-width: 120px;
  }
  
  .pmw-stats-filter-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
  }
}

/* ==================== VIEW SWITCHER BAR ==================== */

.pmw-views-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  margin-bottom: 10px;
  gap: 10px;
}

.pmw-views-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pmw-views-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 600;
  margin-right: 6px;
  white-space: nowrap;
}

.pmw-views-tab {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pmw-views-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.18);
}

.pmw-views-tab-active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
  font-weight: 600;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
}

.pmw-views-tab-active:hover {
  background: rgba(59, 130, 246, 0.28);
}

.pmw-views-tab-add {
  border-style: dashed;
  border-color: rgba(74, 222, 128, 0.3);
  color: rgba(74, 222, 128, 0.6);
  background: transparent;
}

.pmw-views-tab-add:hover {
  border-color: rgba(74, 222, 128, 0.5);
  color: #4ade80;
  background: rgba(74, 222, 128, 0.08);
}

.pmw-views-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.pmw-views-action-btn {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
  line-height: 1;
}

.pmw-views-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
}

.pmw-views-action-btn-subtle {
  opacity: 0.4;
  font-size: 14px;
}

.pmw-views-action-btn-subtle:hover {
  opacity: 1;
}

/* ==================== VIEW MODAL ==================== */

.pmw-view-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pmw-view-modal {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.pmw-view-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pmw-view-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
}

.pmw-view-modal-close {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.pmw-view-modal-close:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.pmw-view-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.pmw-view-modal-name-group {
  margin-bottom: 16px;
}

.pmw-view-modal-name-group label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
  margin-bottom: 4px;
}

.pmw-view-modal-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px !important;
  font-size: 14px !important;
}

.pmw-view-modal-columns-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pmw-view-modal-columns-header span:first-child {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
}

.pmw-view-modal-columns-count {
  font-size: 11px;
  color: #93c5fd;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 10px;
}

.pmw-view-modal-group {
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
}

.pmw-view-modal-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pmw-view-modal-group-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
}

.pmw-view-modal-group-count {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

.pmw-view-modal-group-toggle {
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.pmw-view-modal-group-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

.pmw-view-modal-group-cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2px;
  padding: 6px;
}

.pmw-view-modal-col {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.pmw-view-modal-col:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
}

.pmw-view-modal-col-selected {
  color: #e2e8f0;
  background: rgba(59, 130, 246, 0.08);
}

.pmw-view-modal-col-locked {
  opacity: 0.6;
  cursor: default;
}

.pmw-view-modal-col input[type="checkbox"] {
  accent-color: #3b82f6;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.pmw-view-modal-col-lock {
  font-size: 10px;
  margin-left: auto;
}

.pmw-view-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Group header colors in modal */
.pmw-view-modal-group-header.pmw-stats-group-product .pmw-view-modal-group-name { color: rgba(148, 163, 184, 0.9); }
.pmw-view-modal-group-header.pmw-stats-group-prices .pmw-view-modal-group-name { color: rgba(96, 165, 250, 0.9); }
.pmw-view-modal-group-header.pmw-stats-group-ai .pmw-view-modal-group-name { color: rgba(192, 132, 252, 0.9); }
.pmw-view-modal-group-header.pmw-stats-group-competition .pmw-view-modal-group-name { color: rgba(251, 191, 36, 0.85); }
.pmw-view-modal-group-header.pmw-stats-group-margins .pmw-view-modal-group-name { color: rgba(34, 211, 238, 0.9); }
.pmw-view-modal-group-header.pmw-stats-group-status .pmw-view-modal-group-name { color: rgba(129, 140, 248, 0.9); }

/* ==================== ANALYTICS DASHBOARD ==================== */

.pmw-views-tab-analytics {
  border-left: 2px solid rgba(99, 102, 241, 0.3) !important;
  margin-left: 8px !important;
}

.pmw-analytics-dashboard {
  padding: 16px 0;
}

.pmw-analytics-section {
  margin-bottom: 24px;
}

.pmw-analytics-section-title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 12px 0;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid rgba(99, 102, 241, 0.6);
  border-radius: 0 6px 6px 0;
  letter-spacing: 0.3px;
}

.pmw-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}

.pmw-analytics-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pmw-analytics-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.pmw-analytics-card-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 4px 0;
}

.pmw-analytics-card-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  margin: 0 0 12px 0;
}

.pmw-analytics-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 220px;
}

.pmw-analytics-chart-wrap canvas {
  width: 100% !important;
  max-height: 280px;
}

.pmw-analytics-card-wide {
  grid-column: 1 / -1;
}

.pmw-analytics-card-wide .pmw-analytics-chart-wrap {
  min-height: 260px;
}

.pmw-analytics-card-wide .pmw-analytics-chart-wrap canvas {
  max-height: 320px;
}

/* KPI cards row */
.pmw-analytics-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.pmw-analytics-kpi {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}

.pmw-analytics-kpi-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.pmw-analytics-kpi-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pmw-analytics-kpi-green .pmw-analytics-kpi-value { color: #34d399; }
.pmw-analytics-kpi-red .pmw-analytics-kpi-value { color: #f87171; }
.pmw-analytics-kpi-blue .pmw-analytics-kpi-value { color: #60a5fa; }
.pmw-analytics-kpi-yellow .pmw-analytics-kpi-value { color: #fbbf24; }
.pmw-analytics-kpi-purple .pmw-analytics-kpi-value { color: #a78bfa; }
.pmw-analytics-kpi-cyan .pmw-analytics-kpi-value { color: #22d3ee; }

.pmw-analytics-empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
}

.pmw-analytics-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* Responsive */
@media (max-width: 900px) {
  .pmw-analytics-grid {
    grid-template-columns: 1fr;
  }
  .pmw-analytics-kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .pmw-analytics-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== CARETAKERS DASHBOARD ==================== */

.pmw-caretakers-dashboard {
  padding: 16px;
}

.pmw-caretakers-period {
  padding: 8px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  border-left: 3px solid rgba(96, 165, 250, 0.5);
  background: rgba(96, 165, 250, 0.05);
  border-radius: 0 6px 6px 0;
}

.pmw-caretakers-notice {
  color: rgba(251, 191, 36, 0.7);
  font-style: italic;
}

.pmw-caretakers-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pmw-caretakers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pmw-caretakers-table thead th {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.pmw-caretakers-table thead th.pmw-ct-num {
  text-align: center;
}

.pmw-caretakers-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
}

.pmw-ct-num {
  text-align: center !important;
  font-variant-numeric: tabular-nums;
}

.pmw-ct-bold {
  font-weight: 700;
}

.pmw-ct-name {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pmw-ct-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.pmw-ct-blurred {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  transition: filter 0.3s ease;
}

.pmw-ct-row-current {
  background: rgba(96, 165, 250, 0.08) !important;
}

.pmw-ct-row-current td {
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 500;
}

.pmw-ct-row-even {
  background: rgba(255, 255, 255, 0.015);
}

.pmw-ct-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.pmw-ct-row-summary {
  background: rgba(255, 255, 255, 0.04) !important;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.pmw-ct-row-summary td {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  padding-top: 12px;
  padding-bottom: 12px;
}

.pmw-ct-row-unassigned {
  opacity: 0.5;
  font-style: italic;
}

.pmw-ct-unassigned-label {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

.pmw-ct-accepted {
  color: #34d399 !important;
}

.pmw-ct-rejected {
  color: #f87171 !important;
}

.pmw-ct-pending {
  color: #fbbf24 !important;
}

.pmw-ct-rate {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.pmw-ct-rate-good {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.pmw-ct-rate-medium {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.pmw-ct-rate-low {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.pmw-ct-date {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}

/* Caretakers tab button */
.pmw-views-tab-caretakers {
  background: rgba(167, 139, 250, 0.1) !important;
  border-color: rgba(167, 139, 250, 0.3) !important;
}

.pmw-views-tab-caretakers.pmw-views-tab-active {
  background: rgba(167, 139, 250, 0.2) !important;
  border-color: rgba(167, 139, 250, 0.5) !important;
  color: #a78bfa !important;
}

/* Default template info box */
.pmw-tpl-default-info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}

.pmw-tpl-default-info p {
  margin: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .pmw-caretakers-table {
    font-size: 12px;
  }
  .pmw-caretakers-table thead th,
  .pmw-caretakers-table tbody td {
    padding: 8px 8px;
  }
}
