/* ============================================================
   CONCURSOSBORME — Design System
   Aesthetic: Premium Legal Editorial · FT meets Legal Tech
   Fonts: Cormorant Garamond (display) · Outfit (UI) · Fira Code (data)
   ============================================================ */

/* ---- TOKENS ---- */
:root {
  /* Color System */
  --ink:          #0E1A2B;   /* near-black navy — primary text */
  --ink-2:        #3D4A5C;   /* secondary text */
  --ink-3:        #7A8694;   /* muted text */
  --gold:         #B8892A;   /* accent — gold/amber */
  --gold-light:   #F5EDD6;   /* gold tint background */
  --paper:        #F7F4EF;   /* warm off-white — page bg */
  --surface:      #FFFFFF;   /* card surface */
  --rule:         #DDD8CE;   /* dividers */
  --rule-2:       #EAE7E0;   /* lighter dividers */
  --blue:         #1A3B6E;   /* link color */
  --blue-mid:     #2452A0;
  --blue-tint:    #EEF3FB;
  --red:          #B83025;   /* en procedimiento */
  --red-tint:     #FDF1F0;
  --green:        #2A6444;   /* concluido */
  --green-tint:   #EEF7F2;
  --nav-bg:       #0C1A2E;   /* header dark navy */
  --nav-border:   rgba(184,137,42,.35);

  /* Typography */
  --serif:   'Cormorant Garamond', 'Georgia', serif;
  --sans:    'Outfit', 'Segoe UI', sans-serif;
  --mono:    'Fira Code', 'Consolas', monospace;

  /* Spacing */
  --max-w:  1220px;
  --r:      4px;    /* base radius */
  --r-lg:   8px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(14,26,43,.07), 0 1px 2px rgba(14,26,43,.05);
  --shadow:    0 4px 12px rgba(14,26,43,.08), 0 1px 3px rgba(14,26,43,.05);
  --shadow-lg: 0 12px 32px rgba(14,26,43,.12), 0 4px 8px rgba(14,26,43,.06);
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; transition: color .15s; }
a:hover { color: var(--blue-mid); text-decoration: underline; text-underline-offset: 3px; }
button { cursor: pointer; font-family: inherit; }

/* ---- LAYOUT ---- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 2.5rem 0; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  position: sticky; top: 0; z-index: 200;
}
.site-header .container {
  display: flex;
  align-items: center;
  height: 60px;
  gap: 0;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--surface);
  flex-shrink: 0;
  margin-right: auto;
}
.site-logo-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.site-logo strong {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--surface);
}
.site-logo strong em {
  color: var(--gold);
  font-style: normal;
}
.site-tagline {
  font-size: .7rem;
  color: rgba(255,255,255,.45);
  font-family: var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  height: 100%;
}
.mobile-nav { display: none; }
.mobile-nav summary {
  list-style: none;
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r);
  padding: .35rem .75rem;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav-panel {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: .4rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  z-index: 300;
}
.mobile-nav-panel a {
  color: var(--ink);
  padding: .55rem .75rem;
  border-radius: var(--r);
  font-size: .88rem;
}
.mobile-nav-panel a:hover {
  background: var(--paper);
  text-decoration: none;
}
.site-nav a {
  color: rgba(255,255,255,.65);
  font-size: .825rem;
  font-weight: 500;
  letter-spacing: .02em;
  padding: .35rem .75rem;
  border-radius: var(--r);
  transition: background .15s, color .15s;
}
.site-nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
}

/* ============================================================
   HERO — Home
   ============================================================ */
.hero-section {
  background: var(--nav-bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(26,59,110,.5) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,.025) 39px, rgba(255,255,255,.025) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,.025) 39px, rgba(255,255,255,.025) 40px);
  padding: 2.75rem 0 2.75rem;
  position: relative;
  overflow: visible;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, rgba(184,137,42,.2) 60%, transparent 100%);
}
.hero-section .container {
  text-align: center;
}
.hero-section h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: .85rem;
  letter-spacing: -.01em;
}
.hero-section h1 span { color: var(--gold); }
.hero-badge-updated {
  display: inline-block;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 3px;
  padding: .2rem .6rem;
  margin-bottom: .75rem;
}
.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,.7);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
  line-height: 1.65;
}
.hero-sub strong { color: rgba(255,255,255,.9); }

/* Search bar */
.hero-search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto 2rem;
}
.hero-search {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  box-shadow: 0 0 0 1px var(--gold), 0 4px 20px rgba(0,0,0,.3);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.hero-search input {
  flex: 1;
  padding: .8rem 1.1rem;
  background: rgba(255,255,255,.07);
  border: none;
  color: rgba(255,255,255,.8);
  font-family: var(--sans);
  font-size: .95rem;
  outline: none;
  backdrop-filter: blur(4px);
}
.hero-search input::placeholder { color: rgba(255,255,255,.35); }
.hero-search button {
  padding: .8rem 1.35rem;
  background: var(--gold);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: background .15s;
}
.hero-search button:hover { background: #a07420; }

/* Stats strip */
.hero-stats {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-lg);
  overflow: hidden;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  backdrop-filter: blur(8px);
}
.stat-item {
  flex: 1;
  padding: .9rem 1.1rem;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,.08);
  position: relative;
}
.stat-item:last-child { border-right: none; }
.stat-item strong {
  display: block;
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--gold);
  line-height: 1;
  margin-bottom: .2rem;
}
.stat-item span {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.45);
}

/* ============================================================
   PAGE HERO (listados / administrador)
   ============================================================ */
.page-hero {
  padding: 1.75rem 0 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.75rem;
  position: relative;
}
.page-hero::before {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 80px; height: 2px;
  background: var(--gold);
}
.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -.015em;
  margin-bottom: .4rem;
  color: var(--ink);
}
.page-subtitle { color: var(--ink-3); font-size: .95rem; }
.stats-row { display: flex; gap: 1.75rem; flex-wrap: wrap; margin-top: .85rem; }
.stat { font-size: .85rem; color: var(--ink-3); }
.stat strong { color: var(--ink); font-weight: 600; }

/* Admin stats grid */
.admin-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1rem;
}
.admin-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .65rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  min-width: 90px;
  text-align: center;
}
.admin-stat-card strong {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.admin-stat-card span {
  font-size: .7rem;
  color: var(--ink-3);
  margin-top: .2rem;
  letter-spacing: .01em;
}
.admin-stat-activos strong  { color: #c0392b; }
.admin-stat-concluidos strong { color: var(--ink-3); }

/* Admin province tags */
.admin-provincias {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .85rem;
}
.admin-prov-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 20px;
  padding: .2rem .65rem;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.admin-prov-tag:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }
.admin-prov-tag span {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--gold);
  font-weight: 600;
}

/* ============================================================
   EMPRESA HERO
   ============================================================ */
.empresa-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 2.5rem 0 2rem;
  width: 100%;
}
.empresa-hero-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.empresa-hero-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .9rem;
}
.meta-item { font-size: .8rem; color: var(--ink-3); display: flex; align-items: center; gap: .3rem; }
.empresa-hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.015em;
  margin-bottom: .75rem;
  color: var(--ink);
  line-height: 1.2;
}
.empresa-intro { color: var(--ink-2); font-size: .95rem; max-width: 680px; line-height: 1.75; }

/* ============================================================
   LAYOUT — Empresa page
   ============================================================ */
.empresa-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; align-items: start; margin-top: 2.5rem; padding-bottom: 4rem; }
.empresa-sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: .25rem; }
.sticky-ad { position: sticky; top: 80px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow); }
.card-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  padding: .9rem 1.25rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  letter-spacing: .005em;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.card-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 16px;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}
.card > *:not(.card-title) { padding: 1.25rem; }
.card > .datos-table { padding: 0; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  padding: .9rem 0 .35rem;
  font-size: .8rem;
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; }
.breadcrumb li { display: flex; align-items: center; gap: .15rem; color: var(--ink-3); }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb [aria-current="page"] span { color: var(--ink-2); }

/* ============================================================
   TABLES — Concursos list
   ============================================================ */
.table-responsive { overflow-x: auto; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.concursos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.concursos-table thead tr {
  background: var(--ink);
  color: rgba(255,255,255,.9);
}
.concursos-table th {
  padding: .7rem 1rem;
  text-align: left;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.6);
  white-space: nowrap;
  border: none;
}
.concursos-table th:first-child { padding-left: 1.25rem; }
.concursos-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--rule-2);
  vertical-align: middle;
  color: var(--ink-2);
}
.concursos-table td:first-child { padding-left: 1.25rem; }
.concursos-table tbody tr { transition: background .1s; }
.concursos-table tbody tr:last-child td { border-bottom: none; }
.concursos-table tbody tr:hover td {
  background: var(--blue-tint);
}
.concursos-table td a {
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
}
.concursos-table td a:hover { color: var(--blue-mid); }
.results-count {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--ink-3);
  letter-spacing: .04em;
  margin-bottom: .75rem;
  text-transform: uppercase;
}
.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--ink-3);
  font-size: .95rem;
}

/* ============================================================
   DATOS TABLE — Ficha empresa
   ============================================================ */
.datos-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.datos-table tr:last-child td,
.datos-table tr:last-child th { border-bottom: none; }
.datos-table th {
  background: var(--paper);
  padding: .6rem 1.25rem;
  font-weight: 500;
  text-align: left;
  width: 38%;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule-2);
  font-size: .8rem;
  letter-spacing: .01em;
}
.datos-table td {
  padding: .6rem 1.25rem;
  border-bottom: 1px solid var(--rule-2);
  color: var(--ink);
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.datos-table td .badge { white-space: normal; line-height: 1.4; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { list-style: none; padding: 1.25rem 1.25rem 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: calc(1.25rem + 5.75rem);
  top: 1.5rem; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--gold), var(--rule) 80%);
}
.timeline-item {
  display: grid;
  grid-template-columns: 5.75rem 1fr;
  gap: 0 1.25rem;
  padding-bottom: 1.5rem;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(5.75rem + .8rem);
  top: .55rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--gold);
  z-index: 1;
}
.timeline-first::before {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-light);
}
.timeline-date time {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--ink-3);
  display: block;
  text-align: right;
  padding-top: .45rem;
  letter-spacing: .02em;
}
.timeline-content {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: .75rem 1rem;
  transition: border-color .15s;
}
.timeline-content:hover { border-color: var(--rule); box-shadow: var(--shadow-sm); }
.timeline-title {
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: .4rem;
  color: var(--ink);
}
.timeline-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .2rem .75rem;
  font-size: .8rem;
}
.timeline-details dt { color: var(--ink-3); font-weight: 400; white-space: nowrap; font-size: .76rem; }
.timeline-details dd { color: var(--ink-2); }
.resolucion-text {
  color: var(--ink-3);
  font-size: .78rem;
  line-height: 1.5;
  font-style: italic;
}
.badge-inline { font-size: .75rem !important; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .55rem;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge::before { content: '●'; font-size: .5rem; }
.badge-red    { background: var(--red-tint);   color: var(--red);    border: 1px solid rgba(184,48,37,.2); }
.badge-gray   { background: #F0EEE9;            color: var(--ink-3);  border: 1px solid var(--rule); }
.badge-green  { background: var(--green-tint);  color: var(--green);  border: 1px solid rgba(42,100,68,.2); }
.badge-orange { background: #FFF5E6;            color: #92500B;       border: 1px solid rgba(146,80,11,.2); }

/* ============================================================
   FILTROS
   ============================================================ */
.filtros-form {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.filtros-inner { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
.filtros-inner select {
  padding: .5rem .85rem;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  font-size: .875rem;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  min-width: 160px;
  appearance: auto;
  transition: border-color .15s;
}
.filtros-inner select:focus { outline: none; border-color: var(--gold); }
.btn-filtrar {
  padding: .5rem 1.25rem;
  background: var(--ink);
  color: var(--surface);
  border: none;
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .02em;
  transition: background .15s;
}
.btn-filtrar:hover { background: var(--blue); }
.htmx-indicator { display: none; color: var(--ink-3); font-size: .8rem; font-family: var(--mono); }
.htmx-request .htmx-indicator { display: inline; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--rule-2);
  background: var(--paper);
  gap: 1rem;
  flex-wrap: wrap;
}
.pagination-btn {
  padding: .4rem .9rem;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  font-size: .85rem;
  font-family: var(--sans);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 500;
  transition: all .15s;
}
.pagination-btn:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  text-decoration: none;
}
.pagination-info {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--ink-3);
  letter-spacing: .02em;
}

/* ============================================================
   PROVINCE CARDS
   ============================================================ */
.province-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .75rem;
  margin-top: 1.25rem;
}
.province-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.15rem;
  position: relative;
  overflow: hidden;
  transition: all .2s;
}
.province-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s;
}
.province-card:hover {
  border-color: var(--rule);
  box-shadow: var(--shadow);
  text-decoration: none;
  transform: translateY(-2px);
}
.province-card:hover::after { transform: scaleX(1); }
.province-card strong { font-weight: 600; font-size: .9rem; color: var(--ink); display: block; margin-bottom: .35rem; }
.province-card span {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--ink-3);
  letter-spacing: .04em;
}
.province-card-more {
  border-style: dashed;
  background: var(--paper);
  align-items: center;
  text-align: center;
  color: var(--gold);
}
.province-card-more strong { color: var(--gold); text-align: center; width: 100%; }
.province-grid { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; list-style: none; }
.province-grid a, .year-grid a {
  display: inline-block;
  padding: .28rem .65rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  font-size: .8rem;
  color: var(--ink-2);
  transition: all .12s;
}
.province-grid a:hover, .year-grid a:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  text-decoration: none;
}
.year-grid { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }

/* ============================================================
   SECTION HEADERS / LINKS
   ============================================================ */
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.section-header h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
}
.section-footer { text-align: center; margin-top: 1.5rem; }
.ver-todos-link {
  font-size: .85rem;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: .01em;
}
.ver-todos-link:hover { color: #8a6318; text-decoration: none; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-block;
  padding: .6rem 1.4rem;
  background: var(--ink);
  color: var(--surface);
  border: none;
  border-radius: var(--r);
  font-family: var(--sans);
  font-weight: 500;
  font-size: .9rem;
  letter-spacing: .02em;
  transition: background .15s;
}
.btn-primary:hover { background: var(--blue); text-decoration: none; color: #fff; }

.btn-secondary {
  display: inline-block;
  padding: .6rem 1.4rem;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  font-family: var(--sans);
  font-weight: 500;
  font-size: .9rem;
  letter-spacing: .02em;
  transition: all .15s;
}
.btn-secondary:hover { background: var(--ink); color: #fff; text-decoration: none; }

.btn-cta {
  display: inline-block;
  padding: .5rem 1rem;
  background: var(--gold);
  color: #fff;
  border-radius: var(--r);
  font-weight: 600;
  font-size: .875rem;
  letter-spacing: .02em;
  transition: background .15s;
}
.btn-cta:hover { background: #9a7222; text-decoration: none; color: #fff; }

.btn-cta-big {
  display: inline-block;
  padding: .85rem 2.25rem;
  background: var(--gold);
  color: #fff;
  border-radius: var(--r-lg);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .02em;
  box-shadow: 0 4px 14px rgba(184,137,42,.35);
  transition: all .15s;
}
.btn-cta-big:hover { background: #9a7222; text-decoration: none; color: #fff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(184,137,42,.4); }
.btn-cta-disabled {
  background: rgba(184,137,42,.12);
  border: 1px solid rgba(184,137,42,.35);
  color: rgba(255,255,255,.55);
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}
.btn-cta-disabled::after {
  content: ' — próximamente';
  font-size: .75em;
  color: rgba(255,255,255,.35);
}

/* ============================================================
   SEO SECTIONS (home)
   ============================================================ */
.seo-links {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin-top: 2rem;
}
.seo-links h2 {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--ink-3);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .85rem;
}
.seo-text { border-top: 1px solid var(--rule); padding-top: 2.5rem; }
.seo-text h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--ink);
  margin-bottom: 1.1rem;
}
.seo-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 1.75rem; }
.seo-cols p { font-size: .9rem; color: var(--ink-2); margin-bottom: .75rem; line-height: 1.75; }
.year-links h3 {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--ink-3);
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}

/* CTA section */
.cta-section {
  background: var(--nav-bg);
  background-image: radial-gradient(ellipse 60% 80% at 85% 50%, rgba(184,137,42,.12) 0%, transparent 60%);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--gold);
}
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.cta-inner h2 { font-family: var(--serif); font-size: 1.5rem; margin-bottom: .5rem; color: #fff; }
.cta-inner > div > p { color: rgba(255,255,255,.65); margin-bottom: .85rem; font-size: .9rem; }
.cta-list { list-style: none; font-size: .875rem; color: rgba(255,255,255,.6); }
.cta-list li { padding: .2rem 0; }
.cta-list li::before { content: '— '; color: var(--gold); }
.badge-pronto {
  display: inline-block;
  font-size: .65rem;
  font-family: var(--mono);
  letter-spacing: .04em;
  color: var(--gold);
  border: 1px solid rgba(184,137,42,.4);
  border-radius: 3px;
  padding: .05rem .35rem;
  margin-left: .4rem;
  vertical-align: middle;
  text-transform: uppercase;
}
.cta-action { text-align: center; flex-shrink: 0; }
.cta-note { font-family: var(--mono); font-size: .72rem; color: rgba(255,255,255,.4); margin-top: .6rem; letter-spacing: .04em; }

/* ============================================================
   ESTADÍSTICAS /estadisticas/
   ============================================================ */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.kpi-card strong {
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
}
.kpi-card span { font-size: .8rem; color: var(--ink-3); }

.stats-section { margin-bottom: 2.5rem; }
.stats-section-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule);
}
.stats-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.stats-note { font-size: .8rem; color: var(--ink-3); margin-top: .75rem; }

/* Bar chart anual más compacto */
.bar-chart-anual .bar-row { padding: .15rem 0; }
.bar-chart-anual .bar-label { width: 42px; font-size: .78rem; }
.bar-row-peak .bar-fill { background: var(--gold) !important; }
.bar-row-peak .bar-value { color: var(--gold); font-weight: 600; }
.bar-label-prov { width: 90px; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Estado breakdown */
.estado-breakdown { display: flex; flex-direction: column; gap: .5rem; }
.estado-row {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.estado-row .badge { min-width: 130px; justify-content: flex-start; flex-shrink: 0; font-size: .7rem; }
.tipo-label { min-width: 130px; font-size: .82rem; color: var(--ink-2); flex-shrink: 0; }
.bar-pct { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); width: 32px; text-align: right; flex-shrink: 0; }
.bar-fill-estado.badge-red    { background: var(--red); }
.bar-fill-estado.badge-orange { background: #D97706; }
.bar-fill-estado.badge-gray   { background: var(--ink-3); }

/* Top admins list */
.stats-admins-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.stats-admins-list li { display: flex; align-items: center; gap: .75rem; }
.stats-admins-rank {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--ink-3);
  width: 18px;
  text-align: right;
  flex-shrink: 0;
}
.stats-admins-info { flex: 1; min-width: 0; }
.stats-admins-info a { font-size: .85rem; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-admins-meta { font-size: .72rem; color: var(--ink-3); }
.stats-admins-n { font-family: var(--mono); font-size: .82rem; color: var(--ink-2); flex-shrink: 0; }
.txt-red { color: var(--red); }

/* Duración kpis */
.duracion-kpis { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.duracion-kpi {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: .65rem 1rem;
  min-width: 100px;
}
.duracion-kpi strong { font-family: var(--mono); font-size: 1rem; color: var(--ink); }
.duracion-kpi span { font-size: .7rem; color: var(--ink-3); margin-top: .15rem; }

@media (max-width: 768px) {
  .stats-cols-2 { grid-template-columns: 1fr; }
  .stats-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   ADMINISTRADORES — listado /administradores/
   ============================================================ */
.admin-orden {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  font-size: .8rem;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.admin-orden a {
  padding: .25rem .65rem;
  border-radius: 20px;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.admin-orden a:hover { border-color: var(--gold); color: var(--gold); }
.admin-orden a.active { border-color: var(--gold); color: var(--gold); background: rgba(184,137,42,.07); }
.admins-table .col-num { text-align: right; white-space: nowrap; width: 90px; }
.admins-table .col-actividad { white-space: nowrap; color: var(--ink-3); font-size: .8rem; }
.admins-table .mono { font-family: var(--mono); font-size: .85rem; }
.admins-table .col-muted { color: var(--ink-3); }
.actividad-rango { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); }
.admin-nombre-link { font-weight: 500; }

/* ============================================================
   EMPRESA RELACIONADAS
   ============================================================ */
.empresas-relacionadas-list { list-style: none; padding: 0; }
.empresas-relacionadas-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .6rem 0;
  border-bottom: 1px solid var(--rule-2);
  gap: 1rem;
}
.empresas-relacionadas-list li:last-child { border-bottom: none; }
.empresas-relacionadas-list a {
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
}
.rel-meta {
  font-family: var(--mono);
  color: var(--ink-3);
  white-space: nowrap;
  font-size: .72rem;
  letter-spacing: .03em;
}

/* ============================================================
   SIDEBAR CARDS
   ============================================================ */
.sidebar-card { font-size: .875rem; }
.sidebar-body {
  padding: 1.25rem 1.35rem 1.35rem;
}
.sidebar-card h3 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: .75rem;
  color: var(--ink);
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule-2);
}
.sidebar-card p { color: var(--ink-2); line-height: 1.7; margin-bottom: .6rem; }
.sidebar-juzgado { font-size: .82rem; color: var(--ink-3); word-break: break-word; }
.sidebar-cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: .75rem 1rem;
  margin-top: .5rem;
  font-size: .875rem;
  letter-spacing: .03em;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--nav-bg);
  border-top: 1px solid rgba(255,255,255,.06);
  color: rgba(255,255,255,.55);
  padding: 3rem 0 1.25rem;
  margin-top: 4rem;
  font-size: .85rem;
}
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.footer-cols > div > strong {
  display: block;
  color: rgba(255,255,255,.85);
  font-family: var(--serif);
  font-size: 1rem;
  margin-bottom: .65rem;
  font-weight: 600;
}
.footer-cols ul { list-style: none; }
.footer-cols ul li { padding: .22rem 0; }
.footer-cols a { color: rgba(255,255,255,.5); transition: color .15s; }
.footer-cols a:hover { color: var(--gold); text-decoration: none; }
.footer-cols p { color: rgba(255,255,255,.4); line-height: 1.65; }
.footer-note { font-size: .78rem !important; color: rgba(255,255,255,.3) !important; margin-top: .75rem !important; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding-top: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  color: rgba(255,255,255,.3);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
}
.footer-bottom a { color: rgba(255,255,255,.3); }
.footer-bottom a:hover { color: var(--gold); }

/* ============================================================
   DATOS COLS — layout 2 columnas en ficha empresa
   ============================================================ */
.datos-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.datos-cols > .card { margin-bottom: 0; }
.objeto-social-text {
  font-size: .82rem;
  color: var(--ink-2);
  line-height: 1.6;
  font-style: italic;
}

/* ============================================================
   RESUMEN NARRATIVO
   ============================================================ */
.resumen-section {
  background: var(--gold-light);
  border: 1px solid #e0d0a0;
  border-left: 4px solid var(--gold);
  border-radius: var(--r-lg);
  padding: 1.75rem 2rem;
  margin-top: 1.75rem;
  margin-bottom: 0;
}
.resumen-inner {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  max-width: 860px;
}
.resumen-inner p {
  font-size: .97rem;
  color: var(--ink-2);
  line-height: 1.85;
}
.resumen-inner p strong { color: var(--ink); font-weight: 600; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { padding: 0 1.25rem 1rem; }
.faq-item {
  border-bottom: 1px solid var(--rule-2);
  padding: .1rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  padding: .75rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '+';
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform .2s;
}
details[open] .faq-q::after { content: '−'; }
.faq-a {
  font-size: .88rem;
  color: var(--ink-2);
  line-height: 1.75;
  padding-bottom: .9rem;
  padding-left: .25rem;
}
.faq-a strong { color: var(--ink); }

/* ============================================================
   ESTADÍSTICAS PROVINCIA
   ============================================================ */
.stats-detalle {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}
.stats-detalle-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--ink);
}
.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-box {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 1rem;
  text-align: center;
}
.stat-box strong {
  display: block;
  font-family: var(--mono);
  font-size: 1.5rem;
  color: var(--gold);
  line-height: 1;
  margin-bottom: .3rem;
}
.stat-box span { font-size: .75rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.stats-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.stats-subtitle {
  font-family: var(--mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-3);
  margin-bottom: .75rem;
}
.stats-list { list-style: none; padding: 0; }
.stats-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .4rem 0;
  border-bottom: 1px solid var(--rule-2);
  font-size: .85rem;
  gap: .5rem;
}
.stats-list li:last-child { border-bottom: none; }
.stats-list li > span:first-child, .stats-list li > a { color: var(--ink-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-count { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); white-space: nowrap; }

/* Bar chart */
.bar-chart { display: flex; flex-direction: column; gap: .35rem; }
.bar-row { display: grid; grid-template-columns: 2.5rem 1fr 2.5rem; gap: .4rem; align-items: center; }
.bar-label { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); text-align: right; }
.bar-track { background: var(--paper); border-radius: 2px; height: 8px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--gold); border-radius: 2px; transition: width .3s; }
.bar-value { font-family: var(--mono); font-size: .68rem; color: var(--ink-3); }

/* ============================================================
   UTILITY
   ============================================================ */
.section-divider {
  height: 1px;
  background: var(--rule);
  margin: 2rem 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-cols   { grid-template-columns: 1fr; }
  .datos-cols   { grid-template-columns: 1fr; }
  .empresa-layout { grid-template-columns: 1fr; }
  .empresa-sidebar { position: static; }
  .sticky-ad { position: static; }
  .footer-cols { grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
  .seo-cols { grid-template-columns: 1fr; gap: 1rem; }
}
@media (max-width: 760px) {
  .timeline::before { left: 0; }
  .timeline { padding-left: 0; }
  .timeline-item { grid-template-columns: 1fr; padding-left: 1.25rem; }
  .timeline-item::before { left: -.35rem; top: .4rem; }
  .timeline-date time { text-align: left; padding-top: 0; padding-bottom: .25rem; }
  .hero-stats { max-width: 100%; }
  .cta-inner { flex-direction: column; gap: 1.25rem; }
  .cta-action { width: 100%; }
  .btn-cta-big { width: 100%; text-align: center; }
}
@media (max-width: 600px) {
  .container { padding: 0 1rem; }
  .footer-cols { grid-template-columns: 1fr; gap: 1.5rem; }
  .site-nav { display: none; }
  .site-header .container { position: relative; justify-content: space-between; }
  .site-logo { margin-right: 0; min-width: 0; }
  .site-logo strong { font-size: 1.05rem; }
  .mobile-nav { display: block; }
  .province-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .hero-section { padding: 2.5rem 0 2.5rem; }
  .hero-section h1 { font-size: 1.75rem; }
  .filtros-inner { flex-direction: column; align-items: stretch; }
  .filtros-inner select, .btn-filtrar { width: 100%; }

  /* CTA section — mobile */
  .cta-section {
    margin-left: 1rem;
    margin-right: 1rem;
    padding: 1.5rem 1.25rem;
  }
  .cta-inner h2 { font-size: 1.25rem; }

  /* Página estadísticas */
  .stats-kpi-grid { grid-template-columns: 1fr; }
  .stats-admins-list li {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .stats-admins-info a {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    overflow-wrap: anywhere;
  }
  .stats-admins-meta {
    display: block;
    overflow-wrap: anywhere;
  }
  .stats-admins-n {
    width: 100%;
    padding-left: 2.5rem;
  }
  .estado-row {
    grid-template-columns: 1fr;
    gap: .35rem;
  }
  .tipo-label,
  .estado-row .badge {
    justify-self: start;
  }
  .estado-row .bar-value,
  .estado-row .bar-pct {
    justify-self: start;
  }

  /* Estadísticas de provincia */
  .stats-detalle { padding: 1rem; overflow: hidden; }
  .stats-grid-4 { grid-template-columns: 1fr; }
  .stat-box { min-width: 0; }
  .stats-cols { grid-template-columns: 1fr; }
  .stats-list li {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .stats-list li > span:first-child,
  .stats-list li > a {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    overflow-wrap: anywhere;
  }
  .stats-count { white-space: normal; }
  .bar-row {
    grid-template-columns: minmax(3.25rem, 5.5rem) 1fr auto;
    row-gap: .2rem;
    column-gap: .4rem;
  }
  .bar-value {
    grid-column: auto;
    justify-self: end;
  }

  /* Tabla de concursos — tarjetas apiladas, sin scroll lateral */
  .table-responsive { overflow-x: visible; box-shadow: none; }
  .concursos-table { border: none; box-shadow: none; }
  .concursos-table thead { display: none; }
  .concursos-table,
  .concursos-table tbody { display: block; }
  .concursos-table tr {
    display: block;
    position: relative;
    padding: .85rem 1rem .85rem 1rem;
    border-bottom: 1px solid var(--rule-2);
    background: var(--surface);
  }
  .concursos-table tbody tr:first-child { border-top: 1px solid var(--rule-2); }
  .concursos-table tbody tr:hover td { background: transparent; }
  .concursos-table td {
    display: block;
    padding: 0;
    border: none;
    color: var(--ink-2);
  }
  /* Nombre empresa */
  .concursos-table td:nth-child(1) {
    font-size: .95rem;
    margin-bottom: .35rem;
    padding-right: 0;
  }
  .concursos-table td:nth-child(1) a {
    font-family: var(--serif);
    font-size: .95rem;
    font-weight: 600;
    color: var(--ink);
  }
  /* Provincia + Fecha en línea */
  .concursos-table td:nth-child(2) {
    display: inline;
    font-size: .78rem;
    color: var(--ink-3);
  }
  .concursos-table td:nth-child(3) {
    display: inline;
    font-size: .78rem;
    color: var(--ink-3);
  }
  .concursos-table td:nth-child(3)::before { content: ' · '; }
  /* Ocultar Tipo */
  .concursos-table td:nth-child(4) { display: none; }
  /* Badge de estado en flujo normal para no romper el título */
  .concursos-table td:nth-child(5) {
    position: static;
    margin-top: .5rem;
  }
  .concursos-table td:nth-child(5) .badge {
    white-space: normal;
    line-height: 1.35;
  }

  /* Tabla de administradores en móvil */
  .admins-table tr { padding-bottom: 1rem; }
  .admins-table td:nth-child(1) {
    margin-bottom: .5rem;
    padding-right: 0;
  }
  .admins-table td:nth-child(2),
  .admins-table td:nth-child(3),
  .admins-table td:nth-child(4),
  .admins-table td:nth-child(5),
  .admins-table td:nth-child(6) {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-right: .75rem;
    margin-top: .35rem;
    font-size: .78rem;
    color: var(--ink-3);
    position: static;
  }
  .admins-table td:nth-child(2)::before { content: 'Concursos'; font-family: var(--mono); font-size: .68rem; }
  .admins-table td:nth-child(3)::before { content: 'Activos'; font-family: var(--mono); font-size: .68rem; }
  .admins-table td:nth-child(4)::before { content: 'Concl.'; font-family: var(--mono); font-size: .68rem; }
  .admins-table td:nth-child(5)::before { content: 'Prov.'; font-family: var(--mono); font-size: .68rem; }
  .admins-table td:nth-child(6)::before { content: 'Periodo'; font-family: var(--mono); font-size: .68rem; }
  .admins-table .col-num,
  .admins-table .col-actividad {
    white-space: normal;
    width: auto;
    text-align: left;
  }
  .admins-table .badge {
    white-space: nowrap;
  }

  /* Ficha de administrador en móvil */
  .admin-detail-table tr {
    padding-bottom: 1rem;
  }
  .admin-detail-table td:nth-child(1) {
    margin-bottom: .45rem;
    padding-right: 0;
  }
  .admin-detail-table td:nth-child(2),
  .admin-detail-table td:nth-child(3),
  .admin-detail-table td:nth-child(4),
  .admin-detail-table td:nth-child(5) {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: .32rem;
    margin-right: .7rem;
    font-size: .78rem;
    color: var(--ink-3);
    position: static;
  }
  .admin-detail-table td:nth-child(2)::before { content: 'Provincia'; font-family: var(--mono); font-size: .68rem; }
  .admin-detail-table td:nth-child(3)::before { content: 'Proc.'; font-family: var(--mono); font-size: .68rem; }
  .admin-detail-table td:nth-child(4)::before { content: 'Juzgado'; font-family: var(--mono); font-size: .68rem; }
  .admin-detail-table td:nth-child(5)::before { content: 'Fecha'; font-family: var(--mono); font-size: .68rem; }
  .admin-detail-table td:nth-child(6) {
    position: static;
    margin-top: .5rem;
  }
  .admin-detail-table td:nth-child(6) .badge {
    white-space: normal;
    line-height: 1.35;
  }
}

/* ============================================================
   ANIMATIONS (subtle, purposeful)
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.empresa-hero, .page-hero { animation: fadeUp .35s ease both; }
.card { animation: fadeUp .3s ease both; }
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .1s; }

/* ── LEGAL PAGES ─────────────────────────────────────────────────────────── */
.legal-content {
  max-width: 780px;
  margin: 0 auto 4rem;
}
.legal-content section {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule-2);
}
.legal-content section:last-of-type { border-bottom: none; }
.legal-content h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
}
.legal-content h3 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.5rem 0 .6rem;
}
.legal-content p {
  color: var(--ink-2);
  line-height: 1.75;
  margin-bottom: .9rem;
}
.legal-content ul {
  color: var(--ink-2);
  line-height: 1.75;
  padding-left: 1.5rem;
  margin-bottom: .9rem;
}
.legal-content ul li { margin-bottom: .35rem; }
.legal-content a { color: var(--blue); }
.legal-content a:hover { color: var(--gold); }

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin: 1rem 0 1.25rem;
}
.legal-table th, .legal-table td {
  padding: .6rem .9rem;
  border: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  background: var(--gold-light);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  width: 160px;
}
.legal-table td { color: var(--ink-2); }

.cookies-table th { width: auto; }
.cookies-table thead th {
  background: var(--ink);
  color: var(--paper);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.legal-update {
  font-size: .82rem;
  color: var(--ink-3);
  margin-top: 2rem;
  font-style: italic;
}

/* ── BUSCADOR ─────────────────────────────────────────────────────────────── */
.hero-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
}

.search-results-list {
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow-y: auto;
  max-height: 320px;
  box-shadow: 0 8px 32px rgba(14,26,43,.18);
  margin: .5rem 0 0;
}
.search-results-list li { border-bottom: 1px solid var(--rule-2); }
.search-results-list li:last-child { border-bottom: none; }
.search-results-list a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .9rem;
  color: var(--ink);
  transition: background .12s;
  flex-wrap: nowrap;
}
.search-results-list a:hover { background: var(--gold-light); }
.sr-name {
  flex: 1;
  font-size: .9rem;
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-meta {
  font-size: .78rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.search-results-list .badge { font-size: .7rem; padding: .15rem .45rem; }

.search-more {
  text-align: center;
  padding: .6rem;
  font-size: .82rem;
  border-top: 1px solid var(--rule-2);
  background: var(--gold-light);
}
.search-more a { color: var(--gold); font-weight: 600; }

.search-no-results {
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  text-align: center;
  padding: .75rem 0;
}

/* Página /buscar/ */
.buscar-page { max-width: 700px; margin: 0 auto 4rem; }
.buscar-form {
  display: flex;
  gap: .5rem;
  margin-bottom: 2rem;
}
.buscar-input {
  flex: 1;
  padding: .7rem 1rem;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--surface);
}
.buscar-input:focus { outline: none; border-color: var(--gold); }
.buscar-results .search-results-list {
  box-shadow: none;
  border-radius: 8px;
}
.search-results-full a { padding: .85rem 1.1rem; }
.search-count {
  font-size: .88rem;
  color: var(--ink-3);
  margin-bottom: .75rem;
}
.search-tip { font-size: .85rem; color: var(--ink-3); margin-top: .5rem; }

/* ── CONTACTO ─────────────────────────────────────────────────────────────── */
.contacto-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto 4rem;
  align-items: start;
}
.contacto-form-wrap { min-width: 0; }

.contacto-form .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1.1rem;
}
.form-group label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
}
.required { color: var(--gold); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: .65rem .9rem;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  font-size: .95rem;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--gold); }
.form-group textarea { resize: vertical; min-height: 130px; }

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}
.form-legal { font-size: .8rem; color: var(--ink-3); }
.form-legal a { color: var(--blue); }

.contacto-ok {
  background: #edf7ed;
  border: 1px solid #a3d9a5;
  border-radius: 10px;
  padding: 1.5rem;
  color: #1e5c20;
}
.contacto-ok-icon { display: block; font-size: 2rem; line-height: 1; margin-bottom: .5rem; color: #2e7d32; }
.contacto-ok strong { display: block; font-size: 1.1rem; margin-bottom: .5rem; }

.contacto-error {
  background: #fdf0f0;
  border: 1px solid #f5c6c6;
  border-radius: 8px;
  padding: .85rem 1rem;
  color: #b91c1c;
  font-size: .9rem;
  margin-bottom: 1.25rem;
}

.contacto-email {
  display: inline-block;
  margin-top: .35rem;
  color: var(--gold);
  font-weight: 600;
  font-size: .9rem;
  word-break: break-all;
}
.contacto-motivos {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.contacto-motivos li { font-size: .85rem; color: var(--ink-2); line-height: 1.5; }
.contacto-motivos strong { color: var(--ink); display: block; }

@media (max-width: 700px) {
  .contacto-layout { grid-template-columns: 1fr; }
  .contacto-form .form-row-2 { grid-template-columns: 1fr; }
}
