:root {
  --sand:    #c4a882;
  --sand-lt: #e8d5b7;
  --sand-dk: #7a5c38;
  --rust:    #c23b1e;
  --rust-lt: #e05535;
  --sky:     #4a6fa5;
  --sky-lt:  #7a9fc8;
  --dusk:    #1e2535;
  --dusk2:   #252e42;
  --dusk3:   #2e3850;
  --dark:    #0e1218;
  --fog:     rgba(196,168,130,0.08);
  --fog2:    rgba(196,168,130,0.14);
  --border:  rgba(196,168,130,0.12);
  --border2: rgba(196,168,130,0.25);
  --text:    #f0e8dc;
  --text-m:  #9e8e7a;
  --text-d:  #5a4e42;
  --f-display: 'Bebas Neue', 'Impact', 'Arial Black', sans-serif;
  --f-ui:      'Rajdhani', 'Arial', sans-serif;
  --f-body:    'Inter', system-ui, -apple-system, sans-serif;
  --r: 6px;
  --r-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--dark);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--sand-dk); border-radius: 2px; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: 240px; height: 100vh;
  background: linear-gradient(180deg, var(--dusk) 0%, var(--dark) 100%);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 200; overflow-y: auto;
}

.brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.brand::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url('../images/img_13.jpg') center/cover no-repeat;
  opacity: 0.12;
}

.brand-inner { position: relative; }

.brand-tag {
  font-family: var(--f-ui);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust-lt);
  margin-bottom: 4px;
}

.brand-name {
  font-family: var(--f-display);
  font-size: 30px; line-height: 0.95;
  color: var(--text);
  letter-spacing: 0.03em;
}

.brand-name span { color: var(--rust-lt); }

.brand-sub {
  font-family: var(--f-ui);
  font-size: 11px; color: var(--text-m);
  margin-top: 6px;
}

.nav-group {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.nav-group-label {
  font-family: var(--f-ui);
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-d); padding: 0 1.25rem 6px;
}
.nav-group-toggle {
  cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  padding-right: 1.25rem;
  transition: color 0.15s;
}
.nav-group-toggle:hover { color: var(--sand-lt); }
.nav-toggle-arrow {
  font-size: 10px; transition: transform 0.2s;
}
.nav-toggle-arrow.open { transform: rotate(90deg); }
.nav-collapse {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}
.nav-collapse.open { max-height: 400px; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 1.25rem;
  font-family: var(--f-ui); font-size: 14px; font-weight: 500;
  color: var(--text-m); text-decoration: none; cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.nav-link:hover { color: var(--sand-lt); background: var(--fog); }
.nav-sub-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 1.25rem;
  font-family: var(--f-ui); font-size: 14px; font-weight: 500;
  color: var(--text-m); cursor: pointer; user-select: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.nav-sub-toggle:hover { color: var(--sand-lt); background: var(--fog); }
.nav-sub-label { flex: 1; }
.nav-sub-collapse {
  overflow: hidden; max-height: 0;
  transition: max-height 0.2s ease;
}
.nav-sub-collapse.open { max-height: 120px; }
.nav-sub-link { padding-left: 2.25rem !important; font-size: 13px !important; }
.nav-link.active {
  color: var(--sand-lt);
  border-left-color: var(--rust-lt);
  background: var(--fog2);
}

.nav-link.nav-fav {
  color: var(--sand-lt);
  font-weight: 700;
}
.nav-link.nav-fav .ico { opacity: 1; color: var(--rust-lt); }

.nav-link .ico {
  width: 16px; text-align: center;
  font-size: 13px; flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-foot {
  margin-top: auto; padding: 1rem 1.25rem;
  font-size: 10px; color: var(--text-d);
  border-top: 1px solid var(--border); line-height: 1.6;
}

/* ── MAIN ── */
.main { margin-left: 240px; min-height: 100vh; }

/* ── HERO ── */
.hero {
  position: relative; height: 420px;
  overflow: hidden;
  display: flex; align-items: flex-end;
}

.hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 40%;
  display: block;
}

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    0deg,
    rgba(14,18,24,1) 0%,
    rgba(14,18,24,0.6) 40%,
    rgba(14,18,24,0.1) 70%,
    rgba(14,18,24,0) 100%
  );
}

.hero-overlay-h {
  position: absolute; inset: 0;
  background: linear-gradient(
    90deg,
    rgba(14,18,24,0.7) 0%,
    transparent 60%
  );
}

.hero-content {
  position: relative; z-index: 2;
  padding: 2rem 2.5rem;
  width: 100%;
}

.hero-eyebrow {
  font-family: var(--f-ui); font-size: 11px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--rust-lt); margin-bottom: 6px;
  display: flex; align-items: center; gap: 10px;
}

.hero-eyebrow::before {
  content: ''; width: 28px; height: 1px;
  background: var(--rust-lt); display: block;
}

.hero-title {
  font-family: var(--f-display);
  font-size: 72px; line-height: 0.9;
  letter-spacing: 0.02em;
  color: var(--text);
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  margin-bottom: 1rem;
}

.hero-title span { color: var(--rust-lt); }

.hero-stats {
  display: flex; gap: 0; flex-wrap: wrap;
}

.hstat {
  padding: 8px 20px 8px 0;
  margin-right: 20px;
  border-right: 1px solid var(--border2);
}

.hstat:last-child { border-right: none; }

.hstat-val {
  font-family: var(--f-display);
  font-size: 24px; line-height: 1;
  color: var(--sand-lt);
}

.hstat-val small {
  font-size: 13px; font-family: var(--f-ui);
  color: var(--text-m); font-weight: 500;
}

.hstat-label {
  font-family: var(--f-ui); font-size: 9px; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-d); margin-top: 2px;
}

/* ── SEARCH ── */
.search-wrap {
  padding: 1.5rem 2.5rem 0;
}

.search-bar {
  display: flex; gap: 8px; max-width: 600px;
}

.search-input {
  flex: 1;
  background: var(--dusk2);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 10px 16px;
  font-size: 13px; font-family: var(--f-body);
  color: var(--text); outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: var(--text-d); }
.search-input:focus { border-color: var(--rust); }

.search-btn {
  background: var(--rust); color: #fff;
  border: none; border-radius: var(--r);
  padding: 10px 22px;
  font-family: var(--f-ui); font-size: 14px; font-weight: 700;
  letter-spacing: 0.06em; cursor: pointer;
  transition: background 0.15s;
}

.search-btn:hover { background: var(--rust-lt); }

/* ── SECTIONS ── */
.section { display: none; padding: 1.5rem 2.5rem 3rem; }
.section.active { display: block; }

.sec-header {
  display: flex; align-items: baseline;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sec-title {
  font-family: var(--f-display);
  font-size: 36px; letter-spacing: 0.03em;
  color: var(--text);
}

.sec-src {
  font-family: var(--f-ui); font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-d);
}

/* ── CARDS GRID ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px; margin-bottom: 1.5rem;
}

.card {
  background: var(--dusk2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative; overflow: hidden;
}

.card::before {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--rust);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.2s;
}

.card:hover { border-color: var(--border2); background: var(--dusk3); transform: translateY(-2px); }
.card:hover::before { transform: scaleX(1); }

.card-ico {
  font-size: 18px; margin-bottom: 10px; opacity: 0.8;
}

.card-title {
  font-family: var(--f-ui);
  font-size: 15px; font-weight: 700;
  color: var(--sand-lt); margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.card-desc {
  font-size: 11px; color: var(--text-m); line-height: 1.5;
}

/* ── SPEC BLOCK ── */
.spec-block {
  background: var(--dusk2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden; margin-bottom: 1rem;
}

.spec-block-head {
  padding: 8px 1.25rem;
  background: var(--dusk3);
  border-bottom: 1px solid var(--border);
  font-family: var(--f-ui); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-m);
}

.spec-row {
  display: flex; justify-content: space-between;
  align-items: center; gap: 1rem;
  padding: 9px 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.spec-row:last-child { border-bottom: none; }
.spec-label { color: var(--text-m); flex-shrink: 0; }
.spec-val { font-weight: 500; color: var(--text); text-align: right; }
.spec-accent { color: var(--rust-lt); }

/* ── PROCEDURE ── */
.procedure {
  background: var(--dusk2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem; margin-bottom: 1rem;
}

.procedure h3 {
  font-family: var(--f-ui); font-size: 15px; font-weight: 700;
  color: var(--sand-lt); letter-spacing: 0.04em;
  margin-bottom: 1rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.steps { counter-reset: st; list-style: none; padding: 0; }

.steps li {
  counter-increment: st;
  display: flex; gap: 12px;
  align-items: flex-start;
  padding: 6px 0;
  font-size: 13px; color: var(--text-m); line-height: 1.6;
}

.steps li::before {
  content: counter(st);
  min-width: 20px; height: 20px;
  background: var(--rust); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-ui); font-size: 10px; font-weight: 700;
  flex-shrink: 0; margin-top: 2px;
}

/* ── ALERTS ── */
.alert {
  padding: 9px 13px;
  border-radius: var(--r);
  font-size: 12px; line-height: 1.6;
  margin: 8px 0;
  display: flex; gap: 8px; align-items: flex-start;
}

.a-warn { background: rgba(196,168,130,0.1); border: 1px solid rgba(196,168,130,0.3); color: var(--sand); }
.a-danger { background: rgba(194,59,30,0.1); border: 1px solid rgba(194,59,30,0.35); color: #e06040; }
.a-info { background: rgba(74,111,165,0.12); border: 1px solid rgba(74,111,165,0.35); color: var(--sky-lt); }

/* ── DIAGRAM ── */
.diagram {
  background: var(--dusk2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden; margin-bottom: 1rem;
}

.diagram-head {
  padding: 8px 1.25rem;
  background: var(--dusk3);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.diagram-title {
  font-family: var(--f-ui); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-m);
}

.diagram-badge {
  font-family: var(--f-ui); font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(194,59,30,0.2); color: var(--rust-lt);
  padding: 2px 10px; border-radius: 20px;
}

.diagram img {
  width: 100%; display: block; background: #f8f4ef;
}

/* ── TWO COL ── */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; margin-bottom: 1rem;
}

/* ── TORQUE TABLE ── */
.torque-row {
  display: grid; grid-template-columns: 1fr 145px 90px;
  background: var(--dusk2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 4px; overflow: hidden;
  transition: border-color 0.15s;
}

.torque-row:hover { border-color: var(--border2); }

.t-c {
  padding: 9px 14px; font-size: 13px;
  border-right: 1px solid var(--border);
}

.t-c:last-child {
  border-right: none; text-align: right;
  font-family: var(--f-ui); font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: flex-end;
}

.t-name { color: var(--text); }
.t-thread { color: var(--text-m); font-family: monospace; font-size: 12px; }
.nm-lo { color: #6abf7a; }
.nm-md { color: var(--sky-lt); }
.nm-hi { color: var(--sand); }
.nm-vhi { color: var(--rust-lt); }

/* ── MAINT TABLE ── */
.maint-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
  background: var(--dusk2);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.maint-table th {
  text-align: left; padding: 9px 12px;
  background: var(--dusk3); color: var(--text-m);
  font-family: var(--f-ui); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.maint-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-m); vertical-align: middle;
}

.maint-table td:first-child { color: var(--text); }
.maint-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block; font-family: var(--f-ui);
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  letter-spacing: 0.04em;
}

.bR { background: rgba(194,59,30,0.2); color: #e06040; }
.bI { background: rgba(74,111,165,0.2); color: var(--sky-lt); }
.bC { background: rgba(196,168,130,0.15); color: var(--sand); }
.bA { background: rgba(100,180,100,0.15); color: #6abf7a; }
.bL { background: rgba(160,100,220,0.15); color: #c084e8; }

/* ── PILLS / FILTERS ── */
.pill-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem; }

.pill {
  font-family: var(--f-ui); font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 20px;
  border: 1px solid var(--border2);
  background: transparent; color: var(--text-m);
  cursor: pointer; transition: all 0.15s;
}

.pill:hover { border-color: var(--sand); color: var(--sand-lt); }
.pill.on { background: var(--rust); color: #fff; border-color: var(--rust); }

/* ── TORQUE GROUP ── */
.tg-label {
  font-family: var(--f-ui); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-d); margin: 1rem 0 6px;
}

.col-hdrs {
  display: grid; grid-template-columns: 1fr 145px 90px;
  padding-bottom: 6px;
}

.col-h {
  font-family: var(--f-ui); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-d); padding: 0 14px;
}

.col-h:last-child { text-align: right; }

/* ── LEGEND ── */
.legend {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 11px;
}

.leg-item {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-m); font-family: var(--f-ui);
}

.leg-dot {
  width: 8px; height: 8px; border-radius: 50%;
}

/* Defaults que el @media sobreescribe — deben ir ANTES del bloque media */
.ham-btn { display: none; }
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 250;
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 300;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .two-col { grid-template-columns: 1fr; }

  /* Hero — más compacto en móvil */
  .hero { height: 220px; }
  .hero-title { font-size: 36px; }
  .hero-content { padding: 1rem 1.25rem; }
  .hero-eyebrow { font-size: 9px; letter-spacing: 0.14em; }
  .hstat { padding: 4px 10px 4px 0; margin-right: 8px; }
  .hstat-val { font-size: 18px; }
  .hstat-val small { font-size: 11px; }
  .hstat-label { font-size: 8px; }

  /* Secciones */
  .section { padding: 1rem; }

  /* Barra de búsqueda */
  .search-wrap { padding: 0.75rem 0 0; }
  .search-btn { padding: 10px 14px; font-size: 13px; }

  /* Spec rows — apilar etiqueta y valor en pantallas muy estrechas */
  .spec-row { flex-wrap: wrap; row-gap: 2px; padding: 8px 1rem; }
  .spec-val { text-align: left; }

  /* Tabla de pares de apriete — ocultar columna de métrica */
  .col-hdrs { grid-template-columns: 1fr 80px; }
  .col-h:nth-child(2) { display: none; }
  .torque-row { grid-template-columns: 1fr 80px; }
  .t-thread { display: none; }
  .t-c { padding: 8px 10px; }

  /* Cards grid — mínimo más pequeño en móvil */
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

  .ham-btn {
    display: flex;
    position: fixed;
    top: 12px; left: 12px;
    z-index: 400;
    width: 44px; height: 44px;
    background: var(--dusk2);
    border: 1px solid var(--border2);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
  }
  .ham-btn span {
    display: block;
    width: 22px; height: 2px;
    background: var(--sand);
    border-radius: 2px;
    transition: all 0.2s;
  }
  .overlay {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }
  .overlay.open {
    opacity: 1;
    pointer-events: all;
  }
  .back-btn { display: flex; }
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--dusk2);
  border: 1px solid var(--border2);
  color: var(--sand);
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 1rem;
  width: fit-content;
  letter-spacing: 0.5px;
}
.back-btn:active { background: var(--dusk3); }

/* ── MEJORAS ── */
.mej-bar {
  display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap;
}

.mej-admin-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--f-ui); font-size: 11px; font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(100,200,100,0.12);
  border: 1px solid rgba(100,200,100,0.3);
  color: #6abf7a;
  padding: 4px 12px; border-radius: 20px;
}

.mej-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: var(--dusk2); border-radius: var(--r-lg);
  overflow: hidden; border: 1px solid var(--border);
}

.mej-table th {
  text-align: left; padding: 9px 12px;
  background: var(--dusk3); color: var(--text-m);
  font-family: var(--f-ui); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.mej-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top; color: var(--text-m);
}

.mej-table tr:last-child td { border-bottom: none; }
.mej-table tr:hover td { background: var(--fog); }

/* ── Grupos colapsables Mejoras ── */
.mej-grp-hdr { cursor: pointer; user-select: none; }
.mej-grp-hdr-cell {
  padding: 10px 14px !important;
  background: rgba(194,59,30,0.07);
  border-top: 1px solid rgba(194,59,30,0.18) !important;
  border-bottom: 1px solid rgba(194,59,30,0.18) !important;
  display: flex; align-items: center; gap: 10px;
}
.mej-grp-hdr:hover .mej-grp-hdr-cell { background: rgba(194,59,30,0.13); }
.mej-grp-arrow { font-size: 10px; color: var(--rust-lt); width: 12px; flex-shrink: 0; transition: color 0.15s; }
.mej-grp-label { font-family: var(--f-ui); font-weight: 700; font-size: 13px; color: var(--sand-lt); flex: 1; }
.mej-grp-cnt {
  font-size: 11px; font-weight: 700; color: var(--rust-lt);
  background: rgba(194,59,30,0.15); border-radius: 10px;
  padding: 1px 8px; border: 1px solid rgba(194,59,30,0.25);
}
.mej-grp-hidden { display: none; }

.mej-inc-cell {
  font-family: var(--f-ui); font-weight: 700; font-size: 13px;
  color: var(--sand-lt); white-space: nowrap;
}

.mej-text-cell { line-height: 1.6; max-width: 240px; }

.mej-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--sky-lt); font-family: var(--f-ui);
  font-size: 12px; font-weight: 600; text-decoration: none;
  padding: 3px 8px; border-radius: var(--r);
  background: rgba(74,111,165,0.12);
  border: 1px solid rgba(74,111,165,0.3);
  transition: background 0.15s;
}
.mej-link:hover { background: rgba(74,111,165,0.25); }

.mej-thumb {
  max-width: 72px; max-height: 52px; object-fit: cover;
  border-radius: 4px; cursor: zoom-in;
  border: 1px solid var(--border2);
  transition: opacity 0.15s;
  display: block; margin: 0 auto;
}
.mej-thumb:hover { opacity: 0.8; }

.mej-del {
  background: transparent; border: 1px solid rgba(194,59,30,0.3);
  color: var(--rust-lt); border-radius: 4px;
  padding: 3px 8px; cursor: pointer; font-size: 11px;
  transition: all 0.15s;
}
.mej-del:hover { background: rgba(194,59,30,0.15); }
.mej-edit {
  background: transparent; border: 1px solid rgba(180,140,60,0.4);
  color: var(--gold); border-radius: 4px;
  padding: 3px 8px; cursor: pointer; font-size: 11px;
  transition: all 0.15s; margin-right: 4px;
}
.mej-edit:hover { background: rgba(180,140,60,0.15); }

.mej-empty {
  text-align: center; color: var(--text-d);
  font-family: var(--f-ui); font-size: 13px;
  padding: 3rem 0;
}

/* Modal */
.mej-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 600; display: flex;
  align-items: center; justify-content: center;
  padding: 1rem;
}

.mej-modal {
  background: var(--dusk);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  width: 100%; max-width: 520px;
  max-height: 90vh; display: flex;
  flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.mej-modal-head {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mej-modal-title {
  font-family: var(--f-ui); font-size: 15px; font-weight: 700;
  color: var(--sand-lt); letter-spacing: 0.04em;
}

.mej-close {
  background: transparent; border: none;
  color: var(--text-d); font-size: 16px;
  cursor: pointer; padding: 4px 8px;
  border-radius: 4px; transition: color 0.15s;
}
.mej-close:hover { color: var(--rust-lt); }

.mej-modal-body { padding: 1.25rem; overflow-y: auto; flex: 1; }

.mej-label {
  display: block; font-family: var(--f-ui);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-m); margin-bottom: 6px;
}

.mej-textarea {
  width: 100%; min-height: 80px; resize: vertical;
  background: var(--dusk3);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 8px 12px;
  font-size: 13px; font-family: var(--f-body);
  color: var(--text); outline: none;
  transition: border-color 0.15s; line-height: 1.6;
}
.mej-textarea:focus { border-color: var(--rust); }
.mej-textarea::placeholder { color: var(--text-d); }

.mej-modal-foot {
  display: flex; justify-content: flex-end;
  gap: 8px; padding: 1rem 1.25rem;
  border-top: 1px solid var(--border); flex-shrink: 0;
}

/* Lightbox */
.mej-lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 700; display: flex;
  align-items: center; justify-content: center;
  cursor: zoom-out; padding: 2rem;
}

.mej-lightbox img {
  max-width: 100%; max-height: 90vh;
  object-fit: contain; border-radius: var(--r);
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
}

.mej-lb-close {
  position: fixed; top: 1.25rem; right: 1.5rem;
  color: rgba(255,255,255,0.5); font-size: 28px;
  cursor: pointer; line-height: 1; user-select: none;
}

/* ── KM FILTER (sección mantenimiento) ── */
.km-filter-bar {
  background: var(--dusk2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.km-filter-inner {
  display: flex; align-items: center;
  gap: 12px; flex-wrap: wrap;
}

.km-filter-label {
  font-family: var(--f-ui); font-size: 13px; font-weight: 600;
  color: var(--text-m); white-space: nowrap;
}

.km-filter-input-wrap {
  position: relative; display: flex; align-items: center;
}

.km-input {
  background: var(--dusk3);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 8px 38px 8px 12px;
  font-size: 15px; font-family: var(--f-ui); font-weight: 700;
  color: var(--text); outline: none;
  width: 150px; transition: border-color 0.15s;
}

.km-input:focus { border-color: var(--rust); }
.km-input::placeholder { color: var(--text-d); font-weight: 400; font-size: 13px; }

.km-unit {
  position: absolute; right: 10px;
  font-family: var(--f-ui); font-size: 11px; font-weight: 700;
  color: var(--text-d); pointer-events: none;
}

.km-clear-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-d); border-radius: var(--r);
  padding: 7px 11px; cursor: pointer; font-size: 12px;
  transition: all 0.15s;
}

.km-clear-btn:hover { border-color: var(--rust-lt); color: var(--rust-lt); }

.maint-due-header {
  font-family: var(--f-ui); font-size: 13px; color: var(--text-m);
  margin-top: 0.75rem; padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.maint-due-header strong { color: var(--rust-lt); font-size: 15px; }

.maint-due-list {
  list-style: none; display: flex;
  flex-wrap: wrap; gap: 6px; margin-top: 8px;
}

.maint-due-list li {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-m);
  background: var(--dusk3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 4px 10px 4px 6px;
}

/* Columna resaltada en la tabla */
.maint-table th.col-highlight {
  background: rgba(194,59,30,0.22);
  color: var(--rust-lt);
}

.maint-table td.col-highlight {
  background: rgba(194,59,30,0.09);
}

/* ── STEPS (div-based, usado en almacenamiento) ── */
.step {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 6px 0; font-size: 13px; color: var(--text-m); line-height: 1.6;
}
.step-n {
  min-width: 20px; height: 20px;
  background: var(--rust); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-ui); font-size: 10px; font-weight: 700;
  flex-shrink: 0; margin-top: 2px;
}

/* ── SEARCH RESULTS ── */
.search-results {
  background: var(--dusk2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  margin-top: 6px;
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
}
.sr-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--fog2); }
.sr-ico { font-size: 13px; color: var(--rust-lt); min-width: 16px; margin-top: 2px; flex-shrink: 0; }
.sr-body { min-width: 0; }
.sr-title { font-family: var(--f-ui); font-weight: 600; font-size: 13px; color: var(--sand-lt); margin-bottom: 2px; }
.sr-snippet { font-size: 12px; color: var(--text-m); line-height: 1.5; }
.sr-mark { background: rgba(194,59,30,0.35); color: var(--sand-lt); border-radius: 2px; padding: 0 2px; }
.sr-empty { padding: 16px; text-align: center; color: var(--text-d); font-size: 13px; font-family: var(--f-ui); }

/* ── ACCESORIOS PATROCINADOS ── */
/* ── Banda de patrocinadores ── */
.sponsors-strip {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.sponsors-strip-label {
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand-dk);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.sponsors-strip-actions { display: inline-flex; gap: 6px; align-items: center; }
.sponsor-add-btn, .sponsor-admin-btn {
  background: var(--rust);
  color: #fff;
  border: 0;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--f-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-transform: none;
}
.sponsor-admin-btn { background: transparent; color: var(--text-m); border: 1px solid var(--border); }
.sponsor-add-btn:hover    { background: var(--rust-lt); }
.sponsor-admin-btn:hover  { background: var(--bg2); color: var(--text); }
.sponsor-add-btn:active,
.sponsor-admin-btn:active { transform: scale(0.97); }
.sponsors-empty {
  color: var(--text-d); font-size: 12px; font-style: italic;
  margin: 0.25rem 0 0;
}
.sponsors-strip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.sponsor-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0;
  height: 64px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.sponsor-card:hover {
  transform: translateY(-2px);
  border-color: var(--rust-lt);
}
.sponsor-card img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
}
@media (max-width: 600px) {
  .sponsor-card { height: 56px; }
}

/* Wrapper que envuelve cada card + botón ✕ admin */
.sponsor-card-wrap { position: relative; display: inline-flex; }
.sponsor-card-wrap .sponsor-card { display: flex; }
.sponsor-del {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #c23b1e; color: #fff; border: 2px solid #fff;
  font-size: 12px; font-weight: 700; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  opacity: 0; transition: opacity 0.15s, transform 0.15s;
  padding: 0;
}
.sponsor-card-wrap:hover .sponsor-del,
.sponsor-card-wrap:focus-within .sponsor-del { opacity: 1; }
.sponsor-del:hover  { transform: scale(1.1); }
.sponsor-del:active { transform: scale(0.95); }

/* Modal de subida: preview e hint */
.sponsor-img-hint  { font-size: 11px; color: var(--text-d); margin: 4px 0 0; line-height: 1.4; }
.sponsor-img-preview-wrap {
  margin-top: 10px; padding: 12px;
  background: #fff; border: 1px dashed var(--border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; min-height: 80px;
}
#sponsor-img-pre { max-width: 100%; max-height: 100px; object-fit: contain; }

/* Card clicable cuando hay código de descuento */
.sponsor-clickable {
  border: 1px solid var(--border);
  cursor: pointer;
  background: #fff;
  padding: 0;
  font: inherit;
  position: relative;
}
.sponsor-clickable::after {
  content: '🏷️';
  position: absolute; top: 3px; right: 4px;
  font-size: 12px; opacity: 0.7;
  pointer-events: none;
}
.sponsor-clickable:hover {
  transform: translateY(-2px);
  border-color: var(--rust-lt);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Popup del código */
.sponsor-code-modal .mej-modal-body { padding-top: 8px; }
.sponsor-code-logo-wrap {
  height: 70px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.sponsor-code-logo-wrap img { max-height: 100%; max-width: 80%; object-fit: contain; }
.sponsor-code-intro {
  color: var(--text-m); font-size: 13px; margin: 0 0 10px;
}
.sponsor-code-box {
  font-family: 'SF Mono', 'Fira Code', Menlo, monospace;
  font-size: 24px; font-weight: 700; letter-spacing: 0.08em;
  background: var(--bg2); color: var(--rust);
  border: 2px dashed var(--rust-lt); border-radius: 12px;
  padding: 18px 16px; margin-bottom: 14px;
  word-break: break-all;
  user-select: all;
}
.sponsor-code-copy { width: 100%; }

.acc-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.acc-cat {
  background: var(--dusk2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem 1rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.acc-cat:hover {
  background: var(--fog2);
  border-color: var(--border2);
  transform: translateY(-2px);
}
.acc-cat-ico {
  font-size: 2rem;
  color: var(--rust-lt);
  margin-bottom: 0.6rem;
  line-height: 1;
}
.acc-cat-name {
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 12px;
  color: var(--sand-lt);
  letter-spacing: 0.03em;
}
.acc-detail-bar {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.acc-empresas-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1rem;
}
.acc-detail-title {
  font-family: var(--f-ui);
  font-size: 18px; font-weight: 700;
  color: var(--sand-lt);
  letter-spacing: 0.04em;
}
.acc-card {
  display: flex; gap: 1rem;
  background: var(--dusk2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem;
  margin-bottom: 0.75rem;
  position: relative;
  transition: border-color 0.15s;
}
.acc-card:hover { border-color: var(--border2); }
.acc-card-img {
  width: 130px; height: 130px;
  object-fit: cover;
  border-radius: var(--r);
  flex-shrink: 0;
  cursor: pointer;
}
.acc-card-img-ph {
  width: 130px; height: 130px;
  background: var(--dusk3);
  border-radius: var(--r);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-d); font-size: 2.5rem;
}
.acc-card-body { flex: 1; min-width: 0; }
.acc-card-title {
  font-family: var(--f-ui); font-weight: 700; font-size: 15px;
  color: var(--sand-lt); margin-bottom: 3px;
}
.acc-card-short {
  font-family: var(--f-ui); font-size: 11px; font-weight: 700;
  color: var(--rust-lt); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 8px;
}
.acc-card-desc {
  font-size: 13px; color: var(--text-m); line-height: 1.55;
  margin-bottom: 10px;
}
.acc-card-precio {
  font-family: var(--f-ui); font-size: 14px; font-weight: 700;
  color: var(--sand); margin-bottom: 8px;
}
.acc-card-link {
  font-family: var(--f-ui); font-size: 12px; font-weight: 600;
  color: var(--sky-lt); text-decoration: none;
}
.acc-card-link:hover { color: var(--sand-lt); }
.acc-card-actions {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 6px;
}
.acc-edit-btn {
  background: var(--dusk3);
  border: 1px solid var(--border2);
  color: var(--text-m);
  border-radius: 4px;
  width: 26px; height: 26px;
  cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.acc-edit-btn:hover { color: var(--sand-lt); border-color: var(--sand); }
.acc-contact {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-m);
  font-size: 14px;
  line-height: 1.8;
  border: 1px dashed var(--border2);
  border-radius: var(--r-lg);
  margin-top: 1rem;
}
.acc-contact a { color: var(--rust-lt); font-weight: 700; text-decoration: none; }
.acc-contact a:hover { color: var(--sand-lt); }
@media (max-width: 600px) {
  .acc-card { flex-direction: column; }
  .acc-card-img, .acc-card-img-ph { width: 100%; height: 180px; }
}

/* ── AVISO LEGAL ── */
.disclaimer-body { max-width: 680px; }
.disclaimer-body .spec-block { margin-bottom: 1rem; }
.disclaimer-body p {
  font-size: 13px; color: var(--text-m); line-height: 1.75;
  padding: 0.6rem 0 0.2rem;
}
/* ── APPS DE NAVEGACIÓN ── */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem; margin-top: 1.25rem;
}
.app-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 0.15s;
}
.app-card:hover { border-color: var(--border2); }
.app-card-img-wrap {
  width: 100%; height: 140px; overflow: hidden;
  background: var(--bg2); display: flex; align-items: center; justify-content: center;
}
.app-card-img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.app-card-img-ph { font-size: 48px; opacity: 0.3; }
.app-card-body { padding: 0.75rem 0.9rem; flex: 1; }
.app-card-nombre { font-family: var(--f-ui); font-weight: 700; font-size: 14px; color: var(--sand-lt); margin-bottom: 6px; }
.app-card-plat {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 20px;
}
.app-plat-android { background: rgba(61,169,73,0.15); color: #3da949; border: 1px solid rgba(61,169,73,0.3); }
.app-plat-mac     { background: rgba(100,160,220,0.15); color: #64a0dc; border: 1px solid rgba(100,160,220,0.3); }
.app-card-actions {
  display: flex; gap: 6px; padding: 0.5rem 0.9rem;
  border-top: 1px solid var(--border);
}

/* ── DIFICULTAD BADGES ── */
.dif-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: 0.05em; padding: 2px 10px; border-radius: 20px;
}
.dif-facil    { background: rgba(61,169,73,0.12);  color: #3da949; border: 1px solid rgba(61,169,73,0.3); }
.dif-moderado { background: rgba(200,160,40,0.12); color: #c8a028; border: 1px solid rgba(200,160,40,0.3); }
.dif-dificil  { background: rgba(194,59,30,0.12);  color: var(--rust-lt); border: 1px solid rgba(194,59,30,0.3); }

/* ── COMPRA · VENTA ── */
.cv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem; margin-top: 1.25rem;
}
.cv-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 0.15s;
}
.cv-card:hover { border-color: var(--border2); }
.cv-card-img-wrap {
  width: 100%; height: 160px; overflow: hidden;
  background: var(--bg2); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cv-card-img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.cv-card-img-ph { font-size: 48px; opacity: 0.25; }
.cv-card-body { padding: 0.85rem 1rem; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.cv-card-titulo { font-family: var(--f-ui); font-weight: 700; font-size: 15px; color: var(--sand-lt); }
.cv-card-precio { font-family: var(--f-head); font-size: 18px; color: var(--gold); letter-spacing: 0.02em; }
.cv-card-desc   { font-size: 12px; color: var(--text-m); line-height: 1.6; margin-top: 2px; flex: 1; }
.cv-card-contact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cv-contact-item {
  font-size: 12px; color: var(--rust-lt); text-decoration: none;
  background: rgba(194,59,30,0.08); padding: 3px 8px;
  border-radius: 4px; border: 1px solid rgba(194,59,30,0.2);
  transition: background 0.15s;
}
.cv-contact-item:hover { background: rgba(194,59,30,0.18); }
.cv-card-fecha { font-size: 10px; color: var(--text-d); margin-top: 4px; }
.cv-card-actions {
  display: flex; gap: 6px; padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
}
.cv-card-actions .mej-edit,
.cv-card-actions .mej-del { flex: 1; justify-content: center; font-size: 12px; }
@media (max-width: 600px) {
  .cv-grid { grid-template-columns: 1fr; }
}

/* ── CV precio wrapper ── */
.cv-precio-wrap {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--border2); border-radius: var(--r);
  overflow: hidden; background: var(--dusk2);
}
.cv-precio-wrap .km-input {
  flex: 1; border: none; border-radius: 0;
  background: transparent;
}
.cv-euro {
  padding: 0 12px;
  font-family: var(--f-ui); font-weight: 700;
  color: var(--gold); font-size: 15px;
  background: rgba(180,140,60,0.1);
  border-left: 1px solid var(--border2);
  display: flex; align-items: center;
}

/* ══ Banner de error de carga (genérico, todas las secciones) ══ */
.load-error-banner {
  display: flex; align-items: center; gap: 14px;
  margin: 16px 0; padding: 14px 18px;
  background: rgba(194,59,30,0.10);
  border: 1px solid rgba(194,59,30,0.35);
  border-left: 4px solid #c23b1e;
  border-radius: 10px; color: var(--text);
  animation: load-error-in .25s ease;
}
@keyframes load-error-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.load-error-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.load-error-body { flex: 1; min-width: 0; line-height: 1.4; }
.load-error-title  { font-weight: 700; font-size: 14px; color: #c23b1e; margin-bottom: 2px; }
.load-error-detail { font-size: 12.5px; color: var(--text-m); }
.load-error-retry {
  background: #c23b1e; color: #fff; border: 0;
  padding: 8px 14px; border-radius: 8px;
  font-weight: 600; font-size: 13px; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.load-error-retry:hover  { background: #d94625; }
.load-error-retry:active { transform: scale(0.97); }
@media (max-width: 600px) {
  .load-error-banner { flex-wrap: wrap; }
  .load-error-retry  { width: 100%; }
}

/* ══ Banner offline (sin conexión) ══ */
.offline-banner {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: #2a2f37; color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  z-index: 9999; display: none;
  border: 1px solid rgba(255,255,255,0.08);
}
.offline-banner.visible { display: flex; align-items: center; gap: 8px; animation: load-error-in .25s ease; }
.offline-banner-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff6b3a; animation: offline-pulse 1.4s ease-in-out infinite;
}
@keyframes offline-pulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* ══ NOTICIAS ══ */
.news-runbox {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; margin-bottom: 18px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; flex-wrap: wrap;
}
.news-runbox-info { flex: 1; min-width: 0; }
.news-runbox-title { font-size: 13px; font-weight: 700; color: var(--text); }
.news-runbox-sub { font-size: 12px; color: var(--text-m); margin-top: 3px; line-height: 1.45; }
.news-runbox-sub.pending { color: #d97706; font-weight: 600; }
#news-run-btn:disabled { opacity: 0.55; cursor: default; }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem; margin-top: 1.25rem;
}
.news-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}
.news-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.news-card-img-wrap {
  width: 100%; height: 170px; overflow: hidden;
  background: var(--bg2); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative;
}
.news-card-img { width: 100%; height: 100%; object-fit: cover; }
.news-card-img-ph { font-size: 48px; opacity: 0.25; }
.news-card-source {
  position: absolute; top: 8px; left: 8px;
  background: rgba(15,17,21,0.85); color: var(--sand-lt);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 4px;
  backdrop-filter: blur(4px);
}
.news-card-body { padding: 0.85rem 1rem 1rem; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.news-card-titulo {
  font-family: var(--f-ui); font-weight: 700; font-size: 15px;
  color: var(--sand-lt); line-height: 1.3;
}
.news-card-extracto { font-size: 12px; color: var(--text-m); line-height: 1.55; flex: 1; }
.news-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px;
}
.news-card-fecha { font-size: 11px; color: var(--text-d); }
.news-card-link {
  font-size: 12px; color: var(--rust-lt); text-decoration: none;
  background: rgba(194,59,30,0.08); padding: 4px 10px;
  border-radius: 4px; border: 1px solid rgba(194,59,30,0.2);
  transition: background 0.15s;
}
.news-card-link:hover { background: rgba(194,59,30,0.18); }
.news-card-actions {
  display: flex; gap: 6px; padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
}
.news-card-actions .mej-del { flex: 1; justify-content: center; font-size: 12px; }

/* Selects de filtro */
.news-filter-sel {
  font-size: 13px; padding: 6px 10px;
  min-width: 130px;
}

/* Badge contador pendientes en sidebar */
.news-pend-badge {
  display: inline-block;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--rust-lt); color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 9px; text-align: center; line-height: 18px;
  margin-left: 6px;
}

/* Cola pendientes (modal) */
.news-pend-item {
  display: flex; gap: 12px;
  padding: 12px; margin-bottom: 12px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r);
}
.news-pend-item-img {
  width: 110px; height: 90px; object-fit: cover; border-radius: 4px;
  background: var(--card); flex-shrink: 0;
}
.news-pend-item-img-ph {
  width: 110px; height: 90px; flex-shrink: 0;
  background: var(--card); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; opacity: 0.3;
}
.news-pend-item-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.news-pend-item-title {
  font-family: var(--f-ui); font-weight: 700; font-size: 14px;
  color: var(--sand-lt); line-height: 1.3;
}
.news-pend-item-meta { font-size: 11px; color: var(--text-d); }
.news-pend-item-meta a { color: var(--rust-lt); text-decoration: none; }
.news-pend-item-meta a:hover { text-decoration: underline; }
.news-pend-item-extracto { font-size: 12px; color: var(--text-m); line-height: 1.5; margin-top: 4px; }
.news-pend-item-actions {
  display: flex; gap: 6px; margin-top: 8px;
}
.news-pend-item-actions button {
  flex: 1; padding: 6px 10px; font-size: 12px; font-weight: 700;
  border: none; border-radius: 4px; cursor: pointer;
  font-family: var(--f-ui);
}
.news-btn-approve { background: #2c6b3a; color: #fff; }
.news-btn-approve:hover { background: #3a8a4d; }
.news-btn-reject  { background: #6b2a1c; color: #fff; }
.news-btn-reject:hover  { background: #8a3722; }

@media (max-width: 600px) {
  .news-grid { grid-template-columns: 1fr; }
  .news-filter-sel { min-width: 0; flex: 1; }
  .news-pend-item { flex-direction: column; }
  .news-pend-item-img, .news-pend-item-img-ph { width: 100%; height: 160px; }
}

/* ══ Badge "NEW" — Noticias y Mejoras de los últimos 7 días ══ */
.new-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  background: #e05535;
  color: #fff;
  font-family: var(--f-ui);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 4px;
  text-transform: uppercase;
  vertical-align: middle;
  animation: newPulse 1.1s ease-in-out infinite;
  will-change: opacity, transform;
}
@keyframes newPulse {
  0% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(224, 85, 53, 0.9);
    background: #e05535;
  }
  50% {
    opacity: 0.55;
    transform: scale(1.18);
    box-shadow: 0 0 0 10px rgba(224, 85, 53, 0);
    background: #ff7a4a;
  }
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(224, 85, 53, 0);
    background: #e05535;
  }
}

/* Badge NEW dentro del sidebar / cards Inicio — un poco más compacto */
.nav-new-badge {
  margin-left: auto;
  font-size: 9px;
  padding: 2px 6px;
}
.card .nav-new-badge { margin-left: 8px; }

/* Punto pulsante (legacy, ya no se usa pero se conserva por compatibilidad) */
.nav-new-dot {
  display: inline-block;
  width: 9px; height: 9px;
  margin-left: 6px;
  border-radius: 50%;
  background: #e05535;
  vertical-align: middle;
  animation: newDotPulse 1.1s ease-in-out infinite;
  will-change: opacity, transform;
}
@keyframes newDotPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(224, 85, 53, 0.85);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    box-shadow: 0 0 0 7px rgba(224, 85, 53, 0);
    opacity: 0.55;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(224, 85, 53, 0);
    opacity: 1;
  }
}

/* En la tabla de Mejoras, mantener el badge contenido en una línea */
.mej-inc-with-badge { white-space: normal; }

/* Accesibilidad: si el usuario pide menos movimiento, congelamos la animación */
@media (prefers-reduced-motion: reduce) {
  .new-badge, .nav-new-dot { animation: none; }
}
