:root {
  --bg: #0b0f14;
  --fg: #e5eef7;
  --muted: #9ab;
  --card: #141a22;
  --accent: #4aa3ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Arial, Helvetica;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #223;
  position: sticky;
  top: 0;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(6px);
}

h1 {
  margin: 0;
  font-size: 20px;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}

.controls input[type="datetime-local"] {
  background: #10151c;
  color: var(--fg);
  border: 1px solid #223;
  padding: 4px 6px;
  border-radius: 6px;
}

.controls button {
  background: var(--accent);
  color: #001;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.controls .file {
  background: #10151c;
  padding: 6px 10px;
  border: 1px dashed #334;
  border-radius: 6px;
}

.controls .file input {
  display: none;
}

#importStatus {
  font-size: 12px;
  color: var(--muted);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px 20px;
}

.summary-section .tiles {
  padding: 12px 0 0;
}

.tile {
  background: var(--card);
  border: 1px solid #223;
  border-radius: 10px;
  padding: 12px;
}

.tile .label {
  color: var(--muted);
  font-size: 12px;
}

.tile .value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
}

section {
  padding: 10px 20px 20px;
}

.site-panel {
  padding-top: 18px;
}

.site-panel-shell {
  background:
    radial-gradient(circle at top right, rgba(74, 163, 255, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(19, 27, 38, 0.98), rgba(13, 18, 27, 0.98));
  border: 1px solid #27405d;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.site-panel-header,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.site-panel-header h2,
.section-heading h2 {
  margin: 0;
}

.site-panel-header .muted strong {
  color: #d9ecff;
}

.site-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #3b5f86;
  background: rgba(74, 163, 255, 0.12);
  color: #d2e8ff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.site-tiles {
  padding: 14px 0 18px;
}

.site-panel-grid > div {
  background: rgba(12, 17, 25, 0.72);
  border: 1px solid #22384f;
  border-radius: 12px;
  padding: 12px;
}

h2 {
  font-size: 16px;
  color: #cfe1f7;
}

h3 {
  font-size: 14px;
  color: #d6e4f8;
  margin: 0 0 8px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid #223;
  padding: 8px 6px;
  text-align: left;
}

tbody tr:hover {
  background: #121820;
}

td.empty {
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .site-panel-header,
  .section-heading {
    flex-direction: column;
  }
}

footer {
  padding: 14px 20px;
  border-top: 1px solid #223;
  color: var(--muted);
  font-size: 12px;
}

#xva .two-col {
  gap: 16px;
}

#xva .two-col > div {
  background: var(--card);
  border: 1px solid #223;
  border-radius: 10px;
  padding: 12px;
}

#xva .two-col table {
  margin-top: 8px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--card);
  padding: 20px;
  border-radius: 10px;
  max-height: 90%;
  overflow: auto;
  width: 90%;
  max-width: 1200px;
}

.modal-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.modal-content h2 {
  margin-top: 0;
}

.modal-content button {
  margin-top: 10px;
  background: var(--accent);
  color: #001;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

#detailTable th,
#detailTable td {
  padding: 4px 12px;
}
