/* ══════════════════════════════════════════
   BASE.CSS — Variables globales y reset
   Aquí viven los colores, fuentes y estilos
   que se usan en TODA la aplicación.
   Si cambia la paleta de colores, solo tocas este archivo.
══════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:           #F9F9F9;
  --primary:      #000F28;
  --accent:       #E82338;
  --accent-hover: #B71C1C;
  --text-muted:   #BBBBBB;
  --submenu:      #0E3969;
  --submenu-item: #172B4E;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: #000;
}

/* ── APP SHELL ── */
#app-screen {
  display: none;
  flex-direction: column;
  height: 100vh;
}

/* ── MAIN CONTENT ── */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-area {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
}

/* ── WELCOME ── */
#welcome-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  max-width: 1200px;
  padding: 8px 0;
  color: #999;
  font-size: 22px;
  font-weight: 500;
  min-height: 100%;
}

/* ── FOOTER ── */
.footer-label {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  padding: 10px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}

/* ── BOTÓN LOGOUT FIJO ── */
.Btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  position: fixed;
  bottom: 24px;
  left: 16px;
  overflow: hidden;
  transition-duration: .3s;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.199);
  background-color: var(--accent);
  z-index: 999;
}

.Btn .sign {
  width: 100%;
  transition-duration: .3s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.Btn .sign svg { width: 17px; }
.Btn .sign svg path { fill: white; }

.Btn .text {
  position: absolute;
  right: 0%;
  width: 0%;
  opacity: 0;
  color: white;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition-duration: .3s;
  white-space: nowrap;
}

.Btn:hover {
  width: 125px;
  border-radius: 40px;
  background-color: var(--accent-hover);
}

.Btn:hover .sign {
  width: 30%;
  padding-left: 20px;
}

.Btn:hover .text {
  opacity: 1;
  width: 70%;
  padding-right: 10px;
}

.Btn:active { transform: translate(2px, 2px); }

/* ── DASHBOARD ── */
#welcome-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  height: 100%;
  width: 100%;
  max-width: 1200px;
  padding: 8px 0;
  color: #999;
  font-size: 22px;
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  width: 100%;
  height: 100%;
  align-items: start; 
}

/* ── COLUMNA IZQUIERDA: INDICADORES ── */
.dashboard-left { display: flex; flex-direction: column; gap: 16px; }

.dashboard-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  opacity: 0.6;
}

.indicator-card {
  background: white;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 4px solid var(--primary);
  transition: transform 0.15s, box-shadow 0.15s;
}

.indicator-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.indicator-card.positive { border-left-color: #16a34a; }
.indicator-card.negative { border-left-color: var(--accent); }

.indicator-left { display: flex; flex-direction: column; gap: 4px; }

.indicator-name {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.indicator-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.indicator-sub {
  font-size: 11px;
  color: #aaa;
}

.indicator-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.indicator-badge.positive { background: #dcfce7; color: #16a34a; }
.indicator-badge.negative { background: #fee2e2; color: var(--accent); }
.indicator-badge.neutral  { background: #f1f5f9; color: #64748b; }

.indicator-loading {
  font-size: 13px;
  color: #aaa;
  text-align: center;
  padding: 20px;
}

/* ── COLUMNA DERECHA: NOTICIAS ── */
.dashboard-right { display: flex; flex-direction: column; gap: 16px; min-height: 0;}

.news-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
  overflow-y: auto;
  max-height: 600px;
}

.news-container::-webkit-scrollbar { width: 4px; }
.news-container::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.news-card {
  background: white;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  display: block;
  border-left: 3px solid transparent;
}

.news-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-left-color: var(--accent);
}

.news-source {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.news-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.4;
  margin-bottom: 4px;
}

.news-date {
  font-size: 11px;
  color: #aaa;
}

.news-loading {
  font-size: 13px;
  color: #aaa;
  text-align: center;
  padding: 20px;
}

.indicator-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.indicator-modal-box {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 560px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.indicator-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}
.indicator-modal-header button {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #aaa;
}
.indicator-modal-header button:hover { color: var(--accent); }

/* ── INDICADORES — mismo estilo borde que noticias ── */
.indicator-card {
  border-left-color: var(--accent) !important;
  margin-bottom: 12px;
}
.indicator-card.positive { border-left-color: var(--accent) !important; }
.indicator-card.negative { border-left-color: var(--accent) !important; }

/* ── NOTICIAS ACORDEÓN ── */
.news-card-accordion { cursor: pointer; }
.news-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.news-chevron {
  font-size: 18px;
  color: #bbb;
  transition: transform 0.2s;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}
.news-chevron.open { transform: rotate(90deg); color: var(--accent); }
.news-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.news-body.open { max-height: 200px; padding-top: 10px; }
.news-summary {
  font-size: 12px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 8px;
}
.news-link {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.news-link:hover { text-decoration: underline; }

/* ── FRED TABS ── */
.fred-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.fred-tab {
  background: white;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: #888;
  cursor: pointer;
  transition: all 0.15s;
}
.fred-tab:hover { border-color: var(--accent); color: var(--accent); }
.fred-tab.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ── RESPONSIVE DASHBOARD ── */
@media (max-width: 850px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* ── ANIMACIÓN CHART MODAL ── */
@keyframes chartDraw {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}
#modal-chart {
  animation: chartDraw 1.2s ease-out forwards;
}