.excel-import-panel {
  margin: 20px 0 26px;
  padding: 20px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  text-align: left;
}

.excel-import-panel h3 {
  margin-bottom: 8px;
}

.excel-import-help {
  margin: 0 0 14px;
  color: #e5e5e5;
  line-height: 1.4;
}

.excel-local-test {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 2px solid #ffd166;
  border-radius: 8px;
  background: rgba(155, 105, 0, 0.28);
  color: #fff;
  font-weight: bold;
}

.excel-import-actions {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.excel-import-file {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  font: inherit;
}

.agency-auto-import {
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
}

.unconfirmed-data-notice {
  margin: 0 0 14px;
  padding: 13px 15px;
  border: 3px solid #ff3030;
  border-radius: 9px;
  background: rgba(150, 0, 0, 0.42);
  color: #ffffff;
  text-align: center;
  animation: new-data-pulse 0.9s steps(2, start) infinite;
}

.unconfirmed-data-notice[hidden] { display: none; }

.unconfirmed-data-notice strong,
.unconfirmed-data-notice span,
.unconfirmed-data-notice small {
  display: block;
}

.unconfirmed-data-notice strong {
  color: #ff5252;
  font-size: 1.45em;
}

.unconfirmed-data-notice small { margin-top: 5px; }

@keyframes new-data-pulse {
  0%, 45% { box-shadow: 0 0 0 0 rgba(255, 45, 45, 0.2); opacity: 1; }
  50%, 100% { box-shadow: 0 0 18px 5px rgba(255, 45, 45, 0.9); opacity: 0.68; }
}

.agency-auto-heading,
.agency-auto-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agency-auto-heading {
  justify-content: space-between;
  margin-bottom: 12px;
}

.agency-auto-toggle {
  cursor: pointer;
}

.agency-auto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.agency-auto-grid > div {
  padding: 10px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.22);
}

.agency-auto-status {
  display: block;
  margin-top: 5px;
  color: #dddddd;
  line-height: 1.35;
}

.agency-auto-status.success { color: #9cff9c; }
.agency-auto-status.warning,
.agency-auto-status.working { color: #ffe18a; }
.agency-auto-status.error { color: #ffaaaa; }

.agency-auto-note {
  margin: 10px 0 0;
  color: #dddddd;
  font-size: 0.94em;
}

.excel-import-button {
  min-width: 220px;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #000;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}

.excel-import-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.excel-import-status {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.4;
  white-space: pre-line;
}

.excel-import-status.success {
  display: block;
  border: 2px solid #7cff7c;
  background: rgba(40, 130, 40, 0.25);
}

.excel-import-status.warning {
  display: block;
  border: 2px solid #ffd166;
  background: rgba(155, 105, 0, 0.28);
}

.excel-import-status.error {
  display: block;
  border: 2px solid #ff8a8a;
  background: rgba(150, 25, 25, 0.3);
}

.excel-import-preview-wrap {
  display: none;
  margin-top: 14px;
  overflow-x: auto;
}

.excel-import-preview {
  width: 100%;
  border-collapse: collapse;
  font-size: 1em;
}

.excel-import-preview th,
.excel-import-preview td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  text-align: left;
}

.excel-import-preview th:nth-child(2),
.excel-import-preview td:nth-child(2) {
  text-align: right;
}

.cik-import-panel {
  border-color: rgba(124, 255, 124, 0.65);
}

.cik-import-mode {
  margin-top: 10px;
  color: #bfffbf;
  font-weight: bold;
}

.cik-import-mode.warning {
  color: #ffe38a;
}

.demography-preview-wrap {
  display: none;
  margin-top: 18px;
}

.demography-section {
  margin-bottom: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.demography-section summary {
  padding: 14px 16px;
  font-size: 1.25em;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
}

.demography-section h4 {
  margin: 18px 16px 10px;
  font-size: 1.1em;
  text-align: left;
}

.demography-table-wrap {
  margin: 0 16px 18px;
  overflow-x: auto;
}

.demography-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.2);
}

.demography-table th,
.demography-table td {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-align: center;
}

.demography-table th:first-child {
  min-width: 180px;
  text-align: left;
}

.demography-input-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.demography-value-input {
  width: 74px;
  padding: 8px 6px;
  border: 2px solid #ffffff;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  color: #000000;
  font: inherit;
  text-align: center;
  box-sizing: border-box;
}

#demographySaveBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 800px) {
  .excel-import-actions {
    grid-template-columns: 1fr;
  }

  .excel-import-button {
    width: 100%;
  }

  .agency-auto-heading,
  .agency-auto-grid {
    display: block;
  }

  .agency-auto-toggle,
  .agency-auto-grid > div + div {
    margin-top: 10px;
  }
}
