:root {
  color-scheme: light;
  --blue: #1a73e8;
  --blue-dark: #1557b0;
  --blue-soft: #e8f0fe;
  --green: #188038;
  --red: #d93025;
  --yellow: #f9ab00;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --surface: #fff;
  --soft: #f8f9fa;
  --shadow: 0 1px 2px rgb(60 64 67 / 0.08), 0 2px 8px rgb(60 64 67 / 0.08);
  --radius: 18px;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--surface); font-size: 16px; line-height: 1.55; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
button, .button { cursor: pointer; }
:focus-visible { outline: 3px solid rgb(26 115 232 / 0.28); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.brand { display: inline-flex; flex-direction: column; align-items: center; gap: 13px; color: var(--ink); font-size: clamp(2rem, 4.8vw, 4.6rem); font-weight: 700; letter-spacing: -0.055em; line-height: 1; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { display: grid; grid-template-columns: repeat(3, 12px); gap: 7px; width: max-content; }
.brand__mark i { width: 12px; height: 12px; border-radius: 999px; background: var(--blue); }
.brand__mark i:nth-child(2) { background: var(--red); }
.brand__mark i:nth-child(3) { background: var(--yellow); }
.brand__mark::after { content: ""; grid-column: 2; width: 12px; height: 12px; border-radius: 999px; background: #34a853; }
.brand--compact { flex-direction: row; gap: 10px; font-size: 1.25rem; letter-spacing: -0.03em; white-space: nowrap; }
.brand--compact .brand__mark { grid-template-columns: repeat(2, 7px); gap: 3px; }
.brand--compact .brand__mark i, .brand--compact .brand__mark::after { width: 7px; height: 7px; }
.brand--compact .brand__mark i:nth-child(3) { display: none; }

.home-nav { min-height: 60px; display: flex; justify-content: flex-end; align-items: center; padding: 0 32px; }
.home-nav a, .simple-header > a, .directory-link { color: var(--ink); font-size: .9rem; }
.home-shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }
.search-hero { min-height: 515px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 0 28px; text-align: center; }
.search-hero h1 { max-width: 680px; margin: 24px auto 30px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.28rem); font-weight: 400; letter-spacing: 0; }

.search-box { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); transition: box-shadow .16s, border-color .16s; }
.search-box:focus-within, .search-box:hover { border-color: transparent; box-shadow: 0 1px 6px rgb(32 33 36 / 0.25); }
.search-box svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box button { border: 0; color: #fff; background: var(--blue); font-weight: 600; transition: background .16s; }
.search-box button:hover { background: var(--blue-dark); }
.search-box--hero { width: min(680px, 100%); min-height: 58px; padding-left: 20px; border-radius: 999px; overflow: hidden; }
.search-box--hero input { height: 56px; padding: 0 15px; font-size: 1rem; }
.search-box--hero button { align-self: stretch; padding: 0 27px; }
.quick-searches { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 22px; }
.quick-searches a { padding: 7px 12px; border-radius: 999px; background: var(--soft); color: #3c4043; font-size: .82rem; }
.quick-searches a:hover { color: var(--blue); text-decoration: none; }

.index-status { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.index-status > div { min-height: 120px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 25px 30px; border-right: 1px solid var(--line); }
.index-status > div:last-child { border-right: 0; }
.index-status strong { color: var(--blue); font-size: clamp(1.5rem, 3vw, 2.15rem); line-height: 1.1; }
.index-status span { color: var(--muted); font-size: .88rem; }
.index-status .index-status__pending { grid-column: 1 / -1; border: 0; align-items: center; text-align: center; }
.index-status .index-status__pending strong { font-size: 1.25rem; }

.search-scope { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; padding: 72px 0 86px; }
.search-scope article { padding: 0 12px; }
.search-scope article > span { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--blue); background: var(--blue-soft); font-weight: 700; font-size: .8rem; }
.search-scope h2 { margin: 17px 0 7px; font-size: 1.08rem; }
.search-scope p { margin: 0; color: var(--muted); font-size: .9rem; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 34px; color: var(--muted); background: var(--soft); border-top: 1px solid #eee; font-size: .8rem; }
.site-footer > div { display: flex; gap: 20px; }
.site-footer p { margin: 0; text-align: right; }

.results-header { position: sticky; z-index: 20; top: 0; min-height: 76px; display: grid; grid-template-columns: auto minmax(260px, 680px) 1fr; align-items: center; gap: 28px; padding: 10px 30px; background: rgb(255 255 255 / .96); border-bottom: 1px solid #eee; backdrop-filter: blur(12px); }
.search-box--header { height: 48px; padding-left: 20px; border-radius: 999px; overflow: hidden; }
.search-box--header input { height: 46px; padding-right: 14px; font-size: 1rem; }
.search-box--header button { align-self: stretch; width: 58px; background: transparent; }
.search-box--header button:hover { background: var(--blue-soft); }
.search-box--header button svg { stroke: var(--blue); }
.directory-link { justify-self: end; }
.results-shell { width: min(850px, calc(100% - 40px)); margin: 0 auto 80px; padding-top: 24px; }
.result-summary { margin: 0 0 22px; color: var(--muted); font-size: .83rem; }
.result-summary p { margin: 0 0 3px; }
.result-summary span { display: block; }
.result-list { display: grid; gap: 30px; }
.result-card { display: grid; grid-template-columns: 184px 1fr; gap: 22px; }
.result-card__image { align-self: start; border-radius: 13px; overflow: hidden; background: var(--soft); border: 1px solid #eee; }
.result-card__image img { width: 100%; aspect-ratio: 1.6; object-fit: cover; }
.result-card__body { min-width: 0; }
.result-card__url { margin: 0 0 2px; color: #3c4043; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-card__url span { padding: 0 4px; color: var(--muted); }
.result-card h2 { margin: 0; font-size: 1.23rem; font-weight: 400; line-height: 1.35; }
.result-card h2 a { color: #1a0dab; }
.result-card h2 a:visited { color: #681da8; }
.result-card__body > p:not(.result-card__url) { margin: 7px 0 9px; color: #4d5156; font-size: .9rem; }
.result-card__actions { display: flex; align-items: center; gap: 18px; font-size: .84rem; }
.text-link { font-weight: 600; }
.wa-link { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; color: #0d652d; background: #e6f4ea; font-weight: 700; }
.wa-link:hover { text-decoration: none; background: #ceead6; }

.empty-state { margin: 48px 0; padding: 42px; border-radius: var(--radius); background: var(--soft); text-align: center; }
.empty-state h1, .empty-state h2 { margin: 0 0 8px; font-size: 1.5rem; }
.empty-state p { margin: 0; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 50px 0 10px; font-size: .88rem; }
.pagination a { padding: 9px 15px; border: 1px solid var(--line); border-radius: 9px; font-weight: 600; }
.pagination a:hover { background: var(--soft); text-decoration: none; }
.pagination span { color: var(--muted); }

.simple-header { min-height: 70px; display: flex; justify-content: space-between; align-items: center; padding: 0 max(24px, calc((100% - 1180px) / 2)); border-bottom: 1px solid #eee; }
.directory-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto 80px; }
.directory-title { padding: 68px 0 42px; max-width: 760px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.directory-title h1 { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.05; letter-spacing: -.04em; }
.directory-title > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 1.04rem; }
.filter-form { display: flex; width: min(580px, 100%); margin-top: 27px; }
.filter-form input { flex: 1; min-width: 0; height: 46px; padding: 0 15px; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; outline: 0; }
.filter-form input:focus { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.filter-form button { padding: 0 19px; color: #fff; border: 0; border-radius: 0 10px 10px 0; background: var(--blue); font-weight: 600; }
.state-strip { padding: 24px 0 30px; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
.state-strip h2 { margin: 0 0 14px; font-size: .92rem; }
.state-strip > div { display: flex; flex-wrap: wrap; gap: 8px; }
.state-strip a { padding: 6px 10px; border-radius: 7px; color: #3c4043; background: var(--soft); font-size: .76rem; }
.state-strip a:hover { color: var(--blue); text-decoration: none; }
.directory-count { margin: 36px 0 17px; color: var(--muted); font-size: .84rem; }
.agency-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 23px; }
.agency-grid article { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; transition: transform .16s, box-shadow .16s; }
.agency-grid article:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.agency-grid img { width: 100%; aspect-ratio: 1.8; object-fit: cover; background: var(--soft); }
.agency-grid article > div { padding: 16px; }
.agency-grid h2 { margin: 0 0 4px; font-size: 1rem; line-height: 1.35; }
.agency-grid h2 a { color: var(--ink); }
.agency-grid p { margin: 0; color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.legal-page { width: min(760px, calc(100% - 40px)); min-height: 65vh; margin: 70px auto; }
.legal-page h1 { font-size: 2.5rem; letter-spacing: -.04em; }
.legal-page p { color: #3c4043; }
.status-page { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: var(--soft); }
.status-card { width: min(580px, 100%); padding: 40px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.status-card .brand { font-size: 1.5rem; letter-spacing: -.03em; }
.status-card h1 { margin: 30px 0 10px; }
.status-card p { margin: 0 0 25px; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 0; border-radius: 9px; color: #fff; background: var(--blue); font-weight: 700; }
.button:hover { color: #fff; background: var(--blue-dark); text-decoration: none; }

/* Administración */
.admin-body { background: #f5f7fb; }
.admin-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 25px 20px; color: #e8eaed; background: #18202d; }
.admin-sidebar .brand { align-self: flex-start; color: #fff; font-size: 1.05rem; white-space: normal; }
.admin-sidebar nav { display: grid; gap: 5px; margin-top: 38px; }
.admin-sidebar nav a { padding: 10px 12px; border-radius: 8px; color: #c7d0dc; font-size: .87rem; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { color: #fff; background: rgb(255 255 255 / .1); text-decoration: none; }
.admin-sidebar__footer { margin-top: auto; display: grid; gap: 8px; }
.admin-sidebar__footer a { color: #aeb8c5; font-size: .78rem; }
.admin-main { min-width: 0; padding: 34px clamp(24px, 4vw, 58px) 80px; }
.admin-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.admin-top h1 { margin: 0; font-size: 1.8rem; letter-spacing: -.025em; }
.admin-top p { margin: 5px 0 0; color: var(--muted); }
.admin-badge { padding: 7px 11px; border-radius: 999px; color: #174ea6; background: var(--blue-soft); font-size: .75rem; font-weight: 700; }
.flash { margin: 0 0 18px; padding: 13px 16px; border-radius: 10px; font-size: .87rem; }
.flash--success { color: #0d652d; background: #e6f4ea; border: 1px solid #ceead6; }
.flash--error { color: #a50e0e; background: #fce8e6; border: 1px solid #fad2cf; }
.flash--info { color: #174ea6; background: var(--blue-soft); border: 1px solid #d2e3fc; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 24px; }
.stat-card { padding: 19px; border: 1px solid #e3e7ed; border-radius: 13px; background: #fff; box-shadow: 0 1px 2px rgb(20 30 50 / .03); }
.stat-card strong { display: block; color: #172033; font-size: 1.65rem; line-height: 1.1; }
.stat-card span { display: block; margin-top: 7px; color: var(--muted); font-size: .76rem; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.admin-panel { padding: 24px; border: 1px solid #e3e7ed; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgb(20 30 50 / .03); }
.admin-panel--wide { grid-column: 1 / -1; }
.admin-panel h2 { margin: 0 0 5px; font-size: 1.08rem; }
.admin-panel > p { margin: 0 0 20px; color: var(--muted); font-size: .84rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { color: #3c4043; font-size: .78rem; font-weight: 700; }
.field small { color: var(--muted); font-size: .72rem; }
.field input, .field textarea, .field select { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #cfd5dd; border-radius: 8px; outline: 0; background: #fff; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgb(26 115 232 / .12); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 19px; }
.button--secondary { color: #174ea6; background: var(--blue-soft); }
.button--secondary:hover { color: #174ea6; background: #d2e3fc; }
.button--danger { color: #a50e0e; background: #fce8e6; }
.button--danger:hover { color: #a50e0e; background: #fad2cf; }
.button--small { min-height: 34px; padding: 0 12px; font-size: .78rem; }
.check-row { display: flex; align-items: flex-start; gap: 9px; color: #3c4043; font-size: .8rem; }
.check-row input { margin-top: 4px; }
.progress { height: 10px; overflow: hidden; border-radius: 999px; background: #e8eaed; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #6ea3f0); transition: width .25s; }
.progress-copy { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: .75rem; }
.code-box { padding: 11px 13px; border-radius: 8px; background: #f1f3f4; color: #303134; font: .76rem/1.5 monospace; overflow-wrap: anywhere; }
.cover-preview { width: 100%; max-height: 240px; margin: 15px 0; border-radius: 12px; object-fit: cover; background: var(--soft); }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.admin-table th, .admin-table td { padding: 11px 9px; border-bottom: 1px solid #eceff3; text-align: left; vertical-align: middle; }
.admin-table th { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-table img { width: 72px; height: 44px; border-radius: 7px; object-fit: cover; }
.admin-table code { font-size: .72rem; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f5f7fb; }
.login-card { width: min(440px, 100%); padding: 36px; border: 1px solid #e1e5eb; border-radius: 18px; background: #fff; box-shadow: 0 10px 35px rgb(20 30 50 / .08); }
.login-card .brand { align-items: flex-start; font-size: 1.35rem; letter-spacing: -.03em; }
.login-card h1 { margin: 32px 0 7px; font-size: 1.5rem; }
.login-card > p { margin: 0 0 25px; color: var(--muted); font-size: .87rem; }
.login-card .field { margin-bottom: 15px; }
.login-card .button { width: 100%; }

@media (max-width: 900px) {
  .results-header { grid-template-columns: auto 1fr; gap: 16px; }
  .directory-link { display: none; }
  .agency-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 25px; padding: 16px 22px; }
  .admin-sidebar nav { display: flex; flex-wrap: wrap; margin: 0; }
  .admin-sidebar__footer { margin: 0 0 0 auto; }
  .admin-sidebar__footer a:first-child { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .home-nav { padding: 0 20px; }
  .search-hero { min-height: 460px; padding-top: 20px; }
  .brand { font-size: 2.1rem; letter-spacing: -.045em; }
  .search-box--hero { min-height: 54px; }
  .search-box--hero input { height: 52px; }
  .search-box--hero button { padding: 0 17px; font-size: .86rem; }
  .index-status, .search-scope { grid-template-columns: 1fr; }
  .index-status > div { min-height: 96px; border-right: 0; border-bottom: 1px solid var(--line); }
  .index-status > div:last-child { border-bottom: 0; }
  .search-scope { gap: 34px; padding: 55px 0; }
  .site-footer { flex-direction: column; padding: 20px; }
  .site-footer p { text-align: left; }
  .results-header { position: static; grid-template-columns: 1fr; padding: 15px 20px; }
  .results-header .brand { justify-self: center; }
  .results-shell { width: min(100% - 28px, 850px); padding-top: 18px; }
  .result-card { grid-template-columns: 112px 1fr; gap: 14px; }
  .result-card__body > p:not(.result-card__url) { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
  .result-card__actions { align-items: flex-start; flex-direction: column; gap: 7px; }
  .simple-header { padding: 0 20px; }
  .directory-title { padding-top: 48px; }
  .agency-grid { grid-template-columns: 1fr; }
  .admin-sidebar { display: block; }
  .admin-sidebar nav { margin-top: 18px; overflow-x: auto; flex-wrap: nowrap; }
  .admin-sidebar__footer { display: none; }
  .admin-main { padding: 25px 15px 60px; }
  .admin-top { display: block; }
  .admin-badge { display: inline-block; margin-top: 12px; }
  .stat-grid, .admin-grid, .field-grid { grid-template-columns: 1fr; }
  .field--full, .admin-panel--wide { grid-column: auto; }
  .admin-panel { padding: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* POLI · ETI · LENOS identity */
.brand-explainer {
  margin: 28px auto 30px;
  max-width: 1100px;
  padding: 28px;
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 24px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 18px 55px rgba(15,23,42,.07);
}
.brand-explainer__eyebrow {
  margin-bottom: 8px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #475569;
}
.brand-explainer h2 { margin: 0 0 18px; font-size: clamp(1.5rem, 4vw, 2.4rem); }
.brand-explainer__grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.brand-explainer__grid article { padding: 18px; border-radius: 18px; background: #f8fafc; border: 1px solid #e2e8f0; }
.brand-explainer__grid strong { display: block; margin-bottom: 7px; font-size: 1.05rem; }
.brand-explainer__grid span { color: #475569; line-height: 1.55; }
.brand-explainer > p { margin: 20px 0 0; color: #334155; line-height: 1.6; }
.directory-identity { max-width: 980px; color: #475569; line-height: 1.55; }
.import-safe-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; font-size: .9rem; line-height: 1.45; }
@media (max-width: 760px) { .brand-explainer__grid { grid-template-columns: 1fr; } .brand-explainer { padding: 20px; } }
