/* ── Reset & base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: #f0f2f6;
  color: #262730;
  min-height: 100vh;
  display: flex;
  justify-content: center;    /* center the whole page-wrap */
}

/* ── Page wrapper — centered, max-width ────────────────────────────── */
.page-wrap {
  display: flex;
  width: 100%;
  max-width: 1280px;          /* cap total width */
  margin: 0 auto;
}

/* ── Sidebar ───────────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-title { font-weight: 700; font-size: 15px; margin-bottom: 16px; color: #0e1117; }
.sidebar-hint  { font-size: 12px; color: #6e7480; line-height: 1.5; margin-top: 10px; }
.sidebar hr    { border: none; border-top: 1px solid #e8e8e8; margin: 16px 0; }

/* Toggle */
.toggle-row {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 13px; font-weight: 500; user-select: none;
}
.toggle-row input[type=checkbox] { display: none; }
.toggle-slider {
  width: 36px; height: 20px; background: #ccc;
  border-radius: 20px; position: relative; flex-shrink: 0; transition: background .2s;
}
.toggle-slider::after {
  content: ""; position: absolute;
  width: 14px; height: 14px; background: #fff; border-radius: 50%;
  top: 3px; left: 3px; transition: left .2s;
}
.toggle-row input:checked + .toggle-slider              { background: #ff4b4b; }
.toggle-row input:checked + .toggle-slider::after       { left: 19px; }

/* ── Main area ──────────────────────────────────────────────────────── */
.main {
  flex: 1;
  padding: 28px 32px;
  min-width: 0;               /* allow flex child to shrink */
}

/* ── App header ─────────────────────────────────────────────────────── */
.app-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.app-icon   { font-size: 40px; }
.app-header h1   { font-size: 26px; font-weight: 700; color: #0e1117; }
.app-caption     { font-size: 13px; color: #555; margin-top: 3px; }

/* ── Cards & dividers ───────────────────────────────────────────────── */
.card {
  background: #fff; border-radius: 8px; padding: 20px 24px;
  margin-bottom: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.card h2 { font-size: 16px; font-weight: 700; margin-bottom: 14px; color: #0e1117; }
.section-divider { border: none; border-top: 1px solid #e4e4e4; margin: 12px 0; }

/* ── Banners ────────────────────────────────────────────────────────── */
.info-banner {
  background: #e8f4fd; border-left: 4px solid #1c83e1;
  border-radius: 4px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; color: #0e1117;
}
.error-banner {
  background: #fff0f0; border-left: 4px solid #ff4b4b;
  border-radius: 4px; padding: 10px 14px; font-size: 13px; margin-top: 10px; color: #a00;
}

/* ── Upload grid ────────────────────────────────────────────────────── */
.upload-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin-bottom: 12px;
}
.upload-box   { display: flex; flex-direction: column; gap: 6px; }
.upload-label { font-weight: 600; font-size: 13px; }
.badge-req {
  background: #ff4b4b; color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px; margin-left: 4px; vertical-align: middle;
}
.drop-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px dashed #ccc; border-radius: 8px; padding: 20px 12px;
  cursor: pointer; transition: border-color .2s, background .2s;
  min-height: 90px; text-align: center; color: #888;
}
.drop-zone:hover, .drop-zone.dragover { border-color: #ff4b4b; background: #fff5f5; }
.drop-zone.has-file { border-color: #21c55d; background: #f0fff4; color: #166534; }
.drop-zone input[type=file] { display: none; }
.dz-text { font-size: 13px; line-height: 1.5; pointer-events: none; }
.dz-text small { font-size: 11px; color: #aaa; }
.drop-zone.has-file .dz-text small { color: #15803d; }
.file-info { font-size: 11px; color: #6e7480; min-height: 14px; }

/* ── Tables ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-top: 8px; }
table  { border-collapse: collapse; width: 100%; font-size: 13px; }
thead tr { background: #f7f8fa; }
th {
  text-align: left; padding: 8px 12px;
  border-bottom: 2px solid #e4e4e4; font-weight: 600; white-space: nowrap; color: #444;
}
td {
  padding: 7px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: top;
  max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
tr:hover td { background: #fafafa; }

/* ── Metrics ────────────────────────────────────────────────────────── */
.metrics-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.metric {
  background: #f7f8fa; border-radius: 8px;
  padding: 14px 16px; text-align: center; border: 1px solid #e8e8e8;
}
.metric-val { font-size: 26px; font-weight: 700; color: #ff4b4b; }
.metric-lbl { font-size: 11px; color: #888; margin-top: 3px; }

/* ── Tabs ───────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 2px solid #e4e4e4; margin-bottom: 14px;
}
.tab-btn {
  background: none; border: none; padding: 8px 16px;
  font-size: 13px; font-weight: 500; color: #888; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover  { color: #444; }
.tab-btn.active { color: #ff4b4b; border-bottom-color: #ff4b4b; }
.tab-pane  { display: none; }
.tab-pane.active { display: block; }

/* ── Pagination ─────────────────────────────────────────────────────── */
.paginator-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.pg-label { font-size: 12px; color: #666; }
.paginator-bar select {
  font-size: 12px; border: 1px solid #d0d0d0; border-radius: 4px;
  padding: 3px 6px; background: #fff; cursor: pointer;
}
.pg-info  { font-size: 12px; color: #888; margin: 0 6px; }
.pg-btn {
  background: #f0f2f6; border: 1px solid #d0d0d0; border-radius: 4px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; transition: background .15s;
}
.pg-btn:hover    { background: #e2e4ea; }
.pg-btn:disabled { opacity: .4; cursor: default; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block; background: #ff4b4b; color: #fff; border: none;
  border-radius: 6px; padding: 10px 22px; font-size: 14px; font-weight: 600;
  cursor: pointer; margin-top: 14px; text-decoration: none; transition: background .15s;
}
.btn-primary:hover { background: #e03c3c; }
.btn-secondary {
  display: inline-block; background: #f0f2f6; color: #444;
  border: 1px solid #d0d0d0; border-radius: 6px; padding: 10px 22px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  margin-top: 14px; margin-left: 10px; transition: background .15s;
}
.btn-secondary:hover { background: #e4e6ed; }
.btn-dl { width: 100%; text-align: center; margin-top: 0; }

/* ── Spinner ────────────────────────────────────────────────────────── */
.spinner-wrap {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; font-size: 13px; color: #666;
}
.spinner {
  width: 20px; height: 20px; border: 3px solid #e0e0e0;
  border-top-color: #ff4b4b; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Misc ───────────────────────────────────────────────────────────── */
.info-text { font-size: 13px; color: #666; margin-bottom: 12px; }
.caption   { font-size: 12px; color: #888; margin-bottom: 8px; }
code { background: #f0f2f6; padding: 1px 5px; border-radius: 3px; font-size: 12px; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .page-wrap     { flex-direction: column; }
  .sidebar       { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid #e0e0e0; }
  .upload-grid   { grid-template-columns: 1fr; }
  .metrics-row   { grid-template-columns: repeat(2, 1fr); }
  .main          { padding: 16px; }
}




.brand-regular {
  font-weight: 400;
}

.brand-bold {
  font-weight: 700;
}

.app-header h1 {
  font-weight: 400;
  margin: 0;
}

.app-header h1 .brand-biblio {
  color: #008a8a;
  font-weight: 400;
}

.app-header h1 .brand-merge {
  color: #087F9A;
  font-weight: 700;
}