/* Base */
@import '/css/base/reset.css';
@import '/css/base/base.css';

/* Foundations */
@import '/css/foundations/primitives.css';
@import '/css/foundations/system.css';

/* Layout */
@import '/css/layout/grid.css';
@import '/css/layout/shell.css';
@import '/css/layout/topbar.css';
@import '/css/layout/footer.css';
@import '/css/layout/sidebar.css';

/* Components */
@import '/css/components/cards.css';
@import '/css/components/utility.css';
@import '/css/components/typography.css';
@import '/css/components/buttons.css';
@import '/css/components/nav.css';
@import '/css/components/button-avatar.css';
@import '/css/components/branding.css';
@import '/css/components/login.css';

/* Tokens */
@import '/css/tokens.css';

/* =========================================
    CANVAS
========================================= */
.canvas-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--sys-z-hide); /* Al fondo del contenedor main */
    pointer-events: none; /* Deja pasar los clics al contenido */
}


/* =========================================
    HERO
========================================= */
.hero {
    min-height: 100svh;

    display: grid;
    place-content: center;
    justify-items: center;
    gap: var(--sys-space-3xs) 0;
    text-align: center;
}

.hero__logo {
    height: 20rem;
    margin-top: -15rem;
}

.hero__title {
    font-weight: var(--sys-weight-medium);
}

.hero__subtitle {
    font-family: var(--sys-font-base);
    font-weight: var(--sys-weight-base);
    letter-spacing: var(--sys-track-wider);
}

.hero .brand__text {
    display: flex;
    flex-direction: row;
    gap: var(--sys-space-xs);
    margin-top: -4rem;
}

.hero h1{
    font-weight: var(--sys-weight-medium);
}

.hero__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: var(--sys-space-2xs);
}

.hero__scroll-line {
    width: 2px;
    height: 4rem;
    background: var(--app-text);
    margin: var(--sys-space-md) 0;

    animation: heroScrollDown 1.5s ease-in-out infinite;
}

@keyframes heroScrollDown{
  0%   { transform: translateY(-10px); opacity: 0.20; }
  45%  { transform: translateY(0px);   opacity: 0.80; }
  85%  { transform: translateY(12px);  opacity: 0.08; }
  100% { transform: translateY(12px);  opacity: 0.08; }
}

/* =========================================
    PORTFOLIO
========================================= */
.section {
    display: flex;
    flex-direction: column;
    gap: var(--sys-space-2xs);
}

.section__header {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--sys-space-2xs);
  padding-left: var(--sys-space-2xl);
}

.section__header p {
    font-style: italic;
    margin-left: var(--sys-space-sm);
    font-size: var(--sys-text-xl);
}

.line-deco{
  width: 20rem;
  height: 2px;
  background: var(--sys-text-accent);
  opacity: .75;

  position: relative;
  border-radius: 999px;

  /* IMPORTANTE: deja que el brillo se salga */
  overflow: visible;

  /* base ligeramente “mineral” */
  box-shadow:
    0 0 14px rgba(255,140,80,.18),
    0 0 30px rgba(255,140,80,.10);
}

/* halo suave permanente (opcional pero ayuda a que “lea” cobre) */
.line-deco::before{
  content:"";
  position:absolute;
  left: -8%;
  right: -8%;
  top: 50%;
  height: 10px;
  transform: translateY(-50%);
  border-radius: 999px;

  background: radial-gradient(closest-side,rgba(255,140,80,.22),transparent 70%);

  filter: blur(2px);
  opacity: .55;
  pointer-events: none;
}

/* estrella fugaz (núcleo + cola) */
.line-deco::after{
  content:"";
  position:absolute;
  top: 50%;
  left: 0;

  /* tamaño del meteorito */
  width: 160px;
  height: 3px;

  transform: translate(-140%, -50%);
  border-radius: 999px;

  /* cola + núcleo brillante */
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,140,80,.12) 18%,
    rgba(255,200,160,.70) 45%,
    rgba(255,246,238,1.00) 55%,
    rgba(255,200,160,.70) 65%,
    rgba(255,140,80,.12) 85%,
    transparent 100%
  );

  /* halo cósmico (desborda por overflow:visible) */
  box-shadow:
    0 0 10px rgba(255,246,238,.70),
    0 0 24px rgba(255,180,120,.55),
    0 0 52px rgba(255,140,80,.30);

  filter: blur(.15px);
  opacity: 1;
  pointer-events: none;

  animation: starFlow 2.8s ease-in-out infinite;
}

@keyframes starFlow{
  0%   { transform: translate(-160%, -50%); opacity: 0; }
  12%  { opacity: 1; }
  55%  { transform: translate(0%, -50%);   opacity: 1; }
  92%  { opacity: .10; }
  100% { transform: translate(160%, -50%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce){
  .line-deco::after{ animation: none; opacity: 0; }
}

/* =========================================
   COMPONENTE: PROJECT (La Tarjeta)
========================================= */
.project {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sys-space-md);
  margin-bottom: var(--sys-space-xl);
}

.project__link{
  display: block;
  position: relative;
  width: 100%;
  min-height: 90svh;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
}

/* fondo */
.project__media{ position:absolute; inset:0; margin:0; z-index:0; }
.project__img{ width:100%; height:100%; object-fit:cover; display:block; }

/* overlay global */
.project__overlay{
  position:absolute;
  inset:0;
  z-index:1;
  transition: opacity 600ms cubic-bezier(.2,.8,.2,1);
}

.project__link:hover .project__overlay{
  opacity: 0;
}

.project__link::after{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 25%, rgba(0,0,0,0.35) 70%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
}

/* === PLACA EDITORIAL === */
.project__plate{
  position: absolute;
  top: auto;
  bottom: 2rem;
  left: 2rem;

  display: grid;
  gap: 10px;

  padding: clamp(14px, 2vw, 22px);
  max-width: min(560px, 88vw);

  background: rgba(8, 10, 14, 0.671);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  
}

/* meta cobre */
.project__meta{
  opacity: .95;
}

/* info */
.project__title{
  margin: 0;
}

.project__tag{
  display: inline-flex;
  width: max-content;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.88);
  letter-spacing: 0.12em;
}

.project__summary{
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: var(--sys-text-sm);
  line-height: 1.35;
}

/* fila: lugar + CTA */
.project__row{
  display: flex;
  align-items: baseline;
  gap: clamp(18px, 3vw, 42px);
}

.project__place{
  margin: 0;
  opacity: .9;
}

.project__cta{
  margin-left: auto;         /* empuja a la derecha dentro de la placa */
  white-space: nowrap;
  opacity: .95;
}

/* micro-interacción */
.project__link:hover .project__cta span[aria-hidden="true"]{
  transform: translateX(4px);
}
.project__cta span[aria-hidden="true"]{
  display: inline-block;
  transition: transform 200ms ease;
}

/* =========================================
   OS - SISTEMAS EN EJECUCIÓN
========================================= */
/* --- Tarjeta base --- */
.os__cards {
  padding: 0 var(--sys-space-md);
  margin-bottom: var(--sys-space-lg);
}

.os__hub {
  padding: var(--sys-space-md);
  gap: var(--sys-space-lg);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  
  background-color: var(--grad-cenote-dark);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-image 0.3s ease;  
}

.os__hub:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.5);
  border-color: var(--sys-text-primary);
}

/* --- Imágenes Especificas con Overlay--- */

  /* Rentas */
.os__hub--rentas {
  background-image: 
    linear-gradient(to bottom, 
        rgba(5, 10, 25, 1) 0%,      /* Negro/Azul casi sólido arriba para el logo */
        rgba(10, 17, 40, 0.8) 40%,  /* Se empieza a aclarar */
        rgba(10, 17, 40, 0.6) 100%), /* Más transparente abajo para ver la foto */
    url('/assets/img/os__rentas.png');
  border: 1px solid var(--sys-text-accent-strong);
}

.os__hub--rentas .text-accent-strong {
  text-shadow: 0 0 15px var(--sys-shadow-accent); 
}

  /* Obra */
.os__hub--obra {
  background-image: 
    linear-gradient(to bottom, 
        rgba(5, 10, 25, 1) 0%,
        rgba(10, 17, 40, 0.8) 40%,
        rgba(10, 17, 40, 0.6) 100%),
    url('/assets/img/os__obra.png');
  border: 1px solid var(--sys-text-brand);
}

.os__hub--obra .text-brand {
  text-shadow: 0 0 15px var(--sys-shadow-brand); 
}

  /* Development */
.os__hub--dev {
  background-image: 
    linear-gradient(to bottom, 
        rgba(5, 10, 25, 1) 0%,
        rgba(10, 17, 40, 0.8) 40%,
        rgba(10, 17, 40, 0.6) 100%),
    url('/assets/img/os__development.png');
  border: 1px solid var(--sys-text-mineral);
}

.os__hub--dev .text-mineral {
  text-shadow: 0 0 20px var(--sys-shadow-mineral);
}

.os__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.os__logo {
  width: auto;
  height: 15rem;
}

.os__title {
  display: inline-flex;
  align-items: center;
  gap: var(--sys-space-xs);
  margin-top: -2rem;
}

.os__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: var(--sys-text-lg);
  height: var(--sys-space-xl);
  padding: 0 var(--sys-space-xs);
 
  border-radius: 999px;
  border: 2px solid var(--app-border-divider);
  background: var(--sys-text-brand);
}

.os__pill--rentas { 
  background-color: var(--sys-bg-accent); 
  border-color: var(--app-border-divider);
}

.os__pill--obra   { 
  background-color: var(--sys-bg-brand); 
  border-color: var(--app-border-divider); 
}

.os__pill--dev    { 
  background-color: var(--sys-bg-mineral);
  border-color: var(--app-border-divider);
}

.os__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sys-space-3xs);

  text-align: center;
  padding: 0 var(--sys-space-lg);
}

.os__meta-title {
  font-size: var(--sys-text-xl);
  font-weight: var(--sys-weight-bold);
  color: var(--sys-text-primary);
}

.os__meta-sub {
  font-style: italic;
  color: var(--sys-text-secondary);
  font-weight: var(--sys-weight-medium);
}

.os__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sys-space-xs);

    margin: var(--sys-space-md) 0;
}

.os__status-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  
  --dot-color: var(--sys-bg-success); 
  background-color: var(--dot-color);
  
  animation: breathing 3s infinite ease-in-out;
}

@keyframes breathing {
    0% {
        /* Usamos la variable --dot-color en lugar del color fijo */
        box-shadow: 0 0 4px var(--dot-color);
        transform: scale(1);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 15px var(--dot-color);
        transform: scale(1.2); 
        opacity: 0.8;
    }
    100% {
        box-shadow: 0 0 4px var(--dot-color);
        transform: scale(1);
        opacity: 1;
    }
}

.os__status-dot--rentas {
    --dot-color: var(--sys-text-accent-strong);
}

.os__status-dot--obra {
    --dot-color: var(--sys-text-brand);
}

.os__status-dot--dev {
    --dot-color: var(--sys-text-mineral);
}

.os__status-text {
  font-weight: var(--sys-weight-bold);
}

/* ==========================================================
   OFICIOS — Herrería Mejía (card OS)
   ========================================================== */

.oficio-card{
  position: relative;
  display: grid;
  grid-template-rows: 220px 1fr;
  overflow: hidden;
  border-radius: var(--radius-xl, 18px);
  text-decoration: none;
  isolation: isolate;

  border: 1px solid rgba(255,255,255,.10);
  background: rgba(8, 12, 20, .55);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.oficio-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 26px 70px rgba(0,0,0,.45);
}

/* Acento operativo (rojo metal) */
.oficio-card--herreria{
  border-color: rgba(255, 70, 40, .35);
}

.oficio-card--herreria:hover{
  border-color: rgba(255, 70, 40, .65);
}

/* ===== Media ===== */
.oficio-card__media{
  position: relative;
  margin: 0;
  height: 220px;
  overflow: hidden;
}

.oficio-card__img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  filter: saturate(.95) contrast(1.05);
  transition: transform .35s ease, filter .35s ease;
}

.oficio-card:hover .oficio-card__img{
  transform: scale(1.08);
  filter: saturate(1.05) contrast(1.08);
}

/* Overlay para legibilidad */
.oficio-card__overlay{
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 420px at 15% 20%, rgba(255,70,40,.18), rgba(0,0,0,.10) 55%),
    linear-gradient(180deg, rgba(0,0,0,.20) 0%, rgba(0,0,0,.78) 100%);
  z-index: 1;
  pointer-events: none;
  transition: opacity .25s ease;
}

/* Trama técnica sutil */
.oficio-card__grid{
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .10;
  z-index: 2;
  pointer-events: none;
  mask-image: radial-gradient(closest-side at 30% 20%, rgba(0,0,0,1), rgba(0,0,0,.1) 70%, rgba(0,0,0,0));
}

/* Badge OS */
.oficio-card__badge{
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(10, 14, 22, .55);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
}

.oficio-card__badge-brand{
  font-weight: 700;
  letter-spacing: .06em;
  font-size: 12px;
  color: rgba(255,255,255,.92);
}

.oficio-card__badge-pill{
  font-weight: 700;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  color: rgba(255,255,255,.92);
  background: rgba(255, 70, 40, .22);
  border: 1px solid rgba(255, 70, 40, .45);
}

/* ===== Plate ===== */
.oficio-card__plate{
  position: relative;
  z-index: 3;
  padding: 18px 18px 16px;
  background:
    linear-gradient(180deg, rgba(8,12,20,.82) 0%, rgba(8,12,20,.92) 100%);
}

.oficio-card__title{
  margin: 0 0 6px 0;
  color: rgba(255,255,255,.96);
}

.oficio-card__tag{
  margin: 0 0 12px 0;
  color: rgba(255, 170, 150, .95);
  font-style: italic;
}

.oficio-card__desc{
  margin: 0 0 14px 0;
  color: rgba(255,255,255,.80);
  line-height: 1.55;
}

/* Lista de bullets con acento */
.oficio-card__list{
  margin: 0 0 14px 0;
  padding-left: 18px;
  color: rgba(255,255,255,.82);
}

.oficio-card__list li{
  margin: 6px 0;
}

.oficio-card__list li::marker{
  color: rgba(255, 70, 40, .85);
}

/* Status */
.oficio-card__status{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.10);
}

.oficio-card__dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 70, 40, .95);
  box-shadow: 0 0 0 6px rgba(255, 70, 40, .14);
}

.oficio-card__status-text{
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.80);
}

/* ===== Responsive (si col-span-4 en móvil te queda apretado) ===== */
@media (max-width: 980px){
  .oficio-card{
    grid-template-rows: 200px 1fr;
  }
}

@media (max-width: 760px){
  /* si tu grid hace col-span-4 todavía, fuerza a 12 para que no se aplaste */
  .oficios .col-span-4{
    grid-column: 1 / -1;
  }
}

/* =========================================
   INTRO OVERLAY — bal·AM OS (Video limpio + letterbox con gradiente)
========================================= */

.is-intro-lock{
  overflow: hidden;
}

/* Overlay base */
.intro{
  position: fixed;
  inset: 0;
  z-index: var(--sys-z-priority, 999);
  display: grid;
  place-items: stretch center;

  /* Fondo del sistema (mata negro si algo falla) */
  background: var(--sys-bg-app, #000);

  opacity: 1;
  pointer-events: auto;
  transition: opacity .6s ease;
  isolation: isolate;
}

.intro.is-hidden{
  opacity: 0;
  pointer-events: none;
}

/* Video layer */
.intro__media{
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--sys-bg-app);
  z-index: -1;
}

/* Video: el TRUCO es el background aquí, para que el "contain" no deje barras negras */
.intro__video{
  width: 100%;
  height: 100%;
  object-position: center;

  /* Default: llena sin recortar de más en pantallas normales */
  object-fit: cover;

  /* Letterbox con gradiente (no negro) */
  background: var(--sys-bg-app, #000);

  /* Sin blur, sin maquillaje */
  filter: none;
  transform: none;
}

/* En pantallas ultrawide: preserva encuadre (sin zoom) */
@media (min-aspect-ratio: 9/16){
  .intro__video{
    object-fit: contain;
  }
}

/* Vignette de enfoque (sutil, sin ensuciar el video) */
.intro::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
 
  z-index: 0;  /* IMPORTANTE: capa entre video y UI */
  background:   /* Scrim editorial: isla al centro + base inferior */
    radial-gradient(900px 520px at 50% 42%,
      rgba(0,0,0,.62) 0%,
      rgba(0,0,0,.30) 48%,
      rgba(0,0,0,.08) 72%,
      rgba(0,0,0,0) 100%
    ),
    linear-gradient(180deg,
      rgba(0,0,0,.08) 0%,
      rgba(0,0,0,.18) 55%,
      rgba(0,0,0,.46) 100%
    );
}

/* UI layer */
.intro__ui{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;

  color: var(--app-text);
  width: min(900px, calc(100vw - 4rem));
  text-align: center;
  z-index: 2;
  height: 100%;
  padding: 6rem 0 4rem;
}

/* Brand */
.intro__brand{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sys-space-2xs);
}

.intro__brand-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sys-space-xs);
}

.intro__kicker{
  font-size: 1.2rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .8;
}

.intro__titles{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Actions */
.intro__actions{
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Buttons */
.intro__btn{
  border-radius: 999px;
  padding: var(--sys-space-2xs) var(--sys-space-sm);
  font: inherit;
  cursor: pointer;

  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: #fff;

  backdrop-filter: blur(10px);
  transition:
    background .25s ease,
    transform .12s ease,
    border-color .25s ease;
}

.intro__btn:hover{
  background: rgba(255,255,255,.12);
}

.intro__btn:active{
  transform: translateY(1px);
}

.intro__btn--primary{
  background: rgba(255,255,255,.16);
}

.intro__btn--ghost{
  background: transparent;
}

/* Sound toggle */
.intro__sound{
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.2rem;
  opacity: .85;
  user-select: none;
}

.intro__sound input{
  appearance: none;
  width: 3.4rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.28);
  position: relative;
  transition: background .2s ease, border-color .2s ease;
  cursor: pointer;
}

.intro__sound input::after{
  content:"";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #fff;
  transition: transform .2s ease;
}

.intro__sound input:checked{
  background: rgba(255,255,255,.55);
  border-color: rgba(255,255,255,.6);
}

.intro__sound input:checked::after{
  transform: translateX(1.4rem);
}

.intro__sound input:focus-visible{
  outline: 2px solid rgba(255,255,255,.7);
  outline-offset: 2px;
}

/* Loading dots (Opción A extendida: 5 puntos) */
.dots::after{
  content:"";
  display:inline-block;
  width: 5ch;               /* reserva espacio para 5 puntos */
  text-align:left;
  animation: dots 1.6s steps(6, end) infinite;
}

@keyframes dots{
  0%   { content:""; }
  20%  { content:"."; }
  40%  { content:".."; }
  60%  { content:"..."; }
  80%  { content:"...."; }
  100% { content:"....."; }
}

/* Mobile tuning */
@media (max-width: 520px){
  .intro__ui{
    width: calc(100vw - 3.2rem);
  }

  .intro__actions{
    gap: 1.2rem;
  }

  .intro__mark{
    width: 4.4rem;
    height: 4.4rem;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .intro{
    transition: none;
  }
  .dots::after{
    animation: none;
    content: "...";
  }
}

/* ==========================================================
   Presupuesto — UI (chips + summary + explorer + filtros glass)
   Archivo: css/components/budget-presupuesto.css
========================================================== */

.budget2{
  padding: var(--sys-space-lg);
  display: grid;
  gap: var(--sys-space-md);
}

/* ===== Header ===== */
.budget2__header{ display: grid; gap: 10px; }
.budget2__title{ margin: 0; }

.budget2__crumbs{
  display: flex;
  align-items: center;
  gap: 14px;
}

.crumbs{
  list-style: none;
  display: inline-flex;
  gap: 10px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  color: var(--sys-text-tertiary);
}

.crumbs__item{
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: var(--sys-text-sm);
}

.crumbs__item::after{
  content: "/";
  opacity: .55;
}

.crumbs__item:last-child{
  color: var(--sys-text-primary);
}
.crumbs__item:last-child::after{ content: ""; }

.crumbs__back{
  border: none;
  background: transparent;
  color: var(--sys-text-brand);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 999px;
}
.crumbs__back:hover{
  background: hsla(var(--pr-caliza-50) / 10%);
}

/* ===== Chipbar ===== */
.budget2__chipbar{
  display: flex;
  align-items: center;
  gap: var(--sys-space-sm);
  justify-content: space-between;
}

.chipbar{
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
}
.chipbar::-webkit-scrollbar{ display:none; }

.chip{
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid hsla(var(--pr-caliza-50) / 14%);
  background: hsla(var(--pr-caliza-50) / 6%);
  color: var(--sys-text-secondary);
  padding: 10px 14px;
  cursor: pointer;
  transition: transform .12s ease, background .18s ease, border-color .18s ease;
}
.chip:hover{ background: hsla(var(--pr-caliza-50) / 10%); }
.chip:active{ transform: translateY(1px); }
.chip.is-active{
  background: hsla(var(--pr-mineral-500) / 55%);
  border-color: hsla(var(--pr-caliza-50) / 22%);
  color: var(--sys-text-primary);
}

/* ===== Filters button ===== */
.filterBtn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid hsla(var(--pr-caliza-50) / 16%);
  background: hsla(var(--pr-caliza-50) / 6%);
  color: var(--sys-text-primary);
  cursor: pointer;
}
.filterBtn:hover{ background: hsla(var(--pr-caliza-50) / 10%); }
.filterBtn__icon{ opacity: .85; }
.filterBtn__chev{ opacity: .75; }

/* ===== Summary ===== */
.budget2__summary{
  border-radius: var(--sys-radius-lg);
  border: 1px solid var(--sys-border);
  background: hsla(var(--pr-caliza-50) / 6%);
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--sys-text-secondary);
}

.sumItem{
  display: inline-flex;
  gap: 10px;
  align-items: center;
}
.sumKey{ color: var(--sys-text-tertiary); }
.sumVal{ color: var(--sys-text-primary); font-weight: var(--sys-weight-semibold); }
.sumInfo{
  width: 18px; height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid hsla(var(--pr-caliza-50) / 18%);
  color: var(--sys-text-tertiary);
}

/* ===== Panel container ===== */
.budget2__panel{
  border-radius: var(--sys-radius-xl);
  border: 1px solid var(--sys-border);
  background: hsla(var(--pr-mineral-600), 0.20);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

/* ===== Explorer list ===== */
.budgetList{ display: grid; }

.node{
  display: grid;
  grid-template-columns: 36px 1fr auto 28px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid hsla(var(--pr-caliza-50) / 10%);
  cursor: pointer;
  user-select: none;
  transition: background .16s ease;
}
.node:hover{ background: hsla(var(--pr-caliza-50) / 7%); }
.node:last-child{ border-bottom: none; }

.node__caret{
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 1px solid hsla(var(--pr-caliza-50) / 14%);
  background: hsla(var(--pr-caliza-50) / 6%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sys-text-secondary);
}

.node__title{
  color: var(--sys-text-primary);
  font-weight: var(--sys-weight-semibold);
}
.node__meta{
  margin-top: 4px;
  color: var(--sys-text-tertiary);
  font-size: var(--sys-text-sm);
}
.node__money{
  color: var(--sys-text-primary);
  font-weight: var(--sys-weight-semibold);
  font-variant-numeric: tabular-nums;
}
.node__chev{
  opacity: .65;
  color: var(--sys-text-tertiary);
}

/* ===== Concepts “table-like” rows ===== */
.concepts{
  padding: 6px 0;
  background: hsla(var(--pr-caliza-50) / 2.5%);
}

.conceptRow{
  display: grid;
  grid-template-columns: 1fr 140px 160px;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid hsla(var(--pr-caliza-50) / 8%);
}
.conceptRow:first-child{ border-top: none; }

.conceptRow__title{
  color: var(--sys-text-primary);
  font-weight: var(--sys-weight-medium);
}
.conceptRow__sub{
  margin-top: 4px;
  color: var(--sys-text-tertiary);
  font-size: var(--sys-text-sm);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.conceptRow__right{
  justify-self: end;
  text-align: right;
  color: var(--sys-text-primary);
  font-variant-numeric: tabular-nums;
}
.conceptRow__status{
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid hsla(var(--pr-caliza-50) / 16%);
  background: hsla(var(--pr-caliza-50) / 6%);
  color: var(--sys-text-secondary);
  white-space: nowrap;
  font-size: var(--sys-text-sm);
}
.badge.ok{
  border-color: hsla(var(--pr-success-400) / 45%);
  background: hsla(var(--pr-success-400) / 12%);
  color: hsl(var(--pr-success-400));
}
.badge.warn{
  border-color: hsla(var(--pr-cobre-500) / 45%);
  background: hsla(var(--pr-cobre-500) / 10%);
  color: hsl(var(--pr-cobre-400));
}
.badge.dim{
  opacity: .85;
}

/* ===== Filters Panel (glass) ===== */
.filtersPanel{
  position: fixed;
  inset: 0;
  z-index: var(--sys-z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.filtersPanel.is-open{
  opacity: 1;
  pointer-events: auto;
}

.filtersPanel__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.50);
  backdrop-filter: blur(6px);
}

.filtersPanel__card{
  position: absolute;
  right: 18px;
  top: 140px;
  width: min(420px, calc(100vw - 36px));
  border-radius: var(--sys-radius-xl);
  border: 1px solid hsla(var(--pr-caliza-50) / 16%);
  background: hsla(var(--pr-mineral-700), .42);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 70px rgba(0,0,0,.40);
  overflow: hidden;
}

.filtersPanel__header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid hsla(var(--pr-caliza-50) / 10%);
}
.filtersPanel__close{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid hsla(var(--pr-caliza-50) / 16%);
  background: hsla(var(--pr-caliza-50) / 6%);
  color: var(--sys-text-primary);
  cursor: pointer;
}

.filtersPanel__body{
  padding: 14px 16px 16px;
  display: grid;
  gap: 14px;
}

.field{ display: grid; gap: 6px; }
.select{
  width: 100%;
  padding: 12px 12px;
  border-radius: var(--sys-radius-lg);
  border: 1px solid hsla(var(--pr-caliza-50) / 16%);
  background: hsla(var(--pr-caliza-50) / 6%);
  color: var(--sys-text-primary);
}

.toggles{ display: grid; gap: 10px; padding-top: 8px; }
.toggle{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 12px;
  border-radius: var(--sys-radius-lg);
  border: 1px solid hsla(var(--pr-caliza-50) / 12%);
  background: hsla(var(--pr-caliza-50) / 4%);
}
.toggle__label{ color: var(--sys-text-secondary); }
.toggle input{ display:none; }
.toggle__ui{
  width: 52px; height: 30px;
  border-radius: 999px;
  position: relative;
  background: hsla(var(--pr-caliza-50) / 16%);
  border: 1px solid hsla(var(--pr-caliza-50) / 16%);
}
.toggle__ui::after{
  content:"";
  position:absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 999px;
  background: hsla(var(--pr-caliza-50) / 85%);
  transition: transform .18s ease;
}
.toggle input:checked + .toggle__ui{
  background: hsla(var(--pr-selva-500) / 35%);
  border-color: hsla(var(--pr-selva-500) / 40%);
}
.toggle input:checked + .toggle__ui::after{
  transform: translateX(22px);
}

.filtersPanel__actions{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}
.btnGhost, .btnPrimary{
  flex: 1;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid hsla(var(--pr-caliza-50) / 16%);
  cursor: pointer;
  color: var(--sys-text-primary);
}
.btnGhost{ background: hsla(var(--pr-caliza-50) / 6%); }
.btnPrimary{
  border-color: hsla(var(--pr-selva-500) / 40%);
  background: hsla(var(--pr-selva-500) / 28%);
}

@media (max-width: 760px){
  .budget2{ padding: var(--sys-space-md); }
  .filtersPanel__card{ top: 120px; right: 12px; }
  .conceptRow{ grid-template-columns: 1fr 120px 140px; }
}

/* ===== Spotlight Search ===== */
.budget2__search{
  display: flex;
  align-items: center;
  gap: 10px;
}

.spotlight{
  width: 100%;
  padding: 14px 44px 14px 16px;
  border-radius: 999px;
  border: 1px solid hsla(var(--pr-caliza-50) / 14%);
  background: hsla(var(--pr-caliza-50) / 6%);
  color: var(--sys-text-primary);
  outline: none;
}
.spotlight::placeholder{ color: var(--sys-text-tertiary); }

.spotlight__clear{
  margin-left: -44px;
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid hsla(var(--pr-caliza-50) / 16%);
  background: hsla(var(--pr-caliza-50) / 6%);
  color: var(--sys-text-primary);
  cursor: pointer;
}

/* ===== Node actions / badges ===== */
.node__actions{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.badgeMini{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid hsla(var(--pr-caliza-50) / 16%);
  background: hsla(var(--pr-caliza-50) / 6%);
  color: var(--sys-text-secondary);
  font-size: var(--sys-text-sm);
  white-space: nowrap;
}

.badgeMini.warn{
  border-color: hsla(var(--pr-cobre-500) / 45%);
  background: hsla(var(--pr-cobre-500) / 10%);
  color: hsl(var(--pr-cobre-400));
}

.badgeMini.ok{
  border-color: hsla(var(--pr-success-400) / 45%);
  background: hsla(var(--pr-success-400) / 12%);
  color: hsl(var(--pr-success-400));
}

.badgeMini.dim{ opacity: .85; }

/* Caret becomes an actual button */
.node__caretBtn{
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 1px solid hsla(var(--pr-caliza-50) / 14%);
  background: hsla(var(--pr-caliza-50) / 6%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sys-text-secondary);
  cursor: pointer;
}
.node__caretBtn:hover{ background: hsla(var(--pr-caliza-50) / 10%); }
.node__caretBtn:active{ transform: translateY(1px); }

/* Highlight search matches */
mark.hl{
  background: hsla(var(--pr-cobre-500) / 18%);
  border: 1px solid hsla(var(--pr-cobre-500) / 18%);
  color: var(--sys-text-primary);
  padding: 0 4px;
  border-radius: 6px;
}

/* Ingresos */

.ingresos__table{
  display: flex;
  flex-direction: column;
  border: 1px solid var(--sys-border);
  border-radius: var(--sys-radius-lg);
  overflow: hidden;
}

.ingresos__row{
  display: grid;
  grid-template-columns: 120px 1fr 160px 120px 160px;
  gap: 16px;

  padding: 14px 16px;
  align-items: center;

  border-bottom: 1px solid var(--sys-border);
}

.ingresos__row .monto{
color: #22c55e;
font-weight:600;
}

.ingresos__row:last-child{
  border-bottom: none;
}

.ingresos__row--head{
  background: var(--sys-bg-inset);
  font-weight: var(--sys-weight-semibold);
}

.ingresos__row:hover{
  background: rgba(255,255,255,.03);
}

.gastos__row{
  display: grid;
  grid-template-columns: 120px 1fr 160px 120px 160px;
  gap: 16px;

  padding: 14px 16px;
  align-items: center;

  border-bottom: 1px solid var(--sys-border);
}


.gastos__row .monto{
color:#ef4444;
font-weight:600;
}

.categoria-gasto{
color:#f87171;
opacity:.8;
}

.monto-gasto{
color:#ef4444;
font-weight:600;
}

/* Ingresos */

.ingresos__table-wrap{
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.ingresos__table{
  display: flex;
  flex-direction: column;
  border: 1px solid var(--sys-border);
  border-radius: var(--sys-radius-lg);
  overflow: hidden;

  /* importante: fuerza ancho mínimo para permitir scroll horizontal */
  min-width: 760px;
}

.ingresos__row,
.gastos__row{
  display: grid;
  grid-template-columns: 120px 1fr 160px 120px 160px;
  gap: 16px;

  padding: 14px 16px;
  align-items: center;

  border-bottom: 1px solid var(--sys-border);
}

.ingresos__row .monto{
  color: #22c55e;
  font-weight: 600;
}

.gastos__row .monto{
  color: #ef4444;
  font-weight: 600;
}

.ingresos__row:last-child,
.gastos__row:last-child{
  border-bottom: none;
}

.ingresos__row--head{
  background: var(--sys-bg-inset);
  font-weight: var(--sys-weight-semibold);
}

.ingresos__row:hover,
.gastos__row:hover{
  background: rgba(255,255,255,.03);
}

.categoria-gasto{
  color: #f87171;
  opacity: .8;
}

.monto-gasto{
  color: #ef4444;
  font-weight: 600;
}

/* evita que textos largos rompan el grid */
.ingresos__row > div,
.gastos__row > div{
  min-width: 0;
  word-break: break-word;
}

/* alinea mejor montos */
.ingresos__row .monto,
.gastos__row .monto{
  white-space: nowrap;
}

/* tablet */
@media (max-width: 1024px){
  .ingresos__table{
    min-width: 700px;
  }

  .ingresos__row,
  .gastos__row{
    grid-template-columns: 110px 1fr 140px 110px 140px;
    gap: 14px;
    padding: 12px 14px;
  }
}

/* mobile */
@media (max-width: 768px){
  .ingresos__table-wrap{
    overflow-x: auto;
  }

  .ingresos__table{
    min-width: 640px;
  }

  .ingresos__row,
  .gastos__row{
    grid-template-columns: 100px minmax(140px, 1fr) 120px 100px 120px;
    gap: 12px;
    padding: 12px;
  }
}