/* ==========================================================================
   VALENTINA GROWTH OS · v6.0 (HEALEN CLARITY EDITION)
   Exact layout proportions, calm breathing room & compacted metrics of Healen OS
   Combined with Valentina's unified Light/Dark palette, Rose-Blush UI brand
   and vivid semantic data tokens (Green #10B981, Yellow #F59E0B, Orange #F97316)
   ========================================================================== */

:root,
html[data-theme="light"] {
  --bg: #F6F5F2;
  --bg-elev: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F1EFEA;
  --surface-3: #E8E5DE;
  --ink: #111312;
  --ink-2: #3D423F;
  --muted: #6E7470;
  --subtle: #9CA29E;
  --line: rgba(17, 19, 18, 0.08);
  --line-soft: rgba(17, 19, 18, 0.055);

  /* Brand UI Accent (Rose / Blush Valentina) */
  --brand: #D66D84;
  --brand-2: #E58C9E;
  --brand-deep: #24151A;
  --brand-soft: rgba(229, 140, 158, 0.14);
  --brand-ring: rgba(214, 109, 132, 0.28);

  /* Semantic Vivid Data Colors (Green, Yellow/Amber, Orange) */
  --ok: #10B981;
  --ok-ink: #047857;
  --ok-soft: #ECFDF5;
  --warn: #F59E0B;
  --warn-ink: #B45309;
  --warn-soft: #FEF3C7;
  --danger: #F97316;
  --danger-ink: #C2410C;
  --danger-soft: #FFEDD5;

  --glass: rgba(255, 255, 255, 0.84);
  --shadow-xs: 0 1px 2px rgba(17, 19, 18, 0.04);
  --shadow-sm: 0 2px 8px rgba(17, 19, 18, 0.04), 0 1px 2px rgba(17, 19, 18, 0.03);
  --shadow-md: 0 12px 32px -12px rgba(17, 19, 18, 0.10), 0 2px 6px rgba(17, 19, 18, 0.04);
  --shadow-lg: 0 24px 60px -20px rgba(17, 19, 18, 0.18), 0 4px 12px rgba(17, 19, 18, 0.06);

  /* Hero Editorial Gradient */
  --hero-bg: linear-gradient(135deg, #23161B 0%, #382129 58%, #522E3B 100%);
  --hero-glow: radial-gradient(360px 220px at 90% -10%, rgba(229, 140, 158, 0.34), transparent 65%);

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --rail: 252px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #0F1110;
  --bg-elev: #171918;
  --surface: #171918;
  --surface-2: #1F2220;
  --surface-3: #282C29;
  --ink: #F4F5F4;
  --ink-2: #C7CCC9;
  --muted: #8E9591;
  --subtle: #636A66;
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.06);

  --brand: #E58C9E;
  --brand-2: #F2A7B6;
  --brand-deep: #1D1317;
  --brand-soft: rgba(229, 140, 158, 0.16);
  --brand-ring: rgba(229, 140, 158, 0.32);

  --ok: #10B981;
  --ok-ink: #34D399;
  --ok-soft: rgba(16, 185, 129, 0.15);
  --warn: #F59E0B;
  --warn-ink: #FBBF24;
  --warn-soft: rgba(245, 158, 11, 0.16);
  --danger: #F97316;
  --danger-ink: #FB923C;
  --danger-soft: rgba(249, 115, 22, 0.16);

  --glass: rgba(23, 25, 24, 0.84);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 14px 34px -12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 28px 64px -20px rgba(0, 0, 0, 0.65);

  --hero-bg: linear-gradient(135deg, #1A1215 0%, #2B1B22 58%, #3F2530 100%);
  --hero-glow: radial-gradient(360px 220px at 90% -10%, rgba(229, 140, 158, 0.25), transparent 65%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.22s ease, color 0.22s ease;
}

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

button {
  cursor: pointer;
  border: 0;
  background: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.025em;
  color: var(--ink);
}

p {
  margin: 0;
}

.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ==========================================================================
   MINIMALIST LOADER OVERLAY
   ========================================================================== */
.vgos-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}

.vgos-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.vgos-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 340px;
  text-align: center;
  padding: 24px;
}

.vgos-loader-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.vgos-loader-bar-track {
  width: 180px;
  height: 4px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.vgos-loader-bar-fill {
  height: 100%;
  width: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.vgos-loader-phrase {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

/* ==========================================================================
   HEALEN OS SHELL (.app, .sidebar, .main, .topbar, .view)
   ========================================================================== */
.app {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.28s var(--ease);
}

.app.is-rail {
  --rail: 72px;
}

/* SIDEBAR */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-right: 1px solid var(--line-soft);
  z-index: 20;
  overflow-y: auto;
  overflow-x: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 14px;
}

.brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-ring);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}

.brand__logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

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

.brand__text strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand__text span {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav__section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtle);
  padding: 6px 12px 2px;
}

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

.nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 13.5px;
  text-align: left;
  width: 100%;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.nav__item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav__item.is-active {
  background: var(--brand-soft);
  color: var(--ink);
  font-weight: 700;
}

.nav__item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--brand);
}

.nav__icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}

.nav__item.is-active .nav__icon {
  color: var(--brand);
}

.nav__label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav__badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.nav__badge--warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.nav__badge--ok {
  background: var(--ok-soft);
  color: var(--ok-ink);
}

.nav__chev {
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.nav__children {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 6px 30px;
  border-left: 1px dashed var(--line);
  margin-left: 20px;
}

.nav__children.is-collapsed {
  display: none;
}

.nav__child {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  transition: all 0.15s ease;
}

.nav__child:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.nav__child.is-active {
  color: var(--ink);
  font-weight: 700;
  background: var(--brand-soft);
}

.sidebar__foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.demo-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
  flex-shrink: 0;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11.5px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.user-meta strong {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta span {
  font-size: 11px;
  color: var(--muted);
}

/* COLLAPSED SIDEBAR (.app.is-rail) */
.app.is-rail .sidebar {
  padding-inline: 10px;
}
.app.is-rail .brand {
  justify-content: center;
  padding-inline: 0;
}
.app.is-rail .brand__text,
.app.is-rail .nav__section-label,
.app.is-rail .nav__label,
.app.is-rail .nav__badge,
.app.is-rail .nav__chev,
.app.is-rail .nav__children,
.app.is-rail .demo-pill__label,
.app.is-rail .user-meta {
  display: none;
}
.app.is-rail .nav__item,
.app.is-rail .demo-pill,
.app.is-rail .sidebar__user {
  justify-content: center;
  padding-inline: 0;
}

/* ==========================================================================
   MAIN COLUMN & TOPBAR
   ========================================================================== */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px clamp(20px, 4vw, 44px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}

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

.topbar__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* COMPANY SWITCHER PILLS */
.company-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  gap: 2px;
}

.company-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.16s var(--ease);
}

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

.company-pill.is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

/* THEME PILL */
.theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.theme-pill:hover {
  border-color: var(--brand);
  color: var(--ink);
}

.theme-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
}

/* BUTTONS */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.16s var(--ease);
  white-space: nowrap;
}

.btn--primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-xs);
}

.btn--primary:hover {
  background: var(--brand);
  color: #FFFFFF;
}

.btn--subtle {
  background: var(--brand-soft);
  color: var(--ink);
  border: 1px solid var(--brand-ring);
}

.btn--subtle:hover {
  background: var(--brand);
  color: #FFFFFF;
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn--sm {
  padding: 5px 11px;
  font-size: 12px;
}

/* ==========================================================================
   CALM CENTERED READING CANVAS (.view) & FLOATING RANGE BAR (.range-bar)
   ========================================================================== */
.view {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 18px clamp(20px, 4vw, 44px) 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

/* HEALEN OS FLOATING RANGE & SEARCH BAR (.range-bar) */
.range-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 10px 16px;
  box-shadow: var(--shadow-sm);
}

.range-presets {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 999px;
  gap: 2px;
}

.range-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s var(--ease);
}

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

.range-pill.is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

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

.range-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: 999px;
}

.range-date span {
  font-weight: 600;
}

.range-date input[type="date"] {
  border: 0;
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-mono);
  outline: none;
}

.range-sep {
  color: var(--subtle);
  font-size: 12px;
}

.range-active-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--ink);
}

.range-search-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.range-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  border: 1px solid transparent;
  padding: 5px 12px;
  border-radius: 999px;
  min-width: 210px;
  color: var(--muted);
  transition: all 0.15s ease;
}

.range-search:focus-within {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  color: var(--ink);
}

.range-search input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 12.5px;
  color: var(--ink);
}

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

.range-search__clear {
  font-size: 14px;
  color: var(--muted);
  padding: 0 2px;
}

/* ==========================================================================
   ROW 1 — SPLIT HERO (.hero, .hero__intro, .panel.today, .evolution-row, .ring)
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: stretch;
}

.hero__intro {
  background: var(--hero-bg);
  color: #FAF8F5;
  border-radius: var(--r-xl);
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--shadow-md);
}

.hero__intro::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-glow);
  pointer-events: none;
}

.hero__intro .eyebrow {
  color: rgba(250, 248, 245, 0.68);
}

.hero__intro h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 29px);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #FFFFFF;
  margin-top: 6px;
}

.hero__sub {
  color: rgba(250, 248, 245, 0.8);
  font-size: 14px;
  line-height: 1.55;
  max-width: 52ch;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  position: relative;
  z-index: 1;
}

.hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12.5px;
  font-weight: 600;
  color: #FAF8F5;
  backdrop-filter: blur(8px);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}

.dot--ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.24);
}

.dot--warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.24);
}

.dot--danger {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.24);
}

/* PANELS (WHITE CARDS WITH BREATHING ROOM) */
.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel__head h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 2px;
}

/* RIGHT HERO CARD: PROYECTOS Y CLIENTES EN EVOLUCIÓN (.evolution-list, .ring) */
.evolution-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.evolution-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: left;
  width: 100%;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}

.evolution-row:hover {
  background: var(--surface-3);
  transform: translateX(2px);
}

.evolution-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.evolution-row__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.evolution-row__top strong {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.evolution-row__meta {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.evolution-row__bar {
  height: 7px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.evolution-row__bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s var(--ease);
}

.evolution-row__bar--ok > span {
  background: var(--ok);
}

.evolution-row__bar--warn > span {
  background: var(--warn);
}

.evolution-row__bar--danger > span {
  background: var(--danger);
}

/* 48x48 CIRCULAR SVG PROGRESS RING (.ring) */
.ring {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.ring svg {
  transform: rotate(-90deg);
  overflow: visible;
}

.ring__track {
  fill: none;
  stroke: var(--line);
}

.ring__value {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.7s var(--ease);
}

.ring--ok .ring__value {
  stroke: var(--ok);
}

.ring--warn .ring__value {
  stroke: var(--warn);
}

.ring--danger .ring__value {
  stroke: var(--danger);
}

.ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ring__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  color: var(--ink);
}

/* ==========================================================================
   ROW 2 — UNIFIED 3-COLUMN FINANCIAL STRIP (.panel.money-strip)
   ========================================================================== */
.money-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.money {
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--line-soft);
}

.money:last-child {
  border-right: 0;
}

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

.money__badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.money__badge--ok {
  background: var(--ok-soft);
  color: var(--ok-ink);
}

.money__badge--warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.money__badge--danger {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.money__value {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}

.money__value--ok {
  color: var(--ok-ink);
}

.money__value--warn {
  color: var(--warn-ink);
}

.money__value--danger {
  color: var(--danger-ink);
}

.money__foot {
  font-size: 12.5px;
  color: var(--muted);
}

/* ==========================================================================
   ROW 3 — TWO ACTIONABLE SUMMARY PANELS (VERTIENTES & PRIORIDADES)
   ========================================================================== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

/* VERTIENTES · DE UN VISTAZO */
.vertientes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vertiente-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) 1.3fr auto;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: left;
  width: 100%;
  transition: all 0.16s var(--ease);
}

.vertiente-row:hover {
  background: var(--surface-3);
  transform: translateX(2px);
}

.vertiente-row__head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.vertiente-row__head strong {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gauge {
  height: 8px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.gauge__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s var(--ease);
}

.gauge__fill--ok {
  background: var(--ok);
}

.gauge__fill--warn {
  background: var(--warn);
}

.gauge__fill--danger {
  background: var(--danger);
}

.vertiente-row__val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ACCIONES · PRIORIDADES DEL PERIODO (.priorities, .priority) */
.priorities {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.priority {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: left;
  width: 100%;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}

.priority:hover {
  transform: translateX(3px);
  background: var(--surface-3);
}

.priority__icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.priority--ok .priority__icon {
  background: var(--ok-soft);
  color: var(--ok-ink);
}

.priority--warn .priority__icon {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.priority--danger .priority__icon {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

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

.priority__body strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.priority__body span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.priority__chev {
  font-size: 18px;
  color: var(--muted);
  font-weight: 600;
}

/* ==========================================================================
   ROW 4 — VISUAL COMPARISON (.bars) & 6-PERIOD TREND (.rev-bars)
   ========================================================================== */
.bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 155px 1fr 90px;
  align-items: center;
  gap: 12px;
}

.bar-row__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.bar-row__track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-row__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s var(--ease);
}

.bar-row__fill--ok {
  background: var(--ok);
}

.bar-row__fill--warn {
  background: var(--warn);
}

.bar-row__fill--danger {
  background: var(--danger);
}

.bar-row__fill--brand {
  background: var(--brand);
}

.bar-row__val {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
}

/* VERTICAL BAR CHART (.rev-bars) */
.rev-bars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: end;
  height: 195px;
  padding: 14px 6px 4px;
}

.rev-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.rev-bar__val {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.rev-bar__track {
  flex: 1;
  width: 100%;
  max-width: 42px;
  background: var(--surface-2);
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.rev-bar__fill {
  width: 100%;
  background: linear-gradient(180deg, var(--ok) 0%, #059669 100%);
  border-radius: 10px;
  transition: height 0.6s var(--ease);
  min-height: 8px;
}

.rev-bar.is-peak .rev-bar__fill {
  background: linear-gradient(180deg, var(--warn) 0%, #D97706 100%);
}

.rev-bar__lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: capitalize;
}

/* ==========================================================================
   CONTABILIDAD (HEALEN OS CAJA CLARITY: .acct-tabs, .acct-focus, .breakdown)
   ========================================================================== */
.acct-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.acct-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1.5px solid var(--line-soft);
  box-shadow: var(--shadow-xs);
  text-align: left;
  transition: all 0.18s var(--ease);
}

.acct-tab:hover {
  border-color: var(--line);
  transform: translateY(-1px);
}

.acct-tab.is-active {
  border-color: var(--ink);
  box-shadow: var(--shadow-md);
}

.acct-tab__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.acct-tab--ok .acct-tab__icon {
  background: var(--ok-soft);
  color: var(--ok-ink);
}

.acct-tab--warn .acct-tab__icon {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.acct-tab--danger .acct-tab__icon {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.acct-tab__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.acct-tab__value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.acct-tab__sub {
  font-size: 12px;
  color: var(--muted);
}

/* SUB-NAVIGATION PILLS FOR CONTABILIDAD 7 SUB-ROUTES */
.subnav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.seg {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  padding: 5px;
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
}

.seg__btn {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s var(--ease);
}

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

.seg__btn.is-active {
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
}

/* 4-CELL FOCUS STRIP (.acct-focus) */
.acct-focus {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.acct-focus__cell {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--line-soft);
}

.acct-focus__cell:last-child {
  border-right: 0;
}

.acct-focus__val {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

/* BREAKDOWN ROWS WITH DASHED HAIRLINE SEPARATORS (.breakdown) */
.breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.breakdown__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.breakdown__row:last-child {
  border-bottom: 0;
}

.breakdown__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.breakdown__cat {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

/* ==========================================================================
   CLEAN TABLES & CARDS FOR OTHER MODULES (MAX 3 SAMPLE ROWS)
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.clean-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.clean-table td {
  padding: 13px 14px;
  border-bottom: 1px dashed var(--line-soft);
  color: var(--ink-2);
  vertical-align: middle;
}

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

.clean-table tbody tr:hover td {
  background: var(--surface-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge--ok {
  background: var(--ok-soft);
  color: var(--ok-ink);
}

.badge--warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.badge--danger {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.badge--brand {
  background: var(--brand-soft);
  color: var(--ink);
}

/* CARDS GRID FOR CLIENTES / PROYECTOS / EMPRESAS */
.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.entity-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.entity-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.entity-card__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
}

/* ==========================================================================
   SLIDE-OVER SHEET / DRAWER (.scrim, .sheet)
   ========================================================================== */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(17, 19, 18, 0.42);
  backdrop-filter: blur(6px);
  display: none;
  justify-content: flex-end;
}

.scrim.is-open {
  display: flex;
}

.sheet {
  width: min(460px, 100vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sheet__head {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sheet__head h2 {
  font-size: 19px;
  margin-top: 2px;
}

.sheet__body {
  padding: 22px 24px;
  flex: 1;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--brand);
  background: var(--surface);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1040px) {
  .hero,
  .grid-2,
  .acct-tabs,
  .cards-grid-3 {
    grid-template-columns: 1fr;
  }
  .money-strip {
    grid-template-columns: 1fr;
  }
  .money {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .acct-focus {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   SECURITY RADAR, ANTI-BYPASS VAULT GATE & REAL-TIME INTRUSION TOAST
   ========================================================================== */
.nav__badge--danger {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.vault-gate {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: color-mix(in srgb, var(--bg) 92%, #000000);
  backdrop-filter: blur(22px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.vault-gate[hidden] {
  display: none !important;
}

.vault-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px 30px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.vault-card__head h2 {
  font-size: 20px;
  margin-top: 2px;
}

.vault-card__sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.vault-error {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid rgba(249, 115, 22, 0.28);
}

.vault-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.intrusion-toast {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 9800;
  width: min(420px, calc(100vw - 32px));
  background: var(--surface);
  border: 1.5px solid var(--danger);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.intrusion-toast[hidden] {
  display: none !important;
}

.intrusion-toast__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.intrusion-toast__title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--danger-ink);
  display: flex;
  align-items: center;
  gap: 7px;
}

.intrusion-toast__meta {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.45;
}

.intrusion-toast__code {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
}

/* ==========================================================================
   EXECUTIVE LOGIN GATE (public/login.html) & SILHOUETTE LOADER
   ========================================================================== */
html[data-theme="light"] .sil-for-dark,
html[data-theme="dark"] .sil-for-light {
  display: none !important;
}

html[data-theme="light"] .ic-sun,
html[data-theme="dark"] .ic-moon {
  display: none !important;
}

.login-only-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
}

.screen-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}

.screen-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.loader-logo-wrap {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
}

.loader-silhouette {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.loader-bar {
  width: 160px;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.loader-fill {
  width: 100%;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  animation: vgosLoadFill 0.55s ease-out forwards;
}

@keyframes vgosLoadFill {
  from { width: 15%; }
  to { width: 100%; }
}

.login-gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.login-topbar {
  position: absolute;
  top: 22px;
  left: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-security-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
}

.sec-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

.login-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 34px 32px 28px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.login-logo-ring {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-ring);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.login-sil {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.login-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.login-title {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.login-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 36ch;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.field-group input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field-group input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

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

.pass-input-wrap input {
  padding-right: 68px;
}

.pass-toggle-btn {
  position: absolute;
  right: 10px;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-soft);
}

.pass-toggle-btn:hover {
  color: var(--ink);
}

.login-error-alert {
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger-ink);
  border: 1px solid rgba(249, 115, 22, 0.3);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}

.btn-primary.login-submit-btn {
  width: 100%;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--brand);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s var(--ease);
}

.btn-primary.login-submit-btn:hover {
  background: var(--ink);
  color: var(--bg);
}

.login-footer {
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}
