:root {
  --bg: #06131a;
  --border: rgba(195, 225, 235, 0.16);
  --text: #f4fbff;
  --muted: #a8c2cc;
  --accent: #9ef01a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(98, 210, 255, 0.14), transparent 28%),
    linear-gradient(180deg, #08161d 0%, #06131a 100%);
  color: var(--text);
  font-family: "Noto Sans JP", sans-serif;
}

body {
  min-width: 1280px;
}

.screen {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 1.4vh;
  height: 100vh;
  padding: 2.2vh 2vw;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.eyebrow {
  margin: 0 0 0.5vh;
  color: var(--accent);
  font-size: clamp(0.85rem, 1.15vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#page-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1.1;
  font-weight: 800;
}

.meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.6vh 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.4rem);
}

.dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

.status-panel {
  display: grid;
  justify-items: end;
  gap: 0.8rem;
}

.status-pill {
  min-width: 8.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  text-align: center;
  font-size: clamp(0.95rem, 1.25vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

.status-pill[data-state="ok"] {
  color: #dfffab;
  background: rgba(158, 240, 26, 0.16);
}

.status-pill[data-state="loading"] {
  color: #d7eef5;
  background: rgba(120, 181, 204, 0.14);
}

.status-pill[data-state="error"] {
  color: #ffd0bb;
  background: rgba(255, 127, 80, 0.18);
}

.status-lines {
  color: var(--muted);
  font-size: clamp(0.95rem, 1.2vw, 1.08rem);
  text-align: right;
}

.status-lines p {
  margin: 0.2rem 0;
}

.status-lines strong {
  color: var(--text);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.summary-card {
  display: grid;
  gap: 0.8rem;
  padding: 1.3rem 1.5rem;
  background: linear-gradient(180deg, rgba(18, 39, 50, 0.95) 0%, rgba(12, 28, 37, 0.95) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.summary-card-accent {
  background: linear-gradient(180deg, rgba(38, 68, 25, 0.95) 0%, rgba(18, 42, 23, 0.95) 100%);
}

.summary-card-strong {
  background: linear-gradient(180deg, rgba(15, 43, 56, 0.98) 0%, rgba(14, 29, 38, 0.98) 100%);
}

.summary-label {
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  font-weight: 700;
}

.summary-value {
  font-size: clamp(2rem, 3.6vw, 3.8rem);
  line-height: 1;
  font-weight: 800;
}

.table-shell {
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(12, 28, 37, 0.94) 0%, rgba(8, 19, 26, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.table-scroll {
  height: 100%;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.monitor-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.monitor-table thead {
  position: sticky;
  top: 0;
  z-index: 3;
}

.monitor-table th,
.monitor-table td {
  padding: 0.8rem 0.65rem;
  border-bottom: 1px solid rgba(195, 225, 235, 0.11);
  border-right: 1px solid rgba(195, 225, 235, 0.06);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.monitor-table th:last-child,
.monitor-table td:last-child {
  border-right: 0;
}

.group-header-row th {
  padding-top: 1rem;
  padding-bottom: 1rem;
  background: rgba(18, 44, 57, 0.96);
  color: var(--text);
  font-size: clamp(0.95rem, 1.2vw, 1.2rem);
  font-weight: 800;
}

.sub-header-row th {
  background: rgba(13, 32, 42, 0.98);
  color: var(--muted);
  font-size: clamp(0.9rem, 1.1vw, 1.05rem);
  font-weight: 700;
}

.monitor-table tbody td {
  font-size: clamp(1rem, 1.2vw, 1.28rem);
  font-weight: 600;
}

.monitor-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}

.monitor-table tbody tr:hover td {
  background: rgba(158, 240, 26, 0.06);
}

.time-cell {
  font-size: clamp(1.15rem, 1.5vw, 1.5rem);
  font-weight: 800;
  color: #fff6d9;
  background: rgba(255, 196, 0, 0.08);
}

.total-cell,
.stay-cell {
  color: #fff;
  font-size: clamp(1.05rem, 1.35vw, 1.45rem);
  font-weight: 800;
}

.total-cell {
  background: rgba(115, 201, 255, 0.1);
}

.stay-cell {
  background: rgba(158, 240, 26, 0.12);
}

.placeholder {
  padding: 2rem;
  color: var(--muted);
  font-size: 1.2rem;
}

@media (max-width: 1600px) {
  .screen {
    gap: 1.1vh;
    padding: 1.6vh 1.4vw;
  }

  .summary-card {
    padding: 1rem 1.2rem;
  }

  .monitor-table th,
  .monitor-table td {
    padding: 0.65rem 0.45rem;
  }
}
