/* Data repo + Handsontable overrides */
.data-repo-page main.repo-main {
  max-width: none;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  padding: 1rem;
  min-height: calc(100vh - 120px);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.nav-link:hover { background: #243044; }

.small { font-size: 0.8rem; }

.repo-sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.dataset-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.dataset-list li button {
  width: 100%;
  text-align: left;
  background: #121a28;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  font-size: 0.82rem;
}

.dataset-list li button:hover { border-color: var(--accent); }
.dataset-list li button.active {
  background: #1e3a5f;
  border-color: var(--accent);
}

.dataset-list .ds-meta {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.schema-box h3 { margin: 1rem 0 0.5rem; font-size: 0.9rem; }
.schema-panel {
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, monospace;
  line-height: 1.45;
}

.schema-panel .col-row {
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border);
}

.repo-toolbar h2 { margin: 0; font-size: 1rem; }
.toolbar-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.toolbar-actions { display: flex; align-items: center; gap: 0.5rem; }

.badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  font-weight: 600;
}

.badge.core { background: #1e3a2f; color: #6ee7b7; }
.badge.premium { background: #3b2f1e; color: #fcd34d; }

.toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.options-filters {
  padding-top: 0.25rem;
  border-top: 1px dashed var(--border);
}

.options-filters select {
  min-width: 140px;
  max-width: 220px;
}

#filter-expiry {
  min-width: 160px;
  max-width: 260px;
}

.toolbar-filters input, .toolbar-filters select {
  background: #121a28;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  margin-left: 0.35rem;
}

.pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.grid-card { padding: 0.5rem; overflow: hidden; }
#data-grid { width: 100%; }

/* Handsontable dark theme */
.handsontable {
  color: #e7ecf3;
  font-size: 0.78rem;
}
.htCore td, .htCore th {
  background-color: #121a28 !important;
  color: #e7ecf3 !important;
  border-color: #2d3a4f !important;
}
.htCore th {
  background-color: #1a2332 !important;
  color: #8b9cb3 !important;
  font-weight: 600;
}
.htCore td.date-col,
.htCore th:first-child {
  min-width: 120px !important;
  color: #e7ecf3 !important;
}
.handsontable .htDimmed { color: #6b7c93 !important; }
.ht_clone_top th, .ht_clone_left th,
.ht_clone_left td {
  background-color: #1a2332 !important;
  color: #e7ecf3 !important;
}

@media (max-width: 900px) {
  .data-repo-page main.repo-main {
    grid-template-columns: 1fr;
  }
  .repo-sidebar { position: static; max-height: none; }
}
