body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(180deg, #eef2fb 0%, #f9fbff 100%);
  margin: 0;
  padding: 0 0 40px;
  color: #212b36;
}

.hidden {
  display: none !important;
}

header {
  text-align: center;
  padding: 40px 20px 30px;
  background: linear-gradient(90deg, #008afc, #1fb070);
  color: white;
  box-shadow: 0 20px 40px rgba(0, 138, 252, 0.2);
}

header h1 {
  margin: 0 0 8px;
  font-size: 2.4rem;
}

header p {
  margin: 0;
  opacity: 0.85;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(280px, 1fr);
  gap: 24px;
  max-width: 1240px;
  margin: 30px auto 0;
  padding: 0 20px;
}

.container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  padding: 28px;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.missing-dates-panel {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 20px 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 255, 0.9));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.missing-dates-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #0f172a;
}

.missing-dates-header p {
  margin: 6px 0 0;
  color: #5a6a7d;
  font-size: 0.95rem;
}

.missing-dates-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  table-layout: auto;
  min-width: 1100px;
}

.missing-dates-table col.missing-col-product {
  width: 24%;
}

.missing-dates-table col.missing-col-set {
  width: 7%;
}

.missing-dates-table col.missing-col-brickmerge {
  width: 13%;
}

.missing-dates-table col.missing-col-launch-target,
.missing-dates-table col.missing-col-eol-target {
  width: 11%;
}

.missing-dates-table col.missing-col-launch-shop,
.missing-dates-table col.missing-col-eol-shop {
  width: 16%;
}

.missing-dates-table col.missing-col-launch-cache,
.missing-dates-table col.missing-col-eol-cache {
  width: 11%;
}

.missing-dates-table col.missing-col-status {
  width: 12%;
}

.missing-dates-table th,
.missing-dates-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: left;
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
}

.missing-dates-table thead th {
  background: rgba(21, 112, 239, 0.08);
  color: #0f172a;
  font-weight: 600;
}

.missing-dates-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.03);
}

.missing-dates-table input[type="date"],
.field-editor input[type="date"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 12px;
  font-size: 0.95rem;
  background: linear-gradient(135deg, rgba(249, 251, 255, 0.95), rgba(237, 244, 255, 0.9));
  box-sizing: border-box;
  flex: 1 1 160px;
  min-width: 0;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  position: relative;
  appearance: none;
  background-repeat: no-repeat;
  background-position: calc(100% - 14px) 50%, 0 0;
  background-size: 18px 18px, auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%231571ef' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Crect width='16' height='16' x='4' y='5' rx='2.5'/%3E%3Cpath stroke-linecap='round' d='M8 3v4M16 3v4M4 11h16'/%3E%3C/svg%3E");
}

.missing-dates-table input[type="date"]::-webkit-calendar-picker-indicator,
.field-editor input[type="date"]::-webkit-calendar-picker-indicator {
  background: none;
  color: transparent;
  cursor: pointer;
  opacity: 0;
}

.missing-dates-table input[type="date"]:hover,
.field-editor input[type="date"]:hover {
  border-color: rgba(21, 112, 239, 0.4);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08), 0 6px 14px rgba(15, 23, 42, 0.08);
}

.missing-dates-table input[type="date"]:focus,
.field-editor input[type="date"]:focus {
  outline: none;
  border-color: rgba(21, 112, 239, 0.6);
  box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.18), inset 0 1px 2px rgba(15, 23, 42, 0.08);
  background: linear-gradient(135deg, rgba(243, 248, 255, 0.98), rgba(228, 240, 255, 0.95));
  transform: translateY(-1px);
}

.missing-dates-table input[type="date"].is-missing,
.field-editor input[type="date"].is-missing {
  border-color: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.missing-dates-table input[type="date"]::placeholder,
.field-editor input[type="date"]::placeholder {
  color: rgba(15, 23, 42, 0.6);
}

.missing-dates-hint {
  margin: 0 0 12px;
  color: #5a6a7d;
  font-size: 0.95rem;
}

.missing-dates-wrapper {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.table1-uploader {
  border: 1px dashed rgba(21, 112, 239, 0.35);
  border-radius: 14px;
  padding: 18px;
  background: rgba(219, 234, 254, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.table1-dropzone {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(21, 112, 239, 0.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(219, 234, 254, 0.6));
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  text-align: center;
}

.table1-dropzone strong {
  font-size: 1rem;
  color: #0f172a;
}

.table1-dropzone span {
  font-size: 0.9rem;
  color: #3b82f6;
}

.table1-dropzone.is-dragover {
  border-color: rgba(37, 99, 235, 0.8);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.table1-dropzone.is-uploading {
  opacity: 0.7;
  pointer-events: none;
}

.table1-helper {
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
}

.table1-status {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.table1-status-info {
  color: #2563eb;
}

.table1-status-success {
  color: #15803d;
}

.table1-status-warning {
  color: #b45309;
}

.table1-status-error {
  color: #dc2626;
}

.missing-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.missing-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 244, 255, 0.92));
  border: 1px solid rgba(21, 112, 239, 0.18);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.missing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.12);
}

.missing-card-warning {
  border-color: rgba(249, 115, 22, 0.35);
}

.missing-card-critical {
  border-color: rgba(220, 38, 38, 0.4);
  box-shadow: 0 18px 42px rgba(220, 38, 38, 0.15);
}

.missing-card-uploaded {
  border-color: rgba(21, 128, 61, 0.4);
  box-shadow: 0 18px 42px rgba(21, 128, 61, 0.12);
}

.missing-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.missing-card-headings {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.missing-card-title {
  margin: 0;
  font-size: 1.05rem;
  color: #0f172a;
}

.missing-card-subtitle {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.missing-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(21, 112, 239, 0.14);
  border-radius: 999px;
  color: #0f69e6;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.missing-card-link:hover {
  background: rgba(21, 112, 239, 0.24);
  transform: translateY(-1px);
}

.missing-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.missing-card-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.missing-date-column {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.missing-date-column h5 {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1d4ed8;
}

.missing-date-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.meta-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #475569;
}

.meta-label {
  font-weight: 600;
  color: #334155;
}

.meta-value {
  font-variant-numeric: tabular-nums;
}

.meta-line.is-missing .meta-value {
  color: #dc2626;
  font-weight: 600;
}

.meta-line.is-pending .meta-value {
  color: #b45309;
  font-weight: 600;
}

.field-editor.condensed {
  gap: 6px;
}

.field-editor.condensed input[type="date"] {
  flex: 1 1 auto;
  min-width: 0;
}

.field-editor.condensed button {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.missing-card-footer {
  display: flex;
  justify-content: flex-end;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
}

.status-badge.status-warning {
  background: rgba(249, 115, 22, 0.18);
  color: #b45309;
}

.status-badge.status-critical {
  background: rgba(220, 38, 38, 0.18);
  color: #b91c1c;
}

.status-badge.status-ok {
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
}

.actions-cell {
  text-align: right;
  min-width: 140px;
}

.missing-dates-table button {
  background: linear-gradient(135deg, #1570ef, #31c48d);
  border: none;
  color: white;
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.missing-dates-table button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.15);
}

.missing-dates-table button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.field-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.field-editor button {
  background: linear-gradient(135deg, #1f7ae0, #30c48d);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex: 0 0 auto;
  white-space: nowrap;
}

.field-editor button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(31, 122, 224, 0.2);
}

.action-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.action-cell button {
  background: linear-gradient(135deg, #0ea5e9, #34d399);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-cell button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(14, 165, 233, 0.25);
}

.action-cell button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.tag-removal-countdown {
  font-size: 0.8rem;
  color: #475569;
}

.tag-removal-countdown.is-active {
  color: #b91c1c;
  font-weight: 600;
}

.action-debug {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #4b5563;
  background: rgba(15, 23, 42, 0.05);
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1.3;
}

.cache-cell {
  font-size: 0.85rem;
  color: #64748b;
}

.cache-cell.cache-pending {
  color: #b91c1c;
  font-weight: 600;
}

.preorder-confirm {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #475569;
}

.preorder-confirm input {
  width: 16px;
  height: 16px;
}

.invest-cell .invest-button,
.invest-cell .invest-button.secondary {
  min-width: 110px;
}

.button-error {
  animation: buttonError 0.4s ease;
}

@keyframes buttonError {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.dashboard-header h2 {
  margin: 0;
  font-size: 1.9rem;
}

.subtitle {
  margin: 4px 0 0;
  color: #5a6a7d;
}

.overall-workload {
  background: linear-gradient(135deg, rgba(0, 138, 252, 0.12), rgba(31, 176, 112, 0.12));
  border: 1px solid rgba(0, 138, 252, 0.2);
  border-radius: 12px;
  padding: 12px 18px;
  text-align: right;
  min-width: 170px;
}

.overall-workload .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1570ef;
}

.overall-workload strong {
  font-size: 1.4rem;
  color: #0f172a;
}

.overall-workload small {
  display: block;
  margin-top: 4px;
  color: #475569;
  font-size: 0.75rem;
}

#sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

details.dashboard-section {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  overflow: visible;
  background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(249,252,255,0.9));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

details.dashboard-section[open] {
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

details.dashboard-section summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  position: relative;
}

details.dashboard-section summary::-webkit-details-marker {
  display: none;
}

details.dashboard-section summary::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-right: 2px solid #0f172a;
  border-bottom: 2px solid #0f172a;
  transform: translateY(-50%) rotate(45deg);
  transition: transform 0.2s ease;
}

details.dashboard-section[open] summary::after {
  transform: translateY(-50%) rotate(-135deg);
}

.summary-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding-right: 32px;
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.line-index {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1570ef, #31c48d);
  color: white;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.line-meta h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #0f172a;
}

.line-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.line-meta p {
  margin: 4px 0 0;
  color: #5a6a7d;
  font-size: 0.9rem;
}

.workload-chip {
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  text-align: right;
  min-width: 140px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.workload-chip span {
  display: block;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.workload-chip strong {
  font-size: 1.1rem;
  line-height: 1.3;
}

.workload-chip small {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.8);
}

.section-body {
  padding: 0 24px 24px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255,255,255,0.6);
}

.section-body.empty {
  padding: 28px;
  text-align: center;
  color: #64748b;
  font-style: italic;
}

.table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  margin-top: 18px;
  padding-bottom: 6px;
}

.table-scroll table {
  min-width: 720px;
}

.missing-dates-wrapper {
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.missing-dates-wrapper table {
  width: 100%;
  min-width: 1100px;
}

.missing-dates-table .brickmerge-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #1570ef;
  text-decoration: none;
}

.missing-dates-table .brickmerge-link::after {
  content: "↗";
  font-size: 0.75rem;
}

.missing-dates-table .brickmerge-link:hover {
  text-decoration: underline;
}

.section-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}

.section-table th,
.section-table td {
  padding: 12px 10px;
  text-align: left;
}

.section-table thead {
  background: rgba(21, 112, 239, 0.08);
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.section-table tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.03);
}

.section-table tbody tr:hover {
  background: rgba(21, 112, 239, 0.12);
  transition: background 0.15s ease;
}

.section-table tbody tr.row-error {
  background: #fee2e2;
  color: #991b1b;
}

.section-table tbody tr.row-error:hover {
  background: #fecaca;
}

.section-table tbody tr.row-critical {
  background: #fee2e2;
  color: #7f1d1d;
  font-weight: 600;
}

.missing-dates-table tbody tr.row-removing,
.section-table tbody tr.row-removing {
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

.section-table tbody tr.row-critical:hover {
  background: #fecaca;
}

.section-table tbody tr.row-warning {
  background: #fef3c7;
  color: #92400e;
}

.section-table tbody tr.row-warning:hover {
  background: #fde68a;
}

.section-table tbody td {
  font-size: 0.92rem;
  color: #1e293b;
}

.need-info-cell,
.margin-info-cell {
  position: relative;
  padding-right: 26px;
}

.need-info-content,
.margin-info-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.need-info-value,
.margin-info-value {
  font-weight: 600;
}

.need-info-indicator,
.margin-info-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.need-info-indicator:focus,
.margin-info-indicator:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.35);
}

.need-info-cell:hover .need-info-indicator,
.need-info-cell:focus-within .need-info-indicator,
.margin-info-cell:hover .margin-info-indicator,
.margin-info-cell:focus-within .margin-info-indicator {
  background: rgba(21, 112, 239, 0.95);
  transform: scale(1.05);
}

.need-info-tooltip,
.margin-info-tooltip {
  position: absolute;
  inset-inline-start: 0;
  bottom: calc(100% + 10px);
  min-width: 220px;
  max-width: 280px;
  background: #0f172a;
  color: #f8fafc;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 0.78rem;
  line-height: 1.4;
  z-index: 10;
}

.need-info-tooltip::after,
.margin-info-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 18px;
  border-width: 6px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

.need-info-tooltip strong,
.margin-info-tooltip strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: #e2e8f0;
}

.need-info-tooltip p,
.margin-info-tooltip p {
  margin: 2px 0;
}

.need-info-tooltip .need-info-basis,
.margin-info-tooltip .margin-info-basis {
  opacity: 0.8;
}

.need-info-cell:hover .need-info-tooltip,
.need-info-cell:focus-within .need-info-tooltip,
.margin-info-cell:hover .margin-info-tooltip,
.margin-info-cell:focus-within .margin-info-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.invest-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.invest-info {
  font-size: 0.9rem;
  font-weight: 500;
  color: #0f172a;
}

.invest-status {
  display: inline-block;
  background: rgba(31, 176, 112, 0.12);
  color: #0f973d;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.invest-button {
  background: linear-gradient(135deg, #1570ef, #31c48d);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.invest-button.secondary {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.invest-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.invest-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.1);
}

.badge-positive {
  color: #0f973d;
  font-weight: 600;
}

.badge-critical {
  color: #e11d48;
  font-weight: 600;
}

#insight-panel h2 {
  margin-top: 0;
  margin-bottom: 18px;
}

.insight-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.insight-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.02), rgba(21, 112, 239, 0.08));
}

.insight-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.insight-card strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.insight-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
}

.insight-card.severity-critical {
  border-left: 4px solid #e11d48;
}

.insight-card.severity-warning {
  border-left: 4px solid #f59e0b;
}

.insight-card.severity-ok {
  border-left: 4px solid #10b981;
}

.legend {
  margin-top: 30px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 20px;
}

.workload-details {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workload-detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #475569;
}

.workload-detail strong {
  color: #1f2937;
  font-weight: 600;
}

.workload-detail span {
  font-weight: 500;
}

.legend h3 {
  margin-top: 0;
  font-size: 1rem;
}

.legend ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #475569;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-flex;
}

.dot-critical { background: #e11d48; }
.dot-warning { background: #f59e0b; }
.dot-ok { background: #10b981; }

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .overall-workload {
    min-width: auto;
  }
}

@media (max-width: 640px) {
  .summary-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .workload-chip {
    align-self: stretch;
    text-align: left;
  }
}

/* Stabiler Sync-Status: sichtbar, aber nicht störend; der Datenbereich bleibt stehen. */
.sync-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(21, 112, 239, 0.18);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(236, 253, 245, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sync-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 6px rgba(100, 116, 139, 0.14);
}

.sync-indicator.sync-success { background: #10b981; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.14); }
.sync-indicator.sync-error { background: #e11d48; box-shadow: 0 0 0 6px rgba(225, 29, 72, 0.14); }
.sync-indicator.sync-running { background: #1570ef; box-shadow: 0 0 0 6px rgba(21, 112, 239, 0.14); animation: syncPulse 1.4s ease-in-out infinite; }

@keyframes syncPulse { 50% { transform: scale(1.18); opacity: 0.65; } }

.sync-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.sync-copy strong { color: #0f172a; font-size: 1rem; }
.sync-copy > span:not(.sync-eyebrow) { color: #475569; font-size: 0.86rem; }
.sync-eyebrow { color: #1570ef; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.sync-times { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 5px; color: #475569; font-size: 0.78rem; }
.sync-times b { color: #1e293b; font-variant-numeric: tabular-nums; }

.sync-button {
  border: 0;
  border-radius: 12px;
  padding: 11px 15px;
  background: #0f172a;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.sync-button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18); }
.sync-button:disabled { cursor: wait; opacity: 0.62; }

.dashboard-message { padding: 11px 14px; border-radius: 12px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: 0.88rem; }

@media (max-width: 760px) {
  header { padding: 28px 16px 22px; }
  header h1 { font-size: 1.8rem; }
  .app-shell { margin-top: 16px; padding: 0 12px; }
  .container { padding: 18px; border-radius: 14px; }
  .dashboard-header { align-items: flex-start; flex-direction: column; }
  .overall-workload { box-sizing: border-box; width: 100%; text-align: left; }
  .sync-panel { grid-template-columns: auto minmax(0, 1fr); }
  .sync-button { grid-column: 1 / -1; width: 100%; }
  details.dashboard-section summary { padding: 16px; }
  .summary-left { align-items: flex-start; gap: 12px; }
  .line-index { flex: 0 0 36px; width: 36px; height: 36px; }
  .section-body { padding: 0 14px 16px; overflow-x: auto; }
}

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