/* ----------------------------------------------
   Global Styles & Google-Font (Poppins)
---------------------------------------------- */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(120deg, #f0f0f0, #dfeef4 60%, #f0f0f0);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  color: #333;
}

.app-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
  max-width: 1600px;
  width: 100%;
  margin: 40px auto;
  padding: 0 20px 40px;
  box-sizing: border-box;
}

.container {
  background: #ffffff;
  border-radius: 15px;
  box-shadow: 0 0 15px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 1200px;
  padding: 20px 30px;
  margin: 0;
}

.main-content {
  flex: 1 1 620px;
  min-width: 0;
  order: 1;
}

.overall-summary {
  margin: 10px 0 25px;
  padding: 14px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, #edf2ff 0%, #f8fbff 100%);
  border: 1px solid rgba(0, 138, 252, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.overall-summary .overall-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

#overall-counter .label {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1f3d7a;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

#overall-counter .description {
  font-size: 0.9rem;
  color: #52648f;
}

#overall-counter .value {
  font-size: 2.25rem;
  font-weight: 700;
  color: #0a7bd8;
  min-width: 3ch;
  text-align: right;
}

.overall-summary.has-issues {
  background: linear-gradient(135deg, #ffe5ea 0%, #fff5f5 100%);
  border-color: rgba(220, 53, 69, 0.35);
  box-shadow: 0 4px 14px rgba(220, 53, 69, 0.12);
}

.overall-summary.has-issues #overall-count {
  color: #dc3545;
}

.overall-summary.has-issues .label {
  color: #b21f2d;
}

.overall-summary.has-issues .description {
  color: #b75c68;
}

header {
  text-align: center;
  margin-bottom: 20px;
}
header h1 {
  font-weight: 600;
  color: #008afc;
  margin-bottom: 10px;
}
header p {
  font-size: 0.95rem;
  line-height: 1.5;
}

.inline-status {
  margin-left: 12px;
  color: #52648f;
  font-size: 0.9rem;
  vertical-align: middle;
}

.inline-status.active {
  color: #0a7bd8;
  font-weight: 600;
}

.inline-status.error {
  color: #c12d34;
  font-weight: 600;
}

.hint {
  font-size: 0.85rem;
  color: #666;
  margin: 4px 0 0 0;
}

.exchange-section {
  margin: 10px 0 20px;
}

.exchange-bar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: #f4f8ff;
  border: 1px solid #d6e0f0;
  border-radius: 10px;
  padding: 12px 16px;
}

.exchange-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.exchange-header .label {
  font-weight: 600;
  color: #1f3d7a;
}

.exchange-header .timestamp {
  font-size: 0.9rem;
  color: #4a5a7a;
}

.exchange-header .source {
  font-size: 0.85rem;
  color: #54627d;
  margin-left: auto;
}

.exchange-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.exchange-rate-item {
  background: #eef3fb;
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  border: 1px solid #d0dbf0;
  font-weight: 500;
  color: #1f3d7a;
}

.exchange-rate-item.fallback {
  border-color: #ffb400;
  background: #fff4df;
  color: #b15b00;
}

.exchange-rate-empty {
  color: #657396;
  font-size: 0.9rem;
}

.exchange-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.exchange-footer button {
  background: #008afc;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.exchange-footer button:hover {
  background: #0a7bd8;
}

.exchange-footer button.loading {
  opacity: 0.7;
  cursor: wait;
}

.exchange-error {
  font-size: 0.9rem;
  color: #c12d34;
  display: none;
}

.exchange-error.visible {
  display: inline;
}

/* Anleitung (Details) */
.instructions-details {
  margin: 10px auto;
  max-width: 600px;
  text-align: left;
}
.instructions-details summary {
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  outline: none;
}
.instructions-details p {
  margin: 10px 0 0 15px;
}

/* Abschnittstitel */
h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  font-weight: 600;
  color: #008afc;
}
h3 {
  font-weight: 500;
  margin-bottom: 10px;
}

hr {
  margin: 30px 0;
  border: none;
  border-top: 2px solid #eaeaea;
}

/* Upload-Sektion */
.upload-section {
  margin-bottom: 20px;
}

/* Drag & Drop */
.drag-drop-zone {
  border: 3px dashed #1fb070;
  padding: 30px;
  text-align: center;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-bottom: 20px;
}
.drag-drop-zone p {
  color: #777;
  font-weight: 500;
}
.drag-drop-zone.drag-over {
  background: #e0ffe0;
  border-color: #1fb070;
}

/* Produkt-Form */
.products-section {
  margin-bottom: 30px;
}
.toggle-all-btn {
  margin-bottom: 10px;
}

/* Produkt-Block */
.product-block {
  background: #fff;
  border: 1px solid #ccc;
  border-left: 4px solid #008afc;
  border-radius: 8px;
  margin: 20px 0;
  padding: 15px 20px;
  position: relative;
}
.use-product-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  margin-top: 5px;
}
label {
  display: block;
  margin-top: 12px;
  font-weight: 500;
}

/* Inputs */
input[type="text"],
textarea {
  width: 100%;
  padding: 10px;
  margin: 5px 0 15px 0;
  border: 2px solid #ccc;
  border-radius: 8px;
  transition: border-color 0.3s;
}
input[type="text"]:focus,
textarea:focus {
  border-color: #008afc;
}
textarea {
  resize: vertical;
}

/* Drei Uploadboxen */
.dropzone-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.upload-box {
  flex: 1;
  color: #fff;
  padding: 10px;
  margin: 10px 0;
  border-radius: 10px;
  transition: transform 0.3s, background-color 0.3s;
  display: flex;
  flex-direction: column;
}
.upload-box h4 {
  margin-top: 0;
  font-weight: 500;
  margin-bottom: 10px;
}
.upload-box:hover {
  transform: translateY(-3px);
}
.box-transparent {
  background: #e21c21;
}
.box-resize {
  background: #555;
}
.box-videos {
  background: #008afc;
}
/* Neue Video Links Box */
.box-video-links {
  background: #ff9800;
}
.sortable-list {
  border: 2px dashed rgba(255,255,255,0.7);
  border-radius: 10px;
  min-height: 60px;
  padding: 10px;
  background: rgba(255,255,255,0.2);
  width: 100%;
}
.preview-img {
  max-width: 80px;
  display: block;
  margin-bottom: 5px;
}.sortable-item {
  background: #fff;
  color: #333;
  padding: 5px 10px;
  margin: 5px 0;
  border-radius: 5px;
  cursor: move;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Download Icon */
.download-icon {
  margin-left: 8px;
  text-decoration: none;
  font-size: 1.2em;
  color: #fff;
  background: rgba(0,0,0,0.3);
  padding: 2px 5px;
  border-radius: 4px;
  transition: background-color 0.3s;
}
.download-icon:hover {
  background-color: rgba(0,0,0,0.6);
}

/* Buttons */
button {
  background: #008afc;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  margin-top: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.3s, transform 0.3s;
  display: inline-block;
}
button:hover {
  background-color: #1fb070;
  transform: translateY(-2px);
}

.danger-btn {
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.danger-btn:hover {
  background-color: #b21f2d;
}

.danger-btn.loading {
  opacity: 0.7;
  cursor: wait;
}

.danger-btn.success {
  background: var(--ok);
}

/* Reset Form Button (zusätzlich) */
#reset-form-btn {
  background: #e21c21;
}
#reset-form-btn:hover {
  background-color: #c00;
}

/* Meldungen */
#zip-messages,
#prod-messages {
  color: #e21c21;
  margin: 10px 0;
  font-weight: 500;
}

/* Overlay */
#wait-overlay {
  display: none;
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  transition: 0.3s;
}
#wait-overlay.active {
  display: flex;
}
#progress-container {
  width: 300px;
  text-align: center;
}
#progress-bar {
  width: 100%;
  height: 30px;
  background: #ccc;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-top: 10px;
}
#progress-fill {
  background: #1fb070;
  width: 0%;
  height: 100%;
  position: absolute;
  top: 0; 
  left: 0;
  transition: width 0.3s;
}

/* Dark Mode Toggle Panel (links) */
.collapsible-panel {
  background: #fff;
  border: 2px solid #008afc;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 0 15px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.collapsible-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.collapsible-panel .panel-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #008afc;
}

.panel-toggle {
  background: rgba(0, 138, 252, 0.12);
  border: 1px solid rgba(0, 138, 252, 0.35);
  border-radius: 6px;
  color: #008afc;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.panel-toggle:hover {
  background: #008afc;
  color: #fff;
  border-color: #008afc;
}

.collapsible-panel .panel-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.collapsible-panel.collapsed {
  flex: 0 0 auto;
  width: auto;
  padding-bottom: 12px;
}

.collapsible-panel.collapsed .panel-body {
  display: none;
}

.collapsible-panel.collapsed .panel-toggle {
  background: #008afc;
  color: #fff;
  border-color: #008afc;
}

#side-panel {
  flex: 0 0 260px;
  min-width: 230px;
  order: 0;
}

#side-panel .panel-body {
  gap: 0.75rem;
}

#side-panel .toggle-label {
  font-weight: 600;
  color: #008afc;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 1200px) {
  .app-shell {
    flex-direction: column;
    padding: 20px;
  }

  #side-panel,
  #workload-panel,
  .main-content {
    flex: 1 1 auto;
    width: 100%;
  }

  .main-content {
    order: 0;
  }

  #side-panel {
    order: 1;
  }

  #workload-panel {
    order: 2;
  }
}

#side-panel .exchange-bar {
  border-radius: 8px;
  padding: 10px 12px;
}
#side-panel .exchange-footer {
  justify-content: space-between;
}

#workload-panel {
  flex: 0 0 320px;
  min-width: 260px;
  gap: 0.9rem;
  order: 2;
}

#workload-panel .panel-body {
  gap: 0.9rem;
}

#workload-panel .estimate-item {
  background: #f4f8ff;
  border: 1px solid #d6e0f0;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#workload-panel .estimate-item.placeholder {
  background: #f8f9fb;
  border-style: dashed;
  border-color: #cdd6e3;
}

#workload-panel .estimate-label {
  font-weight: 600;
  color: #1f3d7a;
  font-size: 0.95rem;
}

#workload-panel .estimate-time {
  font-weight: 700;
  font-size: 1.1rem;
  color: #0a7bd8;
}

#workload-panel .estimate-summary,
#workload-panel .estimate-details {
  font-size: 0.85rem;
  color: #4a5a7a;
  line-height: 1.4;
}

#workload-panel .estimate-placeholder {
  font-size: 0.9rem;
  color: #657396;
}

/* Dark Mode Styles */
.dark-mode {
  background: #1f1f1f;
  color: #ccc;
}
.dark-mode .container {
  background: #2b2b2b;
}
.dark-mode .overall-summary {
  background: linear-gradient(135deg, rgba(25, 36, 64, 0.85) 0%, rgba(17, 24, 42, 0.92) 100%);
  border-color: rgba(120, 160, 255, 0.25);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
.dark-mode #overall-counter .label {
  color: #dbe7ff;
}
.dark-mode #overall-counter .description {
  color: #9db4ff;
}
.dark-mode #overall-counter .value {
  color: #7ab4ff;
}
.dark-mode .overall-summary.has-issues {
  background: linear-gradient(135deg, rgba(70, 0, 22, 0.85) 0%, rgba(112, 7, 34, 0.84) 100%);
  border-color: rgba(255, 99, 132, 0.45);
  box-shadow: 0 10px 24px rgba(112, 7, 34, 0.45);
}
.dark-mode .overall-summary.has-issues .label {
  color: #ffcdd2;
}
.dark-mode .overall-summary.has-issues .description {
  color: #ff9fb1;
}
.dark-mode .overall-summary.has-issues #overall-count {
  color: #ff8ea1;
}
.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4 {
  color: #93c2ff;
}
.dark-mode .instructions-details summary {
  color: #93c2ff;
}
.dark-mode .hint {
  color: #aebad4;
}
.dark-mode .instructions-details p {
  color: #ccc;
}
.dark-mode .exchange-bar {
  background: #2b3548;
  border-color: #3f4a62;
}
.dark-mode .exchange-header .label {
  color: #d4e2ff;
}
.dark-mode .exchange-header .timestamp {
  color: #bdc7e3;
}
.dark-mode .exchange-header .source {
  color: #95a3c7;
}
.dark-mode .exchange-rate-item {
  background: #38425a;
  border-color: #4d5873;
  color: #e3e9ff;
}
.dark-mode .exchange-rate-item.fallback {
  background: #5a4730;
  border-color: #ffb400;
  color: #ffd28a;
}
.dark-mode .exchange-rate-empty {
  color: #b0bad6;
}
.dark-mode .exchange-footer button {
  background: #1a76d2;
}
.dark-mode .exchange-footer button:hover {
  background: #135fa9;
}
.dark-mode .exchange-error {
  color: #ff9b9f;
}
.dark-mode hr {
  border-top-color: #333;
}
.dark-mode input[type="text"],
.dark-mode textarea {
  background: #444;
  color: #fff;
  border-color: #666;
}
.dark-mode input[type="text"]:focus,
.dark-mode textarea:focus {
  border-color: #008afc;
}
.dark-mode .product-block {
  background: #3a3a3a;
  border-color: #555;
}
.dark-mode .upload-box {
  background: #5f5f5f !important;
  color: #eaeaea;
  border-color: #777;
}
.dark-mode .sortable-list {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.1);
}
.dark-mode .sortable-item {
  background: #4c4c4c;
  border-color: #666;
  color: #e0e0e0;
}
.dark-mode button {
  background: #0070c0;
}
.dark-mode button:hover {
  background: #0a995e;
}
.dark-mode .danger-btn {
  background: #e55361;
}
.dark-mode .danger-btn:hover {
  background: #f06b78;
}
.dark-mode .danger-btn.success {
  background: #1fb070;
}
.dark-mode .collapsible-panel {
  background: #2b2b2b;
  border-color: #3f4a62;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.35);
}
.dark-mode .collapsible-panel .panel-title {
  color: #93c2ff;
}
.dark-mode .panel-toggle {
  background: rgba(63, 74, 98, 0.4);
  border-color: #3f4a62;
  color: #93c2ff;
}
.dark-mode .panel-toggle:hover,
.dark-mode .collapsible-panel.collapsed .panel-toggle {
  background: #1a76d2;
  border-color: #1a76d2;
  color: #fff;
}
.dark-mode #zip-messages,
.dark-mode #prod-messages {
  color: #ffa8a8;
}
.dark-mode #side-panel {
  background: #333;
  border-color: #0070c0;
  color: #fff;
}
.dark-mode #side-panel .toggle-label {
  color: #93c2ff;
}
.dark-mode #side-panel .exchange-bar {
  background: #2b3548;
  border-color: #3f4a62;
}

.dark-mode #workload-panel .panel-title {
  color: #93c2ff;
}

.dark-mode #workload-panel .estimate-item {
  background: #2b3548;
  border-color: #3f4a62;
}

.dark-mode #workload-panel .estimate-item.placeholder {
  background: #242e42;
  border-color: #3f4a62;
}

.dark-mode #workload-panel .estimate-label {
  color: #dbe7ff;
}

.dark-mode #workload-panel .estimate-time {
  color: #7ab4ff;
}

.dark-mode #workload-panel .estimate-summary,
.dark-mode #workload-panel .estimate-details {
  color: #aebad4;
}

.dark-mode #workload-panel .estimate-placeholder {
  color: #9aa7c2;
}

.error {
  color: #e21c21;
  font-weight: 500;
}

.summary {
  margin-bottom: 15px;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary .country {
  background: #f0f0f0;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 1.1rem;
}

.summary .missing-count {
  color: #e21c21;
  font-weight: 600;
}

.country {
  font-size: 1.4rem;
  margin-right: 4px;
}

.country.missing {
  background: #e21c21;
  color: #fff;
  border-radius: 3px;
  padding: 2px 4px;
}

.country.present {
  background: #1fb070;
  color: #fff;
  border-radius: 3px;
  padding: 2px 4px;
}

.country.zero {
  background: #6c757d;
  color: #fff;
  border-radius: 3px;
  padding: 2px 4px;
}

.country .psc-tag {
  margin-left: 2px;
  font-size: 0.7em;
  background: rgba(255,255,255,0.8);
  color: #000;
  border-radius: 2px;
  padding: 0 2px;
}

/* Collapsible sections */
.collapsible {
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  margin: 20px 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.collapsible h2 {
  margin: 0;
  padding: 12px 16px;
  font-size: 1.3rem;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  gap: 8px;
}
.collapsible h2::after {
  content: '\25BC';
  font-size: 0.9rem;
  margin-left: auto;
  transition: transform 0.3s;
}
.collapsible.open h2::after {
  transform: rotate(180deg);
}
.collapsible .count {
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.85rem;
  margin-left: 8px;
}
.collapsible .content {
  display: none;
  padding: 15px 20px;
}
.collapsible.open .content {
  display: block;
}

/* Dark mode adjustments */
.dark-mode .collapsible {
  background: #2b2b2b;
  border-color: #444;
}
.dark-mode .collapsible h2 {
  background: #3a3a3a;
}
.dark-mode .collapsible .count {
  background: #c12d34;
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
  font-size: 0.95rem;
}

.table-scroll {
  margin-top: 0.6rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll .analysis-table {
  margin-top: 0;
}

.analysis-table thead th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: #eef3fb;
  color: #1f3d7a;
  border-bottom: 2px solid #d6e0f0;
}

.analysis-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #e2e7f1;
  vertical-align: top;
}

.brickmerge-summary {
  margin: 0.4rem 0 0.6rem;
  font-size: 0.9rem;
  color: #4a5a7a;
}

.brickmerge-table thead th:first-child,
.brickmerge-table td:first-child {
  width: 3ch;
  text-align: center;
}

.brickmerge-table td:nth-child(5),
.brickmerge-table td:nth-child(3),
.brickmerge-table td:nth-child(4) {
  white-space: nowrap;
}

.missing-set-table td:nth-child(2) {
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.02em;
}

.missing-set-table td.muted {
  color: #888;
  font-style: italic;
}

.analysis-table tbody tr:last-child td {
  border-bottom: none;
}

.analysis-table .delta-positive {
  color: #c12d34;
  font-weight: 600;
}

.price-diff-table .required-text {
  font-weight: 600;
  color: #1f3d7a;
}

.price-diff-table .required-base,
.price-diff-table .missing-percent {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.25rem;
}

.price-diff-table .missing-amount {
  font-weight: 600;
}

.price-diff-table .recommend-cell {
  min-width: 18rem;
}

.price-diff-table .recommend-main {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-weight: 600;
  color: #1f3d7a;
}

.price-diff-table .recommend-value {
  font-size: 1.05rem;
}

.price-diff-table .recommend-min,
.price-diff-table .recommend-extra,
.price-diff-table .recommend-euro,
.price-diff-table .recommend-ending,
.price-diff-table .recommend-fallback {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.25rem;
}

.price-diff-table .recommend-extra.warning,
.price-diff-table .recommend-fallback {
  color: #c12d34;
  font-weight: 600;
}

.price-diff-table .recommend-adjust {
  margin-top: 0.6rem;
}

.price-diff-table .recommend-adjust-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #1f3d7a;
}

.price-diff-table .recommend-input-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.35rem;
}

.price-diff-table .recommend-input {
  width: 7.2rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #cbd3e3;
  border-radius: 6px;
  font-size: 0.9rem;
}

.price-diff-table .recommend-input.modified {
  border-color: #008afc;
  box-shadow: 0 0 0 3px rgba(0, 138, 252, 0.12);
}

.price-diff-table .recommend-btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  margin-top: 0;
}

.price-diff-table .recommend-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.price-diff-table .recommend-status {
  font-size: 0.78rem;
  margin-top: 0.35rem;
  color: #4a5a7a;
}

.price-diff-table .recommend-status.pending {
  font-style: italic;
  color: #5a6b8c;
}

.price-diff-table .recommend-status.success {
  color: #1fb070;
  font-weight: 600;
}

.price-diff-table .recommend-status.error {
  color: #c12d34;
  font-weight: 600;
}

.price-diff-table .recommend-status.warning {
  color: #b15b00;
  font-weight: 600;
}

.reference-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: baseline;
  margin: 0.4rem 0 0.8rem;
}

.reference-summary .label {
  font-weight: 600;
  color: #1f3d7a;
}

.reference-summary .value {
  font-weight: 600;
  font-size: 1.05rem;
}

.reference-summary .reference-eur {
  font-size: 0.9rem;
  color: #1f3d7a;
}

.reference-summary .reference-eur.fallback {
  color: #c12d34;
}

.reference-summary .reference-limit {
  font-size: 0.9rem;
  color: #555;
}
.reference-summary .reference-retry-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #8a5a00;
  background: #fff4df;
  border: 1px solid #ffe0a3;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  line-height: 1.3;
}

.reference-summary .reference-meta {
  font-size: 0.85rem;
  color: #666;
}

.reference-summary .reference-competitors {
  flex-basis: 100%;
  display: grid;
  gap: 0.2rem 0.6rem;
  margin-top: 0.1rem;
  font-size: 0.85rem;
  color: #4a5a7a;
}
.reference-summary .reference-price-breakdown {
  flex-basis: 100%;
  margin-top: 0.6rem;
}
.reference-price-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.3rem;
  font-size: 0.95rem;
}
.reference-price-table th,
.reference-price-table td {
  border: 1px solid #dbe1e8;
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
}
.reference-price-table th {
  background: #f4f6fa;
  font-weight: 600;
}
.reference-offer-shop {
  display: block;
  font-weight: 600;
  margin-bottom: 0.15rem;
  color: #1f3d7a;
}
.reference-offer-price {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1b2438;
}
.reference-offer-note {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 0.15rem;
}
.reference-offer-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: #0d6efd;
}
.reference-offer-link:hover {
  text-decoration: underline;
}

.reference-competitor-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.reference-competitor-row.missing {
  color: #808aa1;
  font-style: italic;
}

.reference-competitor-label {
  font-weight: 600;
  color: #1f3d7a;
}

.reference-competitor-source-position {
  font-weight: 400;
  font-size: 0.75em;
  opacity: 0.75;
}

.reference-competitor-row.missing .reference-competitor-label {
  color: inherit;
}

.reference-competitor-seller {
  font-weight: 500;
}

.reference-competitor-price {
  font-weight: 600;
}

.reference-competitor-link {
  font-size: 0.8rem;
  color: #0a66c2;
  text-decoration: none;
}

.reference-competitor-link:hover {
  text-decoration: underline;
}

.reference-link {
  margin-left: auto;
  font-size: 0.85rem;
  color: #0a66c2;
  text-decoration: none;
}

.reference-link:hover {
  text-decoration: underline;
}

.sanity-warning {
  color: #c12d34;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.price-sanity-placeholder {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 12px;
  padding: 16px;
  margin: 0 0 10px 0;
}

.price-sanity-placeholder .placeholder-bar {
  height: 12px;
  border-radius: 999px;
  margin: 8px 0;
}

.price-sanity-placeholder .placeholder-bar.title {
  width: 40%;
  height: 14px;
  margin-bottom: 10px;
}

.price-sanity-placeholder .placeholder-hint {
  margin: 10px 0 0;
  font-size: 0.95rem;
  color: #4b5563;
}

.loading-shimmer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 37%, #e5e7eb 63%);
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.price-sanity-table tr.sanity-fail {
  background: rgba(193, 45, 52, 0.08);
}

.price-sanity-table .status-ok {
  color: #1fb070;
  font-weight: 600;
}

.price-sanity-table .status-fail {
  color: #c12d34;
  font-weight: 600;
}

.sanity-suppressed-note {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.4rem;
}

.reference-summary .reference-calculation {
  display: block;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  color: #5a6470;
}

.reference-summary .reference-breakdown {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #444;
}

.reference-calculation-doc {
  margin-top: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: #f6f8fa;
  border: 1px solid #dce2ea;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #3a4453;
}

.reference-calculation-doc__title {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.reference-calculation-summary {
  margin: 0 0 0.4rem 0;
  color: #4d5665;
}

.reference-calculation-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
}

.reference-calculation-list dt {
  margin: 0;
  font-weight: 600;
}

.reference-calculation-list dd {
  margin: 0;
}

.reference-breakdown-title {
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.reference-breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.reference-breakdown-list li {
  margin: 0.1rem 0;
  padding: 0;
}

.reference-breakdown-note {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: #666;
}

.reference-offer-link {
  font-size: 0.8rem;
}

.price-sanity-table td.actions-cell {
  min-width: 11rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.price-sanity-table .action-btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #1f3d7a;
  background: #f4f7ff;
  color: #1f3d7a;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.price-sanity-table .action-btn:hover {
  background: #1f3d7a;
  color: #fff;
}

.price-sanity-table .action-btn:disabled,
.price-sanity-table .action-btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
}

.price-sanity-table .action-btn.success {
  background: #1fb070;
  border-color: #1fb070;
  color: #fff;
}

.price-sanity-table .action-btn.suppress-btn {
  border-color: #c12d34;
  color: #c12d34;
  background: #fff5f6;
}

.price-sanity-table .action-btn.suppress-btn:hover {
  background: #c12d34;
  color: #fff;
}

.price-sanity-table .action-btn.change-btn {
  border-color: #1f3d7a;
}

.override-note {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #1f3d7a;
}

.muted {
  color: #777;
}

.stale-sales-table .age-critical {
  color: #c12d34;
  font-weight: 600;
}

.stale-sales-table td:nth-child(4) {
  max-width: 16rem;
  white-space: normal;
}

.stale-sales-table .qty-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.zero-stock-table .age-critical {
  color: #c12d34;
  font-weight: 600;
}

.zero-stock-table td.actions-cell {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  text-align: right;
}

.zero-stock-table .action-btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #c12d34;
  background: #fff5f6;
  color: #c12d34;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.zero-stock-table .action-btn:hover {
  background: #c12d34;
  color: #fff;
}

.zero-stock-table .action-btn:disabled,
.zero-stock-table .action-btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
}

.zero-stock-table .action-btn.success {
  background: #1fb070;
  border-color: #1fb070;
  color: #fff;
}

.zero-stock-table td.actions-cell .danger-btn {
  margin-top: 0;
}

.zero-stock-table td:nth-child(2) {
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 0.9rem;
  white-space: nowrap;
}

.buybox-table .winner-own {
  color: #1fb070;
  font-weight: 600;
}

.buybox-table .winner-competitor {
  color: #c12d34;
  font-weight: 600;
}

.buybox-table td {
  word-break: break-word;
}

.buybox-table .price-cell {
  min-width: 0;
  width: 130px;
}

.buybox-table .price-main {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.buybox-table .price-shipping,
.buybox-table .price-total,
.buybox-table .price-note {
  font-size: 0.85rem;
  color: #555;
}

.buybox-table .price-total {
  font-weight: 600;
  margin-top: 0.15rem;
}

.buybox-table .price-note {
  font-style: italic;
  margin-top: 0.3rem;
  color: #6c757d;
}

.buybox-table .delta-total {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.25rem;
}

.buybox-adjust-cell {
  min-width: 0;
  width: 220px;
  vertical-align: top;
}

.buybox-adjust {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 100%;
}

.buybox-adjust-summary {
  font-size: 0.85rem;
  color: #555;
}

.buybox-adjust-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.buybox-adjust-input {
  flex: 1 1 7rem;
  min-width: 6rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid #c7ccd4;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.buybox-adjust-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.buybox-adjust-input.modified {
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.buybox-adjust-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  border: 1px solid #007bff;
  background: #008afc;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  flex: 0 0 auto;
}

.buybox-adjust-btn:hover {
  background: #006fce;
  border-color: #006fce;
}

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

.buybox-adjust-status {
  font-size: 0.85rem;
  min-height: 1.1rem;
  color: #555;
  word-break: break-word;
}

.buybox-adjust-status.pending {
  color: #ff9800;
}

.buybox-adjust-status.success {
  color: #1fb070;
}

.buybox-adjust-status.error {
  color: #c12d34;
}

.buybox-adjust-status.warning {
  color: #ff9800;
}

.buybox-change-info {
  font-size: 0.85rem;
  color: #555;
  word-break: break-word;
}

.buybox-change-info.increase {
  color: #c12d34;
  font-weight: 600;
}

.buybox-change-info.decrease {
  color: #1fb070;
  font-weight: 600;
}

.offer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.offer-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: baseline;
  padding: 0.3rem 0;
  border-bottom: 1px dotted #d9deea;
}

.offer-list li:last-child {
  border-bottom: none;
}

.offer-list li.offer-own .offer-seller {
  color: #1fb070;
}

.offer-list li.offer-winning {
  background: rgba(31,176,112,0.1);
  border-radius: 4px;
  padding: 0.25rem 0.35rem;
}

.offer-pos {
  font-weight: 600;
  color: #008afc;
  min-width: 2.2rem;
}

.offer-seller {
  font-weight: 500;
}

.offer-price {
  margin-left: auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.offer-tags {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
}

.price-de-summary {
  margin: 0.4rem 0 0.6rem 0;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.price-de-summary .label {
  color: #4a5d7a;
}

.price-de-summary .value {
  font-weight: 600;
}

.price-de-summary .max-delta {
  color: #c12d34;
  font-weight: 600;
}

.price-local {
  font-weight: 600;
}

.price-euro {
  color: #4a5d7a;
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.conversion-note {
  font-size: 0.75rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.conversion-note.fallback {
  color: #b15b00;
}

.dark-mode .analysis-table thead th {
  background: #293545;
  color: #d7e3ff;
  border-bottom-color: #3c4657;
}

.dark-mode .analysis-table td {
  border-bottom-color: #3a4454;
}

.dark-mode .analysis-table .delta-positive {
  color: #ff9097;
}

.dark-mode .brickmerge-summary {
  color: #c5d1ee;
}

.dark-mode .missing-set-table td.muted {
  color: #9aa4bd;
}

.dark-mode .price-diff-table .required-text {
  color: #d7e3ff;
}

.dark-mode .price-diff-table .required-base,
.dark-mode .price-diff-table .missing-percent {
  color: #aebbd6;
}

.dark-mode .price-diff-table .recommend-main,
.dark-mode .price-diff-table .recommend-adjust-label {
  color: #d7e3ff;
}

.dark-mode .price-diff-table .recommend-min,
.dark-mode .price-diff-table .recommend-extra,
.dark-mode .price-diff-table .recommend-euro,
.dark-mode .price-diff-table .recommend-ending,
.dark-mode .price-diff-table .recommend-status {
  color: #aebbd6;
}

.dark-mode .price-diff-table .recommend-extra.warning,
.dark-mode .price-diff-table .recommend-fallback {
  color: #ff9097;
}

.dark-mode .price-diff-table .recommend-status.success {
  color: #70d8a1;
}

.dark-mode .price-diff-table .recommend-status.warning {
  color: #ffbf66;
}

.dark-mode .price-diff-table .recommend-status.pending {
  color: #9fb1cf;
}

.dark-mode .price-diff-table .recommend-input {
  background: #1f2532;
  border-color: #3c4657;
  color: #d7e3ff;
}

.dark-mode .price-diff-table .recommend-input.modified {
  border-color: #4a9bff;
  box-shadow: 0 0 0 3px rgba(74, 155, 255, 0.2);
}

.dark-mode .price-diff-table .recommend-btn {
  background: #1a76d2;
}

.dark-mode .price-diff-table .recommend-btn:hover {
  background: #135fa9;
}

.dark-mode .price-diff-table .recommend-btn:disabled {
  background: #244b7a;
  color: #9fb9e3;
  opacity: 0.7;
  cursor: not-allowed;
}

.dark-mode .reference-summary .label {
  color: #d7e3ff;
}

.dark-mode .reference-summary .reference-eur {
  color: #b8c9ff;
}

.dark-mode .reference-summary .reference-limit {
  color: #c3cad8;
}
.dark-mode .reference-summary .reference-retry-note {
  color: #ffe4a8;
  background: rgba(255, 196, 0, 0.18);
  border-color: rgba(255, 196, 0, 0.35);
}

.dark-mode .reference-summary .reference-meta {
  color: #9aa7c4;
}

.dark-mode .reference-summary .reference-competitors {
  color: #b8c9ff;
}
.dark-mode .reference-summary .reference-price-breakdown {
  color: #d7e3ff;
}
.dark-mode .reference-price-table th {
  background: #1f2937;
  border-color: #2b3648;
}
.dark-mode .reference-price-table td {
  border-color: #2b3648;
}
.dark-mode .reference-offer-shop {
  color: #d7e3ff;
}
.dark-mode .reference-offer-price {
  color: #f0f4ff;
}
.dark-mode .reference-offer-note {
  color: #aebbd6;
}
.dark-mode .reference-offer-link {
  color: #69b1ff;
}

.dark-mode .reference-competitor-label {
  color: #d7e3ff;
}

.dark-mode .reference-competitor-source-position {
  opacity: 0.7;
}

.dark-mode .reference-competitor-row.missing {
  color: #9aa7c4;
}

.dark-mode .reference-competitor-link {
  color: #88b7ff;
}

.dark-mode .reference-link {
  color: #88b7ff;
}

.dark-mode .sanity-warning {
  color: #ff9097;
}

.dark-mode .price-sanity-placeholder {
  background: #111827;
  border-color: #1f2937;
}

.dark-mode .price-sanity-placeholder .placeholder-hint {
  color: #cbd5e1;
}

.dark-mode .loading-shimmer {
  background: linear-gradient(90deg, #1f2937 25%, #111827 37%, #1f2937 63%);
}

.dark-mode .price-sanity-table tr.sanity-fail {
  background: rgba(255, 144, 151, 0.12);
}

.dark-mode .price-sanity-table .status-ok {
  color: #70d8a1;
}

.dark-mode .price-sanity-table .status-fail {
  color: #ff9097;
}

.dark-mode .sanity-suppressed-note {
  color: #aebad4;
}

.dark-mode .reference-summary .reference-calculation {
  color: #aebad4;
}

.dark-mode .reference-summary .reference-breakdown {
  color: #c8d2f0;
}

.dark-mode .reference-calculation-doc {
  background: #1f2633;
  border-color: #2d3648;
  color: #dce3ef;
}

.dark-mode .reference-calculation-doc__title {
  color: #f1f6ff;
}

.dark-mode .reference-calculation-summary {
  color: #c4ccda;
}

.dark-mode .reference-calculation-list dt {
  color: #e3e9f5;
}

.dark-mode .reference-calculation-list dd {
  color: #d0d7e3;
}

.dark-mode .reference-breakdown-note {
  color: #aebad4;
}

.dark-mode .reference-offer-link {
  color: #88b7ff;
}

.dark-mode .price-sanity-table .action-btn {
  background: #1f2a3d;
  border-color: #4f6ac7;
  color: #c5d3ff;
}

.dark-mode .price-sanity-table .action-btn:hover {
  background: #4f6ac7;
  color: #fff;
}

.dark-mode .price-sanity-table .action-btn.suppress-btn {
  border-color: #ff9097;
  color: #ff9097;
  background: rgba(255, 144, 151, 0.12);
}

.dark-mode .price-sanity-table .action-btn.suppress-btn:hover {
  background: #ff9097;
  color: #1f1f28;
}

.dark-mode .price-sanity-table .action-btn.success {
  background: #70d8a1;
  border-color: #70d8a1;
  color: #10281f;
}

.dark-mode .zero-stock-table .action-btn {
  background: #1f2a3d;
  border-color: #ff9097;
  color: #ff9097;
}

.dark-mode .zero-stock-table .action-btn:hover {
  background: #ff9097;
  color: #1f1f28;
}

.dark-mode .zero-stock-table .action-btn.success {
  background: #70d8a1;
  border-color: #70d8a1;
  color: #10281f;
}

.dark-mode .override-note {
  color: #9bb5e6;
}

.dark-mode .muted {
  color: #9aa7c4;
}

.dark-mode .buybox-table .winner-own {
  color: #70d8a1;
}

.dark-mode .buybox-table .winner-competitor {
  color: #ff9097;
}

.dark-mode .buybox-table .price-shipping,
.dark-mode .buybox-table .price-total,
.dark-mode .buybox-table .price-note,
.dark-mode .buybox-table .delta-total {
  color: #c7d4f0;
}

.dark-mode .buybox-table .price-note {
  color: #9fb4da;
}

.dark-mode .buybox-adjust-summary,
.dark-mode .buybox-adjust-status,
.dark-mode .buybox-change-info {
  color: #c7d4f0;
}

.dark-mode .buybox-change-info.increase {
  color: #ff9097;
}

.dark-mode .buybox-change-info.decrease {
  color: #70d8a1;
}

.dark-mode .buybox-adjust-input {
  border-color: #3c4657;
  background: #131c2a;
  color: #d7e3ff;
}

.dark-mode .buybox-adjust-input:focus {
  border-color: #4a9bff;
  box-shadow: 0 0 0 2px rgba(74, 155, 255, 0.25);
}

.dark-mode .buybox-adjust-input.modified {
  border-color: #70d8a1;
  box-shadow: 0 0 0 2px rgba(112, 216, 161, 0.25);
}

.dark-mode .buybox-adjust-btn {
  background: #1a76d2;
  border-color: #1a76d2;
}

.dark-mode .buybox-adjust-btn:hover {
  background: #135fa9;
  border-color: #135fa9;
}

.dark-mode .buybox-adjust-status.pending,
.dark-mode .buybox-adjust-status.warning {
  color: #ffbf66;
}

.dark-mode .buybox-adjust-status.success {
  color: #70d8a1;
}

.dark-mode .buybox-adjust-status.error {
  color: #ff9097;
}

.dark-mode .offer-list li {
  border-bottom-color: #3b4452;
}

.dark-mode .offer-list li.offer-own .offer-seller {
  color: #70d8a1;
}

.dark-mode .offer-list li.offer-winning {
  background: rgba(31,176,112,0.18);
}

.dark-mode .offer-pos {
  color: #93c2ff;
}

.dark-mode .offer-tags {
  color: #aebad4;
}

.dark-mode .price-de-summary .label {
  color: #9bb5e6;
}

.dark-mode .price-euro {
  color: #9bb5e6;
}

.dark-mode .conversion-note {
  color: #aebad4;
}
.dark-mode .conversion-note.fallback {
  color: #ffce85;
}

.dark-mode .price-de-summary .max-delta {
  color: #ff9097;
}
#side-panel.collapsed,
#workload-panel.collapsed {
  min-width: 0;
}

/* ================================================================
   Dashboard v2 — cache-first shell and compact issue workspace
   ================================================================ */
:root {
  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --surface-strong: #edf2fa;
  --page: #eef2f8;
  --ink: #14213a;
  --ink-muted: #64718a;
  --line: #dce3ef;
  --brand: #2667ff;
  --brand-strong: #174dcc;
  --success: #178f61;
  --success-soft: #e8f7f0;
  --warning: #b86b00;
  --warning-soft: #fff4da;
  --danger: #cc3347;
  --danger-soft: #ffedf0;
  --shadow: 0 12px 36px rgba(29, 48, 84, 0.09);
}

html { scroll-behavior: smooth; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .64; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 1000;
  transform: translateY(-160%);
  padding: .65rem .9rem;
  border-radius: .65rem;
  background: var(--ink);
  color: #fff;
}
.skip-link:focus { transform: none; }

.app-shell {
  display: block;
  width: min(1480px, calc(100% - 32px));
  max-width: none;
  margin: 24px auto 64px;
  padding: 0;
}

.dashboard-main { min-width: 0; }

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 18px;
  padding: 24px 28px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 20px;
  background: linear-gradient(135deg, #152c62 0%, #225ac5 60%, #2b72ed 100%);
  color: #fff;
  box-shadow: 0 18px 45px rgba(25, 60, 135, .22);
}

.dashboard-header h1 {
  margin: 2px 0 6px;
  color: #fff;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}
.dashboard-header p { margin: 0; color: rgba(255,255,255,.78); }
.eyebrow {
  display: block;
  color: inherit;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-action,
.secondary-action {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: .62rem .9rem;
  font-weight: 750;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.primary-action { background: #fff; color: #174dcc; }
.primary-action:hover { transform: translateY(-1px); background: #f1f6ff; }
.secondary-action { background: var(--surface); color: var(--ink); border-color: var(--line); }
.secondary-action:hover { border-color: #9fb2d3; background: var(--surface-soft); }

.refresh-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: .55rem .78rem;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: .86rem;
  font-weight: 700;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #b8c8eb; }
.refresh-state[data-state="running"] .status-dot { background: #ffd879; animation: status-pulse 1.1s ease-in-out infinite; }
.refresh-state[data-state="succeeded"] .status-dot,
.refresh-state[data-state="ready"] .status-dot { background: #69e0ac; }
.refresh-state[data-state="failed"] .status-dot { background: #ff8795; }
@keyframes status-pulse { 50% { transform: scale(1.45); opacity: .55; } }

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: .5rem .7rem;
  color: rgba(255,255,255,.9);
  font-size: .86rem;
}

.snapshot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  margin-bottom: 14px;
  padding: 13px 17px;
  border: 1px solid #cbd8ed;
  border-left: 4px solid var(--brand);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(31, 57, 103, .05);
}
.snapshot-bar strong, .snapshot-bar span { display: block; }
.snapshot-bar #snapshot-detail { margin-top: 3px; color: var(--ink-muted); font-size: .88rem; }
.snapshot-bar[data-state="failed"] { border-left-color: var(--danger); }
.snapshot-bar[data-state="running"] { border-left-color: var(--warning); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}
.kpi-card {
  display: grid;
  gap: 4px;
  min-height: 126px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(30, 49, 82, .045);
}
.kpi-label { color: var(--ink-muted); font-size: .79rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.kpi-value { align-self: center; color: var(--ink); font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-value-small { font-size: 1.35rem; }
.kpi-note { align-self: end; color: var(--ink-muted); font-size: .79rem; }
.kpi-danger.has-issues { border-color: #f2bcc4; background: linear-gradient(145deg, var(--surface) 30%, var(--danger-soft)); }
.kpi-danger.has-issues .kpi-value { color: var(--danger); }

.error-center {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid #efb7bf;
  border-radius: 15px;
  background: var(--danger-soft);
}
.section-heading-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.section-heading-row h2 { margin: 3px 0 0; font-size: 1.12rem; }
.system-error-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.system-error-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid rgba(204, 51, 71, .16);
  border-radius: 10px;
  background: rgba(255,255,255,.68);
}
.system-error-item strong { font-size: .88rem; }
.system-error-item p { margin: 2px 0 0; color: #6e3540; font-size: .86rem; overflow-wrap: anywhere; }
.error-severity { padding: .2rem .45rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.error-severity.info { background: #65728a; }
.error-severity.warning { background: var(--warning); }
.error-time { color: var(--ink-muted); font-size: .75rem; white-space: nowrap; }

.source-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.source-strip-label { color: var(--ink-muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.source-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.source-chip { display: inline-flex; align-items: center; gap: 5px; padding: .27rem .5rem; border-radius: 999px; background: var(--surface-strong); color: var(--ink-muted); font-size: .75rem; font-weight: 750; }
.source-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8c99ad; }
.source-chip.ok { color: #10734d; background: var(--success-soft); }
.source-chip.ok::before { background: var(--success); }
.source-chip.error { color: #a72c3c; background: var(--danger-soft); }
.source-chip.error::before { background: var(--danger); }
.source-chip.running, .source-chip.stale { color: #8b5600; background: var(--warning-soft); }
.source-chip.running::before, .source-chip.stale::before { background: var(--warning); }

.work-toolbar {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, auto) auto;
  gap: 9px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.work-toolbar input, .work-toolbar select {
  width: 100%;
  min-height: 42px;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
.work-toolbar input:focus, .work-toolbar select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(38,103,255,.13); }

.issue-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.issue-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-muted);
  font-size: .79rem;
  font-weight: 750;
}
.issue-nav button:hover { border-color: #aab9d1; color: var(--ink); }
.issue-nav strong { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 999px; background: var(--surface-strong); color: var(--ink); font-size: .75rem; }
.issue-nav button.has-issues strong { background: var(--danger); color: #fff; }

.issue-stack { display: grid; gap: 9px; }
.collapsible.issue-section {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 4px 13px rgba(32, 51, 84, .035);
}
.collapsible.issue-section[hidden] { display: none; }
.collapsible.issue-section h2 { margin: 0; padding: 0; background: transparent; font-size: inherit; }
.collapsible.issue-section h2::after { display: none; }
.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: .94rem;
  font-weight: 790;
}
.section-toggle::after { content: "⌄"; order: 3; color: var(--ink-muted); font-size: 1.2rem; transition: transform .18s ease; }
.collapsible.open .section-toggle::after { transform: rotate(180deg); }
.section-toggle:focus-visible { outline: 3px solid rgba(38,103,255,.22); outline-offset: -3px; }
.priority-label { display: inline-grid; place-items: center; width: 23px; height: 23px; margin-right: 7px; border-radius: 7px; color: #fff; font-size: .68rem; font-weight: 900; }
.priority-a { background: var(--danger); }
.priority-b { background: var(--warning); }
.priority-c { background: #66728a; }
.collapsible .count {
  order: 2;
  min-width: 30px;
  padding: .25rem .48rem;
  margin-left: auto;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink-muted);
  text-align: center;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}
.collapsible .count.has-issues { background: var(--danger); color: #fff; }
.collapsible .count.count-neutral.has-issues { background: var(--brand); }
.collapsible .content { display: none; padding: 8px 14px 16px; overflow-x: auto; border-top: 1px solid var(--line); }
.collapsible.open .content { display: block; }
.market-section { margin-top: 5px !important; border-style: dashed !important; }
.empty-state { margin: 8px 0; padding: 14px; border-radius: 9px; background: var(--surface-soft); color: var(--ink-muted); text-align: center; }
.filter-no-results { padding: 28px; color: var(--ink-muted); text-align: center; }

.product-block { border-color: var(--line); border-radius: 11px; box-shadow: none; }
.analysis-table { min-width: 720px; font-size: .86rem; }
.analysis-table thead th { position: sticky; top: 0; background: var(--surface-strong); color: var(--ink); }
.analysis-table tr.is-filtered-out, .product-block.is-filtered-out { display: none; }
.analysis-table tbody tr:hover { background: rgba(38,103,255,.035); }

.utility-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.utility-panel > summary { padding: 13px 15px; color: var(--ink-muted); font-size: .84rem; font-weight: 800; cursor: pointer; }
.utility-grid, .estimate-grid { padding: 0 15px 15px; }
.estimate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.estimate-item { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.estimate-item span { color: var(--brand-strong); font-weight: 800; }
.estimate-item small { color: var(--ink-muted); line-height: 1.35; }

body.dark-mode {
  --surface: #151d2c;
  --surface-soft: #1a2435;
  --surface-strong: #222e42;
  --page: #0d1420;
  --ink: #edf3ff;
  --ink-muted: #a4b0c5;
  --line: #2e3b51;
  --danger-soft: #351d27;
  --warning-soft: #352a18;
  --success-soft: #163226;
  background: var(--page);
  color: var(--ink);
}
.dark-mode .dashboard-header { background: linear-gradient(135deg, #14244a, #1a4596); }
.dark-mode .system-error-item { background: rgba(17, 25, 38, .62); }
.dark-mode .system-error-item p { color: #f0b7c0; }
.dark-mode .analysis-table td, .dark-mode .analysis-table th { border-color: var(--line); color: var(--ink); }
.dark-mode .product-block, .dark-mode .exchange-bar { background: var(--surface-soft); border-color: var(--line); }

@media (max-width: 980px) {
  .dashboard-header { align-items: flex-start; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .issue-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .app-shell { width: min(100% - 18px, 1480px); margin-top: 9px; }
  .dashboard-header { display: grid; padding: 19px; border-radius: 15px; }
  .header-actions { justify-content: flex-start; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { min-height: 108px; padding: 13px; }
  .kpi-value { font-size: 1.6rem; }
  .work-toolbar { position: static; grid-template-columns: 1fr; }
  .issue-nav { display: flex; overflow-x: auto; padding-bottom: 3px; }
  .issue-nav button { min-width: 130px; }
  .snapshot-bar, .section-heading-row { align-items: flex-start; flex-direction: column; }
  .system-error-item { grid-template-columns: auto 1fr; }
  .error-time { grid-column: 2; }
  .estimate-grid { grid-template-columns: 1fr; }
  .section-toggle { min-height: 54px; padding: 10px 11px; }
  .collapsible .content { padding: 7px 10px 13px; }
}

@media (max-width: 430px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .header-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .refresh-state { grid-column: 1 / -1; }
  .theme-switch { justify-content: center; }
}
