@font-face { font-family: 'Montserrat'; src: url('/assets/pulse/fonts/montserrat-latin.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('/assets/pulse/fonts/montserrat-latin.woff2') format('woff2'); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('/assets/pulse/fonts/montserrat-latin.woff2') format('woff2'); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('/assets/pulse/fonts/montserrat-latin.woff2') format('woff2'); font-style: normal; font-weight: 800; font-display: swap; }

/* Módulos Gastos y Pulso */

/* ------- Gastos ------- */
.ops-expenses { display: grid; gap: 18px; }
.expense-totals { display: flex; flex-wrap: wrap; gap: 8px; }
.ops-expenses .chip { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.chip-owed { color: #7b5308; background: #fff4d5; }
.chip-paid { color: #176b50; background: #e6f5ee; }
.expense-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 16px; background: #fff; border: 1px solid var(--line, #d4e2e4); border-radius: 14px; }
.expense-form label { display: grid; gap: 5px; font-size: 12px; font-weight: 700; color: #586d72; }
.expense-form label.grow { flex: 1 1 220px; }
.expense-list { display: grid; background: #fff; border: 1px solid var(--line, #d4e2e4); border-radius: 14px; overflow: hidden; }
.expense-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 120px 150px auto; gap: 14px; align-items: center; padding: 13px 16px; border-bottom: 1px solid #e7edf2; }
.expense-row:last-child { border-bottom: 0; }
.expense-date { font-weight: 700; color: #173139; font-variant-numeric: tabular-nums; }
.expense-main { display: grid; gap: 2px; min-width: 0; }
.expense-main .small { font-size: 11px; }
.expense-amount { font-weight: 800; color: #003f4d; text-align: right; font-variant-numeric: tabular-nums; }
.expense-actions { display: flex; gap: 6px; justify-content: flex-end; }
.btn-danger { color: #9f2f22; }

/* ------- Pulso · centro de comando ------- */
.topbar.topbar-pulse { display: none; }
.page.page-pulse { width: 100%; max-width: none; min-height: 100vh; padding: 18px; background: #052a30; }
.ops-pulse-command {
  --pulse-deep: #06363d;
  --pulse-coral: #e8735e;
  --pulse-cream: #f4ede1;
  --pulse-sage: #9cb06a;
  --pulse-muted: #9fbcbc;
  --pulse-line: rgba(255,255,255,.12);
  min-height: calc(100vh - 36px);
  display: grid;
  grid-template-columns: minmax(330px, .62fr) minmax(460px, 1fr);
  overflow: hidden;
  color: #eaf3f2;
  background: #052a30;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  box-shadow: 0 18px 46px rgba(0,0,0,.2);
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, sans-serif;
}
.pulse-diorama-wrap { min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; background: #0b3a42; }
.pulse-diorama { position: relative; height: 100%; max-width: 100%; aspect-ratio: 941 / 1672; overflow: hidden; }
.pulse-master { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pulse-overlay, .pulse-beacon, .pulse-coin { position: absolute; width: auto; transform: translate(-50%, -100%); pointer-events: none; }
.pulse-overlay { z-index: 1; transition: opacity .35s ease, filter .35s ease; animation: pulse-breathe 4s ease-in-out infinite; }
.pulse-overlay:nth-of-type(3n) { animation-delay: -1.3s; }
.pulse-overlay.pulse-signal-inactive { opacity: .24; filter: saturate(.35) brightness(.76); }
.pulse-overlay.pulse-signal-active { opacity: 1; filter: drop-shadow(0 0 8px rgba(156,176,106,.34)); }
.pulse-ghost { z-index: 1; opacity: .58; filter: blur(.3px) brightness(1.15); }
.pulse-ghost.pulse-signal-inactive { opacity: .14; filter: blur(.3px) saturate(.3) brightness(.8); }
.pulse-ghost.pulse-signal-active { opacity: .58; filter: blur(.3px) brightness(1.15); }
.pulse-walkers { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.pulse-walker { position: absolute; display: block; will-change: transform, left, top; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.22)); }
.pulse-walker-soon { filter: drop-shadow(0 0 7px rgba(232,115,94,.72)); }
.pulse-beacon { z-index: 4; animation: pulse-blink 1.4s ease-in-out infinite; filter: drop-shadow(0 0 14px rgba(232,115,94,.8)); }
.pulse-beacon[hidden] { display: none; }
.pulse-coin { z-index: 3; transform: translate(-50%, -50%); animation: pulse-rise 3.2s ease-in infinite; }
.pulse-occ { position: absolute; z-index: 3; pointer-events: none; background: url('/assets/pulse/master_scene.png') no-repeat; }
.pulse-chip {
  position: absolute;
  z-index: 6;
  aspect-ratio: 878 / 651;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 3px 5px;
  color: #20443f;
  background: url('/assets/pulse/proc/placa_contador.png') center / contain no-repeat;
  text-align: center;
  pointer-events: none;
}
.pulse-chip-value { font-size: clamp(7px, .8vw, 12px); line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.pulse-chip-label { max-width: 90%; margin-top: 3%; font-size: clamp(4px, .34vw, 6px); line-height: 1.1; font-weight: 800; letter-spacing: .025em; text-transform: uppercase; }
.pulse-pop { animation: pulse-pop .5s; }

.pulse-command-side { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 16px; padding: 25px 28px 18px; overflow: auto; }
.pulse-command-brand { display: flex; align-items: center; gap: 12px; }
.pulse-brand-ring { width: 30px; height: 30px; flex: 0 0 auto; border: 3px solid var(--pulse-coral); border-radius: 50%; }
.pulse-brand-name { color: var(--pulse-cream); font-family: Montserrat, sans-serif; font-size: 22px; line-height: 1; font-weight: 800; letter-spacing: .13em; }
.pulse-brand-sub { margin-top: 4px; color: var(--pulse-coral); font-size: 8px; font-weight: 800; letter-spacing: .28em; }
.pulse-live { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: var(--pulse-muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pulse-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pulse-sage); animation: pulse-blink 1.6s infinite; }
.pulse-live-partial .pulse-live-dot { background: var(--pulse-coral); }
.pulse-command-card { padding: 14px 18px; background: rgba(255,255,255,.05); border: 1px solid var(--pulse-line); border-radius: 14px; }
.pulse-card-label { display: block; color: var(--pulse-muted); font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.pulse-finance-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-top: 4px; color: var(--pulse-cream); font-family: Montserrat, sans-serif; font-size: clamp(26px, 2.7vw, 34px); line-height: 1.16; font-weight: 800; letter-spacing: -.035em; }
.pulse-finance-value em { color: var(--pulse-coral); font-size: .78em; font-style: normal; }
.pulse-bar { height: 7px; margin-top: 8px; overflow: hidden; background: rgba(255,255,255,.09); border-radius: 999px; }
.pulse-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pulse-sage), var(--pulse-coral)); border-radius: inherit; transition: width .8s ease; }
.pulse-card-hint { display: block; margin-top: 7px; color: var(--pulse-muted); font-size: 10px; line-height: 1.35; }
.pulse-metrics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pulse-metric-card { min-height: 108px; }
.pulse-card-value { display: block; margin-top: 5px; color: var(--pulse-cream); font-family: Montserrat, sans-serif; font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.pulse-feed { flex: 1; min-height: 170px; display: flex; flex-direction: column; gap: 8px; }
.pulse-feed h3 { margin: 0 0 1px; color: var(--pulse-muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.pulse-feed-loading { margin: 0; color: var(--pulse-muted); font-size: 13px; }
.pulse-event { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 9px 12px; color: #dfeeec; background: rgba(255,255,255,.04); border-left: 3px solid var(--pulse-coral); border-radius: 0 10px 10px 0; font-size: 12px; line-height: 1.35; animation: pulse-fade-in .4s ease; }
.pulse-event time { color: var(--pulse-muted); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pulse-event-ok { border-left-color: var(--pulse-sage); }
.pulse-event-neutral { border-left-color: #77aeb2; }
.pulse-event-warning { border-left-color: var(--pulse-coral); }
.pulse-command-foot { padding-top: 5px; color: var(--pulse-muted); font-size: 10px; line-height: 1.4; text-align: center; }
.pulse-source-status { color: #c8dedd; }

@keyframes pulse-blink { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes pulse-breathe { 0%,100% { translate: 0 0; } 50% { translate: 0 -2px; } }
@keyframes pulse-rise { 0% { opacity: 0; translate: 0 0; } 14% { opacity: 1; } 78% { opacity: .9; } 100% { opacity: 0; translate: 0 -42px; } }
@keyframes pulse-pop { 30% { transform: scale(1.18); color: #b05a44; } }
@keyframes pulse-fade-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

@media (max-width: 1120px) {
  .ops-pulse-command { grid-template-columns: minmax(300px, .55fr) minmax(390px, 1fr); }
  .pulse-command-side { padding-inline: 20px; }
}

@media (max-width: 900px) {
  .topbar.topbar-pulse { display: flex; }
  .page.page-pulse { min-height: 0; padding: 0; }
  .ops-pulse-command { min-height: 0; display: block; overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
  .pulse-diorama-wrap { width: 100%; overflow: visible; }
  .pulse-diorama { width: 100%; height: auto; max-width: 560px; aspect-ratio: 941 / 1672; }
  .pulse-command-side { overflow: visible; padding: 24px 20px 34px; }
  .pulse-chip-value { font-size: clamp(8px, 3.3vw, 18px); }
  .pulse-chip-label { font-size: clamp(4px, 1.35vw, 8px); }
  .expense-row { grid-template-columns: 90px minmax(0, 1fr) auto; }
  .expense-row .chip, .expense-actions { grid-column: 2 / -1; justify-self: start; }
}

@media (max-width: 480px) {
  .pulse-command-brand { align-items: flex-start; }
  .pulse-brand-name { font-size: 23px; }
  .pulse-live { margin-top: 7px; font-size: 10px; }
  .pulse-metrics-grid { grid-template-columns: 1fr; }
  .pulse-metric-card { min-height: 96px; }
  .pulse-event { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-overlay, .pulse-beacon, .pulse-coin, .pulse-live-dot, .pulse-pop, .pulse-event { animation: none; }
  .pulse-overlay { transition: none; }
  .pulse-bar i { transition: none; }
}

/* ------- Inicio (home) ------- */
.ops-home { display: grid; gap: 20px; }
.home-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.home-greeting { margin: 0; font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.035em; }
.home-date { margin: 6px 0 0; }
.home-status { display: flex; flex-wrap: wrap; gap: 8px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 13px; background: #fff; border: 1px solid var(--line, #d4e2e4); border-radius: 999px; font-size: 12px; font-weight: 750; color: #173139; }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status-pill.is-ok::before { background: #1fa06c; }
.status-pill.is-down { color: #9f2f22; }
.status-pill.is-down::before { background: #d05043; }
.home-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.kpi-link { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.kpi-link:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,63,77,.10); }
.home-ico { display: grid; place-items: center; flex: 0 0 auto; }
.home-ico svg { width: 22px; height: 22px; }
.kpi-ico { width: 46px; height: 46px; border-radius: 14px; }
.kpi-navy { color: #005465; background: #e5f2f3; }
.kpi-green { color: #176b50; background: #e6f5ee; }
.kpi-coral { color: #a93631; background: #fff0ed; }
.kpi-blue { color: #38618f; background: #e9f0fa; }
.kpi-amber { color: #7b5308; background: #fff4d5; }
.kpi-body { display: grid; gap: 2px; min-width: 0; }
.kpi-label { color: #586d72; font-size: 12px; font-weight: 750; }
.kpi-value { color: #003f4d; font-size: 27px; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-hint { color: #586d72; }
.home-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 16px; align-items: start; }
.home-panel h2 { margin: 0 0 4px; font-size: 19px; }
.home-panel > .meta { margin: 0 0 14px; }
.home-next { display: grid; }
.home-next-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid #e4eeee; }
.home-next-row:last-child { border-bottom: 0; }
.home-next-time { color: #003f4d; font-variant-numeric: tabular-nums; }
.home-next-provider { color: #173139; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-alerts { display: grid; gap: 9px; }
.home-alert-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 14px; text-align: left; color: #173139; background: #fff8f7; border: 1px solid #f0d9d5; border-radius: 12px; cursor: pointer; font: inherit; font-weight: 650; }
.home-alert-row:hover { background: #fff0ed; }
.alert-ico { color: #a93631; }
.alert-ico svg { width: 19px; height: 19px; }

/* iconos del sidebar */
.nav-ico { display: inline-grid; place-items: center; width: 21px; margin-right: 11px; opacity: .9; }
.nav-ico svg { width: 18px; height: 18px; }

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

/* ===== Home refinada 2026-07-28 ===== */
.ops-home { gap: 16px; }
.home-head { align-items: center; margin-bottom: 2px; }
.home-greeting { font-size: clamp(25px, 3vw, 32px); }
.home-date { font-size: 13px; }
.status-pill { min-height: 30px; padding: 5px 11px; font-size: 11px; }
.home-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi-card { flex-direction: column; gap: 8px; padding: 14px 16px; box-shadow: none; }
.kpi-ico { width: 34px; height: 34px; border-radius: 10px; }
.kpi-ico svg { width: 18px; height: 18px; }
.kpi-label { font-size: 11px; letter-spacing: .01em; }
.kpi-value { font-size: 30px; letter-spacing: -.04em; }
.kpi-hint { font-size: 11px; }
.kpi-link:hover { transform: none; box-shadow: 0 6px 18px rgba(0,63,77,.09); border-color: #b9cdd1; }
.home-columns { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 14px; }
.home-panel { padding: 18px 20px; box-shadow: none; }
.home-panel h2 { font-size: 16px; margin-bottom: 2px; }
.home-panel > .meta { font-size: 12px; margin-bottom: 12px; }
.home-next-row { grid-template-columns: 58px minmax(0, 1fr) auto; padding: 9px 0; }
.home-next-time { font-size: 13px; }
.home-next-provider { font-size: 13px; }
.home-alerts { gap: 8px; }
.home-alert-row { align-items: flex-start; padding: 10px 12px; background: #fffaf9; border: 1px solid #f0dcd8; border-left: 3px solid var(--coral-700); border-radius: 0 10px 10px 0; font-weight: 600; font-size: 13px; line-height: 1.4; }
.home-alert-row:hover { background: #fff2ef; }
.alert-ico { margin-top: 1px; }
.alert-ico svg { width: 17px; height: 17px; }
.home-alert-row .alert-text { display: block; }
.home-alert-row .alert-hint { display: block; margin-top: 2px; color: #6b7f83; font-size: 11px; font-weight: 500; }
.home-alert-row.alert-alta { background: #fff6f4; border-color: #f0cfc9; border-left-color: #a93631; }
.home-alert-row.alert-alta .alert-ico { color: #a93631; }
.home-alert-row.alert-media { background: #fffbf0; border-color: #eddfba; border-left-color: #b8860b; }
.home-alert-row.alert-media .alert-ico { color: #8a6508; }
.home-alert-row.alert-baja { background: #f7fafa; border-color: #dde8e9; border-left-color: #6f959b; }
.home-alert-row.alert-baja .alert-ico { color: #56777c; }
