:root {
  color-scheme: light;
  font-family: Inter, Arial, Helvetica, sans-serif;
  line-height: 1.4;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --border: #d8dee8;
  --text: #132238;
  --muted: #5b6b82;
  --accent: #0f62fe;
  --accent-soft: #e9f1ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

code {
  font-family: Consolas, Monaco, monospace;
}

.layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

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

.page-header {
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}

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

.subtitle,
.panel-note,
.table-caption,
.timestamp,
.summary-inline {
  color: var(--muted);
}

.status-pill {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.kpi-grid,
.summary-grid,
.filters-grid {
  display: grid;
  gap: 16px;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 16px;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-bottom: 16px;
}

.filters-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.kpi-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.kpi-card {
  padding: 18px;
}

.kpi-label {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 14px;
}

.kpi-value {
  font-size: 32px;
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.totals-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0;
}

.total-item {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
}

.total-item dt {
  color: var(--muted);
  margin-bottom: 6px;
}

.total-item dd {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.filters-panel label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
}

.secondary-button {
  border: 1px solid var(--border);
  background: white;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.table-wrap {
  overflow: auto;
}

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

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

thead th {
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.empty-state,
.empty-cell {
  color: var(--muted);
  padding: 16px 0;
}

@media (max-width: 800px) {
  .page-header,
  .panel-header,
  .appointments-header {
    flex-direction: column;
  }

  .layout {
    padding: 16px;
  }
}
