:root {
  color-scheme: light;
  --bg: #eef2f5;
  --panel: #ffffff;
  --panel-strong: #f8fafc;
  --text: #17202a;
  --muted: #667485;
  --line: #dbe2e8;
  --blue: #1464e9;
  --green: #0f9f6e;
  --amber: #c77a06;
  --red: #d9483f;
  --shadow: 0 12px 28px rgba(19, 32, 48, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans KR", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
  min-height: 220px;
  color: #ffffff;
  background:
    linear-gradient(110deg, rgba(9, 34, 64, 0.92), rgba(14, 82, 93, 0.72)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=80");
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #9ee6d8;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.55;
}

.status-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(8, 22, 36, 0.48);
  backdrop-filter: blur(10px);
}

.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
  background: #31d69b;
  box-shadow: 0 0 0 5px rgba(49, 214, 155, 0.18);
}

.status-panel strong,
.status-panel span {
  display: block;
}

.status-panel span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  margin-top: 2px;
}

.controls,
.tabs,
.message,
.table-wrap,
.metric,
.flow-card,
.incident-card,
.region-card,
.alert-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.controls {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(19, 32, 48, 0.06);
}

.field {
  display: grid;
  gap: 7px;
  min-width: 160px;
}

.field.grow {
  flex: 1;
  min-width: 260px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--text);
}

input:focus,
select:focus {
  outline: 3px solid rgba(20, 100, 233, 0.18);
  border-color: var(--blue);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.primary {
  color: #ffffff;
  background: var(--blue);
}

.tabs {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  padding: 6px;
}

.tab {
  flex: 0 0 auto;
  color: var(--muted);
  background: transparent;
}

.tab.active {
  color: #ffffff;
  background: #263746;
}

.message {
  margin-top: 16px;
  padding: 14px 16px;
  color: #6f4300;
  background: #fff5df;
  border-color: #f1d59b;
}

.view {
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

.live-board {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.flow-card,
.incident-card {
  padding: 20px;
}

.flow-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: center;
  gap: 18px;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.flow-card strong,
.incident-card strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  line-height: 1.1;
}

.flow-card p,
.incident-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.gauge {
  position: relative;
  height: 18px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5ebef;
}

.gauge span {
  display: block;
  width: var(--value, 30%);
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease, background 180ms ease;
}

.flow-card.slow .gauge span {
  background: var(--amber);
}

.flow-card.jam .gauge span,
.incident-card.has-incident strong {
  color: var(--red);
}

.flow-card.jam .gauge span {
  background: var(--red);
}

.route-panel {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.section-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.section-head span {
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.route-button {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-strong);
  text-align: left;
}

.route-button.active {
  color: #ffffff;
  border-color: #263746;
  background: #263746;
}

.route-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #eef7f4;
}

.route-detail h3,
.route-detail p {
  margin: 0;
}

.route-detail h3 {
  font-size: 18px;
}

.route-detail p {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.route-stat {
  display: grid;
  gap: 4px;
}

.route-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.route-stat strong {
  font-size: 18px;
}

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

.metric {
  padding: 18px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 34px;
  line-height: 1.1;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: var(--panel-strong);
  font-size: 13px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.number {
  text-align: right;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.region-card {
  padding: 18px;
}

.region-card h3,
.alert-item h3 {
  margin: 0;
  font-size: 18px;
}

.bar {
  height: 9px;
  margin: 16px 0 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5ebef;
}

.bar span {
  display: block;
  height: 100%;
  width: var(--value);
  background: var(--green);
}

.region-card.warn .bar span {
  background: var(--amber);
}

.region-card.danger .bar span {
  background: var(--red);
}

.card-meta,
.alert-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.alert-list {
  display: grid;
  gap: 12px;
}

.alert-item {
  padding: 18px;
}

.alert-item p {
  margin: 10px 0;
  line-height: 1.55;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
}

@media (max-width: 780px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .hero,
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .hero {
    padding: 24px;
    min-height: 340px;
  }

  .lead {
    font-size: 16px;
  }

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

  .live-board,
  .flow-card {
    grid-template-columns: 1fr;
  }

  .section-head,
  .route-detail {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    flex: 1 0 110px;
  }
}
