* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #0f172a;
  color: #e2e8f0;
  padding: 1.5rem;
  margin: 0;
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Disclaimer Banner */
.disclaimer {
  background: #1e293b;
  border: 1px solid #334155;
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.disclaimer strong {
  display: block;
  color: #f8fafc;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.disclaimer p {
  margin: 0;
}

.disclaimer a {
  color: #60a5fa;
  text-decoration: underline;
}

.disclaimer a:hover {
  color: #93c5fd;
}

/* Sheet Navigation Bar */
.sheet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.sheet-nav a {
  text-decoration: none;
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  padding: 7px 15px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.sheet-nav a:hover {
  background: #334155;
  color: #ffffff;
}

.sheet-nav a.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
  font-weight: 600;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #f8fafc;
}

.page-subtitle {
  margin: 0.2rem 0 0 0;
  font-size: 0.9rem;
  color: #94a3b8;
}

.badge {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 0.8rem;
  padding: 3px 11px;
  border-radius: 999px;
}

/* Index Overview Grid */
.sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.sheet-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1.25rem;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.sheet-card:hover {
  background: #243147;
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.sheet-card h2 {
  margin: 0 0 0.35rem 0;
  font-size: 1.15rem;
  color: #f8fafc;
}

.sheet-card p.card-sub {
  margin: 0 0 0.5rem 0;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.sheet-card p.card-meta {
  margin: 0 0 1rem 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.card-arrow {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: #60a5fa;
}

/* Pure-CSS Dropdown Filter Bar */
.filter-radio {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.filter-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-dropdown {
  position: relative;
}

.filter-dropdown summary {
  list-style: none;
  cursor: pointer;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
}

.filter-dropdown summary::-webkit-details-marker {
  display: none;
}

.filter-dropdown summary:hover,
.filter-dropdown[open] summary {
  background: #334155;
  border-color: #475569;
}

.filter-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 185px;
  max-height: 280px;
  overflow-y: auto;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.65);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-menu label {
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 13px;
  color: #cbd5e1;
  transition: background 0.1s ease;
}

.filter-menu label:hover {
  background: #334155;
  color: #ffffff;
}

.reset-all-btn {
  text-decoration: none;
  font-size: 12px;
  color: #94a3b8;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.reset-all-btn:hover {
  color: #f8fafc;
  background: #1e293b;
  border-color: #334155;
}

/* Responsive Table Wrapper */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: #1e293b;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  margin-bottom: 3rem;
}

table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}

td, th {
  border: none !important;
  border-bottom: 1px solid #334155 !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  font-family: inherit !important;
  color: #e2e8f0 !important;
  background-color: transparent !important;
  text-align: left;
  white-space: nowrap;
}

td.notes-cell {
  white-space: normal;
  min-width: 180px;
  max-width: 340px;
  color: #cbd5e1 !important;
}

tr:first-child td, tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #020617 !important;
  font-weight: 600 !important;
  color: #f8fafc !important;
  border-bottom: 2px solid #475569 !important;
}

tr:nth-child(even) {
  background-color: #162032;
}

tr:hover td {
  background-color: #283548 !important;
  color: #ffffff !important;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
  body {
    padding: 0.85rem;
  }
  td, th {
    padding: 9px 12px !important;
    font-size: 13px !important;
  }
}
