*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-dark: #1a3a5c;
  --blue-mid: #2563a8;
  --blue-light: #dbeafe;
  --accent: #f59e0b;
  --text: #1e293b;
  --text-muted: #475569;
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

html { font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.site-header {
  background: var(--blue-dark);
  color: var(--white);
  padding: 1.25rem 2rem;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-icon {
  width: 2.2rem;
  height: 2.2rem;
  color: #93c5fd;
  flex-shrink: 0;
}
.header-brand h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.header-brand p {
  font-size: 0.85rem;
  color: #93c5fd;
  margin-top: 0.1rem;
}

/* ── Main ── */
.main-content {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
  width: 100%;
}

/* ── Hero ── */
.hero {
  text-align: center;
  margin-bottom: 3rem;
}
.hero h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 0.75rem;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 650px;
  margin: 0 auto;
}

/* ── Database Cards ── */
.databases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}

.db-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.db-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(37,99,168,0.15);
  border-color: var(--blue-mid);
}
.db-card:focus-visible {
  outline: 3px solid var(--blue-mid);
  outline-offset: 2px;
}

.db-card-period {
  display: inline-block;
  background: var(--blue-dark);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  width: fit-content;
}

.db-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue-dark);
  line-height: 1.3;
}

.db-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.db-card-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.db-card-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 1.1rem;
  position: relative;
}
.db-card-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--blue-mid);
  font-weight: 700;
}

.db-card-btn {
  margin-top: 0.5rem;
  display: inline-block;
  background: var(--blue-mid);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  text-align: center;
  transition: background 0.15s;
  width: fit-content;
}
.db-card:hover .db-card-btn {
  background: var(--blue-dark);
}

/* ── About ── */
.about {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue-mid);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
}
.about-inner {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.about-icon {
  width: 2rem;
  height: 2rem;
  color: var(--blue-mid);
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.about-icon svg { width: 100%; height: 100%; }
.about h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 0.5rem;
}
.about p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ── Footer ── */
.site-footer {
  background: var(--blue-dark);
  color: #93c5fd;
  text-align: center;
  padding: 1.25rem 2rem;
  font-size: 0.85rem;
}

/* ── Banco pages (banco45.html / banco2004.html) ── */
.banco-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.banco-nav {
  background: var(--blue-dark);
  color: var(--white);
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.banco-nav-home {
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: color 0.12s;
  padding: 0.25rem 0;
}
.banco-nav-home:hover { color: var(--white); }
.banco-nav-home:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; border-radius: 3px; }
.banco-nav-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
}
.banco-nav-copy {
  background: transparent;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
}
.banco-nav-copy svg { width: 1.15rem; height: 1.15rem; }
.banco-nav-copy:hover {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}
.banco-nav-copy.copied {
  color: #4ade80;
}
.banco-nav-period {
  margin-left: auto;
  background: var(--accent);
  color: #1c1917;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.banco-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.banco-sidebar {
  width: 240px;
  min-width: 200px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-search {
  position: relative;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.sidebar-search input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--white);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.sidebar-search input:focus {
  outline: none;
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.1);
}
.sidebar-search .search-icon {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.banco-sidebar nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}
.banco-sidebar nav ul {
  list-style: none;
}
.banco-sidebar nav ul li {
  transition: opacity 0.15s;
}
.banco-sidebar nav ul li a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  line-height: 1.4;
}
.banco-sidebar nav ul li a:hover {
  background: var(--blue-light);
  color: var(--blue-mid);
  border-left-color: var(--blue-mid);
}
.banco-sidebar nav ul li a.active {
  background: var(--blue-light);
  color: var(--blue-mid);
  border-left-color: var(--blue-mid);
  font-weight: 600;
}
.banco-sidebar nav ul li a:focus-visible {
  outline: 2px solid var(--blue-mid);
  outline-offset: -2px;
}

.banco-main {
  flex: 1;
  overflow: auto;
  background: var(--bg);
  min-width: 0;
  position: relative;
}
.banco-main iframe {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 52px);
  border: none;
  display: block;
}

.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  z-index: 10;
}
.loading-indicator .spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--border);
  border-top-color: var(--blue-mid);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Mobile ── */
@media (max-width: 700px) {
  .main-content { padding: 1.5rem 1rem 3rem; }
  .hero h2 { font-size: 1.35rem; }
  .databases { grid-template-columns: 1fr; }
  .about-inner { flex-direction: column; gap: 0.75rem; }

  .banco-nav { padding: 0.75rem 1rem; gap: 0.75rem; }
  .banco-nav-title { display: none; }

  .banco-layout { flex-direction: column; }
  .banco-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-y: visible;
    overflow-x: auto;
  }
  .sidebar-search { padding: 0.75rem 1rem; }
  .banco-sidebar nav {
    overflow-y: visible;
    overflow-x: auto;
    padding: 0;
  }
  .banco-sidebar nav ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    padding: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .banco-sidebar nav ul li { flex-shrink: 0; }
  .banco-sidebar nav ul li a {
    padding: 0.5rem 0.85rem;
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    font-size: 0.82rem;
  }
  .banco-sidebar nav ul li a:hover,
  .banco-sidebar nav ul li a.active {
    border-left-color: transparent;
    border-bottom-color: var(--blue-mid);
    background: var(--blue-light);
  }
  .banco-main iframe { min-height: calc(100vh - 180px); }
}

