/* DynPricing Admin theme overlay: sticky headers, chip polish, dark mode */
:root {
  --toggle-size: 36px;
}

/* Sticky table header and subtle backdrop */
.md-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(30, 136, 229, 0.08);
  backdrop-filter: blur(6px);
}

/* Elevated surface cards in both themes */
.surface-card {
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.tab-selector__option .material-icons-outlined {
  font-size: 16px;
  opacity: 0.7;
}
}

/* Chip cosmetics */
.chip {
  border-radius: 8px;
  padding: 6px 10px;
}

.filters-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.filters-inline__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  color: var(--md-on-surface);
}

.filters-inline__field > span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--md-muted, #64748b);
}

.filters-inline__field select,
.filters-inline__field input {
  border: none;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  padding: 8px 12px;
  font: inherit;
  color: inherit;
  min-height: 34px;
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}

.filters-inline__field select:focus,
.filters-inline__field input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.25);
  background: rgba(30, 136, 229, 0.12);
}

.filters-inline__field--narrow {
  min-width: 120px;
  max-width: 160px;
}

.filters-inline__field--grow {
  flex: 1 1 260px;
  min-width: 220px;
}

body.theme-dark .filters-inline {
  background: rgba(11, 18, 32, 0.82);
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.6);
}

body.theme-dark .filters-inline__field select,
body.theme-dark .filters-inline__field input {
  background: rgba(100, 181, 246, 0.12);
  color: var(--md-on-surface);
}

body.theme-dark .filters-inline__field select:focus,
body.theme-dark .filters-inline__field input:focus {
  background: rgba(144, 202, 249, 0.16);
}

@media (max-width: 720px) {
  .filters-inline {
    flex-direction: column;
    padding: 10px;
  }

  .filters-inline__field {
    width: 100%;
  }
}

/* Theme toggle icon swaps via data-mode attribute */
.theme-toggle .material-icons-outlined::before {
  content: attr(data-icon);
}
.theme-toggle[data-mode="dark"] .material-icons-outlined { content: 'light_mode'; }
.theme-toggle[data-mode="light"] .material-icons-outlined { content: 'dark_mode'; }

/* Ensure button has consistent size when floating */
.theme-toggle {
  width: var(--toggle-size);
  height: var(--toggle-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}


.language-switch {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 999px;
  padding: 6px 24px 6px 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}
.language-switch:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.language-switch option {
  color: #1f2937;
}
body.theme-dark .language-switch {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Dark theme palette override */
body.theme-dark {
  --md-primary: #90caf9;
  --md-primary-dark: #64b5f6;
  --md-secondary: #94a3b8;
  --md-surface: #0b1220;
  --md-background: #070d19;
  --md-error: #ef9a9a;
  --md-on-surface: #e2e8f0;
  --md-muted: #94a3b8;
}

body.theme-dark {
  background: var(--md-background);
  color: var(--md-on-surface);
}
body.theme-dark .surface-card {
  background: var(--md-surface);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.6);
}
body.theme-dark .md-table tbody tr:hover {
  background: rgba(100, 181, 246, 0.08);
}
body.theme-dark .chip { color: var(--md-on-surface); }

.table-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.table-sort .material-icons-outlined {
  font-size: 18px;
  color: var(--md-muted, #64748b);
}

.overview-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
}

.overview-card__header h2 {
  margin: 0 0 4px;
}

.overview-card__header p {
  margin: 0;
  color: var(--md-muted, #64748b);
}

.overview-table-wrapper {
  overflow: auto;
}

.overview-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.overview-item__icon {
  font-size: 18px;
  color: var(--md-muted, #94a3b8);
}

.overview-item__text {
  display: flex;
  flex-direction: column;
}

.overview-item__text .muted {
  display: block;
  margin-top: 2px;
}

.overview-row--project {
  background: rgba(30, 136, 229, 0.05);
}

.overview-row--strategy {
  background: rgba(30, 136, 229, 0.03);
}

.overview-row--rule {
  background: rgba(15, 23, 42, 0.02);
}

body.theme-dark .overview-row--project {
  background: rgba(30, 136, 229, 0.16);
}

body.theme-dark .overview-row--strategy {
  background: rgba(30, 136, 229, 0.12);
}

body.theme-dark .overview-row--rule {
  background: rgba(148, 163, 184, 0.08);
}

.link-btn {
  border: 1px solid rgba(30, 136, 229, 0.4);
  background: transparent;
  color: var(--md-primary, #1e88e5);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.link-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

body.theme-dark .link-btn {
  border-color: rgba(144, 202, 249, 0.5);
  color: var(--md-primary, #90caf9);
}

.repricing-debug {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}

.repricing-debug__panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.repricing-debug__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.repricing-debug__title {
  margin: 0;
}

.repricing-debug__helper {
  margin: 4px 0 0;
  color: var(--md-muted, #64748b);
  max-width: 640px;
}

.repricing-debug__refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.repricing-debug__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.repricing-debug__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.repricing-debug__strategy-select {
  position: relative;
}

.repricing-debug__strategy-select select {
  width: 100%;
}

.repricing-debug__strategy-spinner {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.repricing-debug__strategy-spinner .spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.repricing-debug__strategy-note {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--md-muted, #64748b);
}

.spinner--inline {
  width: 18px;
  height: 18px;
  border-width: 2px;
  display: inline-block;
  vertical-align: middle;
}

.repricing-debug__alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.repricing-debug__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.repricing-debug__endpoints {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--md-muted, #64748b);
}

.repricing-debug__endpoints div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.repricing-debug__endpoints code {
  font-family: 'Roboto Mono', monospace;
  background: rgba(15, 23, 42, 0.08);
  padding: 4px 6px;
  border-radius: 6px;
}

body.theme-dark .repricing-debug__endpoints code {
  background: rgba(148, 163, 184, 0.12);
}

.repricing-debug__strategies {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.repricing-debug__strategy-list {
  display: grid;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.repricing-debug__strategy-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.repricing-debug__strategy-item:focus-visible {
  outline: 2px solid var(--md-primary, #1e88e5);
  outline-offset: 2px;
}

.repricing-debug__strategy-item--selected {
  border-color: var(--md-primary, #1e88e5);
  box-shadow: 0 8px 18px rgba(30, 136, 229, 0.18);
}

.repricing-debug__strategy-item--applies {
  background: rgba(30, 136, 229, 0.08);
}

.repricing-debug__strategy-item--inactive {
  opacity: 0.7;
}

body.theme-dark .repricing-debug__strategy-item {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.04);
}

body.theme-dark .repricing-debug__strategy-item--applies {
  background: rgba(30, 136, 229, 0.18);
}

.repricing-debug__strategy-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.repricing-debug__strategy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--md-muted, #64748b);
}

.repricing-debug__rules {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.repricing-debug__rules-table-wrapper {
  overflow-x: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
}

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

.repricing-debug__rules-table th,
.repricing-debug__rules-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.repricing-debug__rules-table thead {
  background: rgba(15, 23, 42, 0.04);
}

body.theme-dark .repricing-debug__rules-table-wrapper {
  border-color: rgba(148, 163, 184, 0.18);
}

body.theme-dark .repricing-debug__rules-table thead {
  background: rgba(148, 163, 184, 0.08);
}

body.theme-dark .repricing-debug__rules-table th,
body.theme-dark .repricing-debug__rules-table td {
  border-bottom-color: rgba(148, 163, 184, 0.12);
}

.repricing-debug__rule-result small {
  display: block;
  margin-top: 4px;
  color: var(--md-muted, #64748b);
  max-width: 260px;
}

.repricing-debug__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}

.repricing-debug__badge--match {
  background: rgba(34, 197, 94, 0.18);
  color: #166534;
}

.repricing-debug__badge--miss {
  background: rgba(244, 63, 94, 0.18);
  color: #9f1239;
}

.repricing-debug__badge--unknown {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}

.repricing-debug__badge--active {
  background: rgba(30, 136, 229, 0.15);
  color: #0b5394;
}

.repricing-debug__badge--inactive {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}

body.theme-dark .repricing-debug__badge {
  background: rgba(148, 163, 184, 0.16);
  color: var(--md-on-surface);
}

body.theme-dark .repricing-debug__badge--match {
  background: rgba(34, 197, 94, 0.24);
  color: #a7f3d0;
}

body.theme-dark .repricing-debug__badge--miss {
  background: rgba(244, 63, 94, 0.24);
  color: #fecdd3;
}

.repricing-debug__results {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.repricing-debug__columns {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.repricing-debug__column {
  flex: 1 1 320px;
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.02);
  display: flex;
  flex-direction: column;
}

body.theme-dark .repricing-debug__column {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.06);
}

.repricing-debug__column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.repricing-debug__summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.repricing-debug__summary-card {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 16px;
  background: rgba(30, 136, 229, 0.08);
}

body.theme-dark .repricing-debug__summary-card {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(30, 136, 229, 0.18);
}

.repricing-debug__summary-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--md-muted, #64748b);
  margin-bottom: 4px;
}

.repricing-debug__summary-value {
  font-size: 20px;
  font-weight: 600;
}

.repricing-debug__timestamp {
  font-size: 13px;
  color: var(--md-muted, #64748b);
  margin: 0;
}

.repricing-debug__product-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  background: rgba(30, 136, 229, 0.08);
}

body.theme-dark .repricing-debug__product-card {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(30, 136, 229, 0.18);
}

.repricing-debug__product-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}

.repricing-debug__product-title {
  margin: 0;
  font-size: 20px;
}

.repricing-debug__product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.repricing-debug__tag {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 90px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 13px;
}

.repricing-debug__tag-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--md-muted, #64748b);
}

body.theme-dark .repricing-debug__tag {
  background: rgba(148, 163, 184, 0.18);
}

.repricing-debug__endpoints--footer {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 12px;
  margin-top: 8px;
}

body.theme-dark .repricing-debug__endpoints--footer {
  border-top-color: rgba(148, 163, 184, 0.16);
}

.json-viewer {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.02);
  height: 100%;
}

body.theme-dark .json-viewer {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.6);
}

.json-viewer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 13px;
}

body.theme-dark .json-viewer__toolbar {
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

.json-viewer__title {
  font-weight: 600;
  color: var(--md-muted, #64748b);
}

.json-viewer__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(30, 136, 229, 0.4);
  background: transparent;
  color: var(--md-primary, #1e88e5);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

body.theme-dark .json-viewer__copy {
  border-color: rgba(144, 202, 249, 0.5);
  color: var(--md-primary, #90caf9);
}

.json-viewer__copy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.json-viewer__body {
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
  max-height: 520px;
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 0 0 12px 12px;
}

body.theme-dark .json-viewer__body {
  background: rgba(15, 23, 42, 0.75);
}

.json-viewer__body-fallback {
  margin: 0;
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  line-height: 1.45;
  color: var(--md-on-surface);
  white-space: pre-wrap;
}

body.theme-dark .json-viewer__body-fallback {
  color: #e2e8f0;
}

/* Single Rules Form Styles */
.single-rule-section {
  margin: 0 0 24px;
  padding: 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.single-rule-section--domain {
  border-top: 4px solid #3b82f6;
}

.single-rule-section--products {
  border-top: 4px solid #10b981;
}

.single-rule-section--settings {
  border-top: 4px solid #f59e0b;
}

.single-rule-section--strategy {
  border-top: 4px solid #8b5cf6;
}

.single-rule-section__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 20px 24px 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--md-on-surface);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.single-rule-section--domain .single-rule-section__title {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.single-rule-section--products .single-rule-section__title {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.single-rule-section--settings .single-rule-section__title {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.single-rule-section--strategy .single-rule-section__title {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.single-rule-section__content {
  padding: 24px;
}

.single-rule-section__title small {
  display: block;
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--md-muted, #64748b);
}

.single-rule-section__title .material-icons-outlined {
  font-size: 20px;
  color: var(--md-primary, #1e88e5);
}

/* Form Grid Enhancements */
.form-grid--2-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-grid--3-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.form-row--3-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 16px 0;
  grid-column: span 3;
}

.form-row--2-checkboxes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 16px 0;
  grid-column: span 3;
}

.field--hidden {
  display: none !important;
}

/* Prevent labels from becoming grid items */
.form-grid--2-col > .field,
.form-grid--3-col > .field {
  display: flex;
  flex-direction: column;
}

/* Checkbox fields should maintain row layout even in grids */
.form-grid--2-col > .field--checkbox,
.form-grid--3-col > .field--checkbox {
  flex-direction: row !important;
  align-items: center !important;
}

.form-grid--2-col > .field > .field__label,
.form-grid--3-col > .field > .field__label {
  display: block;
}

@media (max-width: 900px) {
  .form-grid--2-col,
  .form-grid--3-col {
    grid-template-columns: 1fr;
  }
  
  .form-row--3-fields {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-row--2-checkboxes {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Fieldset Styling for Single Rules */
.single-rule-fieldset {
  margin: 0 0 20px;
  padding: 0;
  border: 2px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 
    0 4px 12px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: visible;
  position: relative;
  backdrop-filter: blur(8px);
}

.single-rule-fieldset--domain {
  border-left: 4px solid #1e88e5;
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.03) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(30, 136, 229, 0.2);
}

.single-rule-fieldset--products {
  border-left: 4px solid #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(16, 185, 129, 0.2);
}

.single-rule-fieldset--settings {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.03) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(245, 158, 11, 0.2);
}

.single-rule-fieldset--strategy {
  border-left: 4px solid #8b5cf6;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.03) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(139, 92, 246, 0.2);
}

.single-rule-fieldset > legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  padding: 0 8px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--md-on-surface);
  width: auto;
  float: none;
}

.single-rule-fieldset--domain > legend {
  color: #1e40af;
}

.single-rule-fieldset--products > legend {
  color: #065f46;
}

.single-rule-fieldset--settings > legend {
  color: #92400e;
}

.single-rule-fieldset--strategy > legend {
  color: #5b21b6;
}

.single-rule-fieldset .material-icons-outlined {
  font-size: 16px;
  opacity: 0.7;
  color: #6b7280;
}

/* Fieldset Content Padding */
.single-rule-fieldset > div:not(.fieldset-header) {
  padding: 0 20px 20px 20px;
}

.single-rule-fieldset > .fieldset-header {
  padding: 20px 20px 0 20px;
}

/* Field Styles */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field--span-2 {
  grid-column: span 2;
}

.field--span-3 {
  grid-column: span 3;
}

@media (max-width: 900px) {
  .field--span-2,
  .field--span-3 {
    grid-column: span 1;
  }
}

.field__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--md-on-surface);
  text-transform: uppercase;
}

.field__input {
  border: 2px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  padding: 14px 16px;
  font: inherit;
  color: #334155;
  min-height: 20px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
}

.field__input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(15, 23, 42, 0.1);
  background: rgba(59, 130, 246, 0.02);
  transform: translateY(-1px);
}

.field__input:hover:not(:focus) {
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.08);
}

.field__input--multi {
  min-height: 120px;
}

.field__help {
  font-size: 12px;
  color: var(--md-muted, #64748b);
  margin-top: 4px;
}

/* Checkbox Field Styles - Force inline layout */
.field--checkbox {
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px;
  padding: 6px 0;
  display: flex !important;
}

.field__checkbox {
  width: 16px;
  height: 16px;
  margin: 0 !important;
  accent-color: var(--md-primary, #1e88e5);
  cursor: pointer;
  flex-shrink: 0;
}

.field__checkbox-label {
  font-size: 14px;
  font-weight: normal !important;
  color: var(--md-on-surface);
  cursor: pointer;
  margin: 0 !important;
  display: inline !important;
}

.field__checkbox-label .material-icons-outlined {
  display: none; /* Remove icons from checkboxes */
}

/* Textarea and Label Styling */
.field__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--md-on-surface);
  margin-bottom: 0;
}

.field__input,
.field__textarea {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--md-on-surface);
  font-size: 14px;
  transition: all 0.2s ease;
}

.field__input:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--md-primary, #1e88e5);
  box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.08);
  background: rgba(255, 255, 255, 1);
}

.field__textarea {
  min-height: 72px;
  resize: vertical;
  font-family: inherit;
}

.field__description {
  font-size: 12px;
  color: var(--md-muted, #64748b);
  margin-top: 4px;
  line-height: 1.4;
}

.field__description--warning {
  color: #dc2626;
  font-weight: 500;
}

.field__help {
  font-size: 11px;
  color: var(--md-muted, #6b7280);
  margin-top: 2px;
  line-height: 1.3;
  font-style: normal;
}

/* Tab Selector Styles */
.tab-selector {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.tab-selector > * {
  margin: 0;
}

.tab-selector--product {
  background: transparent;
  border: none;
  box-shadow: none;
}

.tab-selector--strategy {
  background: transparent;
  border: none;
  box-shadow: none;
}

.tab-selector__option {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid #d1d5db !important;
  background: #ffffff !important;
  color: #374151 !important;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  justify-content: center;
  text-align: center;
  min-width: auto;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-selector__option:hover {
  background: #f9fafb;
  color: #111827;
  border-color: #9ca3af;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-selector__option--active {
  background: #000000 !important;
  color: white !important;
  font-weight: 600;
  border: 1px solid #333333 !important;
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

.tab-selector__option .material-icons-outlined {
  font-size: 14px;
  opacity: 0.8;
}

.tab-selector--product .tab-selector__option--active,
.tab-selector--strategy .tab-selector__option--active {
  background: #000000;
  color: white;
  border: 1px solid #333333;
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

/* Tab Content Styles */
.tab-content {
  margin-top: 24px;
}

.product-filter-content,
.strategy-content {
  animation: fadeIn 0.3s ease;
}

.strategy-content__subtitle {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--md-on-surface);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dark Theme Support */
body.theme-dark .single-rule-section {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.4);
}

body.theme-dark .field__input {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.24);
  color: var(--md-on-surface);
}

body.theme-dark .field__input:focus {
  background: rgba(30, 136, 229, 0.08);
  border-color: var(--md-primary, #90caf9);
  box-shadow: 0 0 0 3px rgba(144, 202, 249, 0.18);
}

body.theme-dark .tab-selector__option {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.24);
  color: var(--md-on-surface);
}

body.theme-dark .tab-selector__option:hover {
  background: rgba(30, 136, 229, 0.12);
  border-color: var(--md-primary, #90caf9);
}

body.theme-dark .tab-selector__option--active {
  background: var(--md-primary, #90caf9);
  border-color: var(--md-primary, #90caf9);
  color: #0b1220;
}

body.theme-dark .tab-selector__option--active .material-icons-outlined {
  color: #0b1220;
}

.json-node {
  display: block;
}

.json-node__row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  color: var(--md-on-surface);
}

.json-node__row--expandable {
  cursor: pointer;
}

.json-node__row--expandable:hover {
  background: rgba(30, 136, 229, 0.08);
}

.json-node__row--collapsed .material-icons-outlined {
  transform: rotate(0deg);
}

.json-node__toggle {
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 20px;
  height: 20px;
  color: var(--md-muted, #64748b);
  cursor: pointer;
}

.json-node__toggle--empty {
  width: 20px;
  height: 20px;
}

.json-node__key {
  font-weight: 600;
}

.json-node__colon {
  margin-left: -2px;
  margin-right: 4px;
  color: var(--md-muted, #94a3b8);
}

.json-node__preview {
  color: var(--md-muted, #475569);
}

.json-node__value {
  color: #0f172a;
}

body.theme-dark .json-node__preview {
  color: rgba(226, 232, 240, 0.75);
}

body.theme-dark .json-node__value {
  color: #e2e8f0;
}

.json-node__children {
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  margin-left: 10px;
  padding-left: 8px;
}

body.theme-dark .json-node__children {
  border-left-color: rgba(148, 163, 184, 0.18);
}

.json-node-enter-active,
.json-node-leave-active {
  transition: all 0.2s ease;
}

.json-node-enter-from,
.json-node-leave-to {
  opacity: 0;
  transform: translateY(-4px);
}

@media (max-width: 900px) {
  .repricing-debug {
    padding: 20px;
  }

  .repricing-debug__summary-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

.repricing-debug__actions-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Compact Button Styles */
.btn--compact {
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  min-width: auto !important;
  height: auto !important;
  line-height: 1.2 !important;
}

.btn--compact .material-icons-outlined {
  font-size: 16px !important;
  margin-right: 4px !important;
}

/* Notification Styles */
.app-notification--message {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  animation: slideIn 0.3s ease-out;
}

/* Modal Notification Overlay */
.modal-notification-overlay {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  pointer-events: none;
  width: 100%;
  max-width: 600px;
  padding: 0 20px;
}

.modal-notification {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease-out;
  pointer-events: auto;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-notification__text {
  flex: 1;
}

.modal-notification__close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.modal-notification__close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.modal-notification__close .material-icons-outlined {
  font-size: 18px;
}

.app-notification--success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.app-notification--error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.app-notification--warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.modal-notification--success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.modal-notification--error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.modal-notification--warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.app-notification__close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.app-notification__close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.app-notification__close .material-icons-outlined {
  font-size: 18px;
}

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

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Validation Error Styling */
.field__input--error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15) !important;
}

.field__error {
  color: #ef4444;
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.field__error .material-icons-outlined {
  font-size: 16px;
}

/* Form Grid Variations */
.form-grid--1-col {
  grid-template-columns: 1fr !important;
}

/* Fieldset Header with Tabs */
.fieldset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  position: relative;
}

.fieldset-header legend {
  margin: 0;
  position: static;
  float: none;
  flex: 1;
}

.fieldset-tabs {
  margin: 0;
  margin-left: 20px;
  flex-shrink: 0;
  overflow: visible;
  z-index: 10;
}
