/* Margen (pantallas/margen.js): ingresos de The Burger Cup frente a los gastos de cada evento.
   Estética Arc como Eventos (eventos.css): bloques de borde fino, neutros, acción casi negra. Lo que
   suma va en el verde suave del resumen de Arc y lo que resta en un rojo apagado; el resultado, en el
   verde entero. Todo mezclado con la superficie, así que el tema oscuro sale solo. */

.mg-raiz {
  --mg-r: 22px; --mg-gap: 16px;
  --mg-g: oklch(52% .16 150); --mg-r-tono: oklch(57% .16 25);
  --mg-g0: color-mix(in oklab, var(--mg-g) 8%, var(--fc-card));
  --mg-g2: color-mix(in oklab, var(--mg-g) 32%, var(--fc-card));
  --mg-g3: color-mix(in oklab, var(--mg-g) 55%, var(--fc-card));
  --mg-r0: color-mix(in oklab, var(--mg-r-tono) 8%, var(--fc-card));
  --mg-r2: color-mix(in oklab, var(--mg-r-tono) 28%, var(--fc-card));
  --mg-r3: color-mix(in oklab, var(--mg-r-tono) 50%, var(--fc-card));
  --mg-tinta-g: oklch(45% .13 150); --mg-tinta-r: oklch(50% .16 25);
  display: grid; gap: var(--mg-gap); min-width: 0;
}
html[data-theme="dark"] .mg-raiz { --mg-g: oklch(78% .17 150); --mg-r-tono: oklch(72% .15 25); --mg-tinta-g: oklch(80% .15 150); --mg-tinta-r: oklch(78% .14 25); }
.mg-raiz *, .mg-velo * { box-sizing: border-box; }

/* ---------- Cabecera y botones ---------- */
.mg-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.mg-cab h1 { margin: 0; font-family: var(--arc-display, inherit); font-weight: 500; letter-spacing: -.035em; }
.mg-cab p { margin: 4px 0 0; color: var(--fc-muted); font-size: 14px; }
.mg-volver { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 6px 12px 6px 8px; border: 0; border-radius: 12px; background: transparent; color: var(--fc-muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.mg-volver:hover { background: var(--fc-selected); color: var(--fc-ink); }
.mg-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--fc-border); background: var(--fc-card); color: var(--fc-ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color var(--arc-fast, 160ms) ease, transform 80ms ease; }
.mg-btn:hover { background: var(--fc-row-hover); }
.mg-btn:active { transform: scale(.98); }
.mg-btn.primario { background: var(--fc-primary); color: var(--fc-on-primary); border-color: transparent; }
.mg-btn.primario:hover { filter: brightness(1.15); }
.mg-btn.peligro { color: var(--mg-tinta-r); }
.mg-btn.peligro:hover { background: var(--mg-r0); }
.mg-icono { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--fc-muted); cursor: pointer; }
.mg-icono:hover { background: var(--fc-selected); color: var(--fc-ink); }

/* ---------- Ajustes del evento: una frase con dos casillas ---------- */
.mg-ajustes { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--fc-border); border-radius: 18px; background: var(--fc-card); font-size: 14px; color: var(--fc-muted); }
.mg-num { position: relative; display: inline-flex; align-items: center; }
.mg-num input { width: 72px; min-height: 38px; padding: 0 26px 0 12px; border: 1px solid var(--fc-border); border-radius: 10px; background: var(--fc-card); color: var(--fc-ink); font: inherit; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.mg-num i { position: absolute; right: 10px; font-style: normal; color: var(--fc-muted); pointer-events: none; }
.mg-ajustes .mg-btn { margin-left: auto; min-height: 38px; }

/* ---------- Resumen: cifras clave ---------- */
html[data-ui] .mg-raiz .mg-resumen { margin: 0; }
html[data-ui] .mg-raiz .mg-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
html[data-ui] .mg-raiz .mg-kpi { cursor: default; min-width: 0; }
html[data-ui] .mg-raiz .mg-kpi:hover { background: transparent; }
html[data-ui] .mg-raiz .arc-res-kpi-nombre { display: inline-flex; align-items: center; }
.mg-cifra { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--arc-display, inherit); font-size: clamp(22px, 1.4vw + 8px, 28px); font-weight: 400; letter-spacing: -.045em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.mg-kpi-ico { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 8px; }
.mg-kpi-ico svg { width: 15px; height: 15px; }
.mg-kpi-ico.ing { background: var(--mg-g0); color: var(--mg-tinta-g); }
.mg-kpi-ico.gas { background: var(--mg-r0); color: var(--mg-tinta-r); }
.mg-leyenda { display: inline-flex; align-items: center; gap: 6px; }
.mg-leyenda i { display: inline-block; width: 10px; height: 10px; margin-left: 8px; border-radius: 3px; }
.mg-leyenda i:first-child { margin-left: 0; }
.mg-leyenda i.ing { background: var(--mg-g2); box-shadow: inset 0 2px 0 var(--mg-g); }
.mg-leyenda i.gas { background: var(--mg-r2); box-shadow: inset 0 2px 0 var(--mg-r-tono); }
.mg-leyenda i.tot { background: var(--mg-g); }

/* ---------- Cascada ---------- */
.mg-cascada { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: clamp(4px, .6vw, 10px); height: 300px; padding: 30px 24px 64px; }
.mg-paso-cero { position: absolute; left: -6px; right: -6px; border-top: 1px solid var(--fc-border); }
.mg-paso { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; }
.mg-paso-zona { position: relative; height: 100%; }
.mg-paso-barra { position: absolute; left: 6%; right: 6%; border-radius: 7px; transform-origin: bottom; animation: arc-barra-sube 800ms var(--arc-spring, ease) both; animation-delay: calc(var(--i) * 70ms + 150ms); }
.mg-paso.ing .mg-paso-barra { background: linear-gradient(180deg, var(--mg-g2), var(--mg-g0)); box-shadow: inset 0 2px 0 var(--mg-g); }
.mg-paso.gas .mg-paso-barra { background: linear-gradient(180deg, var(--mg-r0), var(--mg-r2)); box-shadow: inset 0 -2px 0 var(--mg-r-tono); transform-origin: top; }
.mg-paso.tot .mg-paso-barra { background: linear-gradient(180deg, var(--mg-g3), var(--mg-g2)); box-shadow: inset 0 2px 0 var(--mg-g); }
.mg-paso-valor { position: absolute; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; animation: arc-entrada 500ms var(--arc-ease-enter, ease) both; animation-delay: calc(var(--i) * 70ms + 500ms); }
.mg-paso.ing .mg-paso-valor { color: var(--mg-tinta-g); }
.mg-paso.gas .mg-paso-valor { color: var(--mg-tinta-r); }
.mg-paso.tot .mg-paso-valor { color: var(--fc-ink); font-size: 13px; }
.mg-paso-nombre { position: absolute; top: calc(100% + 10px); left: -4px; right: -4px; display: grid; justify-items: center; gap: 1px; text-align: center; line-height: 1.2; }
.mg-paso-nombre b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; }
.mg-paso-nombre small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--fc-muted); }
.mg-paso.tot .mg-paso-nombre b { font-weight: 600; }

/* ---------- Bloques ---------- */
.mg-bloque { min-width: 0; border: 1px solid var(--fc-border); border-radius: var(--mg-r); background: var(--fc-card); overflow: hidden; animation: arc-entrada var(--arc-considered, 480ms) var(--arc-ease-enter, ease) both; }
.mg-bloque-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 22px 4px; }
.mg-bloque-cab h2 { margin: 0; font-family: var(--arc-display, inherit); font-size: 17px; font-weight: 500; letter-spacing: -.025em; }
.mg-bloque-cab p { margin: 2px 0 0; font-size: 12.5px; color: var(--fc-muted); }
.mg-cuerpo { padding: 12px 22px 22px; }
.mg-grupos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--mg-gap); }
.mg-rejilla { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--mg-gap); align-items: start; }
.mg-cifra-grande { font-family: var(--arc-display, inherit); font-size: 30px; font-weight: 400; letter-spacing: -.045em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg-cifra-grande.negativo { color: var(--mg-tinta-r); }
.mg-grupo-cifra { display: grid; gap: 2px; margin-bottom: 14px; }
.mg-grupo-cifra small { font-size: 12.5px; color: var(--fc-muted); }
.mg-duelo { display: grid; gap: 8px; margin-bottom: 14px; }
.mg-duelo > div { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12.5px; }
.mg-duelo span { color: var(--fc-muted); }
.mg-duelo b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg-duelo i { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--fc-selected); overflow: hidden; }
.mg-duelo i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--w) * 100%); border-radius: inherit; transform-origin: left; animation: arc-barra-crece 900ms var(--arc-ease-enter, ease) both; }
.mg-duelo i.ing::after { background: linear-gradient(90deg, var(--mg-g2), var(--mg-g)); }
.mg-duelo i.gas::after { background: linear-gradient(90deg, var(--mg-r2), var(--mg-r-tono)); }
.mg-desglose { display: grid; gap: 0; margin: 0; }
.mg-desglose > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--fc-border); font-size: 13px; }
.mg-desglose dt { color: var(--fc-ink); }
.mg-desglose dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg-desglose .suave dt, .mg-desglose .suave dd { color: var(--fc-muted); font-weight: 400; }

/* ---------- Gastos ---------- */
.mg-gasto-grupo { display: flex; justify-content: space-between; margin: 14px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--fc-muted); }
.mg-gasto-grupo:first-child { margin-top: 0; }
.mg-gasto-grupo b { font-variant-numeric: tabular-nums; color: var(--fc-ink); letter-spacing: 0; }
.mg-gastos { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mg-gasto { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--fc-ink); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--arc-fast, 160ms) ease; }
.mg-gasto:hover { background: var(--mg-r0); }
.mg-gasto-txt { display: grid; min-width: 0; }
.mg-gasto-txt b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-gasto-txt small { font-size: 12px; color: var(--fc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-gasto-imp { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg-gasto-ed { color: var(--fc-muted); opacity: 0; transition: opacity var(--arc-fast, 160ms) ease; }
.mg-gasto:hover .mg-gasto-ed { opacity: 1; }
.mg-nada { margin: 0; color: var(--fc-muted); font-size: 13.5px; }
html[data-ui] .mg-raiz .mg-donut-caja .arc-res-lista { padding: 18px 22px 18px; }
html[data-ui] .mg-raiz .mg-donut-caja .arc-donut .arc-res-lista-cab b { font-size: 17px; }
html[data-ui] .mg-raiz .arc-donut-seg { fill: color-mix(in oklab, var(--mg-r-tono) calc(var(--tono) * .85), var(--fc-card)); stroke: color-mix(in oklab, var(--mg-r-tono) calc(var(--tono) * .85), var(--fc-card)); }
html[data-ui] .mg-raiz .arc-donut-fila i { background: color-mix(in oklab, var(--mg-r-tono) calc(var(--tono) * .85), var(--fc-card)); }
.mg-donut-caja { container-type: inline-size; }
@container (max-width: 520px) {
  html[data-ui] .mg-raiz .mg-donut-caja .arc-donut-cuerpo { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; }
  html[data-ui] .mg-raiz .mg-donut-caja .arc-donut-filas { width: 100%; }
}

/* ---------- Puestos ---------- */
.mg-tabla-caja { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.mg-tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mg-tabla th { padding: 10px 12px; border-bottom: 1px solid var(--fc-border); color: var(--fc-muted); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; }
.mg-tabla td { padding: 11px 12px; border-bottom: 1px solid var(--fc-border); }
.mg-tabla tr:last-child td { border-bottom: 0; }
.mg-tabla tbody tr:hover { background: var(--fc-row-hover); }
.mg-tabla .der { text-align: right; }
.mg-tabla .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg-tabla .fuerte { font-weight: 600; color: var(--mg-tinta-g); }
.mg-tabla .suave { color: var(--fc-muted); }
.mg-tabla b { font-weight: 500; }
.mg-tipo { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; background: var(--fc-selected); color: var(--fc-muted); vertical-align: 1px; }
.mg-tipo.barras { background: var(--mg-g0); color: var(--mg-tinta-g); }
.mg-mas { display: block; width: 100%; margin-top: 10px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--fc-muted); font: inherit; font-size: 13px; cursor: pointer; }
.mg-mas:hover { background: var(--fc-selected); color: var(--fc-ink); }

/* ---------- Lista de eventos ---------- */
.mg-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--mg-gap); }
.mg-tarjeta { display: grid; gap: 10px; padding: 22px; border: 1px solid var(--fc-border); border-radius: var(--mg-r); background: var(--fc-card); color: var(--fc-ink); font: inherit; text-align: left; cursor: pointer; animation: arc-entrada var(--arc-considered, 480ms) var(--arc-ease-enter, ease) both; transition: box-shadow var(--arc-fast, 160ms) ease, transform var(--arc-fast, 160ms) ease, border-color var(--arc-fast, 160ms) ease; }
.mg-tarjeta:hover { border-color: var(--mg-g2); box-shadow: 0 14px 34px -18px oklch(0% 0 0 / .28); transform: translateY(-2px); }
.mg-tarjeta-cab { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.mg-tarjeta h3 { margin: 0; font-family: var(--arc-display, inherit); font-size: 18px; font-weight: 500; letter-spacing: -.025em; }
.mg-tarjeta-cab small, .mg-sub { font-size: 12.5px; color: var(--fc-muted); }
.mg-tarjeta-cifra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.mg-tarjeta .mg-duelo { margin: 6px 0 0; }
.mg-flecha-ir { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--mg-g0); color: var(--mg-tinta-g); flex: none; transition: transform var(--arc-fast, 160ms) ease; }
.mg-tarjeta:hover .mg-flecha-ir { transform: translateX(3px); }
.mg-pastilla { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mg-pastilla svg { width: 13px; height: 13px; }
.mg-pastilla.bien { background: var(--mg-g0); color: var(--mg-tinta-g); }
.mg-pastilla.mal { background: var(--mg-r0); color: var(--mg-tinta-r); }

/* ---------- Vacío y carga ---------- */
.mg-vacio { display: grid; justify-items: center; gap: 8px; padding: 48px 24px; text-align: center; border: 1px dashed var(--fc-border); border-radius: var(--mg-r); background: var(--fc-card); }
.mg-vacio h2 { margin: 6px 0 0; font-family: var(--arc-display, inherit); font-size: 20px; font-weight: 500; }
.mg-vacio p { margin: 0; max-width: 460px; color: var(--fc-muted); font-size: 14px; }
.mg-vacio .ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--mg-g0); color: var(--mg-tinta-g); }
.mg-cargando { height: 180px; border-radius: var(--mg-r); background: linear-gradient(90deg, var(--fc-selected), color-mix(in oklab, var(--fc-selected) 40%, var(--fc-card)), var(--fc-selected)); background-size: 200% 100%; animation: mg-brillo 1.3s ease-in-out infinite; }
@keyframes mg-brillo { to { background-position: -200% 0; } }

/* ---------- Ventana del gasto ---------- */
.mg-velo { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: oklch(0% 0 0 / .32); animation: mg-velo 160ms ease both; }
@keyframes mg-velo { from { opacity: 0; } }
.mg-ventana { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; display: grid; gap: 14px; padding: 22px; border-radius: 22px; background: var(--fc-card); color: var(--fc-ink); box-shadow: 0 30px 70px -20px oklch(0% 0 0 / .4); animation: mg-ventana 220ms var(--arc-ease-enter, ease) both; }
@keyframes mg-ventana { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.mg-ventana-cab { display: flex; justify-content: space-between; align-items: center; }
.mg-ventana-cab h2 { margin: 0; font-family: var(--arc-display, inherit); font-size: 20px; font-weight: 500; letter-spacing: -.03em; }
.mg-campo { display: grid; gap: 6px; font-size: 13px; color: var(--fc-muted); }
.mg-campo input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--fc-border); border-radius: 12px; background: var(--fc-card); color: var(--fc-ink); font: inherit; font-size: 15px; }
.mg-campo input:focus { outline: none; border-color: var(--fc-muted); box-shadow: 0 0 0 4px oklch(0% 0 0 / .05); }
.mg-dos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.mg-euro { position: relative; display: block; }
.mg-euro input { padding-right: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.mg-euro i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--fc-muted); }
.mg-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 13px; background: var(--fc-selected); }
.mg-seg label { position: relative; }
.mg-seg input { position: absolute; opacity: 0; pointer-events: none; }
.mg-seg span { display: grid; place-items: center; min-height: 36px; padding: 0 8px; border-radius: 10px; color: var(--fc-muted); font-size: 13px; font-weight: 500; text-align: center; cursor: pointer; transition: background-color var(--arc-fast, 160ms) ease, color var(--arc-fast, 160ms) ease; }
.mg-seg input:checked + span { background: var(--fc-card); color: var(--fc-ink); box-shadow: 0 1px 2px oklch(0% 0 0 / .08), 0 0 0 .5px oklch(0% 0 0 / .05); }
.mg-seg input:focus-visible + span { outline: 2px solid oklch(0% 0 0 / .22); }
.mg-ventana-pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.mg-ventana-pie > div { display: flex; gap: 8px; }

/* ---------- Pantallas estrechas ---------- */
@media (max-width: 1100px) {
  .mg-grupos { grid-template-columns: minmax(0, 1fr); }
  .mg-rejilla { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  html[data-ui] .mg-raiz .mg-kpis { grid-template-columns: 1fr 1fr; }
  .mg-bloque-cab { padding: 16px 16px 4px; }
  .mg-cuerpo { padding: 10px 16px 18px; }
  .mg-tabla-caja { margin: 0 -16px; padding: 0 16px; }
  /* En el móvil cada paso tiene su ancho y el gráfico se desplaza de lado dentro de su bloque */
  .mg-cascada { height: 260px; padding: 28px 14px 64px; gap: 8px; grid-template-columns: repeat(var(--n), 78px); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .mg-cascada::-webkit-scrollbar { display: none; }
  .mg-paso-valor { font-size: 11px; }
  .mg-paso-nombre small { display: none; }
  .mg-paso-nombre b { font-size: 11px; white-space: normal; }
  .mg-ajustes .mg-btn { margin-left: 0; }
  .mg-lista { grid-template-columns: minmax(0, 1fr); }
  .mg-dos { grid-template-columns: minmax(0, 1fr); }
  .mg-campo input { font-size: 16px; }
  .mg-tabla thead { display: none; }
  .mg-tabla, .mg-tabla tbody { display: block; }
  .mg-tabla tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--fc-border); }
  .mg-tabla td { padding: 0; border: 0; }
  .mg-tabla td:nth-child(1) { grid-column: 1 / -1; }
  .mg-tabla td:nth-child(2), .mg-tabla td:nth-child(3), .mg-tabla td:nth-child(4) { display: none; }
  .mg-tabla td.fuerte::before { content: "Para ti "; font-weight: 400; color: var(--fc-muted); font-size: 12px; }
  .mg-tabla td.suave::before { content: "Puesto "; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .mg-raiz *, .mg-raiz *::before, .mg-raiz *::after { animation: none !important; transition: none !important; }
}

/* El pago a las hamburgueserías: un gasto que sale de las ventas y no se edita a mano */
.mg-gasto.fijo { cursor: default; }
.mg-gasto.fijo:hover { background: transparent; }

/* ---------- Panel del año (Vidal, 02-12-2026: «una pantalla conjunta como en ventas pero de
   márgenes»): las piezas del panel de Eventos (eventos.css; la raíz lleva también .ev-raiz) ---------- */
.mg-barra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mg-meses { height: 260px; }
.mg-negativo { color: var(--mg-tinta-r); }
.mg-reparto { display: flex; gap: 4px; height: 18px; margin: 6px 0 18px; }
.mg-reparto i { display: block; min-width: 4px; border-radius: 6px; transform-origin: left; animation: arc-barra-crece 800ms var(--arc-ease-enter, ease) both; }
.mg-reparto .pago, .mg-reparto-leyenda i.pago { background: color-mix(in oklab, var(--fc-ink) 22%, var(--fc-card)); }
.mg-reparto .gasto, .mg-reparto-leyenda i.gasto { background: var(--mg-r2); }
.mg-reparto .margen, .mg-reparto-leyenda i.margen { background: var(--mg-g3); }
.mg-reparto-leyenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mg-reparto-leyenda li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 56px; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--fc-border); font-size: 14px; }
.mg-reparto-leyenda li:last-child { border-bottom: 0; }
.mg-reparto-leyenda i { width: 12px; height: 12px; border-radius: 4px; }
.mg-reparto-leyenda b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg-reparto-leyenda em { font-style: normal; color: var(--fc-muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
/* Cada gasto dice si es definitivo (con su factura, registrada en el contabilizador) o anotado a mano */
.mg-con-factura, .mg-anotado { display: inline-flex; align-items: center; gap: 6px; justify-self: start; margin-top: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.mg-con-factura { background: var(--mg-g0); color: var(--mg-tinta-g); }
.mg-con-factura::before, .mg-anotado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mg-anotado { background: var(--fc-selected); color: var(--fc-muted); }
.mg-gasto-txt { display: grid; }
