:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #586474;
  --line: #d8dee7;
  --panel: #ffffff;
  --page: #f4f6f8;
  --accent: #0b7285;
  --accent-dark: #075563;
  --good: #2f9e44;
  --caution: #f08c00;
  --bad: #c92a2a;
}

* {
  box-sizing: border-box;
}

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

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 32px auto;
}

.search-panel,
.graph-panel,
.suggestions-panel,
.table-panel,
.status,
.summary-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-panel {
  padding: 24px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 28px;
}

h2 {
  margin-bottom: 16px;
  font-size: 18px;
}

p {
  color: var(--muted);
}

.search-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
button {
  min-height: 42px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

button {
  border: 0;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.checkbox {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.checkbox input {
  width: 18px;
  min-height: 18px;
}

.status {
  margin-top: 16px;
  padding: 14px 16px;
}

.results {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

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

.summary-grid article {
  padding: 16px;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

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

.graph-panel,
.suggestions-panel,
.table-panel {
  padding: 18px;
}

.bar {
  display: grid;
  grid-template-columns: 140px 1fr 40px;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

.bar-track {
  height: 14px;
  overflow: hidden;
  background: #e9edf2;
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
}

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

.section-header button {
  min-height: 34px;
}

#suggestions {
  margin: 0;
  padding-left: 20px;
}

#suggestions li {
  margin: 8px 0;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

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

.badge {
  display: inline-block;
  min-width: 72px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f4;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.badge.active {
  background: #d3f9d8;
  color: #1b6b2a;
}

.badge.cancelled {
  background: #ffe3e3;
  color: #9c1c1c;
}

@media (max-width: 760px) {
  .filters,
  .summary-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100vw - 20px, 1180px);
    margin: 10px auto;
  }

  .bar {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
