/* Colores y tipografía de la marca sobre las variables del admin de Django */
@font-face { font-family: "Inter"; src: url("../fonts/inter.260c81a4759b.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

html[data-theme="light"], :root {
  --primary: #1f5fae;
  --secondary: #0f2f57;
  --accent: #9fd0ff;
  --primary-fg: #fff;
  --header-color: #dbe9f8;
  --header-branding-color: #fff;
  --header-bg: linear-gradient(135deg, #0f2f57, #1f5fae);
  --header-link-color: #fff;
  --breadcrumbs-fg: #dbe9f8;
  --breadcrumbs-link-fg: #fff;
  --breadcrumbs-bg: #174c8c;
  --link-fg: #1f5fae;
  --link-hover-color: #0f2f57;
  --link-selected-fg: #0f2f57;
  --button-bg: #1f5fae;
  --button-hover-bg: #174c8c;
  --default-button-bg: #0f2f57;
  --default-button-hover-bg: #1f5fae;
  --selected-row: #e6effa;
  --font-family-primary: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --primary: #7cb4f2; --secondary: #143e74; --link-fg: #7cb4f2; --link-hover-color: #a3cbf7; --link-selected-fg: #a3cbf7; --selected-row: #17294a; --primary-fg: #0a1628; }
}
html[data-theme="dark"] { --primary: #7cb4f2; --secondary: #143e74; --link-fg: #7cb4f2; --link-hover-color: #a3cbf7; --link-selected-fg: #a3cbf7; --selected-row: #17294a; --primary-fg: #0a1628; }

#header { background: var(--header-bg); padding: 12px 32px; }
#site-name a { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -.01em; }
#site-name img { height: 40px; width: auto; background: #fff; border-radius: 8px; padding: 2px 6px; }
#site-name img.logo-app { padding: 2px; }
#site-name img.logo-centro { margin-left: 8px; }
.login #header { justify-content: center; }
.login #site-name img { height: 52px; }
.module, .login #container { border-radius: 12px; overflow: hidden; }
.login #container { box-shadow: 0 24px 48px rgb(16 24 40 / .15); }
.button, input[type=submit], input[type=button], .submit-row input, a.button { border-radius: 8px; }
.object-tools a { border-radius: 999px; }

/* Accesos rápidos de la portada */
#accesos-rapidos ul { margin: 16px; padding: 0; list-style: none; display: flex; gap: 12px; flex-wrap: wrap; }
#accesos-rapidos a.button { display: inline-block; padding: 12px 18px; font-weight: 600; background: var(--button-bg); color: var(--button-fg, #fff); }
#accesos-rapidos a.button:hover { background: var(--button-hover-bg); }
#accesos-rapidos a.button.secundario { background: transparent; color: var(--link-fg); border: 1.5px solid var(--link-fg); }
#site-name a, #site-name a:link, #site-name a:visited { color: #fff; }
/* El admin pinta el detalle del icono con var(--header-bg); al ser un degradado, hace falta un color sólido. */
#header .theme-toggle svg { fill: #fff; color: #174c8c; }

/* ---------- Panel de la portada ---------- */
.panel-bolsa { margin-bottom: 20px; }
.panel-bolsa .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 16px; }
.kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
  background: var(--body-bg); border: 1px solid var(--hairline-color); border-radius: 12px;
  color: var(--body-fg); text-decoration: none;
}
a.kpi:hover { border-color: var(--primary); text-decoration: none; }
.kpi__etiqueta { font-size: .8rem; font-weight: 600; color: var(--body-quiet-color); }
.kpi__valor { font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--body-fg); }
.kpi__nota { font-size: .78rem; color: var(--body-quiet-color); }
.kpi--heroe { border-color: var(--primary); }
.kpi--heroe .kpi__valor { font-size: 3rem; color: var(--primary); }
.aviso-estado {
  display: flex; gap: 10px; align-items: center; margin: 0 0 16px; padding: 12px 16px;
  border: 1px solid var(--error-fg); border-radius: 10px; color: var(--body-fg); text-decoration: none;
}
.aviso-estado svg { color: var(--error-fg); flex: none; }
.panel-columnas { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.tabla-barras table { width: 100%; }
.tabla-barras .num { text-align: right; font-variant-numeric: tabular-nums; width: 4.5em; }
.tabla-barras td.barra { width: 40%; vertical-align: middle; }
.tabla-barras td.barra span { display: block; height: 10px; min-width: 2px; background: var(--primary); border-radius: 0 4px 4px 0; }
.tabla-barras .quiet, .actividad-reciente .quiet { color: var(--body-quiet-color); }
.actividad-reciente h2 { display: flex; justify-content: space-between; align-items: center; }
.actividad-reciente h2 a { color: var(--header-link-color); font-weight: 400; font-size: .85em; }
.actividad-reciente ul { list-style: none; margin: 0; padding: 8px 12px; }
.actividad-reciente li { padding: 6px 0; border-bottom: 1px solid var(--hairline-color); }
.actividad-reciente li:last-child { border-bottom: 0; }
.actividad-reciente time { font-variant-numeric: tabular-nums; color: var(--body-quiet-color); margin-right: 8px; }
.actividad-reciente .actor { font-weight: 600; margin-right: 6px; }
