:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background-color: #f5f6f8;
  color: #101828;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  background: linear-gradient(135deg, #212d63, #2c4aa0);
  color: white;
  padding: 1.75rem clamp(1rem, 3vw, 2.5rem);
}

.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.page-header p {
  margin: 0;
  max-width: 60ch;
  font-size: 1rem;
  opacity: 0.9;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 1.5rem;
  padding: clamp(1.5rem, 2vw, 2.5rem);
  align-items: start;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.panel h2 {
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #d0d5dd;
  font-size: 0.95rem;
  background: #f9fafb;
  color: inherit;
}

.form-group input:focus,
.form-group select:focus {
  outline: 2px solid #2c4aa0;
  outline-offset: 2px;
}

.form-group--dates .date-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  border: none;
}

.button--secondary {
  background: rgba(33, 45, 99, 0.08);
  color: #212d63;
}

.button--secondary:hover {
  background: rgba(33, 45, 99, 0.14);
}

.witness-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.witness-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  cursor: pointer;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.witness-item:hover {
  border-color: rgba(44, 74, 160, 0.4);
  box-shadow: 0 10px 20px rgba(44, 74, 160, 0.12);
  transform: translateY(-1px);
}

.witness-item.active {
  border-color: rgba(44, 74, 160, 0.6);
  background: rgba(44, 74, 160, 0.1);
}

.witness-item__name {
  font-weight: 600;
  font-size: 0.95rem;
}

.witness-item__count {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: #475467;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
}

.stat-label {
  font-size: 0.85rem;
  color: #475467;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.details {
  background: white;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.details__header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.details__header p {
  margin: 0.3rem 0 0;
  color: #475467;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead {
  background: rgba(33, 45, 99, 0.08);
  position: sticky;
  top: 0;
  z-index: 1;
}

thead th {
  text-align: left;
  padding: 0;
  font-weight: 600;
  color: #182656;
}

tbody td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  vertical-align: top;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
}

.sort-button:hover {
  background: rgba(44, 74, 160, 0.08);
}

.sort-button:focus-visible {
  outline: 2px solid #2c4aa0;
  outline-offset: -2px;
  border-radius: 6px;
}

.sort-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.85rem;
  height: 0.85rem;
  font-size: 0.75rem;
  color: #475467;
}

.sort-button[data-sort-direction="asc"] .sort-indicator::before {
  content: '▲';
}

.sort-button[data-sort-direction="desc"] .sort-indicator::before {
  content: '▼';
}

tbody tr:hover {
  background: rgba(33, 45, 99, 0.06);
}

.hearing-title {
  font-weight: 600;
  color: #15224b;
  margin-bottom: 0.15rem;
}

.hearing-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.hearing-links a {
  color: #2c4aa0;
  text-decoration: none;
  font-size: 0.85rem;
  border-bottom: 1px solid transparent;
}

.hearing-links a:hover {
  border-bottom-color: currentColor;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(44, 74, 160, 0.12);
  color: #2c4aa0;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.page-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  color: #475467;
}

code {
  background: rgba(15, 23, 42, 0.08);
  padding: 0.15rem 0.3rem;
  border-radius: 6px;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .witness-list {
    max-height: 280px;
  }
}

@media (max-width: 640px) {
  .panel,
  .details {
    padding: 1.1rem;
  }

  thead th,
  tbody td {
    padding-inline: 0.6rem;
  }
}

.empty-state {
  text-align: center;
  color: #475467;
  padding: 1.5rem 0.85rem;
}

.witness-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(33, 45, 99, 0.1);
  color: #212d63;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.8rem;
  margin: 0 0.3rem 0.3rem 0;
  font-weight: 500;
}

.witness-chip--active {
  background: #2c4aa0;
  color: white;
}
