/* COSEDE hub — BibliotecaGT */
:root {
  --cosede-ink: #0f2a33;
  --cosede-teal: #2b9ba6;
  --cosede-deep: #1e5f66;
  --cosede-sand: #f4f7f8;
  --cosede-line: #d5e3e6;
  --cosede-gold: #c9a227;
}
body.cosede-page {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--cosede-ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d9f2f4 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #eef6e8 0%, transparent 50%),
    var(--cosede-sand);
  min-height: 100vh;
}
.cosede-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}
.cosede-crumb {
  font-size: 0.85rem;
  color: #5a737a;
  margin: 0.5rem 0 1.25rem;
}
.cosede-crumb a { color: var(--cosede-deep); text-decoration: none; }
.cosede-crumb a:hover { text-decoration: underline; }
.cosede-hero {
  background: linear-gradient(135deg, #163a42 0%, #1e5f66 45%, #2b9ba6 100%);
  color: #fff;
  border-radius: 18px;
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 12px 32px rgba(15, 42, 51, 0.18);
}
.cosede-hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.02em;
}
.cosede-hero p { margin: 0; opacity: 0.92; line-height: 1.55; max-width: 52rem; }
.cosede-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(201, 162, 39, 0.25);
  border: 1px solid rgba(201, 162, 39, 0.55);
  color: #ffe9a8;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}
.cosede-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.cosede-card {
  display: block;
  background: #fff;
  border: 1px solid var(--cosede-line);
  border-radius: 16px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 18px rgba(15, 42, 51, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.cosede-card:hover {
  transform: translateY(-4px);
  border-color: #2b9ba688;
  box-shadow: 0 14px 28px rgba(15, 42, 51, 0.12);
}
.cosede-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  color: var(--cosede-deep);
}
.cosede-card p { margin: 0; color: #5a737a; font-size: 0.92rem; line-height: 1.5; }
.cosede-card .tag {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cosede-teal);
}
.cosede-section {
  background: #fff;
  border: 1px solid var(--cosede-line);
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}
.cosede-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--cosede-deep);
}
.cosede-section h3 {
  margin: 1rem 0 0.4rem;
  font-size: 1rem;
}
.cosede-list {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.55;
}
.cosede-list li { margin: 0.2rem 0; }
.cosede-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.cosede-table th,
.cosede-table td {
  border-bottom: 1px solid var(--cosede-line);
  text-align: left;
  padding: 0.55rem 0.4rem;
  vertical-align: top;
}
.cosede-table th { color: var(--cosede-deep); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.cosede-note {
  font-size: 0.88rem;
  color: #5a737a;
  background: #f0f7f8;
  border-left: 3px solid var(--cosede-teal);
  padding: 0.75rem 0.9rem;
  border-radius: 0 10px 10px 0;
  margin: 0.75rem 0 0;
}
.cosede-pill {
  display: inline-block;
  background: #e7f4f5;
  color: var(--cosede-deep);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
  margin: 0.15rem 0.2rem 0.15rem 0;
}
a.cosede-back {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--cosede-deep);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
a.cosede-back:hover { text-decoration: underline; }

/* Home 4th card */
.category-icon.cosede-gradient {
  background: linear-gradient(135deg, #163a42, #2b9ba6 55%, #c9a227);
}
a.category-card[data-bgt-cosede] h3 { color: var(--cosede-ink, #0f2a33); }

/* Fallback si el scope Vue cambia */
a.category-card[data-bgt-cosede]{
  background:var(--color-surface,#fff);
  border-radius:18px;
  border:1px solid var(--color-border-accent,#d5e3e6);
  box-shadow:0 8px 24px rgba(15,42,51,.08);
  padding:2rem;
  text-align:center;
  text-decoration:none;
  color:inherit;
  display:block;
  transition:transform .28s ease,box-shadow .28s ease,border-color .28s ease;
}
a.category-card[data-bgt-cosede]:hover{
  transform:translateY(-6px);
  box-shadow:0 16px 32px rgba(15,42,51,.14);
  border-color:#2b9ba652;
}
a.category-card[data-bgt-cosede] .category-icon{
  width:5rem;height:5rem;border-radius:18px;display:flex;align-items:center;justify-content:center;
  margin:0 auto 1.5rem;color:#fff;
}
a.category-card[data-bgt-cosede] h3{
  font-size:1.28rem;font-weight:800;margin:0 0 .65rem;color:#0f2a33;
}
a.category-card[data-bgt-cosede] p{
  color:#5a737a;font-size:.92rem;line-height:1.65;margin:0;
}

/* Inventario por institución (escritorio) */
@media (min-width: 641px) {
  body.cosede-page .cosede-inv {
    background: #fff;
    border: 1px solid var(--cosede-line);
    border-radius: 18px;
    padding: 1.4rem 1.5rem 1.5rem;
    box-shadow: 0 10px 30px rgba(15, 42, 51, 0.07);
    overflow-x: auto;
  }
  body.cosede-page .cosede-inv h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1.1rem;
    font-size: 1.25rem;
    color: var(--cosede-ink);
  }
  body.cosede-page .cosede-inv h2::before {
    content: "";
    width: 6px;
    height: 1.3em;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--cosede-teal), var(--cosede-gold));
  }
  body.cosede-page .cosede-inv table {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--cosede-line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    font-size: 0.95rem;
  }
  body.cosede-page .cosede-inv th {
    background: var(--cosede-deep);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.85rem 0.9rem;
    border-bottom: 0;
  }
  body.cosede-page .cosede-inv td {
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid #e6eef0;
    vertical-align: middle;
    transition: background 0.15s ease;
  }
  body.cosede-page .cosede-inv tbody tr:nth-child(even) td { background: #f8fbfc; }
  body.cosede-page .cosede-inv tbody tr:hover td { background: #eef8f9; }
  body.cosede-page .cosede-inv th:first-child,
  body.cosede-page .cosede-inv td:first-child {
    width: 3rem;
    text-align: center;
  }
  body.cosede-page .cosede-inv td:first-child {
    color: #7a9095;
    font-weight: 600;
    font-size: 0.85rem;
  }
  body.cosede-page .cosede-inv td:nth-child(2) a {
    color: var(--cosede-deep);
    font-weight: 600;
    text-decoration: none;
  }
  body.cosede-page .cosede-inv td:nth-child(2) a:hover {
    color: var(--cosede-teal);
    text-decoration: underline;
  }
  body.cosede-page .cosede-inv td.num { font-weight: 600; color: var(--cosede-ink); }
  body.cosede-page .cosede-inv td.num .cosede-ok,
  body.cosede-page .cosede-inv td.num .cosede-missing {
    display: inline-flex;
    justify-content: center;
    min-width: 2rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
  }
  body.cosede-page .cosede-inv td.num .cosede-ok { background: #e3f4ef; color: #17694f; }
  body.cosede-page .cosede-inv td.num .cosede-missing { background: #fde8eb; color: #b00020; }
  body.cosede-page .cosede-inv td:nth-child(6) { color: #5a737a; font-size: 0.88rem; }
  body.cosede-page .cosede-inv td:nth-child(6) .cosede-missing {
    display: inline-block;
    background: #fff1f2;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
  }
  body.cosede-page .cosede-inv tbody tr:has(.cosede-missing):not(:last-child) td:first-child {
    box-shadow: inset 4px 0 0 #d9415a;
  }
  body.cosede-page .cosede-inv tbody tr:last-child td,
  body.cosede-page .cosede-inv tbody tr:last-child:hover td {
    background: #e7f4f5;
    border-top: 2px solid var(--cosede-teal);
    border-bottom: 0;
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-weight: 700;
    color: var(--cosede-ink);
  }
  body.cosede-page .cosede-inv tbody tr:last-child td:nth-child(2) {
    letter-spacing: 0.06em;
    color: var(--cosede-deep);
  }
}

/* Teléfono */
body.cosede-page,
body.cosede-page *,
body.cosede-page *::before,
body.cosede-page *::after {
  box-sizing: border-box;
}
body.cosede-page { overflow-x: hidden; }

@media (max-width: 640px) {
  .cosede-wrap { padding: 1rem 0.9rem 3rem; }
  .cosede-hero { padding: 1.25rem 1.1rem; border-radius: 14px; }
  .cosede-hero p { font-size: 0.95rem; }
  .cosede-crumbs, .cosede-crumb { font-size: 0.8rem; overflow-wrap: anywhere; }
  .cosede-card, .cosede-section { padding: 1rem; }
  .cosede-card:hover { transform: none; }

  body.cosede-page .cosede-inv { overflow-x: visible; }
  body.cosede-page .cosede-inv h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
  body.cosede-page .cosede-inv table,
  body.cosede-page .cosede-inv tbody,
  body.cosede-page .cosede-inv tr,
  body.cosede-page .cosede-inv td {
    display: block;
    width: auto;
  }
  body.cosede-page .cosede-inv table { border: 0; background: transparent; }
  body.cosede-page .cosede-inv thead { display: none; }
  body.cosede-page .cosede-inv tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem 0.5rem;
    background: #fff;
    border: 1px solid var(--cosede-line);
    border-radius: 14px;
    padding: 0.8rem 0.9rem;
    margin-bottom: 0.6rem;
  }
  body.cosede-page .cosede-inv td {
    border: 0;
    padding: 0;
    text-align: left;
    font-size: 1rem;
  }
  body.cosede-page .cosede-inv td:nth-child(1) { display: none; }
  body.cosede-page .cosede-inv td:nth-child(2) {
    grid-column: 1 / -1;
    font-weight: 700;
    font-size: 1.02rem;
    margin-bottom: 0.2rem;
  }
  body.cosede-page .cosede-inv td:nth-child(2) a {
    display: block;
    padding: 0.2rem 0;
    color: var(--cosede-deep);
    text-decoration: none;
  }
  body.cosede-page .cosede-inv td:nth-child(3),
  body.cosede-page .cosede-inv td:nth-child(4),
  body.cosede-page .cosede-inv td:nth-child(5) {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: left;
  }
  body.cosede-page .cosede-inv td:nth-child(3)::before,
  body.cosede-page .cosede-inv td:nth-child(4)::before,
  body.cosede-page .cosede-inv td:nth-child(5)::before {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5a737a;
  }
  body.cosede-page .cosede-inv td:nth-child(3)::before { content: "Redactados"; }
  body.cosede-page .cosede-inv td:nth-child(4)::before { content: "Faltantes"; }
  body.cosede-page .cosede-inv td:nth-child(5)::before { content: "Plan"; }
  body.cosede-page .cosede-inv td:nth-child(6) {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    color: #5a737a;
    overflow-wrap: anywhere;
  }
  body.cosede-page .cosede-inv td:nth-child(6):empty { display: none; }
  body.cosede-page .cosede-inv tr:last-child {
    background: #e7f4f5;
    border-color: #2b9ba6;
  }
  body.cosede-page .cosede-inv tr:last-child td { background: transparent; }

  body.cosede-page .poli-tabs { gap: 0.5rem; }
  body.cosede-page .poli-tab {
    min-height: 42px;
    padding: 0.5rem 0.95rem;
  }
}
