/* dm-custom.css - ajustes propios sobre el CSS base */

#navbar-top { background-color: #055a8e; min-height: 34px; }
.navbar-brand-exp {
  font-family: "Arial Black", Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
  font-size: 1.05rem;
}

#navbar-main .navbar-nav .nav-link { color: #fff; font-weight: 500; }
#navbar-main .navbar-nav .nav-link:hover { color: #fff; font-weight: 700; }
#navbar-main .dropdown-menu .dropdown-item { color: #305b96; }

.contenedor { padding-bottom: 30px; min-height: 60vh; }

/* Banderas via flagcdn (sustituye al sprite original) */
.flg-cdn { width: 28px; height: 21px; object-fit: cover; vertical-align: middle;
  margin-right: 7px; border: 1px solid #d6cfc5; }
.flg-cdn-lg { width: 64px; height: 48px; object-fit: cover; border: 1px solid #d6cfc5; }

/* Barras horizontales en tablas (graph_hbar ya viene del CSS base) */
.graph_hbar { background-color: #4E80C0; border-radius: 1px; }

/* Contenedor de graficos */
.dm-chart-box { position: relative; height: 360px; margin: 10px 0 20px; }
.dm-chart-box canvas { max-width: 100%; }

h1.title { color: #1a1816; margin-bottom: 4px; }
.dm-subtitle { color: #6b6b6b; font-size: 0.95rem; margin-bottom: 14px; }

.tabledat td a { color: #305b96; }
.tabledat tbody tr:hover { background-color: #f3ead9; }

.dm-value-big { font-size: 2.1rem; font-weight: bold; color: #1a1816; }
.dm-value-eur { font-size: 1.3rem; font-weight: bold; color: #386ab0; }
.dm-value-date { color: #6b6b6b; font-size: 0.9rem; }

.breadcrumb { font-size: 0.8rem; background: transparent; padding: 4px 0; margin-bottom: 6px; }
.breadcrumb a { color: #305b96; }

/* Feed del home estilo datosmacro (teasers de indicador) */
.views-row { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid #d6cfc5; }
.views-row:last-child { border-bottom: none; }
.node__title { font-size: 1.25rem; margin: 0 0 8px; line-height: 1.2; }
.node__title a { color: #305b96; font-weight: 700; }
.node__title a:hover { color: #018fe2; }
.node--view-mode-teaser .field--name-body {
  font-size: 0.9rem; color: #444; line-height: 1.45; }
.node--view-mode-teaser .table-responsive { margin-bottom: 6px; }
.node-readmore a { font-size: 0.85rem; font-weight: 700; color: #305b96; }
.node-readmore a::after { content: " >"; }
.tabledat.table-condensed td, .tabledat.table-condensed th { padding: 3px 6px; }

/* Mapa interactivo del home (3/4 mapa + 1/4 silueta) */
.dm-geo { display: flex; gap: 10px; margin: 4px 0 18px; align-items: stretch; }
.dm-geo-map { flex: 0 0 75%; max-width: 75%; background: #cfe2f3; border: 1px solid #b8b2ad; }
.dm-geo-map svg { width: 100%; height: auto; display: block; }
.dm-geo-side { flex: 0 0 calc(25% - 10px); display: flex; flex-direction: column;
  align-items: center; background: #fffdfa; border: 1px solid #b8b2ad; padding: 8px; }
.dm-geo-side-name { font-weight: bold; color: #1a1816; font-size: 0.95rem;
  text-align: center; margin-bottom: 6px; min-height: 1.2em; }
.dm-geo-side svg { width: 100%; height: auto; flex: 1; }
.dm-geo-hint { font-size: 0.7rem; color: #6b6b6b; text-align: center; margin: 6px 0 0; }

.country { fill: #e6e0d4; stroke: #fffdfa; stroke-width: 0.4; }
.country.has-data { fill: #a9c3e0; cursor: pointer; }
.country.has-data:hover, .country.hover { fill: #386ab0; }

/* Panel lateral deslizante (estilo ayuda ichimoku.com) */
.country-panel { position: fixed; top: 0; right: 0; width: 340px; max-width: 86vw;
  height: 100vh; background: #fff1e0; border-left: 3px solid #386ab0;
  box-shadow: -8px 0 18px rgba(0,0,0,0.25); padding: 18px; z-index: 1050;
  transform: translateX(105%); transition: transform .28s ease; overflow-y: auto; }
.country-panel.open { transform: translateX(0); }
.country-panel-close { position: absolute; top: 8px; right: 12px; border: none;
  background: none; font-size: 1.6rem; line-height: 1; color: #555; cursor: pointer; }
.country-panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.country-panel-head img { width: 48px; height: 36px; object-fit: cover; border: 1px solid #d6cfc5; }
.country-panel-head h3 { margin: 0; font-size: 1.2rem; color: #1a1816; }
.panel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.18);
  opacity: 0; visibility: hidden; transition: opacity .28s; z-index: 1040; }
.panel-overlay.show { opacity: 1; visibility: visible; }

@media (max-width: 767px) {
  .dm-geo { flex-direction: column; }
  .dm-geo-map, .dm-geo-side { flex: 1 1 100%; max-width: 100%; }
}

/* Mini-cards "Ultimos datos publicados" (cabecera del home) - sin colores */
.dm-latest { margin: 14px 0 18px; }
.dm-latest-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: .5px;
  color: #6b6b6b; font-weight: 700; margin-bottom: 8px; }
.dm-latest-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dm-wg-info {
  display: block; background-color: #e6daca; border-top: 4px solid #555;
  padding: 8px 12px; min-width: 8rem; flex: 1 1 0; text-decoration: none;
  color: #1a1816; transition: background-color .15s; }
.dm-wg-info:hover { background-color: #ddcfb8; color: #1a1816; }
.dm-wg-hl { text-transform: uppercase; font-weight: bold; color: #000;
  font-size: 0.72rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.dm-wg-fl { width: 1.2em; height: auto; margin: 0 5px 2px 0; border: none; }
.dm-wg-val { font-size: 1.15rem; font-weight: bold; color: #1a1816; margin-bottom: 2px; }
.dm-wg-sub { font-size: 0.72rem; color: #6b6b6b; margin-bottom: 2px; }
.dm-wg-var { font-size: 0.8rem; color: #333; margin-bottom: 0; }
.dm-wg-var .bi { font-size: 0.7rem; }

/* Agenda semanal (calendario) estilo FXStreet: cabecera repetida por dia
   (dm-dayhead, 2 filas: fecha+grupos ABS/MoM/YoY, luego columnas Hora/Pais/
   Indicador/...). La celda de la fecha (dm-daycell) se resalta como antes
   se resaltaba la fila separadora dm-day; "hoy" tinta las 2 filas de cabecera. */
.dm-agenda-tbl tbody tr.dm-dayhead th.dm-daycell {
  background: #eef1f5; font-weight: bold; text-transform: capitalize;
  text-align: center; border-top: 2px solid #b8b2ad; }
.dm-agenda-tbl tbody tr.dm-dayhead.hoy th { background: #386ab0; color: #fff; }
.dm-agenda-tbl tbody tr.dm-dayhead.hoy th.dm-daycell { border-top-color: #386ab0; }
.dm-day-empty td { color: #aaa; font-style: italic; }

/* Etiqueta de procedencia de la fuente (oficial vs agregador) */
.src-tag { font-size: 0.6rem; text-transform: uppercase; letter-spacing: .3px;
  padding: 0 4px; border-radius: 3px; border: 1px solid; vertical-align: middle; }
.src-oficial { color: #2e6b2e; background: #e6f0e0; border-color: #bcd6b0; }
.src-agregador { color: #6b6b6b; background: #ece7dd; border-color: #d6cfc5; }

/* Estado de fuentes por pais */
.est-badge { font-size: 0.68rem; padding: 1px 6px; border-radius: 3px; border: 1px solid;
  white-space: nowrap; }
.est-activa { color: #2e6b2e; background: #e6f0e0; border-color: #bcd6b0; }
.est-pendiente-key { color: #8a5a00; background: #faedd2; border-color: #e6cfa0; }
.est-pendiente-api { color: #8a3a00; background: #f7e2d2; border-color: #e6bfa0; }
.est-agregador, .est-agregador-activo { color: #2c5a8a; background: #dce8f4; border-color: #b3cce6; }
.est-abierta-pendiente { color: #1d6f6f; background: #d7efef; border-color: #a8d8d8; }
.est-privado { color: #6b5b6b; background: #ece3ec; border-color: #d6c7d6; }

/* Navbar: buscador de pais a la derecha del menu, sin envolver (lg+) */
@media (min-width: 992px) {
  #navbar-main .navbar-nav { flex-wrap: nowrap; align-items: center; }
}
#navbar-main .navbar-form { margin-left: .75rem; }
#navbar-main .navbar-form input { width: 11rem; max-width: 40vw; }

/* Estado: filas de agencia desplegables (indicadores) */
tr.agc-expandable { cursor: pointer; }
tr.agc-expandable:hover { background: #f3ead9; }
.agc-caret { font-size: .68rem; color: #888; margin-right: 5px; transition: transform .15s;
  display: inline-block; }
tr.agc-row.expanded .agc-caret { transform: rotate(90deg); }
.agc-detail > td { background: #fbf6ec; padding: 4px 8px 10px 26px; border-top: none; }
.agc-detail table { margin: 0; background: transparent; }

/* Barras de importancia del calendario (estilo FXStreet) */
.imp-bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.imp-bars .bar { width: 4px; height: 6px; background: #d6cfc5; display: inline-block; }
.imp-bars .bar:nth-child(2) { height: 10px; }
.imp-bars .bar:nth-child(3) { height: 14px; }
.imp-bars .bar.on { background: #386ab0; }
.imp-3 .bar.on { background: #b53f1b; }

/* Previsiones: etiqueta (pre) y fondo ligeramente distinto */
.pre-tag { font-size: 0.62rem; color: #8a6d3b; font-weight: normal; vertical-align: middle; }
.dm-value-big .pre-tag { font-size: 0.9rem; }
.dm-wg-pre { background-color: #ece3d0; border-top-style: dashed; }
.dm-pre-box { background-color: #f3ead9; }

/* Previsiones FMI (años futuros) */
.dm-forecast td { color: #8a6d3b; font-style: italic; }
.badge-prev { font-size: 0.65rem; text-transform: uppercase; background: #f3ead9;
  color: #b53f1b; border: 1px solid #e0d4bd; border-radius: 3px; padding: 0 4px;
  margin-left: 4px; font-style: normal; vertical-align: middle; }

/* Ficha: tabs de serie */
.ficha-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.ficha-tab {
  background: #f3ead9; border: 1px solid #d9c9a8; color: #3d2b1f;
  border-radius: 4px; padding: 4px 14px; font-size: .84rem; cursor: pointer;
  transition: background .15s;
}
.ficha-tab:hover { background: #e8d8b8; }
.ficha-tab.active { background: #386ab0; border-color: #2d559a; color: #fff; font-weight: 600; }

/* Ficha: comentario automático */
.ficha-comment { font-size: .97rem; line-height: 1.6; color: #2a2017; }
