/* ================================================================
   BOE Diario — main.css
   Diseño limpio, tipografía Circular/Inter, estilo Airbnb
================================================================ */

/* --- Google Fonts: Inter --------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Variables ------------------------------------------------- */
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;

  /* Escala de grises */
  --gray-0:  #ffffff;
  --gray-50: #f7f7f7;
  --gray-100:#ebebeb;
  --gray-200:#dddddd;
  --gray-300:#b0b0b0;
  --gray-400:#717171;
  --gray-500:#484848;
  --gray-600:#222222;

  /* Acento — rosa Airbnb */
  --accent:     #FF385C;
  --accent-soft:#FFF0F2;
  --accent-dark:#D90B2F;

  /* Semánticos */
  --bg:       var(--gray-50);
  --surface:  var(--gray-0);
  --border:   var(--gray-200);
  --border-focus: var(--gray-600);
  --text:     var(--gray-600);
  --text-sub: var(--gray-400);
  --text-hint:var(--gray-300);

  /* Pills de sección */
  --violet-bg: #f3f0ff; --violet-tx: #5b21b6;
  --teal-bg:   #f0fdf9; --teal-tx:   #0f766e;
  --blue-bg:   #eff6ff; --blue-tx:   #1d4ed8;
  --amber-bg:  #fffbeb; --amber-tx:  #b45309;
  --slate-bg:  #f1f5f9; --slate-tx:  #475569;

  /* Layout */
  --max-w:    1120px;
  --sidebar:  288px;
  --radius:   12px;
  --radius-sm:8px;
  --shadow:   0 1px 2px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md:0 4px 16px rgba(0,0,0,.10);
}

/* --- Modo oscuro ---------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-0:  #1a1a1a; --gray-50: #222222; --gray-100:#2e2e2e;
    --gray-200:#3d3d3d; --gray-300:#6b6b6b; --gray-400:#9e9e9e;
    --gray-500:#c9c9c9; --gray-600:#f5f5f5;
    --bg:      #121212; --surface: #1e1e1e; --border: #333333;
    --violet-bg:#1e1433; --violet-tx:#a78bfa;
    --teal-bg:  #0d2320; --teal-tx:  #34d399;
    --blue-bg:  #0d1f3c; --blue-tx:  #60a5fa;
    --amber-bg: #2d1f00; --amber-tx: #fbbf24;
    --slate-bg: #1e2530; --slate-tx: #94a3b8;
  }
}

/* --- Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: var(--font); }

/* --- Utilidades ----------------------------------------------- */
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ================================================================
   TOPBAR
================================================================ */
.topbar {
  background: var(--gray-600);
  color: rgba(255,255,255,.75);
  font-size: 11px;
  letter-spacing: .02em;
  padding: 8px 0;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar a { color: rgba(255,255,255,.75); }
.topbar a:hover { color: #fff; }

/* ================================================================
   HEADER
================================================================ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 24px;
}
.header-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
  text-decoration: none;
}
.header-brand__name {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.3px;
  line-height: 1;
}
.header-brand__tag {
  font-size: 10px;
  color: var(--text-sub);
  font-weight: 400;
  letter-spacing: .02em;
}

/* Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 16px;
}
.header-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sub);
  padding: 6px 14px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.header-nav a:hover { background: var(--gray-100); color: var(--text); }
.header-nav a.active { color: var(--text); background: var(--gray-100); }

/* Search */
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 1 320px;
}
.header-search__wrap {
  position: relative;
  flex: 1;
}
.header-search__ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-sub);
  pointer-events: none;
}
.header-search__input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  background: var(--gray-50);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s, background .15s;
}
.header-search__input:focus { border-color: var(--border-focus); background: var(--surface); }
.header-search__input::placeholder { color: var(--text-hint); }

/* Hamburguesa móvil */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text);
  margin-left: auto;
  flex-shrink: 0;
}
.nav-toggle svg { display: block; }

/* Menú móvil */
.mobile-menu {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-menu a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-sub);
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  display: block;
}
.mobile-menu a:last-child { border-bottom: none; }

/* ================================================================
   DATE BAR — fechas recientes
================================================================ */
.datebar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.datebar .container {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.datebar .container::-webkit-scrollbar { display: none; }
.datebar__label {
  font-size: 11px;
  color: var(--text-hint);
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.datebar__chip {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color .15s, color .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.datebar__chip:hover { border-color: var(--gray-400); color: var(--text); }
.datebar__chip.is-active {
  border-color: var(--gray-600);
  color: var(--text);
  background: var(--gray-600);
  color: var(--surface);
}
.datebar__chip .chip-count {
  font-size: 11px;
  font-weight: 400;
  opacity: .7;
}

/* ================================================================
   LAYOUT PRINCIPAL
================================================================ */
.page-wrap {
  display: grid;
  grid-template-columns: 1fr var(--sidebar);
  gap: 32px;
  padding: 32px 0 64px;
  align-items: start;
}

/* ================================================================
   ENCABEZADO DEL DÍA
================================================================ */
.day-header {
  margin-bottom: 24px;
}
.day-header__date {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--text);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}
.day-header__num {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-sub);
  border: 1.5px solid var(--border);
  padding: 2px 10px;
  border-radius: 20px;
}
.day-header__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

/* Stats de sección */
.sec-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sec-stat {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  text-align: center;
  min-width: 90px;
}
.sec-stat__n  { font-size: 22px; font-weight: 700; color: var(--text); display: block; }
.sec-stat__lbl{ font-size: 11px; color: var(--text-sub); display: block; margin-top: 2px; }

/* ================================================================
   ITEM CARD
================================================================ */
.items-list { display: flex; flex-direction: column; gap: 0; }

.item-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 12px;
  border-left: 4px solid transparent;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, box-shadow .15s;
}
.item-card.visible { opacity: 1; transform: none; }
.item-card:hover { box-shadow: var(--shadow); }
.item-card.has-resume { border-left-color: var(--accent); }

/* Header del card */
.item-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.item-card__pills { display: flex; gap: 6px; flex-wrap: wrap; }
.item-card__id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-hint);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.item-card__id:hover { border-color: var(--gray-400); color: var(--text-sub); }

.item-card__epigrafe {
  font-size: 11px;
  color: var(--text-hint);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.item-card__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 12px;
}

/* Resumen IA */
.item-resume {
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.item-resume__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.item-resume__text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  .item-resume { background: rgba(255,56,92,.08); }
}

.item-status {
  font-size: 13px;
  padding: 4px 0;
  margin-bottom: 10px;
}
.item-status--pending { color: var(--amber-tx); }
.item-status--error   { color: #dc2626; }

/* Links del card */
.item-card__links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.item-link {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  color: var(--text-sub);
  transition: all .12s;
}
.item-link:hover { border-color: var(--gray-500); color: var(--text); }
.item-link--primary { border-color: var(--gray-400); color: var(--text); }
.item-link--primary:hover { background: var(--text); color: var(--surface); border-color: var(--text); }

/* Item leído */
.item-card.is-read { opacity: .65; }

/* ================================================================
   PILLS / BADGES
================================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill-violet { background: var(--violet-bg); color: var(--violet-tx); }
.pill-teal   { background: var(--teal-bg);   color: var(--teal-tx);   }
.pill-blue   { background: var(--blue-bg);   color: var(--blue-tx);   }
.pill-amber  { background: var(--amber-bg);  color: var(--amber-tx);  }
.pill-slate  { background: var(--slate-bg);  color: var(--slate-tx);  }
.pill-dept   { background: var(--gray-100);  color: var(--gray-400);  font-weight: 400; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-count   { background: var(--blue-bg);   color: var(--blue-tx);   }
.badge-ok      { background: var(--teal-bg);   color: var(--teal-tx);   }
.badge-pending { background: var(--amber-bg);  color: var(--amber-tx);  }
.badge-search  { background: var(--accent-soft);color: var(--accent);   }
.badge-search .badge-clear { margin-left: 4px; opacity: .6; font-size: 11px; }
.badge-search .badge-clear:hover { opacity: 1; }

/* ================================================================
   PAGINACIÓN
================================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
}
.pag-btn {
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  transition: all .12s;
  text-decoration: none;
}
.pag-btn:hover { border-color: var(--gray-500); text-decoration: none; }
.pag-info { font-size: 13px; color: var(--text-sub); }

/* ================================================================
   EMPTY STATE
================================================================ */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--text-sub);
}
.empty-state__title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty-state__msg   { font-size: 14px; color: var(--text-sub); line-height: 1.7; max-width: 400px; margin: 0 auto 20px; }
.empty-state__cmd   { display: inline-block; background: var(--gray-100); border: 1px solid var(--border);
                      padding: 10px 18px; border-radius: var(--radius-sm); font-family: var(--font-mono);
                      font-size: 13px; color: var(--text-sub); margin-top: 8px; }

/* ================================================================
   SIDEBAR
================================================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 80px;
}
.scard {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.scard--accent {
  border-color: rgba(255,56,92,.2);
  background: var(--accent-soft);
}
@media (prefers-color-scheme: dark) {
  .scard--accent { background: rgba(255,56,92,.07); border-color: rgba(255,56,92,.25); }
}
.scard__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 14px;
}
.scard__body { font-size: 13px; color: var(--text-sub); line-height: 1.7; }
.scard__body a { color: var(--text); font-weight: 500; border-bottom: 1px solid var(--border); }
.scard__body a:hover { border-color: var(--text-sub); }

/* Resumen ejecutivo */
.exec-summary { font-size: 14px; line-height: 1.75; color: var(--text); font-weight: 400; }

/* Filtros chips */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  color: var(--text-sub);
  transition: all .12s;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.fchip:hover { border-color: var(--gray-400); color: var(--text); text-decoration: none; }
.fchip.is-active { background: var(--text); border-color: var(--text); color: var(--surface); }

/* Date input */
.date-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s;
  cursor: pointer;
}
.date-input:focus { border-color: var(--border-focus); background: var(--surface); }

/* ================================================================
   FOOTER
================================================================ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 48px;
}
.site-footer .container {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-top: 48px;
  padding-bottom: 48px;
}
.footer-col {}
.footer-col__brand-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.3px;
  margin-bottom: 10px;
}
.footer-col__about {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.7;
  max-width: 240px;
}
.footer-col__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-hint);
  margin-bottom: 14px;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a {
  font-size: 13px;
  color: var(--text-sub);
  transition: color .12s;
}
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}
.footer-bottom .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 0;
  padding-bottom: 0;
}
.footer-bottom p { font-size: 12px; color: var(--text-hint); }

/* ================================================================
   PÁGINA BUSCAR
================================================================ */
.search-hero { padding: 40px 0 32px; }
.search-hero__title { font-size: 28px; font-weight: 700; margin-bottom: 6px; letter-spacing: -.5px; }
.search-hero__sub   { font-size: 15px; color: var(--text-sub); margin-bottom: 24px; }
.search-form {
  display: flex;
  gap: 10px;
  max-width: 560px;
}
.search-form__input {
  flex: 1;
  padding: 12px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s;
}
.search-form__input:focus { border-color: var(--border-focus); }
.search-count { font-size: 14px; color: var(--text-sub); margin-bottom: 20px; }
.search-count strong { color: var(--text); font-weight: 600; }
.search-hint  { padding: 24px; background: var(--surface); border: 1.5px solid var(--border);
                border-radius: var(--radius); font-size: 14px; color: var(--text-sub); line-height: 1.7; }
.search-hint em { font-style: normal; color: var(--accent); font-weight: 500; }

/* ================================================================
   PÁGINA ESTADÍSTICAS
================================================================ */
.stats-hero { padding: 40px 0 32px; }
.stats-hero__title { font-size: 28px; font-weight: 700; letter-spacing: -.5px; margin-bottom: 4px; }
.stats-hero__sub   { font-size: 15px; color: var(--text-sub); }
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.metric {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.metric__n   { font-size: 32px; font-weight: 700; color: var(--text); letter-spacing: -.5px; display: block; }
.metric__lbl { font-size: 13px; color: var(--text-sub); margin-top: 4px; display: block; }
.metric--accent { border-left: 4px solid var(--accent); }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.stat-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 24px; }
.stat-card--full { grid-column: 1 / -1; }
.stat-card__title { font-size: 15px; font-weight: 700; margin-bottom: 20px; }

.rank-list { list-style: none; }
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.rank-item:last-child { border-bottom: none; }
.rank-pos  { font-size: 12px; color: var(--text-hint); width: 20px; flex-shrink: 0; text-align: center; }
.rank-name { flex: 1; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank-n    { font-size: 12px; font-weight: 600; background: var(--gray-100); color: var(--text-sub);
             padding: 2px 8px; border-radius: 20px; flex-shrink: 0; }

.bar-list { display: flex; flex-direction: column; gap: 14px; }
.bar-item { display: grid; grid-template-columns: 160px 1fr 36px; align-items: center; gap: 12px; }
.bar-item__label { font-size: 12px; color: var(--text-sub); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bar-item__track { height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.bar-item__fill  { height: 100%; background: var(--gray-600); border-radius: 3px; transition: width .5s; }
.bar-item__count { font-size: 12px; color: var(--text-hint); text-align: right; }

.days-table-wrap { overflow-x: auto; }
.days-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.days-table th { text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--border);
                  font-size: 11px; font-weight: 700; color: var(--text-hint); text-transform: uppercase; letter-spacing: .05em; }
.days-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.days-table tr:last-child td { border-bottom: none; }
.days-table tr:hover td { background: var(--gray-50); }
code.id-code { font-family: var(--font-mono); font-size: 12px; color: var(--text-sub); }

/* ================================================================
   BOTONES
================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn--dark   { background: var(--text); color: var(--surface); border-color: var(--text); }
.btn--dark:hover { opacity: .85; }
.btn--outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn--outline:hover { border-color: var(--gray-400); }
.btn--full { width: 100%; }
.btn--sm   { font-size: 12px; padding: 6px 14px; }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* ================================================================
   ANIMACIÓN entrada
================================================================ */
@keyframes fadein { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }
.highlight-pulse { animation: pulse-border 2s ease-out; }
@keyframes pulse-border {
  0%   { box-shadow: 0 0 0 0 rgba(255,56,92,.3); }
  50%  { box-shadow: 0 0 0 6px rgba(255,56,92,.08); }
  100% { box-shadow: 0 0 0 0 rgba(255,56,92,0); }
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 960px) {
  .page-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; order: -1; }
  .metrics-row { grid-template-columns: repeat(2,1fr); }
  .stats-grid { grid-template-columns: 1fr; }
  .site-footer .container { grid-template-columns: 1fr 1fr; gap: 28px; }
  .bar-item { grid-template-columns: 120px 1fr 30px; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .header-nav { display: none; }
  .header-search { display: none; }
  .nav-toggle { display: flex; }
  .day-header__date { font-size: 20px; }
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .site-footer .container { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom .container { flex-direction: column; align-items: flex-start; }
  .search-form { flex-direction: column; }
  .bar-item { grid-template-columns: 1fr; }
}

/* ================================================================
   PANEL DE PROCESADO
================================================================ */
.process-panel {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  max-width: 620px;
}
.process-panel__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--text-sub);
}
.process-panel__icon--ok  { background: #f0fdf4; color: #16a34a; }
.process-panel__icon--err { background: #fef2f2; color: #dc2626; }
.process-panel__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px;
  margin-bottom: 12px;
}
.process-panel__msg {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.7;
  max-width: 440px;
  margin: 0 auto 28px;
}
.process-panel__btn { font-size: 15px; padding: 12px 28px; }
.process-panel__hint {
  font-size: 12px;
  color: var(--text-hint);
  margin-top: 14px;
}

/* Spinner */
.progress-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}
.progress-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Barra de progreso */
.progress-bar-wrap {
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .4s ease;
  min-width: 4px;
}

/* Log de progreso */
.progress-log {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  max-height: 240px;
  overflow-y: auto;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
}
.log-line { margin: 0; }
.log-line--info     { color: var(--text-sub); }
.log-line--ok       { color: #16a34a; }
.log-line--progress { color: var(--text-hint); }
.log-line--error    { color: #dc2626; font-weight: 600; }
.log-line--done     { color: #16a34a; font-weight: 700; }

@media (prefers-color-scheme: dark) {
  .progress-log { background: #1a1a1a; }
  .log-line--ok   { color: #4ade80; }
  .log-line--done { color: #4ade80; }
  .process-panel__icon--ok  { background: #052e16; color: #4ade80; }
  .process-panel__icon--err { background: #450a0a; color: #f87171; }
}
