/* RegistroMacros — layout app + menú lateral + tipografía Outfit / Fraunces */
:root {
  --r: 14px;
  --r2: 10px;
  --font: "Outfit", system-ui, sans-serif;
  --font-h: "Fraunces", ui-serif, Georgia, serif;
  --navw: 272px;
  /* oscuro (por defecto) */
  --bg0: #07080c;
  --bg1: #0e1017;
  --bg2: #141824;
  --ink: #eef0f4;
  --mute: #8a91a3;
  --line: #252a38;
  --line2: #1c2130;
  --acc: #22d3c8;
  --acc-d: #0d9488;
  --warm: #fbbf24;
  --card: #11141c;
  --glow: rgba(34, 211, 200, 0.15);
  --glow-amb: rgba(251, 191, 36, 0.06);
  --sh: 0 18px 50px rgba(0, 0, 0, 0.45);
  --amb-a: #07080c;
  --amb-b: #0a0c12;
  --nav-item-hover-bg: rgba(255, 255, 255, 0.04);
  --nav-ico-tint: rgba(0, 0, 0, 0.25);
  --nav-ico-tint-active: rgba(0, 0, 0, 0.12);
  --input-bg: #080a0f;
  --btn-ghost-bg: rgba(0, 0, 0, 0.2);
  --menu-backdrop: rgba(0, 0, 0, 0.5);
  --nav-m-shadow: 12px 0 40px rgba(0, 0, 0, 0.5);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg0: #eef0f4;
  --bg1: #ffffff;
  --bg2: #e2e5ec;
  --ink: #0f1118;
  --mute: #5a6270;
  --line: #c5cad5;
  --line2: #d5dae3;
  --acc: #0d9488;
  --acc-d: #0f766e;
  --warm: #a16207;
  --card: #ffffff;
  --glow: rgba(13, 148, 136, 0.12);
  --glow-amb: rgba(180, 83, 9, 0.07);
  --sh: 0 4px 28px rgba(15, 20, 35, 0.1);
  --amb-a: #e8ebf0;
  --amb-b: #f2f3f6;
  --nav-item-hover-bg: rgba(0, 0, 0, 0.04);
  --nav-ico-tint: rgba(0, 0, 0, 0.07);
  --nav-ico-tint-active: rgba(0, 0, 0, 0.09);
  --input-bg: #f6f7f9;
  --btn-ghost-bg: rgba(0, 0, 0, 0.05);
  --menu-backdrop: rgba(0, 0, 0, 0.35);
  --nav-m-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
}
html {
  color-scheme: dark;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
.rm-body {
  font-family: var(--font);
  background: var(--bg0);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
.rm-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1000px 500px at 20% -10%, var(--glow), transparent 55%),
    radial-gradient(800px 400px at 100% 0%, var(--glow-amb), transparent 50%),
    linear-gradient(180deg, var(--amb-a), var(--amb-b) 50%, var(--amb-a));
}
.rm-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
/* ——— Sidebar ——— */
.rm-nav {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  width: var(--navw);
  max-width: 90vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem 1rem;
  background: color-mix(in srgb, var(--bg1) 92%, transparent);
  border-right: 1px solid var(--line2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
@media (min-width: 1024px) {
  .rm-nav {
    position: relative;
    z-index: 1;
    flex: 0 0 var(--navw);
    width: var(--navw);
    max-width: none;
    height: auto;
    min-height: 100dvh;
    transform: none;
    box-shadow: none;
  }
  .rm-burger,
  .rm-nav__backdrop {
    display: none;
  }
  .rm-shell {
    flex-direction: row;
  }
  body.rm-menu-open .rm-nav {
    box-shadow: none;
  }
}
body.rm-menu-open .rm-nav {
  transform: translateX(0);
  box-shadow: var(--nav-m-shadow);
}
@media (min-width: 1024px) {
  body.rm-menu-open .rm-nav {
    transform: none;
  }
}
.rm-nav__backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  background: var(--menu-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s;
  border: none;
  padding: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
body.rm-menu-open .rm-nav__backdrop {
  opacity: 1;
  visibility: visible;
}
@media (min-width: 1024px) {
  .rm-nav__backdrop {
    display: none;
  }
}
.rm-nav__brand {
  margin-bottom: 1.5rem;
  padding: 0 0.5rem 1rem;
  border-bottom: 1px solid var(--line2);
}
.rm-nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.25rem;
  font-family: var(--font-h);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.rm-nav__logo:hover .rm-nav__logo-t {
  color: var(--acc);
}
.rm-nav__logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--acc) 0%, #059669 100%);
  box-shadow: 0 4px 16px rgba(34, 211, 200, 0.3);
  flex-shrink: 0;
}
.rm-nav__logo-s {
  color: var(--warm);
}
.rm-nav__tag {
  margin: 0.5rem 0 0 2.2rem;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--mute);
  max-width: 12rem;
}
.rm-nav__list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}
.rm-nav__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.7rem;
  border-radius: var(--r2);
  text-decoration: none;
  color: var(--mute);
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.rm-nav__item:hover {
  color: var(--ink);
  background: var(--nav-item-hover-bg);
  border-color: var(--line2);
}
.rm-nav__item.is-active {
  color: #042f2c;
  background: linear-gradient(120deg, #5eead4, var(--acc), #2dd4bf);
  border-color: rgba(13, 148, 136, 0.5);
  box-shadow: 0 4px 20px rgba(45, 212, 191, 0.25);
}
.rm-nav__item.is-active .rm-nav__sub {
  color: color-mix(in srgb, #042f2c 55%, #666);
}
.rm-nav__ico {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--nav-ico-tint);
}
.rm-nav__item.is-active .rm-nav__ico {
  background: var(--nav-ico-tint-active);
}
.rm-nav__ico svg {
  width: 20px;
  height: 20px;
  display: block;
}
.rm-nav__txt {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}
.rm-nav__lab {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.rm-nav__sub {
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--mute);
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rm-nav__foot {
  font-size: 0.65rem;
  line-height: 1.4;
  color: var(--mute);
  margin: 1.5rem 0.5rem 0.5rem;
  opacity: 0.85;
}
/* Tema: control fijo (visible con menú hamburguesa) */
.rm-theme {
  position: fixed;
  z-index: 45;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--sh);
}
@media (min-width: 1024px) {
  .rm-theme {
    top: 1.1rem;
    right: 1.5rem;
  }
}
.rm-theme__b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 2.1rem;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
.rm-theme__b:hover {
  color: var(--ink);
  background: var(--nav-item-hover-bg);
}
.rm-theme__b[aria-pressed="true"] {
  color: #042f2c;
  background: linear-gradient(120deg, #5eead4, var(--acc), #2dd4bf);
  box-shadow: 0 1px 8px rgba(45, 212, 191, 0.2);
}
html[data-theme="light"] .rm-theme__b[aria-pressed="true"] {
  color: #042f2c;
}
.rm-theme__b svg {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
}
/* ——— Main column ——— */
.rm-maincol {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: 0;
  width: 100%;
}
@media (min-width: 1024px) {
  .rm-maincol {
    margin-left: 0;
  }
}
/* Burger */
.rm-burger {
  position: fixed;
  z-index: 45;
  top: 1rem;
  left: 1rem;
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--sh);
  transition: background 0.2s, transform 0.15s;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  color: var(--ink);
}
@media (min-width: 1024px) {
  .rm-burger {
    display: none;
  }
}
.rm-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: 0.25s;
}
body.rm-menu-open .rm-burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.rm-menu-open .rm-burger span:nth-child(2) {
  opacity: 0;
  transform: scale(0.5);
}
body.rm-menu-open .rm-burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
/* Masthead */
.rm-mast {
  padding: 0.5rem 5.25rem 0 1.25rem;
  padding-top: 4.25rem;
  border-bottom: 1px solid var(--line2);
  background: color-mix(in srgb, var(--bg0) 70%, transparent);
  backdrop-filter: blur(8px);
}
@media (min-width: 1024px) {
  .rm-mast {
    padding: 1.5rem 5.5rem 1.25rem 2.25rem;
  }
}
.rm-mast__row {
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.75rem;
}
.rm-mast__ctx {
  flex: 1 1 17rem;
  min-width: 0;
}
.rm-plan-mast-macros {
  flex: 0 1 auto;
  min-width: 11rem;
  max-width: 100%;
}
.rm-plan-mast-macros__inner {
  border: 1px solid color-mix(in srgb, var(--acc) 35%, var(--line2));
  border-radius: 12px;
  background: color-mix(in srgb, var(--acc) 9%, transparent);
  padding: 0.65rem 0.95rem;
  box-sizing: border-box;
}
.rm-plan-mast-macros__lbl {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
}
.rm-plan-mast-macros__nums {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 0.45rem 0.85rem;
  margin-top: 0.35rem;
  align-items: baseline;
}
@media (max-width: 520px) {
  .rm-plan-mast-macros__nums {
    grid-template-columns: repeat(2, 1fr);
  }
}
.rm-plan-mast-macros__nums strong {
  display: block;
  font-family: var(--font-h);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
}
.rm-plan-mast-macros__nums small {
  display: block;
  font-size: 0.65rem;
  color: var(--mute);
  font-weight: 500;
}
.rm-mast__h {
  margin: 0;
  font-family: var(--font-h);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}
@media (min-width: 1024px) {
  .rm-mast__h {
    font-size: 1.9rem;
  }
}
.rm-mast__b {
  margin: 0.4rem 0 0 0;
  font-size: 0.9rem;
  color: var(--mute);
  max-width: 36em;
  line-height: 1.45;
}
/* Main content */
.rm-main {
  flex: 1;
  max-width: 64rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  box-sizing: border-box;
}
@media (min-width: 1024px) {
  .rm-main {
    padding: 1.75rem 2.25rem 2.5rem;
  }
}
.app-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2.5rem 1rem;
  color: var(--mute);
  font-size: 0.9rem;
}
.rm-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: rm-spin 0.75s linear infinite;
}
@keyframes rm-spin {
  to {
    transform: rotate(360deg);
  }
}
.rm-foot {
  padding: 0.9rem 1.25rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--mute);
  border-top: 1px solid var(--line2);
  background: var(--bg0);
}
@media (min-width: 1024px) {
  .rm-foot {
    text-align: left;
    padding-left: 2.25rem;
  }
}
/* Cards & UI (reused by app.js) */
.text-rm-ink {
  color: var(--ink);
}
.text-rm-mute {
  color: var(--mute);
}
.text-rm-accent {
  color: var(--acc);
}
.text-red-500 {
  color: #f87171;
}
.rm-prose a {
  color: var(--acc);
}
.w-full {
  width: 100%;
}
.grid {
  display: grid;
}
.gap-4 {
  gap: 1rem;
}
.gap-3 {
  gap: 0.75rem;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-1 {
  gap: 0.25rem;
}
.md\:grid-cols-1 {
  grid-template-columns: 1fr;
}
.md\:grid-cols-2 {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .md\:grid-cols-1 {
    grid-template-columns: 1fr;
  }
}
.max-w-6xl {
  max-width: 72rem;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.flex-1 {
  flex: 1;
}
.items-center {
  align-items: center;
}
.items-baseline {
  align-items: baseline;
}
.items-end {
  align-items: flex-end;
}
.self-center {
  align-self: center;
}
.flex-wrap {
  flex-wrap: wrap;
}
.space-y-1 > * + * {
  margin-top: 0.25rem;
}
.space-y-3 > * + * {
  margin-top: 0.75rem;
}
.space-y-4 > * + * {
  margin-top: 1rem;
}
.p-0 {
  padding: 0;
}
.p-2 {
  padding: 0.5rem;
}
.p-3 {
  padding: 0.75rem;
}
.p-4 {
  padding: 1rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 0.75rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-3 {
  margin-bottom: 0.75rem;
}
.w-fit {
  width: fit-content;
}
.text-xs {
  font-size: 0.75rem;
}
.text-sm {
  font-size: 0.875rem;
}
.underline {
  text-decoration: underline;
}
.text-red-500 {
  color: #f87171;
}
.overflow-x-auto {
  overflow-x: auto;
}
.w-48 {
  width: 12rem;
}
.max-w-xs {
  max-width: 20rem;
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.min-w-lg {
  min-width: 32rem;
}
.border-b {
  border-bottom: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
}
code {
  font-size: 0.85em;
  color: var(--warm);
}
.rm-card {
  position: relative;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 98%, #fff) 0%, var(--card) 100%);
  box-shadow: var(--sh);
  margin-bottom: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.rm-card:hover {
  border-color: color-mix(in srgb, var(--acc) 15%, var(--line2));
}
.rm-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1.05rem 1.2rem;
  background: color-mix(in srgb, var(--bg2) 40%, transparent);
  border-bottom: 1px solid var(--line2);
}
.rm-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.rm-card__body {
  padding: 1.1rem 1.2rem 1.2rem;
}
.rm-btn,
.rm-btn--sm,
.rm-btn--pri {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: var(--r2);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: #042f2e;
  text-decoration: none;
  background: linear-gradient(180deg, #5eead4, #2dd4bf, var(--acc));
  box-shadow: 0 2px 10px rgba(45, 212, 191, 0.22);
  transition: filter 0.15s, transform 0.1s;
  box-sizing: border-box;
  line-height: 1.2;
}
.rm-btn--pri {
  display: inline-flex;
}
.rm-btn--sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.7rem;
}
.rm-btn--ghost,
.rm-btn.rm-btn--ghost {
  background: var(--btn-ghost-bg);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
  font-weight: 500;
}
.rm-btn--ghost:hover,
.rm-btn:hover {
  filter: brightness(1.05);
}
.rm-btn:active,
.rm-btn--pri:active {
  transform: scale(0.99);
}
.rm-field {
  display: block;
  margin-bottom: 0.25rem;
}
.rm-field__l {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mute);
  margin-bottom: 0.35rem;
}
.rm-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line2);
  border-radius: 9px;
  background: var(--input-bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  margin-bottom: 0.4rem;
}
.rm-input:focus {
  outline: 2px solid color-mix(in srgb, var(--acc) 45%, transparent);
  border-color: var(--acc-d);
}
.rm-macro-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.rm-mrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line2);
}
.rm-mrow:last-of-type {
  border-bottom: none;
}
.rm-mrow small {
  color: var(--mute);
  font-weight: 400;
}
.rm-footnote {
  margin: 0.6rem 0 0 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--mute);
}

/** Banner macros totales día (Macros / día) */
.rm-card.rm-macro-total-banner {
  padding: 1rem 1.15rem;
  background: linear-gradient(145deg, #0f172a, #1e293b);
  color: #f8fafc;
  border: none !important;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.25);
}

