:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #101828;
  --ink-soft: #475467;
  --border: #e4e7ec;
  --brand: #16406b;
  --brand-dark: #0d2c4a;
  --accent: #c8102e;
  --accent-soft: #fdecee;
  --good: #067647;
  --good-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--brand-dark);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.topbar .brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}
.topbar .brand small {
  font-weight: 400;
  font-size: 12px;
  color: #b8c6d9;
}
.topbar nav { display: flex; gap: 20px; flex-wrap: wrap; }
.topbar nav a { color: #dfe7f0; font-size: 14px; font-weight: 500; }
.topbar nav a:hover { color: #fff; }
.topbar nav a.active { color: #fff; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.hero {
  background: linear-gradient(160deg, var(--brand-dark), var(--brand) 70%);
  color: #fff;
  padding: 56px 24px 64px;
}
.hero h1 { font-size: clamp(28px, 4vw, 42px); margin: 0 0 12px; letter-spacing: -0.02em; }
.hero p.lead { font-size: 18px; color: #dbe6f2; max-width: 640px; margin: 0 0 28px; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #a80d26; text-decoration: none; }
.btn-secondary { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.btn-secondary:hover { background: rgba(255,255,255,.2); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); text-decoration: none; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.stat-card .label { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

section.panel { padding: 48px 0; }
section.panel h2 { font-size: 24px; margin: 0 0 6px; }
section.panel p.sub { color: var(--ink-soft); margin: 0 0 24px; max-width: 640px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.explorer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.explorer-card h3 { margin: 0; font-size: 17px; }
.explorer-card p { margin: 0; color: var(--ink-soft); font-size: 14px; flex: 1; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.tag-mef { background: var(--good-soft); color: var(--good); }
.tag-oece { background: var(--accent-soft); color: var(--accent); }

.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 160px; flex: 1; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.field input, .field select {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
table thead th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--border);
  padding: 10px 12px;
  white-space: nowrap;
}
table tbody td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table tbody tr:hover { background: #fafbfc; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.mono { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-goods { background: #eef4ff; color: #1849a9; }
.pill-works { background: var(--warn-soft); color: var(--warn); }
.pill-services { background: #f4ebff; color: #6941c6; }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 14px; color: var(--ink-soft); }
.pager .btns { display: flex; gap: 8px; }

.state-msg { padding: 40px 0; text-align: center; color: var(--ink-soft); }

footer { border-top: 1px solid var(--border); padding: 32px 24px; margin-top: 40px; color: var(--ink-soft); font-size: 13px; }
footer a { color: var(--ink-soft); text-decoration: underline; }
footer .cols { display: flex; gap: 40px; flex-wrap: wrap; justify-content: space-between; }

.badge-fuente { display:inline-flex; align-items:center; gap:6px; font-size: 12px; color: var(--ink-soft); background:#fff; border:1px solid var(--border); padding: 4px 10px; border-radius: 999px; }

@media (max-width: 640px) {
  .topbar nav { display: none; }
  .hero { padding: 40px 20px 56px; }
}
