* {
  box-sizing: border-box;
}

body.heatstroke-notification-logs-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Yu Gothic", "Meiryo", sans-serif;
  background: #f7f8fb;
  color: #1f2937;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 24px;
  background: linear-gradient(135deg, #fff7ed, #fee2e2);
  border-bottom: 1px solid #fed7aa;
}

.page-header h1 {
  margin: 0;
  font-size: 24px;
  color: #9a3412;
}

.page-subtitle,
.section-note {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-main {
  width: min(1480px, calc(100% - 32px));
  margin: 16px auto 32px;
}

.panel-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  padding: 16px;
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.section-header.compact {
  align-items: center;
}

.section-header h2 {
  margin: 0;
  font-size: 18px;
  color: #374151;
}

.filter-grid {
  display: grid;
  grid-template-columns: 180px 180px 160px 1fr;
  gap: 12px;
  align-items: end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-field label {
  font-size: 12px;
  font-weight: 700;
  color: #4b5563;
}

.filter-field input,
.filter-field select {
  min-height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 14px;
  background: #ffffff;
}

.filter-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}

.primary-button,
.secondary-button,
.detail-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

.secondary-button {
  background: #ffffff;
  color: #374151;
  border-color: #d1d5db;
}

.detail-button {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

.primary-button:hover {
  background: #c2410c;
}

.secondary-button:hover,
.detail-button:hover {
  background: #f9fafb;
}

.message-area {
  margin-bottom: 12px;
}

.message {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.message.info {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.message.error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.summary-area {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}

.list-area {
  overflow-x: auto;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

.logs-table th,
.logs-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.logs-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9fafb;
  color: #4b5563;
  font-size: 12px;
}

.logs-table tr:hover td {
  background: #fff7ed;
}

.status-badge,
.level-badge,
.boolean-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-success {
  color: #166534;
  background: #dcfce7;
}

.status-failed {
  color: #b91c1c;
  background: #fee2e2;
}

.status-skipped {
  color: #92400e;
  background: #fef3c7;
}

.level-danger {
  color: #991b1b;
  background: #fee2e2;
}

.level-strict {
  color: #9a3412;
  background: #ffedd5;
}

.level-warning {
  color: #92400e;
  background: #fef3c7;
}

.level-caution {
  color: #365314;
  background: #ecfccb;
}

.level-safe {
  color: #166534;
  background: #dcfce7;
}

.level-unknown {
  color: #374151;
  background: #f3f4f6;
}

.boolean-yes {
  color: #b91c1c;
  background: #fee2e2;
}

.boolean-no {
  color: #374151;
  background: #f3f4f6;
}

.text-muted {
  color: #9ca3af;
}

.error-text {
  color: #b91c1c;
  font-weight: 700;
}

.empty-message {
  padding: 24px;
  text-align: center;
  color: #6b7280;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1000;
  overflow-y: auto;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-panel {
  width: min(980px, 100%);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  padding: 18px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.modal-header h2 {
  margin: 0;
  color: #374151;
  font-size: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 12px;
  margin-bottom: 16px;
}

.detail-label {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.detail-value {
  font-size: 13px;
  color: #1f2937;
  word-break: break-word;
}

.detail-section {
  margin-top: 16px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #374151;
}

.message-text-box,
.forecast-json-box {
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px;
  background: #111827;
  color: #f9fafb;
  border-radius: 12px;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.forecast-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.forecast-table th,
.forecast-table td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  font-size: 13px;
  text-align: left;
}

.forecast-table th {
  background: #f9fafb;
  color: #4b5563;
}

@media (max-width: 900px) {
  .page-header,
  .section-header,
  .modal-header {
    flex-direction: column;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    width: 100%;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

.raw-json-details {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f9fafb;
}

.raw-json-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  color: #374151;
}

.raw-json-details summary:hover {
  color: #ea580c;
}

.message-text-box {
  max-height: 220px;
}

.forecast-json-box {
  max-height: 220px;
  margin-top: 10px;
}
}