/* Legato · estilos de componentes. Todos los valores vienen de tokens.css (tokens.json). */
@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,200..500;1,6..72,300..400&display=swap");

.lg { font-family: var(--font-sans); color: var(--text); -webkit-font-smoothing: antialiased; }
.lg *, .lg *::before, .lg *::after { box-sizing: border-box; }
.lg-num { font-variant-numeric: tabular-nums lining-nums; }
.lg-label { font-family: var(--font-sans); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.lg-muted { color: var(--text-muted); }
.lg-wordmark { font-family: var(--font-display); font-style: italic; font-weight: 300; letter-spacing: .01em; }
.lg-gl { display: block; width: 56px; height: 1px; background: var(--dorado); border: 0; margin: 0; }
.lg :focus-visible { outline: 2px solid var(--seleccion); outline-offset: 2px; }

/* Botones */
.lg-btn { display: inline-flex; align-items: center; gap: var(--space-3); height: var(--control-comodo); padding: 0 var(--space-6); font: 500 14px/16px var(--font-sans); letter-spacing: .02em; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background-color 240ms cubic-bezier(.2,0,0,1), color 240ms cubic-bezier(.2,0,0,1); }
.lg-btn svg { width: 16px; height: 8px; }
.lg-btn--primary { background: var(--seleccion); color: var(--on-seleccion); }
.lg-btn--secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.lg-btn--secondary:hover { background: var(--surface-sunken); }
.lg-btn--oporto { background: transparent; color: var(--on-oporto); border-color: var(--dorado); }
.lg-btn--oporto:hover { background: rgba(212,168,95,.12); }
.lg-btn[disabled] { background: transparent; color: var(--text-disabled); border-color: var(--line); cursor: not-allowed; }

/* Placeholder de foto */
.lg-ph { position: relative; background: var(--lino); overflow: hidden; }
.lg-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.lg-ph img + .lg-ph__cap { display: none; }
.lg-ph__cap { position: absolute; left: var(--space-3); bottom: var(--space-3); font: 600 10px/14px var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--tinta-suave); max-width: 32ch; }

/* Hero */
.lg-hero { position: relative; background: var(--cal); color: var(--tinta); overflow: hidden; }
.lg-hero__nav { position: relative; z-index: 2; display: flex; align-items: center; gap: var(--space-8); padding: var(--space-6) var(--space-12); background: var(--cal); border-bottom: 1px solid var(--lino); font: 600 11px/16px var(--font-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--tinta-suave); }
.lg-hero__nav .lg-wordmark { font-size: 26px; letter-spacing: .01em; text-transform: none; color: var(--tinta); margin-right: auto; }
.lg-hero__links { display: flex; gap: var(--space-8); }
.lg-hero__photo { position: absolute; top: 81px; right: 0; bottom: 0; left: 30%; }
.lg-hero__pane { position: relative; z-index: 2; margin: var(--space-24) 0 var(--space-12) var(--space-12); width: min(540px, calc(100% - 96px)); background: var(--oporto); color: var(--on-oporto); padding: var(--space-12); display: flex; flex-direction: column; gap: var(--space-6); }
.lg-hero__title { margin: 0; font-family: var(--font-display); font-weight: 250; font-size: 54px; line-height: 1.04; letter-spacing: -.018em; text-wrap: balance; }
.lg-hero__lead { margin: 0; color: var(--on-oporto-suave); font-size: 17px; line-height: 26px; }
.lg-hero--wide .lg-hero__photo { position: relative; top: auto; left: auto; height: 420px; }
.lg-hero--wide .lg-hero__body { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12); padding: var(--space-12); }
.lg-hero--wide .lg-hero__title { font-size: 64px; color: var(--tinta); }
.lg-hero--wide .lg-hero__lead { color: var(--tinta-suave); }

/* Cabecera de patrimonio */
.lg-nw { background: var(--surface-panel); padding: var(--space-6) var(--space-8); }
.lg-nw__top { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-6); padding-bottom: var(--space-6); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.lg-nw__value { font-family: var(--font-display); font-weight: 250; font-size: 60px; line-height: 1; letter-spacing: -.025em; margin: var(--space-3) 0 var(--space-2); }
.lg-nw__value small, .lg-cur { font-family: var(--font-sans); font-size: 18px; font-weight: 400; color: var(--text-muted); margin-left: var(--space-2); letter-spacing: 0; }
.lg-delta { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-muted); }
.lg-delta b { font-weight: 600; }
.lg-delta--pos b, .lg-delta--pos svg { color: var(--positivo); }
.lg-delta--neg b, .lg-delta--neg svg { color: var(--negativo); }
.lg-delta svg { width: 9px; height: 9px; }
.lg-period { display: flex; gap: var(--space-4); font-size: 13px; }
.lg-period button { background: none; border: 0; padding: 0 0 4px; font: inherit; color: var(--text-muted); border-bottom: 1px solid transparent; cursor: pointer; }
.lg-period button[aria-pressed="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--seleccion); }
.lg-split { padding-top: var(--space-4); }
.lg-bar { display: flex; height: 4px; gap: 3px; margin-bottom: var(--space-4); }
.lg-bar i { display: block; height: 100%; }
.lg-legend { display: flex; gap: var(--space-12); flex-wrap: wrap; }
.lg-legend > div { display: grid; grid-template-columns: 8px auto; column-gap: 10px; align-items: baseline; }
.lg-legend i { width: 8px; height: 8px; display: block; }
.lg-legend .v { grid-column: 2; font-size: 20px; font-weight: 500; }
.lg-legend .p { grid-column: 2; font-size: 13px; color: var(--text-muted); }

/* Tabla */
.lg-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.lg-table th { font: 600 10.5px/14px var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); text-align: left; padding: var(--space-3) var(--space-3) var(--space-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.lg-table th button { all: unset; cursor: pointer; }
.lg-table th[aria-sort] { color: var(--text); }
.lg-table td { height: var(--row-comoda); padding: var(--space-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.lg-table th:first-child, .lg-table td:first-child { padding-left: 0; }
.lg-table th:last-child, .lg-table td:last-child { padding-right: 0; }
.lg-table .r { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.lg-table .sub { display: block; font-size: 13px; color: var(--text-muted); }
.lg-table tr.is-selected td { background: var(--seleccion-suave); }
.lg-table tbody tr:hover td { background: var(--surface-sunken); }
.lg-table tr.lg-group td { height: auto; padding-top: var(--space-6); font: 600 11px/16px var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }
.lg-table tr.lg-total td { border-bottom: 0; border-top: 1px solid var(--text); font-weight: 600; background: none; }
.lg-table tr.lg-total td.r { font-family: var(--font-display); font-weight: 300; font-size: 24px; }
.lg-table--compact { font-size: 14px; }
.lg-table--compact td { height: var(--row-compacta); padding-top: 0; padding-bottom: 0; }
.lg-table--compact th { background: var(--surface-sunken); padding-top: var(--space-2); }
.lg-table--compact th:first-child, .lg-table--compact td:first-child { padding-left: var(--space-3); }
.lg-caret { display: inline-block; width: 16px; color: var(--text-muted); }

/* Titularidad */
.lg-own { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lg-own__t { width: 56px; height: 2px; background: var(--line); position: relative; }
.lg-own__t i { position: absolute; inset: 0 auto 0 0; background: var(--text); }

/* Valoración y confianza */
.lg-val { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.lg-conf { display: inline-flex; gap: 3px; }
.lg-conf i { width: 5px; height: 5px; border-radius: 50%; border: 1px solid var(--text-muted); display: block; }
.lg-conf i.f { background: var(--text-muted); }
.lg-val--stale { color: var(--aviso); }
.lg-val--stale .lg-conf i { border-color: var(--aviso); }
.lg-val--stale .lg-conf i.f { background: var(--aviso); }

/* Etiqueta de estado */
.lg-tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; border: 1px solid var(--line-strong); color: var(--text); white-space: nowrap; }
.lg-tag--aviso { background: var(--aviso-suave); border-color: transparent; color: var(--aviso); }

/* Gestor */
.lg-gestor { display: flex; align-items: center; gap: var(--space-3); font-size: 14px; }
.lg-avatar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--dorado); display: grid; place-items: center; font-family: var(--font-display); font-size: 15px; color: var(--text); background: var(--surface-panel); overflow: hidden; flex: none; }
.lg-avatar img { width: 100%; height: 100%; object-fit: cover; }
