:root {
  --background: #0f172a;
  --panel: #111827;
  --card: #1e293b;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #38bdf8;
  --green: #22c55e;
  --yellow: #facc15;
  --red: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--background);
  color: var(--text);
}

.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.logo {
  width: auto;
  height: 82px;
  padding: 6px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 35%);
}

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

h2 {
  margin-top: 0;
}

.subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 19px;
}

.powered {
  margin-top: 7px;
  color: #60a5fa;
  font-size: 14px;
}

.status-ribbon {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.status-item {
  padding: 13px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
}

.green {
  background: var(--green);
}

.yellow {
  background: var(--yellow);
}

.red {
  background: var(--red);
}

.top-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  margin-bottom: 16px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

form {
  margin: 0;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

button,
select {
  min-height: 42px;
  padding: 10px 15px;
  border: 0;
  border-radius: 9px;
  font-size: 14px;
}

button {
  cursor: pointer;
}

button:hover {
  filter: brightness(0.9);
}

button.danger {
  background: #fee2e2;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.weather-summary,
.system-state {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.weather-summary div,
.system-state div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px;
  background: var(--card);
  border-radius: 10px;
}

.weather-summary span,
.system-state span {
  color: var(--muted);
}

.mimic-panel {
  overflow: hidden;
}

.mimic {
  display: grid;
  grid-template-columns: 1fr 70px 1fr 70px 1fr;
  align-items: center;
  gap: 10px;
}

.asset {
  min-height: 160px;
  padding: 20px;
  background: var(--card);
  border-radius: 15px;
  text-align: center;
}

.asset-icon {
  font-size: 38px;
}

.asset-name {
  margin-top: 8px;
  color: var(--muted);
}

.asset-value {
  margin-top: 10px;
  color: var(--cyan);
  font-size: 28px;
  font-weight: 700;
}

.asset-detail {
  margin-top: 8px;
}

.arrow {
  color: var(--cyan);
  font-size: 36px;
  text-align: center;
}

.tank {
  position: relative;
  height: 70px;
  margin-top: 12px;
  overflow: hidden;
  border: 2px solid #64748b;
  border-radius: 10px;
}

.tank-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  background: #0ea5e9;
  transition: height 0.6s ease;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  padding: 17px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.metric-label {
  color: #e2e8f0;
  font-size: 14px;
}

.metric-value {
  margin-top: 7px;
  color: var(--cyan);
  font-size: 28px;
  font-weight: 700;
}

.ok-text {
  color: var(--green);
}

.warn-text {
  color: var(--yellow);
}

.bad-text {
  color: var(--red);
}

.recommendation {
  color: var(--cyan);
  font-size: 22px;
  font-weight: 700;
}

code {
  color: #bfdbfe;
}

@media (max-width: 1150px) {
  .status-ribbon {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .header {
    align-items: flex-start;
  }

  .logo {
    height: 65px;
  }

  h1 {
    font-size: 28px;
  }

  .status-ribbon,
  .metric-grid {
    grid-template-columns: 1fr;
  }

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

  .arrow {
    transform: rotate(90deg);
  }
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 16px;
}

.chart-box {
  min-height: 250px;
  padding: 16px;
  background: var(--card);
  border-radius: 12px;
}

.chart-box h3 {
  margin-top: 0;
}

.chart-box canvas {
  width: 100%;
  height: 190px;
}

.two-column-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-grid {
  display: grid;
  gap: 10px;
}

.detail-grid div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 11px;
  background: var(--card);
  border-radius: 9px;
}

.detail-grid span {
  color: var(--muted);
}

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

.download-button {
  padding: 10px 14px;
  color: #0f172a;
  background: #e2e8f0;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 700;
}

.register-table {
  width: 100%;
  border-collapse: collapse;
}

.register-table th,
.register-table td {
  padding: 11px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.register-table th {
  color: var(--muted);
}

.event-log {
  max-height: 260px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 13px;
}

.event-row {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

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