/* ══════════════════════════════════════════════════════════════════
   GESTOR · Sistema de diseño
   Crema cálida + terracota. Móvil primero, editorial y directo.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #F7F4EE;
  --bg-deep: #F1ECE2;
  --panel: #FFFDFA;
  --panel-soft: #FBF7F0;
  --ink: #2B2723;
  --ink-2: #6E665B;
  --ink-3: #9C9385;
  --line: #E7DFD2;
  --line-soft: #F0E9DE;
  --accent: #C96442;
  --accent-deep: #A94E30;
  --accent-strong: #B8542F;
  --accent-soft: #F7E5DC;
  --accent-wash: #FCF1EA;
  --gold: #B68A4E;
  --green: #55704A;
  --green-soft: #ECF2E7;
  --green-line: #DCE7D3;
  --amber: #A9762E;
  --amber-soft: #FBF1E0;
  --amber-line: #F0DFC2;
  --red: #A9453A;
  --red-soft: #FBEDE9;
  --red-line: #F0D2CA;
  --shadow-sm: 0 1px 2px rgba(var(--shadow-rgb), .045);
  --shadow-md: 0 10px 30px -18px rgba(var(--shadow-rgb), .28);
  --shadow-lg: 0 30px 70px -30px rgba(var(--shadow-rgb), .35);
  --radius: 16px;
  --radius-sm: 11px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Tokens derivados del tema. Los temas solo cambian la base. */
  --shadow-rgb: 43, 39, 35;
  --accent-rgb: 201, 100, 66;
  --text-on-accent: #FFF9F3;
  --text-on-dark: #F8F1E7;
  --text-on-dark-soft: #FBF6EC;
  --inset-highlight: color-mix(in srgb, var(--panel) 20%, transparent);
  --accent-hover: #A24827;
  --selection: color-mix(in srgb, var(--accent) 30%, var(--panel));
  --scroll-thumb: color-mix(in srgb, var(--ink) 12%, var(--bg));
  --scroll-thumb-hover: color-mix(in srgb, var(--ink) 20%, var(--bg));
  --line-strong: color-mix(in srgb, var(--line) 70%, var(--ink-3));
  --line-strong-2: color-mix(in srgb, var(--line) 80%, var(--ink-3));
  --placeholder: color-mix(in srgb, var(--ink-3) 80%, var(--bg));
  --nav-hover: color-mix(in srgb, var(--panel) 65%, transparent);
  --bottom-nav: color-mix(in srgb, var(--panel) 94%, transparent);
  --setup-panel: color-mix(in srgb, var(--panel) 74%, transparent);
  --setup-line: color-mix(in srgb, var(--line) 85%, transparent);
  --soft-divider: color-mix(in srgb, var(--ink-2) 22%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--panel));
  --accent-wash: color-mix(in srgb, var(--accent) 7%, var(--panel));
  --accent-surface: color-mix(in srgb, var(--accent) 4%, var(--panel));
  --accent-wash-2: color-mix(in srgb, var(--accent) 12%, var(--panel));
  --accent-wash-3: color-mix(in srgb, var(--accent) 9%, var(--bg));
  --accent-wash-4: color-mix(in srgb, var(--accent) 9%, var(--panel));
  --accent-wash-5: color-mix(in srgb, var(--accent) 7%, var(--panel));
  --accent-wash-6: color-mix(in srgb, var(--accent) 6%, var(--panel));
  --accent-line: color-mix(in srgb, var(--accent) 28%, var(--panel));
  --accent-line-2: color-mix(in srgb, var(--accent) 26%, var(--panel));
  --accent-line-3: color-mix(in srgb, var(--accent) 22%, var(--panel));
  --accent-line-4: color-mix(in srgb, var(--accent) 20%, var(--panel));
  --accent-line-5: color-mix(in srgb, var(--accent) 35%, var(--panel));
  --accent-line-6: color-mix(in srgb, var(--accent) 40%, var(--panel));
  --accent-line-7: color-mix(in srgb, var(--accent) 25%, var(--panel));
  --accent-line-8: color-mix(in srgb, var(--accent) 26%, var(--panel));
  --accent-tint: color-mix(in srgb, var(--accent) 18%, var(--panel));
  --accent-tint-2: color-mix(in srgb, var(--accent) 12%, var(--panel));
  --accent-text: color-mix(in srgb, var(--accent-deep) 70%, var(--ink-2));
  --accent-text-2: color-mix(in srgb, var(--accent) 70%, var(--ink-2));
  --accent-text-3: color-mix(in srgb, var(--accent-deep) 60%, var(--ink-2));
  --neutral-soft: color-mix(in srgb, var(--line) 55%, var(--bg));
  --neutral-soft-2: color-mix(in srgb, var(--line) 45%, var(--bg));
  --avatar-bg: color-mix(in srgb, var(--accent) 16%, var(--bg));
  --avatar-ink: color-mix(in srgb, var(--accent-deep) 55%, var(--ink));
  --num-bg: color-mix(in srgb, var(--accent) 12%, var(--bg));
  --num-ink: color-mix(in srgb, var(--accent-deep) 60%, var(--ink));
  --danger-hover: color-mix(in srgb, var(--red) 12%, var(--panel));
  --green-hover: color-mix(in srgb, var(--green) 14%, var(--panel));
  --green-wash: color-mix(in srgb, var(--green) 7%, var(--panel));
  --green-wash-2: color-mix(in srgb, var(--green) 4%, var(--panel));
  --green-wash-3: color-mix(in srgb, var(--green) 5%, var(--panel));
  --green-wash-4: color-mix(in srgb, var(--green) 10%, var(--panel));
  --heat-1: color-mix(in srgb, var(--accent) 18%, var(--panel));
  --heat-2: color-mix(in srgb, var(--accent) 38%, var(--panel));
  --heat-3: color-mix(in srgb, var(--accent) 62%, var(--panel));
  --heat-4: var(--accent);
  --heat-line: color-mix(in srgb, var(--line) 60%, transparent);
  --focus-glow: color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-shadow: color-mix(in srgb, var(--accent-deep) 25%, transparent);
  --accent-shadow-2: color-mix(in srgb, var(--accent-deep) 65%, transparent);
  --brand-glow: color-mix(in srgb, var(--accent) 45%, transparent);
  --brand-gold: color-mix(in srgb, var(--gold) 14%, transparent);
  --hero-line: color-mix(in srgb, var(--text-on-dark) 10%, transparent);
  --hero-muted: color-mix(in srgb, var(--text-on-dark) 54%, transparent);
  --hero-muted-2: color-mix(in srgb, var(--text-on-dark) 62%, transparent);
  --hero-faint: color-mix(in srgb, var(--text-on-dark) 50%, transparent);
  --hero-accent: color-mix(in srgb, var(--accent) 55%, var(--panel));
  --hero-warn: color-mix(in srgb, var(--amber) 55%, var(--panel));
  --hero-ok: color-mix(in srgb, var(--green) 45%, var(--panel));
  --hero-panel: color-mix(in srgb, var(--panel) 7%, transparent);
  --hero-panel-2: color-mix(in srgb, var(--panel) 8%, transparent);
  --hero-panel-3: color-mix(in srgb, var(--panel) 14%, transparent);
  --hero-panel-4: color-mix(in srgb, var(--panel) 15%, transparent);
  --hero-line-2: color-mix(in srgb, var(--panel) 9%, transparent);
  --hero-line-3: color-mix(in srgb, var(--panel) 16%, transparent);
  --hero-line-4: color-mix(in srgb, var(--panel) 18%, transparent);
  --toast-ok: #BBD3AE;
  --toast-err-bg: #4A2620;
  --toast-err: #F0B4A4;
}

/* ══════════════════════════ TEMAS ══════════════════════════ */

[data-theme="verde"] {
  --bg: #F2F6F0;
  --bg-deep: #E6EEE3;
  --panel: #FCFEFB;
  --panel-soft: #F4F8F2;
  --ink: #1E2A21;
  --ink-2: #566257;
  --ink-3: #879386;
  --line: #D8E3D5;
  --line-soft: #E7EFE3;
  --accent: #4F7A5A;
  --accent-deep: #3C6047;
  --accent-strong: #467052;
  --accent-hover: #385A43;
  --gold: #A78343;
  --green: #3F6B4D;
  --amber: #8A6A2C;
  --red: #9E453C;
  --shadow-rgb: 30, 42, 33;
  --accent-rgb: 79, 122, 90;
}

[data-theme="azul"] {
  --bg: #F0F4F7;
  --bg-deep: #E4EBF0;
  --panel: #FBFDFE;
  --panel-soft: #F3F7FA;
  --ink: #1C2733;
  --ink-2: #53616F;
  --ink-3: #8493A1;
  --line: #D5E0E8;
  --line-soft: #E5EDF2;
  --accent: #3E6E8E;
  --accent-deep: #2F5670;
  --accent-strong: #386380;
  --accent-hover: #294A61;
  --gold: #B08A4E;
  --green: #4B7256;
  --amber: #9A752B;
  --red: #A34A42;
  --shadow-rgb: 28, 39, 51;
  --accent-rgb: 62, 110, 142;
}

[data-theme="violeta"] {
  --bg: #F5F1F6;
  --bg-deep: #EBE3EE;
  --panel: #FDFBFE;
  --panel-soft: #F7F2F9;
  --ink: #2A2030;
  --ink-2: #62566A;
  --ink-3: #92869A;
  --line: #E1D6E6;
  --line-soft: #EEE6F1;
  --accent: #7A548C;
  --accent-deep: #624170;
  --accent-strong: #704B81;
  --accent-hover: #53355F;
  --gold: #B08A4E;
  --green: #5A7355;
  --amber: #9A752B;
  --red: #A34A42;
  --shadow-rgb: 42, 32, 48;
  --accent-rgb: 122, 84, 140;
}

[data-theme="arena"] {
  --bg: #F6F3EA;
  --bg-deep: #EDE7D9;
  --panel: #FFFDF8;
  --panel-soft: #F9F5EB;
  --ink: #2D2920;
  --ink-2: #676052;
  --ink-3: #978E7C;
  --line: #E3DBC8;
  --line-soft: #EFE9DC;
  --accent: #8A6B3F;
  --accent-deep: #6E5430;
  --accent-strong: #7D6038;
  --accent-hover: #5D4728;
  --gold: #B68A4E;
  --green: #58724C;
  --amber: #A9762E;
  --red: #A9453A;
  --shadow-rgb: 45, 41, 32;
  --accent-rgb: 138, 107, 63;
}

[data-theme="cereza"] {
  --bg: #F7F1F2;
  --bg-deep: #EFE5E7;
  --panel: #FEFBFC;
  --panel-soft: #F9F4F5;
  --ink: #2B2023;
  --ink-2: #66575B;
  --ink-3: #9A888D;
  --line: #E5D8DB;
  --line-soft: #F0E7E9;
  --accent: #8E3F4E;
  --accent-deep: #73303D;
  --accent-strong: #863B49;
  --accent-hover: #652A35;
  --gold: #B18A4C;
  --green: #57724E;
  --amber: #9B752D;
  --red: #A9453A;
  --shadow-rgb: 43, 32, 35;
  --accent-rgb: 142, 63, 78;
}

[data-theme="turquesa"] {
  --bg: #EFF6F5;
  --bg-deep: #E2EEEC;
  --panel: #FBFEFE;
  --panel-soft: #F3F9F8;
  --ink: #1B2B2A;
  --ink-2: #526462;
  --ink-3: #849693;
  --line: #D3E3E0;
  --line-soft: #E4F0ED;
  --accent: #2F7C7A;
  --accent-deep: #245F5D;
  --accent-strong: #2B7270;
  --accent-hover: #1D4E4D;
  --gold: #B08A4E;
  --green: #3F7259;
  --amber: #99742B;
  --red: #A34A42;
  --shadow-rgb: 27, 43, 42;
  --accent-rgb: 47, 124, 122;
}

[data-theme="grafito"] {
  --bg: #F2F4F6;
  --bg-deep: #E7EBEF;
  --panel: #FCFDFE;
  --panel-soft: #F5F7F9;
  --ink: #20262E;
  --ink-2: #59636F;
  --ink-3: #8B96A3;
  --line: #D9E0E7;
  --line-soft: #E8EDF2;
  --accent: #4C5A6B;
  --accent-deep: #3B4654;
  --accent-strong: #465361;
  --accent-hover: #323C48;
  --gold: #A98A52;
  --green: #4E725A;
  --amber: #98732C;
  --red: #A34A42;
  --shadow-rgb: 32, 38, 46;
  --accent-rgb: 76, 90, 107;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  border-top: 3px solid var(--accent-strong);
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 10px;
  border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

::-webkit-scrollbar-track {
  background: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--text-on-dark);
  border-radius: 9px;
  font-size: 12.5px;
  transition: top .18s;
}

.skip-link:focus {
  top: 12px;
}

/* ══════════════════════════ BOTONES ══════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s, transform .12s, box-shadow .18s;
}

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

.btn svg {
  width: 14px;
  height: 14px;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-strong);
  color: var(--text-on-accent);
  border-color: var(--accent-strong);
  box-shadow: 0 1px 2px var(--accent-shadow), inset 0 1px 0 var(--inset-highlight);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--panel-soft);
  border-color: var(--line-strong);
}

.btn-soft {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-deep);
}

.btn-soft:hover {
  background: var(--accent-tint);
}

.btn-danger {
  background: var(--red-soft);
  border-color: var(--red-line);
  color: var(--red);
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-success {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green);
}

.btn-success:hover {
  background: var(--green-hover);
}

.btn-block {
  width: 100%;
  padding: 11px 18px;
  font-size: 13px;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 7px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  transition: background .16s, color .16s, border-color .16s;
}

.icon-btn:hover {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn.danger:hover {
  background: var(--red-soft);
  border-color: var(--red-line);
  color: var(--red);
}

/* ══════════════════════════ SHELL ══════════════════════════ */

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 16px 18px;
  background: var(--bg-deep);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  margin: 0 0 28px 0px;
  background: none;
  border: 0;
  text-align: left;
  background: radial-gradient(110% 140% at 88% 0%, var(--brand-glow) 0%, transparent 55%), radial-gradient(90% 100% at 0% 100%, var(--brand-gold) 0%, transparent 60%), var(--ink);
  color: var(--text-on-dark);
  border-radius: 10px;
}

.brand-mark {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-strong);
  color: var(--text-on-dark);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  box-shadow: inset 0 1px 0 var(--inset-highlight);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.015em;
}

.brand-sub {
  font-size: 9.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 450;
  text-align: left;
  transition: background .16s, color .16s;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  opacity: .75;
}

.nav-item:hover {
  background: var(--nav-hover);
  color: var(--ink);
}

.nav-item.active {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.nav-item.active svg {
  color: var(--accent);
  opacity: 1;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: auto;
  flex: none;
}

.sidebar-today {
  margin-top: auto;
  padding: 14px 14px 15px;
  background: linear-gradient(160deg, var(--accent-wash), var(--accent-wash-3));
  border: 1px solid var(--accent-line-7);
  border-radius: 14px;
}

.sidebar-today .st-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 7px;
}

.sidebar-today .st-label svg {
  width: 13px;
  height: 13px;
}

.sidebar-today .st-amount {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.sidebar-today .st-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-2);
}

.sidebar-today .st-pay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--soft-divider);
  font-size: 10.5px;
  color: var(--ink-2);
}

.sidebar-today .st-pay strong {
  font-size: 11.5px;
}

.sidebar-today .st-pay.ok strong {
  color: var(--green);
}

.sidebar-today .st-pay.warn strong {
  color: var(--accent-deep);
}

.sidebar-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-strong-2);
}

.main {
  min-width: 0;
  padding: 26px 32px 64px;
}

/* ══════════════════════════ TOPBAR ══════════════════════════ */

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.page-head h1 {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.12;
}

.page-head p {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ══════════════════════════ NAV INFERIOR / FAB ══════════════════════════ */

.bottom-nav {
  display: none;
}

.fab {
  display: none;
}

/* ══════════════════════════ VISTA / LAYOUT ══════════════════════════ */

.view {
  animation: viewIn .28s ease both;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.grid-kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.grid-2-1 {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr);
  gap: 16px;
}

.grid-1-1 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-1-2 {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1.9fr);
  gap: 16px;
  align-items: start;
}

.grid-3-1 {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(260px, 1fr);
  gap: 16px;
}

/* ══════════════════════════ TARJETAS ══════════════════════════ */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.card-pad {
  padding: 18px 20px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px 0;
}

.card-head.with-line {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.015em;
}

.card-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.card-body {
  padding: 16px 20px 18px;
}

.card-action {
  flex: none;
}

.kpi {
  position: relative;
  padding: 15px 17px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.kpi-label svg {
  width: 14px;
  height: 14px;
  color: var(--ink-3);
}

.kpi-value {
  margin-top: 7px;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

.kpi-value small {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0;
}

.kpi-meta {
  margin-top: 5px;
  font-size: 11px;
  color: var(--ink-3);
}

.kpi-meta .up {
  color: var(--green);
  font-weight: 500;
}

.kpi-meta .down {
  color: var(--red);
  font-weight: 500;
}

.kpi.accent {
  background: linear-gradient(150deg, var(--accent-surface) 0%, var(--accent-wash-2) 100%);
  border-color: var(--accent-line-8);
}

.kpi.accent .kpi-value {
  color: var(--accent-deep);
}

.kpi.accent .kpi-label svg {
  color: var(--accent-text-2);
}

.chart-wrap {
  position: relative;
  height: 270px;
  padding: 6px 18px 16px;
}

.chart-wrap.sm {
  height: 230px;
}

.chart-wrap.xs {
  height: 200px;
}

.chart-empty {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 20px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
}

.chart-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}

.chart-summary .cs-item {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.chart-summary .cs-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
}

.chart-summary .cs-value {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chart-summary .cs-value.accent {
  color: var(--accent-deep);
}

/* ══════════════════════════ HERO ══════════════════════════ */

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(230px, .8fr);
  gap: 24px;
  padding: 26px 28px;
  color: var(--text-on-dark);
  background:
    radial-gradient(110% 140% at 88% 0%, var(--brand-glow) 0%, transparent 55%),
    radial-gradient(90% 100% at 0% 100%, var(--brand-gold) 0%, transparent 60%),
    var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -120px;
  bottom: -190px;
  border: 1px solid var(--hero-line);
  border-radius: 50%;
  pointer-events: none;
}

.hero-main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero .eyebrow {
  color: var(--hero-accent);
}

.hero-label {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--hero-muted);
}

.hero-value {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 58px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.015em;
  color: var(--text-on-dark-soft);
  font-variant-numeric: tabular-nums;
}

.hero-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--hero-muted-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-actions .btn-ghost {
  background: var(--hero-panel-2);
  border-color: var(--hero-line-4);
  color: var(--text-on-dark-soft);
}

.hero-actions .btn-ghost:hover {
  background: var(--hero-panel-4);
}

.hero-actions .badge {
  background: var(--hero-panel-3);
  border-color: var(--hero-line-3);
  color: var(--text-on-dark-soft);
}

.hero-side {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: center;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 10px;
  background: var(--hero-panel);
  border: 1px solid var(--hero-line-2);
  border-radius: 10px;
  min-width: 0;
}

.hero-stat span {
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--hero-faint);
}

.hero-stat strong {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-on-dark-soft);
}

.hero-stat strong.warn {
  color: var(--hero-warn);
}

.hero-stat strong.ok {
  color: var(--hero-ok);
}

/* ══════════════════════════ TABS / RANGE ══════════════════════════ */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 100%;
}

.tabs.scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tabs.scroll::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.tab small {
  font-size: 10px;
  color: var(--ink-3);
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
}

.range-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.segmented button {
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button.active {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.range-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.range-nav .range-arrow {
  width: 27px;
  height: 27px;
  border-radius: 7px;
}

.range-nav .range-arrow svg {
  width: 15px;
  height: 15px;
}

.range-nav .range-arrow:disabled {
  opacity: .28;
  cursor: default;
}

.range-nav .range-arrow:disabled:hover {
  background: transparent;
  border-color: transparent;
}

.range-label {
  min-width: 112px;
  padding: 0 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ══════════════════════════ BUSCADOR ══════════════════════════ */

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 220px;
}

.search svg {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
}

.search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 12.5px;
  min-width: 0;
}

.search input::placeholder {
  color: var(--placeholder);
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-glow);
}

/* ══════════════════════════ INGRESOS (LISTA) ══════════════════════════ */

.entry-list {
  display: flex;
  flex-direction: column;
}

.entry-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.35fr) auto 16px;
  gap: 4px 14px;
  align-items: center;
  width: 100%;
  padding: 12px 18px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
  transition: background .13s;
}

.entry-item:last-child {
  border-bottom: 0;
}

.entry-item:hover {
  background: var(--panel-soft);
}

.entry-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  line-height: 1;
  flex: none;
}

.entry-date strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.entry-date span {
  margin-top: 2px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.entry-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.entry-service {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-sub {
  font-size: 10.5px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.entry-money {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
}

.entry-money span {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  min-width: 56px;
}

.entry-money small {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-3);
}

.entry-money strong {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.entry-money strong.neg {
  color: var(--accent-deep);
}

.entry-chev {
  color: var(--ink-3);
  display: grid;
  place-items: center;
}

.entry-chev svg {
  width: 15px;
  height: 15px;
}

.list-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel-soft);
  font-size: 11px;
  color: var(--ink-3);
}

.list-foot strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.list-foot .neg {
  color: var(--accent-deep);
}

/* ══════════════════════════ PAGOS ══════════════════════════ */

.pay-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-row {
  --stripe: var(--line);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
  box-shadow: inset 3px 0 0 var(--stripe), var(--shadow-sm);
}

.pay-row.status-pending {
  --stripe: var(--accent);
}

.pay-row.status-partial {
  --stripe: var(--gold);
}

.pay-row.status-paid {
  --stripe: var(--green);
  background: linear-gradient(150deg, var(--green-wash-2) 0%, var(--green-wash) 100%);
  border-color: var(--green-line);
}

.pay-top {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  grid-column: 1 / 3;
}

.pay-info {
  min-width: 0;
}

.pay-name {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.pay-reason {
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pay-progress {
  margin-top: 7px;
  max-width: 360px;
}

.pay-progress .mini-bar {
  height: 4px;
}

.pay-progress .mini-bar>span {
  background: var(--stripe);
}

.pay-amounts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.pay-amounts strong {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.pay-amounts span {
  font-size: 10px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.pay-status {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  grid-column: 3;
}

.pay-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  grid-column: 3;
}

.pay-close-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.pay-close-card.done {
  background: linear-gradient(150deg, var(--green-wash-3), var(--green-wash-4));
  border-color: var(--green-line);
}

.pay-close-card.has-pending {
  background: linear-gradient(150deg, var(--accent-surface), var(--accent-wash-4));
  border-color: var(--accent-line-2);
}

.close-copy {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.close-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: var(--bg-deep);
  color: var(--ink-2);
}

.close-icon svg {
  width: 20px;
  height: 20px;
}

.pay-close-card.done .close-icon {
  background: var(--green-soft);
  color: var(--green);
}

.pay-close-card.has-pending .close-icon {
  background: var(--accent-tint-2);
  color: var(--accent-deep);
}

.close-copy h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.close-copy p {
  margin-top: 1px;
  font-size: 11px;
  color: var(--ink-3);
}

.close-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.close-stats {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.close-stats span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.close-stats small {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
}

.close-stats strong {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════ HEATMAPS ══════════════════════════ */

.heatmap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: start;
}

.heatmap-main {
  min-width: 0;
}

.heatmap-body {
  display: flex;
  gap: 6px;
}

.heatmap-days {
  display: grid;
  grid-template-rows: repeat(7, 21px);
  gap: 4px;
  padding-top: 20px;
  font-size: 9.5px;
  color: var(--ink-3);
  flex: none;
}

.heatmap-days span {
  display: flex;
  align-items: center;
  height: 21px;
  line-height: 1;
}

.heat-scroll {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.heatmap-months {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 21px;
  gap: 4px;
  height: 16px;
  font-size: 9.5px;
  color: var(--ink-3);
}

.heatmap-months span {
  overflow: visible;
  white-space: nowrap;
}

.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 21px);
  grid-auto-flow: column;
  grid-auto-columns: 21px;
  gap: 4px;
  width: max-content;
}

.hm-cell {
  width: 21px;
  height: 21px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: var(--neutral-soft);
  outline: 1px solid transparent;
  transition: transform .1s, outline-color .1s;
  cursor: default;
}

.hm-cell.l1 {
  background: var(--heat-1);
}

.hm-cell.l2 {
  background: var(--heat-2);
}

.hm-cell.l3 {
  background: var(--heat-3);
}

.hm-cell.l4 {
  background: var(--heat-4);
}

.hm-cell.has-data {
  cursor: pointer;
}

.hm-cell.has-data:hover {
  outline-color: var(--ink);
  transform: scale(1.16);
}

.hm-cell.is-future {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--heat-line);
}

.hm-cell.is-today {
  box-shadow: 0 0 0 1.5px var(--ink);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 11px;
  padding-left: 27px;
  font-size: 9.5px;
  color: var(--ink-3);
}

.heatmap-legend .hm-cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  cursor: default;
}

.heatmap-legend .hm-cell:hover {
  transform: none;
  outline-color: transparent;
}

.heatmap-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, auto));
  gap: 14px 24px;
}

.hm-stat {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.hm-stat .hs-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-3);
}

.hm-stat .hs-value {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hm-stat .hs-value small {
  font-weight: 400;
  color: var(--ink-3);
}

.hour-heat {
  display: grid;
  grid-template-columns: 30px repeat(13, minmax(0, 1fr));
  gap: 4px;
  max-width: 860px;
}

.hh-corner {
  min-height: 20px;
}

.hh-col {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  font-size: 9px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.hh-row {
  display: flex;
  align-items: center;
  height: 27px;
  font-size: 9.5px;
  color: var(--ink-3);
}

.hh-cell {
  height: 27px;
  border-radius: 4px;
  background: var(--neutral-soft);
  border: 0;
  padding: 0;
  cursor: default;
}

.hh-cell.l1 {
  background: var(--heat-1);
}

.hh-cell.l2 {
  background: var(--heat-2);
}

.hh-cell.l3 {
  background: var(--heat-3);
}

.hh-cell.l4 {
  background: var(--heat-4);
}

.hh-cell.has-data {
  cursor: pointer;
}

.hh-cell.has-data:hover {
  outline: 1.5px solid var(--ink);
}

/* ══════════════════════════ TABLAS ══════════════════════════ */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.data th {
  padding: 9px 14px;
  text-align: left;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--panel);
}

table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data tbody tr {
  transition: background .13s;
}

table.data tbody tr.clickable {
  cursor: pointer;
}

table.data tbody tr.clickable:hover {
  background: var(--panel-soft);
}

table.data .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.data .num.strong {
  font-weight: 600;
}

table.data .num.accent {
  color: var(--accent-deep);
}

table.data .num.negative {
  color: var(--accent-deep);
}

.table-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12px;
}

.cell-main {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.cell-main strong {
  font-weight: 500;
  font-size: 12.5px;
}

.cell-main span {
  font-size: 10.5px;
  color: var(--ink-3);
}

/* ══════════════════════════ BADGES / AVATARES ══════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
  white-space: nowrap;
}

.badge svg {
  width: 11px;
  height: 11px;
}

.badge.accent {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-deep);
}

.badge.green {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green);
}

.badge.amber {
  background: var(--amber-soft);
  border-color: var(--amber-line);
  color: var(--amber);
}

.badge.red {
  background: var(--red-soft);
  border-color: var(--red-line);
  color: var(--red);
}

.badge.muted {
  color: var(--ink-3);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--avatar-ink);
  font-size: 11.5px;
  font-weight: 600;
  flex: none;
  letter-spacing: -.01em;
}

.avatar.sm {
  width: 26px;
  height: 26px;
  font-size: 9.5px;
}

.avatar.lg {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.mini-bar {
  height: 5px;
  border-radius: 5px;
  background: var(--neutral-soft-2);
  overflow: hidden;
}

.mini-bar>span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 5px;
}

.cat-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  flex: none;
}

.stack-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* ══════════════════════════ LISTAS DE PERSONAL / SERVICIOS ══════════════════════════ */

.manage-list {
  display: flex;
  flex-direction: column;
}

.manage-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.manage-row:last-child {
  border-bottom: 0;
}

.manage-main {
  min-width: 0;
  flex: 1;
}

.manage-name {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.manage-sub {
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--ink-3);
}

.manage-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.manage-amount {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.manage-amount span {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  color: var(--ink-3);
}

.manage-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ══════════════════════════ ONBOARDING / VACÍOS ══════════════════════════ */

.onboarding-card {
  background: linear-gradient(150deg, var(--accent-surface) 0%, var(--accent-wash-4) 100%);
  border-color: var(--accent-line-2);
}

.onboarding-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(270px, .9fr);
  gap: 26px;
  align-items: center;
  padding: 22px 24px;
}

.onboarding-copy h2 {
  margin-top: 6px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.2;
}

.onboarding-copy>p {
  margin-top: 7px;
  max-width: 520px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-2);
}

.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.setup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.setup-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 11px;
  background: var(--setup-panel);
  border: 1px solid var(--setup-line);
  border-radius: 11px;
}

.setup-step button {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.setup-step .ss-num {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex: none;
  border-radius: 50%;
  background: var(--num-bg);
  color: var(--num-ink);
  font-size: 10.5px;
  font-weight: 600;
}

.setup-step .ss-num svg {
  width: 12px;
  height: 12px;
}

.setup-step.done .ss-num {
  background: var(--green-soft);
  color: var(--green);
}

.setup-step>div,
.setup-step button>div {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  min-width: 0;
}

.setup-step strong {
  font-size: 12px;
  font-weight: 600;
}

.setup-step>div>span,
.setup-step button>div>span {
  font-size: 10.5px;
  color: var(--ink-3);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 38px 22px;
  text-align: center;
}

.empty.sm {
  padding: 22px 16px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--bg-deep);
  color: var(--ink-3);
}

.empty-icon svg {
  width: 20px;
  height: 20px;
}

.empty strong {
  font-size: 13.5px;
  font-weight: 600;
}

.empty p {
  max-width: 340px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.inline-guard {
  display: flex;
  gap: 10px;
  padding: 13px;
  background: var(--panel-soft);
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.inline-guard svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 1px;
  color: var(--accent);
}

.inline-guard>div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inline-guard strong {
  font-size: 12px;
  color: var(--ink);
}

.info-note {
  display: flex;
  gap: 9px;
  padding: 11px 13px;
  background: var(--accent-wash);
  border: 1px solid var(--accent-line-4);
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.info-note svg {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 1px;
  color: var(--accent);
}

.info-note strong {
  color: var(--ink);
}

/* ══════════════════════════ FORMULARIOS ══════════════════════════ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  position: relative;
}

.form-field>label,
.form-field>.lbl {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.form-field>label .lbl-hint {
  font-weight: 400;
  color: var(--ink-3);
  font-size: 10px;
}

.field-hint {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--ink-3);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}

.textarea {
  resize: vertical;
  min-height: 64px;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-glow);
}

.input[aria-invalid="true"] {
  border-color: var(--red);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E665B' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}

.input-money {
  position: relative;
}

.input-money .currency {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11.5px;
  color: var(--ink-3);
  pointer-events: none;
}

.input-money input {
  padding-left: 31px;
  font-variant-numeric: tabular-nums;
}

.input-suffix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-suffix-wrap .input {
  padding-right: 36px;
  font-variant-numeric: tabular-nums;
}

.input-suffix-wrap .suffix {
  position: absolute;
  right: 11px;
  font-size: 11px;
  color: var(--ink-3);
  pointer-events: none;
}

.divider {
  height: 1px;
  background: var(--line-soft);
  margin: 16px 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title h3 {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.section-title .hint {
  font-size: 10px;
  color: var(--ink-3);
}

/* ══════════════════════════ MODALES ══════════════════════════ */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--shadow-rgb), .42);
  backdrop-filter: blur(3px);
  animation: fadeIn .18s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .22s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.985);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.modal.modal-wide {
  max-width: 900px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
}

.modal-head h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.3;
}

.modal-head p {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink-2);
}

.modal-close:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

.modal-close svg {
  width: 15px;
  height: 15px;
}

.modal-body {
  padding: 0 22px 20px;
}

.modal-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 22px;
  background: var(--panel);
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 20px 20px;
  box-shadow: 0 -12px 24px -24px rgba(var(--shadow-rgb), .55);
}

.modal-foot .foot-left {
  margin-right: auto;
}

.modal.modal-wide .modal-foot {
  border-radius: 0 0 20px 20px;
}

/* Formulario de ingreso */
.entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr);
  gap: 22px;
  align-items: start;
  padding: 0 22px 20px;
}

.entry-col {
  min-width: 0;
}

.entry-col.side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comm-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.comm-editor .segmented {
  flex: none;
}

.comm-editor .comm-input {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 110px;
}

.comm-editor .comm-input .input {
  flex: 1;
  min-width: 0;
}

.comm-editor .comm-unit {
  font-size: 11px;
  color: var(--ink-3);
  flex: none;
}

.comm-result {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--accent-wash);
  border: 1px solid var(--accent-line-4);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.chip {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  font-size: 10px;
  color: var(--ink-2);
  transition: background .15s, border-color .15s, color .15s;
}

.chip:hover {
  background: var(--accent-wash);
  border-color: var(--accent-line-5);
  color: var(--accent-deep);
}

.quick-services {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.quick-service-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-service {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 7px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: left;
  transition: border-color .15s, background .15s;
}

.quick-service span {
  font-size: 11px;
  font-weight: 500;
}

.quick-service small {
  font-size: 9.5px;
  color: var(--ink-3);
}

.quick-service:hover {
  border-color: var(--accent-line-6);
  background: var(--accent-wash);
}

.summary-card {
  padding: 17px 18px;
  background: linear-gradient(165deg, var(--accent-surface), var(--accent-wash-5));
  border: 1px solid var(--accent-line-3);
  border-radius: var(--radius);
}

.summary-card .sc-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--accent-text-3);
  margin-bottom: 12px;
}

.sc-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--ink-2);
}

.sc-row strong {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.sc-row.neg strong {
  color: var(--accent-deep);
}

.sc-net {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--soft-divider);
  font-size: 11.5px;
  color: var(--ink-2);
}

.sc-net strong {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.sc-progress {
  margin-top: 10px;
}

.sp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.summary-note {
  margin-top: 9px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.summary-note.warn {
  color: var(--red);
  font-weight: 500;
}

.mini-info {
  padding: 11px 13px;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.mini-info strong {
  color: var(--ink-2);
  font-weight: 600;
}

/* Detalle */
.detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: linear-gradient(150deg, var(--accent-surface), var(--accent-wash-6));
  border: 1px solid var(--accent-line-3);
  border-radius: 13px;
}

.dh-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent-text-3);
}

.dh-value {
  margin-top: 1px;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.dh-meta {
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-3);
  text-align: right;
}

.detail-rows {
  display: flex;
  flex-direction: column;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-2);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row>span {
  color: var(--ink-3);
  font-size: 11px;
}

.detail-row strong {
  font-weight: 500;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.detail-row.total {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.detail-row.total strong {
  font-size: 14px;
  font-weight: 600;
}

/* Pago */
.pay-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  margin-bottom: 14px;
  background: linear-gradient(150deg, var(--accent-surface), var(--accent-wash-6));
  border: 1px solid var(--accent-line-3);
  border-radius: 13px;
}

.pay-hero .dh-value {
  font-size: 26px;
}

.pay-lines {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.pay-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11.5px;
}

.pay-line:last-child {
  border-bottom: 0;
}

.pay-line span {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pay-line strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pay-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pay-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.pay-preview .pp-text {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.45;
}

.pay-preview .pp-text strong {
  color: var(--ink);
  font-weight: 600;
}

.pay-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

/* ══════════════════════════ AJUSTES ══════════════════════════ */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row .sr-title {
  font-size: 12.5px;
  font-weight: 500;
}

.setting-row .sr-desc {
  margin-top: 1px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--ink-3);
}

.settings-note {
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

.theme-pick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.theme-option:hover {
  border-color: var(--accent-line-6);
}

.theme-option:has(input:checked) {
  background: var(--accent-wash);
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--focus-glow);
}

.theme-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-option:focus-within {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

.theme-swatch {
  display: flex;
  flex: none;
  gap: 2px;
}

.theme-swatch i {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(var(--shadow-rgb), .12);
}

/* ══════════════════════════ CARGA ══════════════════════════ */

.load-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 130;
  height: 3px;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}

.load-bar.is-on {
  opacity: 1;
}

.load-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loadSlide 1s ease-in-out infinite;
}

@keyframes loadSlide {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(350%);
  }
}

/* ══════════════════════════ TOAST / CONFIRM ══════════════════════════ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 10px 15px;
  background: var(--ink);
  color: var(--text-on-dark-soft);
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.toast svg {
  color: var(--toast-ok);
}

.toast.error {
  background: var(--toast-err-bg);
}

.toast.error svg {
  color: var(--toast-err);
}

.confirm-modal {
  max-width: 420px;
}

.confirm-modal .modal-head {
  padding-bottom: 8px;
}

.confirm-modal .modal-body {
  padding-bottom: 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.confirm-modal .modal-foot {
  border-radius: 0 0 20px 20px;
}

/* ══════════════════════════ RESPONSIVE ══════════════════════════ */

@media (max-width: 1180px) {
  .grid-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2-1,
  .grid-3-1,
  .grid-1-2 {
    grid-template-columns: 1fr;
  }

  .heatmap-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .heatmap-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 20px 20px 108px;
  }

  .top-action {
    display: none;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    padding: 6px 6px calc(6px + var(--safe-bottom));
    background: var(--bottom-nav);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .bottom-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-2);
    font-size: 9.5px;
    font-weight: 500;
    min-height: 48px;
  }

  .bottom-item svg {
    width: 20px;
    height: 20px;
    opacity: .72;
  }

  .bottom-item.active {
    background: var(--accent-wash);
    color: var(--accent-deep);
  }

  .bottom-item.active svg {
    opacity: 1;
  }

  .bottom-item .nav-dot {
    position: absolute;
    top: 6px;
    left: calc(50% + 5px);
    margin: 0;
    width: 6px;
    height: 6px;
  }

  .fab {
    position: fixed;
    right: 14px;
    bottom: calc(74px + var(--safe-bottom));
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 16px 11px 13px;
    border: 1px solid var(--accent-strong);
    border-radius: 999px;
    background: var(--accent-strong);
    color: var(--text-on-accent);
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 10px 24px -10px var(--accent-shadow-2), inset 0 1px 0 var(--inset-highlight);
  }

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

  .fab svg {
    width: 18px;
    height: 18px;
  }

  .toast {
    bottom: calc(84px + var(--safe-bottom));
  }

  .modal-foot {
    border-radius: 0 0 20px 20px;
  }
}

@media (max-width: 360px) {
  .bottom-item {
    font-size: 9px;
    letter-spacing: -.1px;
  }
}

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
  }

  .hero-side {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero-stat {
    padding: 7px 9px;
  }

  .hero-stat strong {
    font-size: 13.5px;
  }

  .onboarding-body {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px 19px;
  }

  .grid-1-1 {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .entry-grid {
    grid-template-columns: 1fr;
    padding: 0 18px 18px;
  }

  .entry-col.side {
    order: -1;
  }

  .entry-col.side .mini-info {
    display: none;
  }

  .entry-col.side .summary-card {
    padding: 14px 16px;
  }

  .summary-card .sc-title {
    margin-bottom: 8px;
  }

  .sc-net strong {
    font-size: 18px;
  }

  .modal.modal-wide .modal-head {
    padding-left: 18px;
    padding-right: 18px;
  }

  .modal.modal-wide .modal-foot {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13.5px;
  }

  .main {
    padding: 16px 14px 104px;
  }

  .topbar {
    margin-bottom: 16px;
    gap: 10px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .page-head p {
    font-size: 11.5px;
  }

  .eyebrow {
    font-size: 9.5px;
  }

  .stack {
    gap: 12px;
  }

  .hero {
    padding: 19px 18px;
    border-radius: 17px;
  }

  .hero-value {
    font-size: 46px;
  }

  .hero-actions {
    margin-top: 14px;
  }

  .hero-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero::after {
    display: none;
  }

  .grid-kpi {
    gap: 9px;
  }

  .kpi {
    padding: 13px 14px 12px;
    border-radius: 14px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .kpi-label {
    font-size: 10.5px;
  }

  .kpi-meta {
    font-size: 10px;
  }

  .card {
    border-radius: 14px;
  }

  .card-head {
    padding: 14px 15px 0;
  }

  .card-head.with-line {
    padding-bottom: 11px;
  }

  .card-body {
    padding: 14px 15px 15px;
  }

  .card-title {
    font-size: 13px;
  }

  .card-sub {
    font-size: 10.5px;
  }

  .chart-wrap {
    height: 235px;
    padding: 4px 10px 12px;
  }

  .chart-wrap.sm {
    height: 210px;
  }

  .chart-wrap.xs {
    height: 185px;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    padding: 7px 8px;
    font-size: 11.5px;
    text-align: center;
  }

  .tabs.scroll .tab {
    flex: 0 0 auto;
  }

  .range-bar {
    width: 100%;
    justify-content: space-between;
  }

  .range-bar>.segmented {
    flex: 1;
  }

  .range-bar>.segmented button {
    flex: 1;
  }

  .range-bar>.range-nav {
    flex: 1;
    justify-content: space-between;
  }

  .range-label {
    flex: 1;
    min-width: 0;
  }

  .search {
    width: 100%;
    min-width: 0;
  }

  .entry-item {
    grid-template-columns: 42px minmax(0, 1fr) 14px;
    grid-template-areas:
      "date info chev"
      "money money money";
    gap: 7px 11px;
    padding: 12px 14px;
  }

  .entry-date {
    grid-area: date;
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }

  .entry-date strong {
    font-size: 15px;
  }

  .entry-info {
    grid-area: info;
  }

  .entry-chev {
    grid-area: chev;
  }

  .entry-money {
    grid-area: money;
    justify-content: space-between;
    gap: 8px;
    padding-top: 7px;
    border-top: 1px dashed var(--line-soft);
  }

  .entry-money span {
    align-items: flex-start;
    min-width: 0;
  }

  .entry-money strong {
    font-size: 12px;
  }

  .entry-tags {
    margin-top: 4px;
  }

  .list-foot {
    padding: 11px 14px;
    font-size: 10.5px;
  }

  .pay-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 13px 14px;
  }

  .pay-top {
    grid-column: 1 / -1;
  }

  .pay-amounts {
    align-items: flex-start;
  }

  .pay-amounts strong {
    font-size: 16px;
  }

  .pay-status,
  .pay-actions {
    grid-column: 2;
    justify-content: flex-end;
  }

  .pay-actions .btn {
    padding: 7px 11px;
    font-size: 11.5px;
  }

  .pay-progress {
    max-width: none;
  }

  .pay-close-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 15px 16px;
  }

  .close-actions {
    justify-content: flex-start;
  }

  .close-stats {
    gap: 14px;
  }

  .heatmap-days {
    grid-template-rows: repeat(7, 19px);
    padding-top: 18px;
  }

  .heatmap-days span {
    height: 19px;
  }

  .heatmap-grid {
    grid-template-rows: repeat(7, 19px);
    grid-auto-columns: 19px;
  }

  .hm-cell {
    width: 19px;
    height: 19px;
  }

  .heatmap-months {
    grid-auto-columns: 19px;
  }

  .heatmap-legend {
    padding-left: 25px;
  }

  .heatmap-stats {
    gap: 12px 16px;
  }

  .hour-heat {
    grid-template-columns: 27px repeat(13, minmax(0, 1fr));
    gap: 3px;
  }

  .hh-col {
    font-size: 8px;
  }

  .hh-row {
    font-size: 9px;
  }

  .hh-cell {
    height: 24px;
  }

  .manage-row {
    padding: 12px 15px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .manage-main {
    flex: 1 1 150px;
  }

  .manage-side {
    gap: 6px;
  }

  .manage-actions {
    margin-left: auto;
  }

  .onboarding-copy h2 {
    font-size: 18.5px;
  }

  .setup-step {
    padding: 8px 10px;
  }

  .modal-root {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 20px;
    border-bottom: 0;
    margin: auto;
  }

  .modal.modal-wide {
    max-width: 100%;
  }

  .modal-head {
    padding: 17px 16px 12px;
  }

  .modal-head h3 {
    font-size: 16px;
  }

  .modal-body {
    padding: 0 16px 18px;
  }

  .modal-foot {
    padding: 11px 16px calc(11px + var(--safe-bottom));
    border-radius: 0;
  }

  .modal.modal-wide .modal-head {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal.modal-wide .modal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .entry-grid {
    padding: 0 16px 16px;
    gap: 16px;
  }

  .confirm-root {
    align-items: center;
    padding: 18px;
  }

  .confirm-modal {
    border-radius: 18px;
    border-bottom: 1px solid var(--line);
    max-height: calc(100vh - 36px);
  }

  .confirm-modal .modal-foot {
    border-radius: 0 0 18px 18px;
    padding-bottom: 13px;
  }

  .toast {
    bottom: calc(76px + var(--safe-bottom));
  }

  .detail-hero {
    padding: 13px 14px;
  }

  .dh-value {
    font-size: 23px;
  }

  .pay-hero {
    padding: 13px 14px;
  }

  .footer-note {
    display: none;
  }
}

@media (max-width: 380px) {
  .hero-value {
    font-size: 40px;
  }

  .kpi-value {
    font-size: 20px;
  }

  .tab {
    font-size: 10.5px;
    padding: 7px 5px;
  }

  .entry-money strong {
    font-size: 11.5px;
  }

  .heatmap-grid {
    grid-auto-columns: 18px;
    grid-template-rows: repeat(7, 18px);
  }

  .hm-cell {
    width: 18px;
    height: 18px;
  }

  .heatmap-days {
    grid-template-rows: repeat(7, 18px);
  }

  .heatmap-days span {
    height: 18px;
  }
}

.combobox {
  position: relative;
}

.combobox>.input,
.combobox>input[type="search"] {
  position: relative;
  z-index: 2;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.combobox-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  z-index: 10;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
  width: 100%;
  margin-top: -1px;
}

.combobox-item {
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  text-align: left;
  width: 100%;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  transition: background .12s;
}

.combobox-item:hover {
  background: var(--accent-wash);
  border-color: var(--line-soft);
}

/* ══════════════════════════ FIN ══════════════════════════ */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ══════════════════════════════════════════════════════════════════
   AMPLIACIONES · pagos, listas y estadísticas
   ══════════════════════════════════════════════════════════════════ */

.chart-wrap.tall {
  height: 330px;
}

.avatar svg {
  width: 15px;
  height: 15px;
}

/* Lista de pendientes en Inicio */
.pay-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 4px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
  transition: background .14s;
}

.pay-mini:last-child {
  border-bottom: 0;
}

.pay-mini:hover {
  background: var(--panel-soft);
}

.pm-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.pm-info strong {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-info small {
  font-size: 10.5px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
}

.pm-side strong {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Agrupación de ingresos por día */
.day-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.day-group-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.day-group-head>div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.day-group-head strong {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.day-group-head span {
  font-size: 10.5px;
  color: var(--ink-3);
}

.dg-money {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
  flex: none;
}

.dg-money span {
  font-size: 10px;
  color: var(--ink-3);
}

.dg-money strong {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.list-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  font-size: 11px;
  color: var(--ink-3);
}

.list-caption strong {
  color: var(--ink);
  font-weight: 600;
}

/* Motivos de pago */
.pay-progress-lbl {
  margin-top: 4px;
  font-size: 9.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.pay-reasons {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
  padding-top: 9px;
  border-top: 1px dashed var(--line-soft);
}

.pay-reason-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-size: 10.5px;
  color: var(--ink-2);
}

.pay-reason-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pay-reason-line b {
  font-weight: 600;
  color: var(--ink);
}

.pay-reason-line strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.pay-reason-more {
  font-size: 10px;
  color: var(--ink-3);
}

.pay-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--ink-3);
}

.pay-note svg {
  width: 12px;
  height: 12px;
}

.pay-row.status-paid .pay-reason-line strong {
  color: var(--green);
}

.pay-row.status-paid .pay-reasons {
  border-top-color: var(--green-line);
}

.pay-row.status-partial .pay-amounts strong {
  color: var(--gold);
}

.pay-row.status-pending .pay-amounts strong {
  color: var(--accent-deep);
}

/* Filas de detalle clicables */
button.detail-row {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}

button.detail-row:last-child {
  border-bottom: 0;
}

/* Tablas de estadísticas */
.grid-kpi .kpi-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .chart-wrap.tall {
    height: 300px;
  }

  .pay-reason-line {
    font-size: 10px;
  }

  .day-group-head strong {
    font-size: 12px;
  }

  .list-caption {
    font-size: 10px;
  }

  .grid-kpi .kpi-value {
    font-size: 19px;
  }

  .pm-info small {
    font-size: 10px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   REPORTE · calendario  (pegar al final de tu hoja de estilos)
   ══════════════════════════════════════════════════════════════════ */

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.cal-week {
  margin-bottom: 6px;
}

.cal-week span {
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
}

.cal-cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background .15s, border-color .15s, color .15s;
}

.cal-cell.is-blank {
  border-color: transparent;
  background: transparent;
}

button.cal-cell:hover {
  background: var(--accent-wash);
  border-color: var(--accent-line-5);
}

.cal-cell.is-today {
  border-color: var(--ink);
}

.cal-cell.is-selected {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--text-on-accent);
}

.cal-dot {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--accent);
}

.cal-cell.is-selected .cal-dot {
  background: var(--text-on-accent);
}

.rep-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.rep-kpis .kpi-value {
  font-size: 17px;
}

@media (max-width: 640px) {
  .rep-kpis {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .rep-foot {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .rep-foot .foot-left,
  .rep-foot .btn,
  .rep-foot .segmented {
    width: 100%;
  }

  .rep-foot .segmented button {
    flex: 1;
    width: auto;
  }
}/* meds app extras */
.chip.active{background:var(--accent-soft);color:var(--accent-deep);border-color:var(--accent-line)}
.time-row .btn{flex:0 0 auto}
