/* Dali · estilos del portal. Mobile first: las reglas base son para teléfono
   y los @media agregan el diseño de tablet y escritorio. */

:root {
  --ink: #0a0f12;
  --slate: #6c6a7a;
  --slate-soft: #8f8d9c;
  --mist: #f1f2f2;
  --white: #ffffff;
  --rose: #cd8796;
  --rose-ink: #9c5466;      /* rosa oscuro para texto: contraste AA sobre blanco */
  --rose-tint: #f7e9ec;
  --line: #e2e2e6;
  --ok: #2f7d5b;
  --ok-tint: #e6f3ec;
  --warn: #9a6200;
  --warn-tint: #fdf1dc;
  --danger: #b23a48;
  --danger-tint: #fbe8ea;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(10, 15, 18, .05), 0 6px 18px rgba(10, 15, 18, .06);
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --bottom-nav: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--mist);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--rose-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-family: var(--font-display); font-weight: 600; font-size: 2rem; letter-spacing: .2px; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--slate); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; border-radius: 6px; }

/* --- Estructura ----------------------------------------------------------- */
.app { min-height: 100vh; padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 16px); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top));
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand span { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; font-style: italic; }
.topbar .spacer { flex: 1; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  font: inherit; font-weight: 700; cursor: pointer;
}
.icon-btn:hover { border-color: var(--rose); }
.main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 1rem; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin: .25rem 0 1rem; }
.page-head p { margin: 0; color: var(--slate); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.back { display: inline-flex; align-items: center; gap: .25rem; font-size: .9rem; margin-bottom: .25rem; color: var(--slate); }

/* Navegación inferior (móvil) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottom-nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--white); border-top: 1px solid var(--line);
}
.bottom-nav a, .bottom-nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: inherit; font-size: .7rem; font-weight: 600; color: var(--slate);
  background: none; border: 0; cursor: pointer; min-width: 0;
}
.bottom-nav a:hover { text-decoration: none; color: var(--ink); }
.bottom-nav .is-active { color: var(--ink); }
.bottom-nav .is-active svg { color: var(--rose); }
.bottom-nav svg { width: 24px; height: 24px; }
.bottom-nav .cta span.dot {
  display: grid; place-items: center; width: 48px; height: 48px; margin-top: -18px;
  border-radius: 50%; background: var(--ink); color: var(--white); box-shadow: 0 6px 16px rgba(10, 15, 18, .25);
}
.bottom-nav .cta span.dot svg { color: var(--rose); }

.sidebar { display: none; }

/* Hoja "Más" */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; background: var(--white); }
.sheet::backdrop { background: rgba(10, 15, 18, .45); }
.sheet nav { display: grid; padding: .5rem 0 calc(1rem + env(safe-area-inset-bottom)); }
.sheet nav a, .sheet nav button {
  display: flex; align-items: center; gap: .75rem; padding: .85rem 1.25rem;
  color: var(--ink); font: inherit; font-weight: 600; background: none; border: 0; text-align: left; cursor: pointer; width: 100%;
}
.sheet nav a:hover, .sheet nav button:hover { background: var(--mist); text-decoration: none; }
.sheet .grabber { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: .6rem auto .25rem; }
.sheet form { margin: 0; }

/* --- Componentes ------------------------------------------------------------ */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; min-width: 0; }
.card > h2 { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card > h2 a { font-size: .85rem; font-weight: 600; }
.grid { display: grid; gap: 1rem; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat { background: var(--white); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); min-width: 0; }
.stat .label { font-size: .78rem; color: var(--slate); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat .value { font-size: 1.45rem; font-weight: 800; overflow-wrap: anywhere; }
.stat.accent { background: var(--ink); color: var(--white); }
.stat.accent .label { color: #c9c7d3; }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.quick a {
  display: flex; flex-direction: column; gap: .35rem; padding: .9rem; border-radius: var(--radius);
  background: var(--white); color: var(--ink); box-shadow: var(--shadow); font-weight: 700; min-width: 0;
}
.quick a:hover { text-decoration: none; outline: 2px solid var(--rose-tint); }
.quick a small { font-weight: 500; }
.quick svg { width: 26px; height: 26px; color: var(--rose); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; overflow-wrap: anywhere; }
.list a.row { display: flex; align-items: center; gap: .75rem; color: inherit; width: 100%; min-width: 0; }
.list a.row:hover { text-decoration: none; }
.list a.row:hover .title { color: var(--rose-ink); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.pos { color: var(--ok); }
.neg { color: var(--danger); }

.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--mist); color: var(--slate); white-space: nowrap; }
.badge.low, .badge.danger { background: var(--danger-tint); color: var(--danger); }
.badge.ok { background: var(--ok-tint); color: var(--ok); }
.badge.warn { background: var(--warn-tint); color: var(--warn); }
.badge.rose { background: var(--rose-tint); color: var(--rose-ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--ink); color: var(--white);
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn.rose { background: var(--rose); color: var(--ink); }
.btn.ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--white); color: var(--danger); border-color: #efc4ca; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: .35rem .8rem; font-size: .85rem; }

/* Formularios */
.form { display: grid; gap: .9rem; }
.field { display: grid; gap: .3rem; min-width: 0; align-content: start; }
.field > * { min-width: 0; }
.field label, .label-text { font-weight: 600; font-size: .9rem; }
.field .help { font-size: .8rem; color: var(--slate); }
.field .errorlist { color: var(--danger); }
.input {
  width: 100%; min-height: 46px; padding: .6rem .8rem;
  font: inherit; font-size: 16px; /* evita zoom en iOS */
  color: var(--ink); background: var(--white);
  border: 1px solid #d4d3da; border-radius: var(--radius-sm);
}
.input:focus { border-color: var(--rose); outline: 3px solid var(--rose-tint); }
textarea.input { min-height: 70px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
.check { width: 22px; height: 22px; accent-color: var(--rose-ink); }
.check-row { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.row2 { display: grid; gap: .9rem; grid-template-columns: minmax(0, 1fr); }
.errorlist { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.form-errors { background: var(--danger-tint); color: var(--danger); border-radius: var(--radius-sm); padding: .75rem 1rem; font-weight: 600; }
.form-errors ul { margin: 0; padding-left: 1rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; margin-top: .5rem; }
.form-actions .btn { flex: 1 1 auto; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.segmented > div, .segmented li { display: contents; }
.segmented label { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; background: var(--white); }
.segmented input { accent-color: var(--rose-ink); }
.segmented label:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--white); }

/* Líneas dinámicas (materiales, productos de una orden) */
.lines { display: grid; gap: .6rem; }
.line {
  display: grid; gap: .5rem; grid-template-columns: minmax(0, 1fr) 44px;
  align-items: start; padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fcfcfc;
}
.line > .field:first-of-type { grid-column: 1 / -1; }
.line.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
/* Etiquetas de una sola línea y altura fija: así el botón × queda a la altura de los campos. */
.line .field label { font-size: .75rem; color: var(--slate); height: 1.15rem; line-height: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line .remove { margin-top: calc(1.15rem + .3rem); width: 44px; height: 46px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--white); color: var(--danger); font-size: 1.2rem; cursor: pointer; }
.line.is-removed { display: none; }
.line .delete-box { display: none; }

/* Filtros y búsqueda */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters .input { flex: 1 1 180px; min-height: 42px; }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; margin-bottom: .75rem; scrollbar-width: none; }
.chips a { flex: 0 0 auto; padding: .4rem .85rem; border-radius: 999px; background: var(--white); border: 1px solid var(--line); color: var(--ink); font-size: .85rem; font-weight: 600; }
.chips a.is-active { background: var(--ink); color: var(--white); border-color: var(--ink); }
.chips a:hover { text-decoration: none; }

/* Tablas: en móvil se ven como tarjetas */
.table-wrap { width: 100%; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .4px; color: var(--slate); padding: .5rem; }
table.data td { padding: .6rem .5rem; border-top: 1px solid var(--line); vertical-align: top; }
table.data .r { text-align: right; }
@media (max-width: 719px) {
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { padding: .6rem 0; border-top: 1px solid var(--line); }
  table.data tr:first-child { border-top: 0; }
  table.data td { border: 0; padding: .15rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  table.data td::before { content: attr(data-label); color: var(--slate); font-size: .8rem; font-weight: 600; text-align: left; }
  table.data td.r { text-align: right; }
  table.data td.main-cell { font-weight: 700; text-align: left; }
  table.data td.main-cell::before { display: none; }
}

.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem 1rem; margin: 0; }
.kv dt { color: var(--slate); }
.kv dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: 1rem; }
.empty { text-align: center; padding: 1.5rem 1rem; color: var(--slate); }
.empty .btn { margin-top: .75rem; }

.messages { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.messages li { padding: .75rem 1rem; border-radius: var(--radius-sm); font-weight: 600; background: var(--white); box-shadow: var(--shadow); border-left: 4px solid var(--slate); }
.messages .success { border-left-color: var(--ok); }
.messages .error { border-left-color: var(--danger); color: var(--danger); }
.messages .warning { border-left-color: var(--warn); }

.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 600; }
.alert.warn { background: var(--warn-tint); color: var(--warn); }
.alert.info { background: var(--rose-tint); color: var(--rose-ink); }
.alert.danger { background: var(--danger-tint); color: var(--danger); }

.service-pick { display: grid; gap: .6rem; }
.service-pick a { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: 1rem; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); font-weight: 700; }
.service-pick a:hover { text-decoration: none; outline: 2px solid var(--rose); }
.service-pick small { display: block; font-weight: 500; }

.bar { height: 6px; border-radius: 3px; background: var(--mist); overflow: hidden; margin-top: .35rem; }
.bar span { display: block; height: 100%; background: var(--rose); width: 0; }
.bar .w10 { width: 10%; }
.bar .w20 { width: 20%; }
.bar .w30 { width: 30%; }
.bar .w40 { width: 40%; }
.bar .w50 { width: 50%; }
.bar .w60 { width: 60%; }
.bar .w70 { width: 70%; }
.bar .w80 { width: 80%; }
.bar .w90 { width: 90%; }
.bar .w100 { width: 100%; }

/* --- Guías (onboarding) ------------------------------------------------------ */
.tour { border: 0; padding: 0; width: min(92vw, 440px); border-radius: 22px; background: var(--white); color: var(--ink); box-shadow: 0 20px 60px rgba(10, 15, 18, .35); }
.tour::backdrop { background: rgba(10, 15, 18, .55); }
.tour .tour-head { background: var(--ink); color: var(--white); padding: 1.25rem 1.25rem 1rem; display: flex; align-items: center; gap: .75rem; }
.tour .tour-head img { width: 44px; height: 44px; }
.tour .tour-head h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; margin: 0; }
.tour .tour-body { padding: 1.1rem 1.25rem .5rem; }
.tour .step { display: none; }
.tour .step.is-current { display: block; }
.tour .step h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.tour .step ul { padding-left: 1.1rem; margin: 0 0 .5rem; }
.tour .step li { margin-bottom: .3rem; }
.tour .tour-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1.25rem 1.25rem; }
.tour .dots { display: flex; gap: .35rem; }
.tour .dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tour .dots span.is-current { background: var(--rose); width: 20px; border-radius: 4px; }

/* --- Login ------------------------------------------------------------------ */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background: var(--ink); }
.auth .panel { width: 100%; max-width: 400px; background: var(--white); border-radius: 22px; padding: 2rem 1.5rem; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.auth .logo { display: block; width: 96px; margin: 0 auto .5rem; }
.auth h1 { text-align: center; font-style: italic; font-size: 2.4rem; margin-bottom: .1rem; }
.auth .tagline { text-align: center; color: var(--slate); margin-bottom: 1.5rem; }

.help-section { scroll-margin-top: 80px; }
.center { text-align: center; }

/* --- Tablet ------------------------------------------------------------------ */
@media (min-width: 600px) {
  .row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Campos lado a lado: etiqueta, campo, ayuda y errores comparten filas (subgrid),
     así un texto de ayuda o una etiqueta larga no desalinea el campo vecino. */
  @supports (grid-template-rows: subgrid) {
    .row2 > .field { grid-row: span 5; grid-template-rows: subgrid; row-gap: .3rem; }
  }
  @supports not (grid-template-rows: subgrid) {
    .row2 { align-items: start; }
  }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .line { grid-template-columns: minmax(0, 1fr) 140px 44px; }
  .line > .field:first-of-type { grid-column: auto; }
  .line.three { grid-template-columns: minmax(0, 1fr) 130px 130px 44px; }
  .form-actions .btn { flex: 0 0 auto; }
  h1 { font-size: 2.3rem; }
}

/* --- Escritorio -------------------------------------------------------------- */
@media (min-width: 960px) {
  .app { padding-bottom: 2rem; padding-left: 248px; }
  .bottom-nav { display: none; }
  .topbar .brand { display: none; }
  .sidebar {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 25;
    background: var(--ink); color: var(--white); padding: 1.25rem .9rem; overflow-y: auto;
  }
  .sidebar .brand { color: var(--white); margin: 0 .5rem 1.25rem; }
  .sidebar .brand img { width: 44px; height: 44px; }
  .sidebar .brand span { font-size: 2rem; }
  .sidebar .group { font-size: .7rem; text-transform: uppercase; letter-spacing: .8px; color: var(--slate-soft); margin: 1rem .75rem .35rem; }
  .sidebar a, .sidebar button {
    display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: var(--radius-sm);
    color: #d8d7df; font: inherit; font-weight: 600; font-size: .95rem; background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
  }
  .sidebar a:hover, .sidebar button:hover { background: rgba(255, 255, 255, .06); color: var(--white); text-decoration: none; }
  .sidebar a.is-active { background: rgba(205, 135, 150, .16); color: var(--white); }
  .sidebar a.is-active svg { color: var(--rose); }
  .sidebar svg { width: 20px; height: 20px; flex: 0 0 auto; }
  .sidebar .cta { background: var(--rose); color: var(--ink); margin-bottom: .5rem; justify-content: center; }
  .sidebar .cta:hover { background: var(--rose); color: var(--ink); opacity: .92; }
  .sidebar .bottom { margin-top: auto; padding-top: 1rem; }
  .sidebar form { margin: 0; }
  .main { padding: 1.5rem 2rem; }
  .cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
  .narrow { max-width: 720px; }
}

.void-inline { display: flex; gap: .35rem; align-items: center; justify-content: flex-end; }
.void-inline .input { min-height: 36px; width: 9rem; font-size: 14px; padding: .3rem .5rem; }
a.help { display: inline-block; font-size: .8rem; margin-top: .3rem; }

/* --- Finanzas: navegación por mes, KPIs y gráficos ----------------------------- */
:root {
  --series-income: #5b4fc4;   /* validado (dataviz): contraste ≥3:1 y separable con daltonismo */
  --series-expense: #d0607a;
  --series-income-prev: #c9c4ef;
  --series-expense-prev: #f0c6cf;
}
.month-nav { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.month-nav .month-name { font-weight: 800; font-size: 1.1rem; min-width: 9.5rem; text-align: center; }
.month-nav a.icon-btn { font-size: 1.3rem; text-decoration: none; }
.icon-btn.is-disabled { opacity: .35; cursor: default; }
.kpi-sub { font-size: .8rem; margin-top: .15rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: baseline; }
.stat.accent .kpi-sub .muted { color: #c9c7d3; }
.trend { font-weight: 800; }
.trend.good { color: var(--ok); }
.trend.bad { color: var(--danger); }
.stat.accent .trend.good { color: #8fd5b3; }
.stat.accent .trend.bad { color: #f2a3ad; }
.stat .value a { font-size: 1rem; }

.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--slate); margin-bottom: .75rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.key.income { background: var(--series-income); }
.key.expense { background: var(--series-expense); }
.key.income.prev { background: var(--series-income-prev); }
.key.expense.prev { background: var(--series-expense-prev); }

.vchart { --axis: 46px; }
.vchart-plot { position: relative; height: 190px; margin-left: var(--axis); margin-top: .5rem; }
.gridline { position: absolute; left: 0; right: 0; bottom: var(--p, 0); border-top: 1px solid var(--line); }
.gridline span { position: absolute; right: calc(100% + 6px); transform: translateY(-50%); font-size: .7rem; color: var(--slate); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vchart-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.vcol { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-radius: 8px 8px 0 0; text-decoration: none; }
.vcol:hover, .vcol:focus-visible { background: rgba(108, 106, 122, .08); text-decoration: none; }
.vcol.is-selected { background: var(--rose-tint); }
.bar { display: block; width: min(16px, 34%); height: var(--p, 0); min-height: 0; border-radius: 4px 4px 0 0; }
.bar.income { background: var(--series-income); }
.bar.expense { background: var(--series-expense); }
.vchart-x { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-left: var(--axis); margin-top: .35rem; font-size: .75rem; color: var(--slate); text-align: center; }
.vchart-x .is-selected { color: var(--ink); font-weight: 800; }
.vtip {
  position: absolute; z-index: 5; top: 0; transform: translateX(-50%); pointer-events: none;
  background: var(--ink); color: var(--white); border-radius: 10px; padding: .5rem .7rem; font-size: .78rem; line-height: 1.4;
  box-shadow: var(--shadow); white-space: nowrap;
}
.vtip strong { display: block; margin-bottom: .15rem; }
.vtip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: .3rem; }
.table-view { margin-top: .75rem; }
.table-view summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--rose-ink); }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.hbar-head { display: flex; justify-content: space-between; gap: .75rem; font-size: .9rem; margin-bottom: .3rem; }
.hbar-label { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.hbar-track { height: 10px; border-radius: 5px; background: var(--mist); overflow: hidden; }
.hbar-track.thin { height: 6px; margin-top: 3px; }
.hbar { display: block; height: 100%; width: var(--w, 0); border-radius: 0 4px 4px 0; }
.hbar.income { background: var(--series-income); }
.hbar.expense { background: var(--series-expense); }
.hbar.income.prev { background: var(--series-income-prev); }
.hbar.expense.prev { background: var(--series-expense-prev); }
.hbars small { display: block; margin-top: .2rem; font-size: .75rem; }
