/* AMT Journal — Financiera: estados financieros SEC, reportes y noticias bursátiles (prefijo .fin-) */

.fin { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fin-body, .fin-company { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- cabecera y buscador ---------- */
.fin-head { margin-bottom: 0; align-items: center; }
.fin-head-main { min-width: 0; }
.fin-back { display: inline-flex; align-items: center; gap: 7px; height: 32px; font-size: 13px; font-weight: 500; color: var(--text-2); transition: color .14s; }
.fin-back:hover { color: var(--text); }

.fin-search { position: relative; width: min(420px, 100%); }
.fin-search .input { height: 38px; }
.fin-suggest {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 380px; overflow-y: auto;
  padding: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
}
.fin-suggest-item {
  display: grid; grid-template-columns: auto 64px minmax(0, 1fr); align-items: center; gap: 10px;
  width: 100%; padding: 7px 8px;
  border-radius: var(--r-sm);
  text-align: left;
  transition: background .1s;
}
.fin-suggest-item:hover, .fin-suggest-item.is-active { background: var(--active); }
.fin-suggest-tk { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--text); }
.fin-suggest-name { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-suggest-msg { padding: 12px 10px; font-size: 12.5px; color: var(--text-3); }

.fin-chipbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-top: -4px; }
.fin-chipgroup { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fin-chipgroup > .cap { flex: none; }
.fin-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.fin-chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .02);
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--text-2);
  transition: color .12s, border-color .12s, background .12s;
}
.fin-chip:hover { color: var(--text); border-color: var(--line-strong); }
.fin-chip.is-active { color: var(--text); background: var(--blue-soft); border-color: var(--blue-line); }
.fin-chip.is-recent { color: var(--text-3); }
.fin-chip.is-recent:hover { color: var(--text); }
.fin-chip-clear { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-sm); color: var(--text-4); transition: color .12s, background .12s; }
.fin-chip-clear:hover { color: var(--text); background: var(--hover); }

/* marca del ticker */
.fin-mark {
  flex: none; display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012));
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: -.01em;
  color: var(--mk, var(--text-2));
}
.fin-mark.is-sm { width: 26px; height: 26px; border-radius: var(--r-sm); font-size: 8.5px; }
.fin-mark.is-lg { width: 54px; height: 54px; border-radius: var(--r-lg); font-size: 13px; }

/* ---------- avisos ---------- */
.fin-sample {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  font-size: 12.5px; line-height: 1.55; color: var(--text-2);
  overflow-wrap: anywhere;
}
.fin-sample .pill { flex: none; }
.fin-sample.is-warn { border-style: solid; border-color: var(--warn-line); background: var(--warn-soft); }
.fin-sample.is-warn svg { flex: none; margin-top: 2px; color: var(--warn); }
.fin-card-note { padding: 12px 18px 0; }
.fin-card-note .fin-sample { padding: 8px 12px; font-size: 12px; }
.fin-disclaimer { font-size: 11.5px; line-height: 1.6; color: var(--text-3); }

/* ---------- columnas ---------- */
.fin-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fin-cols.is-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- portada ---------- */
.fin-pop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fin-pop-item {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .012);
  transition: background .14s, border-color .14s;
}
.fin-pop-item:hover { background: var(--hover); border-color: var(--line); }
.fin-pop-item > svg { flex: none; margin-left: auto; color: var(--text-4); transition: color .14s, transform .14s; }
.fin-pop-item:hover > svg { color: var(--text-2); transform: translateX(2px); }
.fin-pop-txt { display: flex; flex-direction: column; min-width: 0; }
.fin-pop-txt b { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--text); }
.fin-pop-txt span { margin-top: 2px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-pop-txt small { margin-top: 1px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fin-guide-list { display: flex; flex-direction: column; gap: 14px; }
.fin-guide-list > div { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: start; }
.fin-guide-list dd { font-size: 12.5px; line-height: 1.55; color: var(--text-2); }
.fin-guide-note { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 12px; line-height: 1.55; color: var(--text-3); }
.fin-guide-note svg { flex: none; margin-top: 2px; }

.fin-form {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; height: 22px; padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: rgba(255, 255, 255, .03);
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: var(--text-2); white-space: nowrap;
}
.fin-form.is-annual { color: var(--blue); background: var(--blue-soft); border-color: var(--blue-line); }

/* ---------- titulares (compartido con Noticias › Acciones) ---------- */
.fin-nl { list-style: none; margin: 0; padding: 0; }
.fin-nl > li + li { border-top: 1px solid var(--line-soft); }
.fin-nl-item {
  position: relative;
  display: flex; flex-direction: column; gap: 5px;
  padding: 12px 44px 12px 18px;
  transition: background .12s;
}
a.fin-nl-item:hover { background: rgba(255, 255, 255, .025); }
.fin-nl-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 0; font-size: 11.5px; color: var(--text-3); min-height: 14px; }
.fin-nl-src { font-weight: 500; color: var(--text-2); }
.fin-nl-src + .fin-nl-time::before { content: "·"; margin: 0 7px; color: var(--text-4); }
.fin-nl-title { font-size: 13.5px; font-weight: 500; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.fin-nl-ext { position: absolute; top: 13px; right: 18px; color: var(--text-4); transition: color .12s, transform .12s; }
a.fin-nl-item:hover .fin-nl-ext { color: var(--text-2); transform: translate(1px, -1px); }
a.fin-nl-item:visited .fin-nl-title { color: var(--text-2); }
.fin-nl.is-dense .fin-nl-item { padding-top: 10px; padding-bottom: 10px; }
.fin-nl.is-dense .fin-nl-title { font-size: 13px; }

/* carga */
.fin-skel {
  display: inline-block; max-width: 100%; height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .1), rgba(255, 255, 255, .045));
  background-size: 200% 100%;
  animation: fin-shimmer 1.5s linear infinite;
  vertical-align: middle;
}
.fin-skel-box { color: transparent; background: linear-gradient(90deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .1), rgba(255, 255, 255, .045)); background-size: 200% 100%; animation: fin-shimmer 1.5s linear infinite; }
.fin-skel-card { min-height: 300px; }
@keyframes fin-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- ficha de la empresa ---------- */
.fin-id { display: flex; align-items: center; justify-content: space-between; gap: 20px 32px; padding: 20px 22px; overflow: hidden; }
.fin-id::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(520px 170px at 0% 0%, rgba(61, 123, 255, .08), transparent 70%);
}
.fin-id > * { position: relative; }
.fin-id-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.fin-id-txt { min-width: 0; }
.fin-id-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.fin-id-name { font-size: 22px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; overflow-wrap: anywhere; }
.fin-id-tk { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text-2); }
.fin-id-facts { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 10px; }
.fin-id-facts dt { font-size: 10px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: var(--text-4); }
.fin-id-facts dd { margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.fin-id-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; flex: none; }
.fin-id-last { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.fin-id-last b { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.fin-id-last small { font-size: 11.5px; color: var(--text-3); }
.fin-id-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* KPI: 6 columnas en escritorio, 3 en portátil, 2 en móvil */
.fin-kpis .kpi-value { font-size: 22px; }
.fin-kpis .kpi-sub { color: var(--text-4); }

/* ---------- gráfico ---------- */
.fin-chart-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.fin-chart-fig { margin: 0; min-width: 0; }
.fin-chart-fig figcaption { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.fin-chart-box { min-width: 0; }
.fin-key { width: 8px; height: 8px; border-radius: 2px; }
.fin-key.is-rev { background: var(--c1); }
.fin-key.is-ni { background: var(--pos); }

/* ---------- razones ---------- */
.fin-ratio-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 18px; padding-top: 4px; }
.fin-ratio { display: flex; flex-direction: column; min-width: 0; }
.fin-ratio dt { font-size: 11.5px; font-weight: 500; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-ratio dd { margin-top: 4px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.fin-ratio dd.pos { color: var(--pos); }
.fin-ratio dd.neg { color: var(--neg); }
.fin-ratio-bar { display: block; height: 3px; margin-top: 7px; border-radius: 2px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.fin-ratio-bar i { display: block; height: 100%; border-radius: 2px; background: var(--c1); }
.fin-ratio-bar.is-empty { background: none; }
.fin-ratio { cursor: help; }

/* ---------- estados financieros ---------- */
.fin-st-head { align-items: flex-end; padding-top: 6px; border-bottom: 1px solid var(--line-soft); min-height: 0; }
.fin-st-head .tabs { border-bottom: none; }
.fin-st-head .card-tools { padding-bottom: 8px; }
.fin-tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fin-tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.fin-tbl thead th { vertical-align: bottom; padding-top: 12px; }
.fin-th-p { display: block; font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--text); }
.fin-th-d { display: block; margin-top: 3px; font-size: 10.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-4); }
.fin-tbl .fin-tbl-concept { min-width: 210px; text-align: left; }
.fin-tbl tbody th {
  padding: 10px 14px 10px 18px;
  font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--text-2);
  white-space: nowrap;
  border-bottom: 1px solid var(--line-soft);
}
.fin-tbl td { padding-top: 10px; padding-bottom: 10px; min-width: 96px; }
.fin-tbl td.is-na { color: var(--text-4); }
.fin-tbl td.pos { color: var(--pos); }
.fin-tbl td.neg { color: var(--neg); }
.fin-tbl tr.is-strong th { font-weight: 600; color: var(--text); }
.fin-tbl tr.is-strong td { font-weight: 600; }
.fin-tbl tr.is-sub th { padding-left: 32px; font-size: 12px; color: var(--text-3); }
.fin-tbl tr.is-sub td { font-size: 12px; color: var(--text-3); }
.fin-tbl tr.is-sub td.pos { color: var(--pos); }
.fin-tbl tr.is-sub td.neg { color: var(--neg); }
.fin-tbl tr.is-total th, .fin-tbl tr.is-total td { border-top: 1px solid var(--line); }
.fin-tbl tr.fin-tr-head th {
  padding: 16px 18px 7px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase;
  color: var(--text-3);
  background: rgba(255, 255, 255, .012);
}
.fin-tbl tbody tr.fin-tr-head:hover { background: none; }
.fin-tbl-foot { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 11px 18px; border-top: 1px solid var(--line-soft); font-size: 11.5px; line-height: 1.5; color: var(--text-3); }
.fin-tbl-foot > span { display: inline-flex; align-items: flex-start; gap: 6px; }
.fin-tbl-foot svg { flex: none; margin-top: 2px; }
.fin-st-body > .empty { padding-top: 36px; padding-bottom: 36px; }

/* ---------- reportes ---------- */
.fin-fl { list-style: none; margin: 0; padding: 0; }
.fin-fl > li + li { border-top: 1px solid var(--line-soft); }
.fin-fl-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto 14px; align-items: center; gap: 14px;
  padding: 11px 18px;
  transition: background .12s;
}
a.fin-fl-item:hover { background: rgba(255, 255, 255, .025); }
.fin-fl-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fin-fl-txt b { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-fl-txt small { font-size: 11.5px; color: var(--text-3); }
.fin-fl-date { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.fin-fl-ext { color: var(--text-4); transition: color .12s; }
a.fin-fl-item:hover .fin-fl-ext { color: var(--text-2); }

/* ---------- Noticias › Acciones ---------- */
.fin-sn-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 12px 16px; }
.fin-sn-bar > .cap { flex: none; }
.fin-sn-form { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.fin-sn-form .input-group { width: 190px; }
.fin-sn-form .input { height: 30px; font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; }
.fin-sn-form .input::placeholder { font-family: var(--sans); text-transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .fin-kpis.kpi-strip { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fin-kpis.kpi-strip > .kpi { border-left: none; }
  .fin-kpis.kpi-strip > .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line-soft); }
  .fin-kpis.kpi-strip > .kpi:not(:nth-child(3n+1)) { border-left: 1px solid var(--line-soft); }
  .fin-pop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .fin-cols, .fin-cols.is-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 920px) {
  /* la tabla se desplaza en horizontal: el concepto queda fijo a la izquierda */
  .fin-tbl .fin-tbl-concept { position: sticky; left: 0; z-index: 1; background: var(--bg-1); box-shadow: 1px 0 0 var(--line-soft); }
  .fin-tbl tbody tr:hover .fin-tbl-concept { background: var(--bg-3); }
  .fin-kpis.kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-kpis.kpi-strip > .kpi { border-left: none; border-bottom: 1px solid var(--line-soft); }
  .fin-kpis.kpi-strip > .kpi:nth-child(even) { border-left: 1px solid var(--line-soft); }
  .fin-kpis.kpi-strip > .kpi:nth-last-child(-n+2) { border-bottom: none; }
  .fin-pop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-id { flex-direction: column; align-items: stretch; }
  .fin-id-side { flex-direction: row; align-items: flex-end; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line-soft); }
  .fin-id-last { align-items: flex-start; }
}
@media (max-width: 640px) {
  .fin-head .fin-search { width: 100%; }
  .fin-chipbar { gap: 10px; }
  .fin-chipgroup { align-items: flex-start; flex-direction: column; gap: 7px; }
  .fin-pop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fin-pop-item { gap: 10px; padding: 10px; }
  .fin-pop-item > svg, .fin-pop-txt small { display: none; }
  .fin-pop-item .fin-mark { width: 32px; height: 32px; font-size: 9.5px; }
  .fin-id { padding: 16px; }
  .fin-id-main { align-items: flex-start; }
  .fin-id-name { font-size: 19px; }
  .fin-id-facts { gap: 8px 18px; }
  .fin-id-side { flex-direction: column; align-items: stretch; gap: 10px; }
  .fin-id-links { justify-content: flex-start; }
  .fin-kpis .kpi { padding: 13px 14px; }
  .fin-kpis .kpi-value { font-size: 19px; }
  .fin-chart-body { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .fin-ratio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-st-head { flex-direction: column; align-items: stretch; gap: 8px; padding: 6px 14px 0; }
  .fin-st-head .tabs { gap: 18px; overflow-x: auto; scrollbar-width: none; }
  .fin-st-head .tabs button { flex: none; white-space: nowrap; }
  .fin-st-head .card-tools { padding-bottom: 10px; }
  .fin-tbl .fin-tbl-concept { min-width: 148px; max-width: 168px; white-space: normal; }
  .fin-tbl tbody th { padding-left: 14px; line-height: 1.35; }
  .fin-tbl tr.is-sub th { padding-left: 22px; }
  .fin-tbl td { min-width: 84px; }
  .fin-filings .card-head { flex-direction: column; align-items: flex-start; }
  .fin-fl-item { grid-template-columns: auto minmax(0, 1fr) 14px; gap: 1px 12px; padding: 11px 14px; }
  .fin-fl-item .fin-form { grid-row: span 2; }
  .fin-fl-date { grid-column: 2; grid-row: 2; font-size: 11.5px; color: var(--text-3); }
  .fin-fl-ext { grid-column: 3; grid-row: 1; }
  .fin-nl-item { padding: 12px 38px 12px 14px; }
  .fin-nl-ext { right: 14px; }
  .fin-sn-form { margin-left: 0; width: 100%; }
  .fin-sn-form .input-group { flex: 1; width: auto; }
}
