:root {
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --dash-bg: #061214;
  --dash-bg-2: #08191a;
  --surface: #0d2022;
  --surface-2: #10282a;
  --surface-3: #133032;
  --line: rgba(137, 217, 203, .12);
  --line-strong: rgba(137, 217, 203, .22);
  --text: #eafbf7;
  --muted: #789792;
  --muted-2: #56726f;
  --accent: #43e5be;
  --accent-soft: rgba(67, 229, 190, .14);
  --yellow: #f2c75f;
  --red: #ef6f86;
  --purple: #aa8cff;
  --blue: #68a6ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, .32);
  --card-shadow: 0 14px 34px rgba(0, 0, 0, .2);
  --radius: 18px;
  --radius-sm: 14px;
  --sidebar-width: 246px;
  --transition: 180ms cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { color: inherit; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

/* LOGIN — RC3 DISEÑO OSCURO DIVIDIDO */
body[data-page="login"] {
  min-height: 100dvh;
  overflow-x: hidden;
  color: #f4f7f5;
  background: #1d1d1d;
}
body.account-modal-open, body.detail-open, body.client-modal-open { overflow: hidden; }
.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vh, 38px) clamp(22px, 4vw, 58px);
  background:
    radial-gradient(circle at 50% 5%, rgba(48, 56, 52, .35), transparent 42%),
    #1d1d1d;
}
.auth-shell {
  width: min(1180px, 100%);
  min-height: min(720px, calc(100dvh - 64px));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  overflow: hidden;
  border: 8px solid #050605;
  border-radius: 3px;
  background: #050605;
  box-shadow: 0 38px 100px rgba(0, 0, 0, .48);
}
.auth-intro {
  position: relative;
  isolation: isolate;
  min-width: 0;
  overflow: hidden;
  padding: clamp(34px, 4.4vw, 62px);
  background:
    linear-gradient(135deg, rgba(3, 55, 45, .98), rgba(9, 95, 67, .95) 55%, rgba(20, 96, 70, .92));
}
.auth-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(125deg, rgba(255,255,255,.02), transparent 42%),
    radial-gradient(circle at 18% 20%, rgba(67, 229, 190, .16), transparent 34%);
}
.auth-intro::after {
  content: "";
  position: absolute;
  right: -22%;
  bottom: -28%;
  width: 72%;
  aspect-ratio: 1;
  z-index: -2;
  border-radius: 50%;
  background: rgba(82, 231, 166, .2);
  filter: blur(74px);
}
.auth-orb {
  position: absolute;
  z-index: -1;
  display: block;
  border-radius: 50%;
  filter: blur(55px);
  pointer-events: none;
}
.auth-orb-one {
  width: 310px;
  height: 310px;
  top: 15%;
  right: -12%;
  background: rgba(56, 211, 157, .22);
}
.auth-orb-two {
  width: 230px;
  height: 230px;
  left: 14%;
  bottom: -10%;
  background: rgba(5, 45, 40, .48);
}
.auth-intro-content {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.auth-logo {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}
.auth-logo-mark {
  width: 43px;
  height: 43px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 13px;
  color: #f7fffb;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px rgba(255,255,255,.12);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .03em;
}
.auth-logo > span:last-child {
  display: grid;
  gap: 3px;
}
.auth-logo strong { font-size: 15px; letter-spacing: -.01em; }
.auth-logo small { color: rgba(255,255,255,.62); font-size: 11px; font-weight: 600; }
.auth-intro-copy {
  max-width: 560px;
  margin: auto 0 clamp(52px, 7vh, 88px);
}
.auth-intro-copy p {
  margin: 0 0 12px;
  color: #70e8bf;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.auth-intro-copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(43px, 5.2vw, 70px);
  line-height: .99;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.auth-intro-copy > span {
  display: block;
  max-width: 440px;
  margin-top: 20px;
  color: rgba(255,255,255,.72);
  font-size: 15px;
  line-height: 1.65;
}
.auth-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.auth-step {
  min-width: 0;
  min-height: 132px;
  padding: 17px 16px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.075);
  backdrop-filter: blur(8px);
}
.auth-step.is-active {
  color: #0b1713;
  background: #f5f8f6;
  box-shadow: 0 18px 46px rgba(2, 35, 27, .2);
}
.auth-step > span {
  width: 27px;
  height: 27px;
  margin-bottom: auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: inherit;
  background: rgba(255,255,255,.09);
  font-size: 11px;
  font-weight: 900;
}
.auth-step.is-active > span { color: #fff; background: #07110e; }
.auth-step strong {
  margin-top: 17px;
  color: inherit;
  font-size: 13px;
  line-height: 1.3;
}
.auth-step small {
  margin-top: 6px;
  color: inherit;
  opacity: .65;
  font-size: 10px;
  line-height: 1.45;
}
.auth-card {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: clamp(44px, 5vw, 78px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #f4f7f5;
  border: 0;
  border-radius: 0;
  background: #050605;
  box-shadow: none;
  backdrop-filter: none;
}
.auth-card > * { width: min(100%, 420px); margin-inline: auto; }
.auth-mobile-brand { display: none; }
.auth-heading { margin-bottom: 30px; text-align: center; }
.auth-heading p {
  margin: 0 0 10px;
  color: #64d9ad;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.auth-heading h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(31px, 3vw, 42px);
  line-height: 1.05;
  letter-spacing: -.045em;
}
.auth-heading > span {
  display: block;
  margin-top: 11px;
  color: #717975;
  font-size: 13px;
  line-height: 1.55;
}
.auth-form { display: grid; gap: 18px; }
.auth-field {
  display: grid;
  gap: 8px;
  color: #b7bfbb;
  font-size: 12px;
  font-weight: 700;
}
.auth-input-wrap { position: relative; }
.auth-input-wrap input {
  width: 100%;
  min-height: 52px;
  padding: 0 50px 0 15px;
  border: 1px solid #1f2422;
  border-radius: 7px;
  outline: none;
  color: #f5f7f6;
  background: #111312;
  font: inherit;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.015);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.auth-input-wrap input::placeholder { color: #5e6662; }
.auth-input-wrap input:hover { border-color: #303734; }
.auth-input-wrap input:focus {
  border-color: #4ed7a2;
  background: #131715;
  box-shadow: 0 0 0 4px rgba(78, 215, 162, .11);
}
.auth-input-wrap > svg,
.auth-input-wrap .password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
}
.auth-input-wrap > svg {
  width: 20px;
  height: 20px;
  color: #737c77;
  pointer-events: none;
}
.password-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #737c77;
  background: transparent;
  cursor: pointer;
}
.password-toggle:hover,
.password-toggle:focus-visible { color: #dce5e1; background: #1a1e1c; outline: none; }
.password-toggle svg { width: 20px; height: 20px; }
.password-toggle .eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }
.remember-row {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #88918d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.remember-row input { position: absolute; opacity: 0; pointer-events: none; }
.checkmark {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 1px solid #343b37;
  border-radius: 6px;
  color: #07110d;
  background: #111412;
}
.checkmark svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.6; opacity: 0; }
.remember-row input:checked + .checkmark { border-color: #5ad9aa; background: #5ad9aa; }
.remember-row input:checked + .checkmark svg { opacity: 1; }
.remember-row input:focus-visible + .checkmark { box-shadow: 0 0 0 4px rgba(78,215,162,.14); }
.auth-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #fff;
  border-radius: 7px;
  color: #060706;
  background: #fff;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  transition: transform 100ms ease, background 160ms ease, box-shadow 160ms ease;
}
.auth-submit:hover { background: #dffbf0; box-shadow: 0 14px 32px rgba(63, 211, 155, .14); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(78,215,162,.17); }
.auth-submit:disabled { cursor: wait; opacity: .72; }
.auth-submit svg { width: 18px; height: 18px; }
.auth-access-note {
  margin-top: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  color: #6f7773;
  font-size: 12px;
}
.account-request-trigger {
  display: inline;
  margin: 0;
  padding: 2px 3px;
  border: 0;
  color: #d8e4de;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #35423c;
  text-underline-offset: 4px;
}
.account-request-trigger:hover { color: #67dbae; text-decoration-color: #67dbae; }
.account-request-trigger:focus-visible { outline: 2px solid #4ed7a2; outline-offset: 4px; border-radius: 4px; }
.account-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .74);
  backdrop-filter: blur(6px);
}
.account-modal {
  position: fixed;
  z-index: 100;
  top: 50%;
  left: 50%;
  width: min(calc(100% - 32px), 440px);
  transform: translate(-50%, -50%);
  padding: 34px;
  border: 1px solid #26332e;
  border-radius: 18px;
  color: #f5f8f6;
  background: linear-gradient(145deg, #07110e, #0b2018);
  box-shadow: 0 34px 100px rgba(0,0,0,.62), inset 0 1px rgba(255,255,255,.035);
  text-align: center;
}
.account-modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #29342f;
  border-radius: 9px;
  color: #9ba5a0;
  background: #111613;
  cursor: pointer;
}
.account-modal-close:hover,
.account-modal-close:focus-visible { color: #fff; background: #1a211e; outline: none; }
.account-modal-close svg { width: 19px; height: 19px; }
.account-modal-icon {
  width: 58px;
  height: 58px;
  margin: 2px auto 17px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(91,218,171,.22);
  border-radius: 15px;
  color: #68dfb2;
  background: rgba(91,218,171,.08);
}
.account-modal-icon svg { width: 31px; height: 31px; }
.account-modal-kicker {
  margin: 0 0 7px;
  color: #67dbae;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.account-modal h2 { margin: 0 0 10px; font-size: 28px; letter-spacing: -.035em; }
.account-modal > p:not(.account-modal-kicker) { margin: 0; color: #8c9993; font-size: 13px; line-height: 1.65; }
.account-whatsapp-button {
  width: 100%;
  min-height: 54px;
  margin-top: 23px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #5ad9aa;
  border-radius: 9px;
  color: #06100c;
  background: #5ad9aa;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}
.account-whatsapp-button:hover { filter: brightness(1.08); }
.account-whatsapp-button:focus-visible { outline: 4px solid rgba(90,217,170,.17); outline-offset: 3px; }
.account-whatsapp-button svg { width: 22px; height: 22px; }
.form-alert {
  padding: 12px 14px;
  margin-bottom: 17px;
  border: 1px solid rgba(239,111,134,.35);
  border-radius: 8px;
  color: #ffc8d2;
  background: rgba(117, 26, 43, .2);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr); }
  .auth-intro { padding: 38px 32px; }
  .auth-intro-copy h1 { font-size: clamp(39px, 5vw, 54px); }
  .auth-steps { grid-template-columns: 1fr; }
  .auth-step { min-height: auto; display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; padding: 13px; }
  .auth-step > span { grid-row: 1 / 3; margin: 0; }
  .auth-step strong { margin: 0; }
  .auth-step small { margin-top: 3px; }
  .auth-card { padding: 46px 34px; }
}

@media (max-width: 760px) {
  body[data-page="login"] { background: #050605; }
  .auth-page { min-height: 100dvh; padding: 0; place-items: stretch; background: #050605; }
  .auth-shell {
    width: 100%;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .auth-intro { min-height: 280px; padding: 28px 24px 24px; }
  .auth-logo { display: none; }
  .auth-intro-copy { margin: 34px 0 28px; }
  .auth-intro-copy p { margin-bottom: 9px; font-size: 10px; }
  .auth-intro-copy h1 { font-size: clamp(35px, 10vw, 48px); }
  .auth-intro-copy > span { margin-top: 13px; font-size: 13px; line-height: 1.5; }
  .auth-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .auth-step { min-height: 84px; display: flex; padding: 11px; border-radius: 10px; }
  .auth-step > span { width: 23px; height: 23px; margin-bottom: auto; font-size: 9px; }
  .auth-step strong { margin-top: 10px; font-size: 10px; }
  .auth-step small { display: none; }
  .auth-card { min-height: 0; padding: 35px 24px 38px; }
  .auth-card > * { max-width: 460px; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; color: #fff; font-size: 14px; }
  .auth-mobile-brand .auth-logo-mark { width: 38px; height: 38px; border-radius: 11px; }
  .auth-heading { margin-bottom: 25px; text-align: left; }
  .auth-heading h2 { font-size: 34px; }
  .auth-heading > span { max-width: 360px; }
}

@media (max-width: 430px) {
  .auth-intro { min-height: 246px; padding: 22px 18px 18px; }
  .auth-intro-copy { margin: 24px 0 22px; }
  .auth-intro-copy h1 { font-size: 34px; }
  .auth-intro-copy > span { font-size: 12px; }
  .auth-step { min-height: 76px; padding: 9px; }
  .auth-step strong { font-size: 9px; }
  .auth-card { padding: 30px 18px 34px; }
  .auth-mobile-brand { margin-bottom: 24px; }
  .auth-heading h2 { font-size: 30px; }
  .auth-input-wrap input { min-height: 50px; font-size: 14px; }
  .auth-submit { min-height: 50px; }
  .auth-access-note { display: grid; justify-items: center; gap: 4px; }
  .account-modal { width: calc(100% - 24px); padding: 30px 20px 22px; border-radius: 16px; }
  .account-modal h2 { font-size: 25px; }
}

@media (max-height: 720px) and (min-width: 761px) {
  .auth-page { place-items: start center; }
  .auth-shell { min-height: 640px; }
  .auth-intro-copy { margin-bottom: 36px; }
  .auth-step { min-height: 112px; }
  .auth-card { padding-block: 38px; }
}

/* INSTALADOR */
.setup-page { min-height: 100dvh; background: #eef3eb; color: #17211f; }
.setup-shell { min-height: 100dvh; display: grid; place-items: center; padding: 28px; }
.setup-card { width: min(100%, 760px); padding: clamp(28px, 5vw, 54px); border: 1px solid #dfe8dc; border-radius: 26px; background: #fff; box-shadow: 0 24px 70px rgba(44,78,33,.12); }
.setup-card-small { max-width: 520px; text-align: center; }
.setup-mark { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 14px; color: #fff; background: #236f69; font-weight: 900; }
.setup-card-small .setup-mark { margin-inline: auto; }
.setup-kicker { margin: 0 0 7px; color: #34766e; font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.setup-card h1 { margin: 0 0 10px; font-size: clamp(27px,4vw,38px); }
.setup-card > p:not(.setup-kicker) { color: #68736f; line-height: 1.6; }
.setup-card code { padding: 2px 6px; border-radius: 6px; background: #f1f5f0; }
.setup-form { display: grid; gap: 16px; margin-top: 28px; }
.setup-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.setup-form label { display: grid; gap: 7px; color: #38423f; font-size: 13px; font-weight: 750; }
.setup-form input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #d7e0dc; border-radius: 11px; outline: none; font: inherit; }
.setup-form input:focus { border-color: #3b8a81; box-shadow: 0 0 0 4px rgba(35,111,105,.1); }
.setup-divider { height: 1px; margin: 4px 0; background: #e8eeeb; }
.setup-submit { min-height: 50px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; color: #fff; background: #236f69; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; }


/* INICIO CLARO — RC2 */
body[data-page="dashboard"] {
  --ui-bg: #f4f6f4;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f8faf8;
  --ui-line: #e7ece8;
  --ui-line-strong: #d9e1db;
  --ui-text: #17211c;
  --ui-muted: #7d8a82;
  --ui-muted-2: #a1aaa4;
  --ui-green: #0c7046;
  --ui-green-dark: #075636;
  --ui-green-soft: #e8f4ed;
  --ui-mint: #8bcbaa;
  --ui-yellow: #e9b84a;
  --ui-yellow-soft: #fff6df;
  --ui-red: #d76868;
  --ui-red-soft: #fff0f0;
  --ui-shadow: 0 16px 46px rgba(38, 64, 49, .08);
  --ui-shadow-soft: 0 8px 24px rgba(38, 64, 49, .055);
  --ui-radius: 20px;
  min-height: 100dvh;
  color: var(--ui-text);
  background: var(--ui-bg);
  overflow-x: hidden;
}
body[data-page="dashboard"] button,
body[data-page="dashboard"] input,
body[data-page="dashboard"] select { font: inherit; }
body[data-page="dashboard"] button,
body[data-page="dashboard"] a { -webkit-tap-highlight-color: transparent; }
body[data-page="dashboard"] button:focus-visible,
body[data-page="dashboard"] a:focus-visible,
body[data-page="dashboard"] input:focus-visible,
body[data-page="dashboard"] select:focus-visible { outline: 3px solid rgba(12,112,70,.17); outline-offset: 2px; }
body.detail-open { overflow: hidden; }

.dashboard-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  inset: 0 auto auto 0;
  z-index: 50;
  height: 100dvh;
  min-height: 620px;
  padding: 26px 17px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ui-line);
  background: rgba(255,255,255,.94);
  box-shadow: 8px 0 32px rgba(54,75,62,.035);
  overflow: hidden;
}
.sidebar-brand-row { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.sidebar-brand { min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--ui-text); text-decoration: none; }
.brand-symbol {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border-radius: 12px; color: var(--ui-green); background: var(--ui-green-soft);
}
.brand-symbol svg { width: 24px; height: 24px; stroke-width: 2; }
.brand-text { display: flex; align-items: baseline; gap: 4px; font-size: 15px; letter-spacing: -.02em; }
.brand-text strong { font-weight: 850; }
.brand-text small { color: var(--ui-muted); font-size: 12px; font-weight: 650; }
.sidebar-close {
  display: none; margin-left: auto; width: 38px; height: 38px; place-items: center;
  border: 0; border-radius: 11px; color: var(--ui-muted); background: var(--ui-surface-soft); cursor: pointer;
}
.sidebar-close svg { width: 19px; height: 19px; }
.nav-label { margin: 34px 12px 11px; color: var(--ui-muted-2); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-label-general { margin-top: 31px; }
.sidebar-nav, .sidebar-actions { display: grid; gap: 5px; }
.sidebar-link {
  position: relative; width: 100%; min-height: 43px; padding: 0 12px; display: grid;
  grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: 11px;
  border: 0; border-radius: 12px; color: #6f7b74; background: transparent;
  font-size: 13px; font-weight: 680; text-decoration: none; text-align: left; cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}
.sidebar-link svg { width: 19px; height: 19px; stroke-width: 1.8; }
.sidebar-link:hover { color: var(--ui-green); background: #f4f8f5; transform: translateX(2px); }
.sidebar-link.active { color: var(--ui-text); background: #f2f7f3; font-weight: 800; }
.sidebar-link-indicator { position: absolute; left: -17px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 6px 6px 0; background: var(--ui-green); }
.sidebar-link-button { appearance: none; }
.sidebar-spacer { flex: 1; min-height: 22px; }
.sidebar-promo {
  position: relative; isolation: isolate; width: 100%; min-height: 162px; padding: 18px; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  border: 0; border-radius: 18px; color: #fff; text-align: left; cursor: pointer;
  background:
    radial-gradient(circle at 85% 20%, rgba(99,204,151,.48), transparent 30%),
    linear-gradient(145deg, #102c20, #0a5d3c 72%, #0f7b4f);
  box-shadow: 0 14px 30px rgba(15,91,59,.18);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.sidebar-promo::before { content:""; position:absolute; inset:auto -35px -55px auto; width:145px; height:145px; border:1px solid rgba(255,255,255,.17); border-radius:50%; z-index:-1; }
.sidebar-promo:hover { transform: translateY(-2px); box-shadow: 0 18px 34px rgba(15,91,59,.23); }
.promo-badge { width: 28px; height: 28px; margin-bottom: 14px; display:grid; place-items:center; border-radius:9px; color:#15452f; background:#d9f5e4; font-size:10px; font-weight:900; }
.sidebar-promo strong { font-size: 13px; }
.sidebar-promo small { margin-top: 5px; color: rgba(255,255,255,.72); font-size: 9px; line-height: 1.45; }
.promo-cta { margin-top: 14px; display:flex; align-items:center; gap:5px; font-size:10px; font-weight:800; }
.promo-cta svg { width: 14px; height: 14px; }

.workspace { min-width: 0; display: grid; grid-template-rows: 70px minmax(0,1fr); }
.topbar {
  position: sticky; top: 0; z-index: 35; min-width: 0; padding: 13px clamp(18px,3vw,34px);
  display: flex; align-items: center; gap: 18px; border-bottom: 1px solid rgba(225,232,227,.72);
  background: rgba(244,246,244,.88); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.mobile-menu-button, .topbar-icon {
  width: 42px; height: 42px; flex:none; display:grid; place-items:center; padding:0;
  border: 1px solid var(--ui-line); border-radius: 13px; color: var(--ui-text); background: var(--ui-surface); cursor:pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 100ms ease;
}
.mobile-menu-button { display:none; }
.mobile-menu-button svg, .topbar-icon svg { width: 19px; height: 19px; }
.topbar-icon:hover, .mobile-menu-button:hover { border-color: #cdd9d1; background: #fafcfb; }
.topbar-icon:active, .mobile-menu-button:active { transform: translateY(1px); }
.global-search {
  width: min(100%, 410px); min-height: 43px; padding: 0 12px; display:flex; align-items:center; gap:10px;
  border: 1px solid var(--ui-line); border-radius: 14px; background: rgba(255,255,255,.82);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.global-search:focus-within { border-color: rgba(12,112,70,.34); background:#fff; box-shadow: 0 0 0 4px rgba(12,112,70,.07); }
.global-search svg { width:18px; height:18px; flex:none; color:#7c8b82; }
.global-search input { min-width:0; flex:1; border:0; outline:0; color:var(--ui-text); background:transparent; font-size:12px; }
.global-search input::placeholder { color:#a1aaa4; }
.global-search kbd { padding: 4px 7px; border: 1px solid var(--ui-line); border-radius:7px; color:#89958e; background:#f6f8f6; font:700 9px var(--font); }
.topbar-actions { margin-left:auto; display:flex; align-items:center; gap:8px; }
.topbar-icon { position:relative; text-decoration:none; }
.notification-count { position:absolute; top:-4px; right:-4px; min-width:18px; height:18px; padding:0 5px; display:grid; place-items:center; border:2px solid var(--ui-bg); border-radius:999px; color:#fff; background:#d66767; font-size:9px; font-weight:850; }
.profile-button {
  min-width:0; min-height:45px; margin-left:4px; padding:4px 8px 4px 5px; display:grid;
  grid-template-columns:36px minmax(0,1fr) 16px; align-items:center; gap:9px;
  border:0; border-radius:14px; color:var(--ui-text); background:transparent; text-align:left; cursor:pointer;
}
.profile-button:hover { background:rgba(255,255,255,.76); }
.profile-avatar { width:36px; height:36px; display:grid; place-items:center; border-radius:12px; color:#fff; background:linear-gradient(135deg,#d2a887,#8d5d46); font-size:12px; font-weight:850; }
.profile-name { min-width:0; display:grid; }
.profile-name strong, .profile-name small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.profile-name strong { font-size:11px; }
.profile-name small { margin-top:2px; color:var(--ui-muted); font-size:8px; }
.profile-button > svg { width:15px; height:15px; color:#89958e; }

.dashboard-content { width:100%; max-width:1530px; margin:0 auto; padding: 22px clamp(18px,3vw,34px) 34px; }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:22px; margin-bottom:18px; }
.page-heading h1 { margin:0; color:var(--ui-text); font-size:clamp(27px,2.4vw,34px); letter-spacing:-.045em; }
.page-heading p { margin:5px 0 0; color:var(--ui-muted); font-size:11px; }
.heading-actions { display:flex; align-items:center; gap:9px; }
.button { min-height:40px; padding:0 17px; display:inline-flex; align-items:center; justify-content:center; gap:8px; border-radius:13px; cursor:pointer; font-size:11px; font-weight:800; transition:transform 100ms ease, box-shadow 160ms ease, background 160ms ease; }
.button svg { width:17px; height:17px; }
.button:active { transform:translateY(1px); }
.button-primary { border:1px solid var(--ui-green); color:#fff; background:var(--ui-green); box-shadow:0 9px 20px rgba(12,112,70,.18); }
.button-primary:hover { background:var(--ui-green-dark); box-shadow:0 11px 24px rgba(12,112,70,.23); }
.button-primary.is-loading svg { animation:spin 850ms linear infinite; }
.button-secondary { border:1px solid #b8c8be; color:#2f4036; background:#fff; }
.button-secondary:hover { border-color:var(--ui-green); color:var(--ui-green); }

.metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:11px; }
.metric-card {
  min-width:0; min-height:132px; padding:15px 16px; display:flex; flex-direction:column; align-items:flex-start;
  border:1px solid var(--ui-line); border-radius:17px; color:var(--ui-text); background:var(--ui-surface); text-align:left; cursor:pointer;
  box-shadow:var(--ui-shadow-soft); transition:transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.metric-card:hover { transform:translateY(-3px); border-color:#d3ded6; box-shadow:var(--ui-shadow); }
.metric-card-featured { color:#fff; border-color:#0b6a42; background:linear-gradient(145deg,#0d7b4d,#075d3a); box-shadow:0 16px 34px rgba(11,103,65,.22); }
.metric-head { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; color:inherit; font-size:10px; font-weight:750; }
.metric-head i { width:26px; height:26px; display:grid; place-items:center; border:1px solid var(--ui-line); border-radius:50%; color:#68766e; background:#fff; }
.metric-card-featured .metric-head i { border-color:rgba(255,255,255,.35); color:#fff; background:rgba(255,255,255,.12); }
.metric-head svg { width:13px; height:13px; }
.metric-card > strong { margin-top:11px; font-size:29px; line-height:1; letter-spacing:-.045em; }
.metric-card > small { margin-top:6px; color:var(--ui-muted); font-size:9px; }
.metric-card-featured > small { color:rgba(255,255,255,.68); }
.metric-change { margin-top:auto; padding-top:11px; display:flex; align-items:center; gap:5px; color:#55906f; font-size:8px; font-weight:700; }
.metric-change svg { width:13px; height:13px; }
.metric-card-featured .metric-change { color:#bbf0d2; }
.metric-change-warning { color:#a47716; }
.metric-change-danger, .metric-change.negative { color:#c45c5c; }

.dashboard-top-grid { margin-top:11px; display:grid; grid-template-columns:minmax(0,1.8fr) minmax(205px,.72fr) minmax(255px,.9fr); gap:11px; align-items:stretch; }
.dashboard-bottom-grid { margin-top:11px; display:grid; grid-template-columns:minmax(0,1.25fr) minmax(250px,.85fr) minmax(260px,.85fr); gap:11px; align-items:stretch; }
.dashboard-card {
  min-width:0; min-height:0; overflow:hidden; border:1px solid var(--ui-line); border-radius:var(--ui-radius);
  background:var(--ui-surface); box-shadow:var(--ui-shadow-soft);
}
.card-heading { padding:16px 17px 10px; display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.card-heading.compact { padding-bottom:8px; }
.card-heading h2 { margin:0; color:var(--ui-text); font-size:13px; letter-spacing:-.025em; }
.card-heading p { margin:4px 0 0; color:var(--ui-muted); font-size:8px; line-height:1.45; }
.period-select { position:relative; min-width:126px; }
.period-select select { width:100%; min-height:32px; padding:0 30px 0 10px; appearance:none; border:1px solid var(--ui-line); border-radius:10px; outline:0; color:#4c5a52; background:#fafcfb; font-size:9px; font-weight:700; cursor:pointer; }
.period-select svg { position:absolute; top:50%; right:9px; width:13px; height:13px; transform:translateY(-50%); color:#77857d; pointer-events:none; }
.small-action { min-height:28px; padding:0 10px; border:1px solid var(--ui-line); border-radius:9px; color:#56645c; background:#fff; font-size:8px; font-weight:750; cursor:pointer; }
.small-action:hover { border-color:#bed1c4; color:var(--ui-green); }
.icon-action { width:30px; height:30px; display:grid; place-items:center; border:1px solid var(--ui-line); border-radius:9px; color:var(--ui-green); background:#fff; cursor:pointer; }
.icon-action svg { width:14px; height:14px; }

.analytics-card { min-height:285px; }
.analytics-chart-button { position:relative; width:100%; height:226px; padding:0 13px 12px; display:block; border:0; color:var(--ui-text); background:transparent; cursor:pointer; }
.analytics-chart-button canvas { width:100%; height:100%; display:block; }
.chart-tooltip { position:absolute; z-index:4; min-width:112px; padding:9px 11px; display:grid; gap:3px; border-radius:10px; color:#fff; background:#183326; box-shadow:0 10px 26px rgba(18,48,32,.23); pointer-events:none; text-align:left; }
.chart-tooltip strong { font-size:9px; }
.chart-tooltip span { color:#c9eed8; font-size:10px; font-weight:800; }
.chart-empty { position:absolute; inset:42% auto auto 50%; transform:translate(-50%,-50%); width:min(260px,78%); display:grid; gap:3px; color:#6e7b73; text-align:center; pointer-events:none; }
.chart-empty strong { font-size:11px; }
.chart-empty small { color:#a0aaa4; font-size:8px; }

.reminders-card, .activity-card { min-height:285px; display:flex; flex-direction:column; }
.reminder-list, .activity-list { padding:0 12px; display:grid; gap:6px; }
.reminder-item, .activity-item { width:100%; min-width:0; padding:9px 7px; display:grid; align-items:center; gap:9px; border:0; border-radius:12px; color:var(--ui-text); background:transparent; text-align:left; cursor:pointer; transition:background 150ms ease, transform 150ms ease; }
.reminder-item { grid-template-columns:37px minmax(0,1fr) auto; }
.activity-item { grid-template-columns:34px minmax(0,1fr) auto; }
.reminder-item:hover, .activity-item:hover { background:#f5f8f6; transform:translateX(2px); }
.reminder-date { width:37px; height:37px; display:grid; place-items:center; align-content:center; border-radius:11px; color:#fff; background:linear-gradient(145deg,#387f5c,#0d6842); }
.reminder-date b { font-size:11px; line-height:1; }
.reminder-date small { margin-top:2px; font-size:7px; text-transform:uppercase; opacity:.75; }
.reminder-copy, .activity-copy { min-width:0; display:grid; }
.reminder-copy strong, .reminder-copy small, .activity-copy strong, .activity-copy small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.reminder-copy strong, .activity-copy strong { font-size:9px; }
.reminder-copy small, .activity-copy small { margin-top:3px; color:var(--ui-muted); font-size:7px; }
.reminder-status { padding:4px 6px; border-radius:7px; color:#9a741f; background:var(--ui-yellow-soft); font-size:7px; font-weight:750; white-space:nowrap; }
.activity-avatar { width:34px; height:34px; display:grid; place-items:center; border-radius:11px; color:#325f47; background:#e3f2e9; font-size:9px; font-weight:850; }
.activity-amount { color:var(--ui-green); font-size:8px; font-weight:850; white-space:nowrap; }
.activity-amount.negative { color:var(--ui-red); }
.card-footer-action { margin:auto 12px 12px; min-height:36px; display:flex; align-items:center; justify-content:center; gap:7px; border:0; border-radius:11px; color:#fff; background:var(--ui-green); font-size:8px; font-weight:800; cursor:pointer; }
.card-footer-action:hover { background:var(--ui-green-dark); }
.card-footer-action svg { width:14px; height:14px; }
.compact-empty { min-height:130px; display:grid; place-items:center; align-content:center; gap:4px; color:#8b9890; text-align:center; }
.compact-empty > span { width:34px; height:34px; display:grid; place-items:center; border-radius:11px; color:var(--ui-green); background:var(--ui-green-soft); font-size:13px; font-weight:900; }
.compact-empty strong { font-size:10px; }
.compact-empty small { color:#a4ada7; font-size:8px; }

.portfolio-card { min-height:245px; }
.portfolio-status-list { padding:0 12px 13px; display:grid; gap:5px; }
.portfolio-status-list button { width:100%; min-width:0; min-height:53px; padding:7px 9px; display:grid; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; gap:10px; border:1px solid transparent; border-radius:13px; color:var(--ui-text); background:transparent; text-align:left; cursor:pointer; }
.portfolio-status-list button:hover { border-color:var(--ui-line); background:#f8faf8; }
.status-avatar { width:36px; height:36px; display:grid; place-items:center; border-radius:11px; }
.status-avatar svg { width:17px; height:17px; }
.status-green { color:#16724a; background:#e7f4ec; }
.status-yellow { color:#a77b1c; background:#fff4d8; }
.status-red { color:#c15c5c; background:#ffeded; }
.portfolio-status-list button > span:nth-child(2) { min-width:0; display:grid; }
.portfolio-status-list strong { font-size:9px; }
.portfolio-status-list small { margin-top:3px; color:var(--ui-muted); font-size:7px; }
.portfolio-status-list b { color:#526057; font-size:10px; }

.progress-card { min-height:245px; }
.gauge-button { position:relative; width:100%; height:145px; padding:0 15px; display:block; border:0; background:transparent; cursor:pointer; }
.gauge-button canvas { width:100%; height:100%; display:block; }
.gauge-center { position:absolute; left:50%; top:63%; transform:translate(-50%,-50%); display:grid; place-items:center; }
.gauge-center strong { font-size:27px; letter-spacing:-.05em; }
.gauge-center small { margin-top:2px; color:var(--ui-muted); font-size:8px; }
.gauge-legend { padding:0 16px 15px; display:flex; align-items:center; justify-content:center; gap:16px; color:var(--ui-muted); font-size:7px; }
.gauge-legend span { display:flex; align-items:center; gap:5px; }
.gauge-legend i { width:7px; height:7px; border-radius:50%; }
.legend-complete { background:var(--ui-green); }
.legend-pending { background:#dfe7e1; }

.balance-card { position:relative; isolation:isolate; min-height:245px; padding:19px; overflow:hidden; display:flex; flex-direction:column; align-items:flex-start; border:0; border-radius:var(--ui-radius); color:#fff; background:linear-gradient(145deg,#0b2c1e,#075f3c 62%,#0f7a4d); box-shadow:0 18px 40px rgba(12,92,58,.2); text-align:left; cursor:pointer; }
.balance-card:hover { transform:translateY(-2px); }
.balance-glow { position:absolute; z-index:-1; border:1px solid rgba(255,255,255,.12); border-radius:50%; }
.balance-glow-one { width:150px; height:150px; top:-72px; right:-42px; }
.balance-glow-two { width:90px; height:90px; top:-35px; right:-10px; }
.balance-label { color:rgba(255,255,255,.72); font-size:9px; }
.balance-card > strong { margin-top:8px; font-size:28px; letter-spacing:-.045em; }
.balance-caption { margin-top:5px; color:#bde7cf; font-size:8px; }
.balance-grid { width:100%; margin-top:22px; padding-top:14px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; border-top:1px solid rgba(255,255,255,.13); }
.balance-grid > span { display:grid; }
.balance-grid small { color:rgba(255,255,255,.58); font-size:7px; }
.balance-grid b { margin-top:4px; font-size:10px; }
.balance-footer { width:100%; margin-top:auto; padding-top:17px; display:grid; grid-template-columns:8px minmax(0,1fr) 15px; align-items:center; gap:7px; color:rgba(255,255,255,.68); font-size:7px; }
.balance-footer i { width:7px; height:7px; border-radius:50%; background:#8ee8b5; box-shadow:0 0 0 5px rgba(142,232,181,.11); }
.balance-footer svg { width:14px; height:14px; }

.detail-backdrop { position:fixed; inset:0; z-index:100; background:rgba(26,42,33,.34); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }
.detail-modal { position:fixed; z-index:110; top:50%; left:50%; width:min(calc(100% - 28px),430px); max-height:min(84dvh,680px); overflow-y:auto; transform:translate(-50%,-50%); padding:28px; border:1px solid var(--ui-line); border-radius:24px; color:var(--ui-text); background:#fff; box-shadow:0 30px 90px rgba(32,61,43,.2); }
.detail-close { position:absolute; top:13px; right:13px; width:38px; height:38px; display:grid; place-items:center; border:1px solid var(--ui-line); border-radius:11px; color:var(--ui-muted); background:#fafcfb; cursor:pointer; }
.detail-close svg { width:17px; height:17px; }
.detail-icon { width:48px; height:48px; display:grid; place-items:center; border-radius:15px; color:var(--ui-green); background:var(--ui-green-soft); }
.detail-icon svg { width:22px; height:22px; }
.detail-kicker { margin:18px 0 6px; color:var(--ui-green); font-size:9px; font-weight:850; letter-spacing:.12em; text-transform:uppercase; }
.detail-modal h2 { margin:0; font-size:25px; letter-spacing:-.035em; }
.detail-content { margin-top:18px; color:var(--ui-muted); font-size:11px; line-height:1.6; }
.detail-content p { margin:12px 0 0; }
.detail-stat { padding:17px; display:grid; border:1px solid #d9ebdf; border-radius:15px; background:#f0f8f3; }
.detail-stat strong { color:var(--ui-green); font-size:28px; letter-spacing:-.04em; }
.detail-stat span { margin-top:3px; font-size:9px; }
.detail-stat.warning { border-color:#f0dfb3; background:#fff8e6; }
.detail-stat.warning strong { color:#a87b19; }
.detail-stat.danger { border-color:#f0cccc; background:#fff2f2; }
.detail-stat.danger strong { color:var(--ui-red); }
.detail-stat.profit { border-color:#cfe4d7; background:#edf7f1; }
.detail-columns { margin-top:10px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.detail-columns > div { padding:12px; display:grid; border:1px solid var(--ui-line); border-radius:12px; }
.detail-columns span { font-size:8px; }
.detail-columns strong { margin-top:4px; color:var(--ui-text); font-size:12px; }
.detail-list { margin-top:10px; display:grid; gap:7px; }
.detail-list > div { padding:10px 11px; display:flex; align-items:center; justify-content:space-between; gap:16px; border:1px solid var(--ui-line); border-radius:11px; background:#fafcfb; }
.detail-list > div > span { min-width:0; display:grid; }
.detail-list strong { color:var(--ui-text); font-size:9px; }
.detail-list small { margin-top:2px; color:var(--ui-muted); font-size:7px; }
.detail-list b { color:var(--ui-text); font-size:9px; white-space:nowrap; }
.detail-empty { padding:24px; display:grid; gap:5px; border:1px dashed var(--ui-line-strong); border-radius:13px; text-align:center; }
.detail-empty strong { color:var(--ui-text); }
.detail-primary { width:100%; min-height:44px; margin-top:20px; border:0; border-radius:12px; color:#fff; background:var(--ui-green); font-weight:850; cursor:pointer; }
.detail-primary:hover { background:var(--ui-green-dark); }
.dashboard-toast { position:fixed; z-index:130; right:20px; bottom:20px; max-width:min(360px,calc(100% - 40px)); padding:13px 15px; border:1px solid #d6e4da; border-radius:13px; color:var(--ui-text); background:#fff; box-shadow:var(--ui-shadow); font-size:10px; }
.dashboard-toast.success { border-color:#bde0ca; }
.dashboard-toast.error { border-color:#efc7c7; color:#a94848; }

.reveal { animation:revealUp 520ms both cubic-bezier(.2,.75,.3,1); animation-delay:var(--delay,0ms); }
@keyframes revealUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes spin { to { transform:rotate(360deg); } }

@media (max-width: 1220px) {
  .dashboard-shell { grid-template-columns:200px minmax(0,1fr); }
  .dashboard-top-grid { grid-template-columns:minmax(0,1.6fr) minmax(210px,.72fr); }
  .activity-card { grid-column:1 / -1; min-height:215px; }
  .activity-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-bottom-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .balance-card { grid-column:1 / -1; min-height:205px; }
}

@media (max-width: 900px) {
  .dashboard-shell { display:block; }
  .sidebar { position:fixed; left:0; top:0; width:min(82vw,280px); height:100dvh; transform:translateX(-105%); transition:transform 220ms cubic-bezier(.2,.7,.3,1); box-shadow:20px 0 60px rgba(40,60,49,.16); }
  body.sidebar-open .sidebar { transform:translateX(0); }
  .sidebar-close { display:grid; }
  .sidebar-backdrop { position:fixed; inset:0; z-index:45; background:rgba(31,48,38,.35); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }
  .mobile-menu-button { display:grid; }
  .workspace { grid-template-rows:auto minmax(0,1fr); }
  .topbar { padding:11px 16px; }
  .dashboard-content { padding:20px 16px 30px; }
  .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-top-grid, .dashboard-bottom-grid { grid-template-columns:1fr; }
  .analytics-card, .reminders-card, .activity-card, .portfolio-card, .progress-card, .balance-card { grid-column:auto; }
  .activity-list { grid-template-columns:1fr; }
  .balance-card { min-height:230px; }
}

@media (max-width: 680px) {
  .auth-page { padding:max(18px,env(safe-area-inset-top)) 16px max(18px,env(safe-area-inset-bottom)); background-attachment:scroll; }
  .auth-card { margin:0 auto; padding:30px 24px; border-radius:28px; }
  .auth-heading h1 { font-size:36px; }
  .auth-heading > span { font-size:14px; }
  .auth-field input { min-height:60px; border-radius:16px; }
  .auth-submit { min-height:62px; border-radius:16px; }
  .setup-grid { grid-template-columns:1fr; }
  .global-search { flex:1; width:auto; }
  .global-search kbd { display:none; }
  .profile-name, .profile-button > svg { display:none; }
  .profile-button { grid-template-columns:36px; padding:4px; }
  .page-heading { align-items:flex-start; }
  .page-heading p { max-width:260px; }
  .heading-actions { flex-direction:column; align-items:stretch; }
  .heading-actions .button { min-height:38px; }
  .metric-card { min-height:126px; padding:14px; }
  .metric-card > strong { font-size:25px; }
  .metric-change { display:none; }
  .dashboard-top-grid, .dashboard-bottom-grid { gap:10px; }
  .analytics-chart-button { height:215px; }
}

@media (max-width: 460px) {
  .topbar { gap:8px; padding-inline:11px; }
  .topbar-actions { gap:5px; }
  .topbar-icon { width:39px; height:39px; }
  .topbar-actions > a.topbar-icon { display:none; }
  .global-search { min-height:40px; padding-inline:10px; }
  .global-search input { font-size:11px; }
  .dashboard-content { padding:17px 11px 26px; }
  .page-heading { display:grid; gap:13px; }
  .heading-actions { display:grid; grid-template-columns:1fr 1fr; }
  .metric-grid { gap:8px; }
  .metric-card { min-height:118px; padding:12px; border-radius:15px; }
  .metric-head { font-size:8px; }
  .metric-head i { width:24px; height:24px; }
  .metric-card > strong { margin-top:9px; font-size:22px; }
  .metric-card > small { font-size:7px; }
  .card-heading { padding:14px 13px 9px; }
  .period-select { min-width:118px; }
  .analytics-chart-button { height:205px; padding-inline:5px; }
  .reminder-list, .activity-list, .portfolio-status-list { padding-inline:8px; }
  .reminder-status { display:none; }
  .detail-modal { padding:25px 18px 20px; border-radius:19px; }
}

@media (max-width: 390px) {
  .auth-page { padding-inline:12px; }
  .auth-card { padding:27px 20px; border-radius:25px; }
  .account-modal { width:min(calc(100% - 24px),430px); padding:28px 20px 22px; border-radius:23px; }
  .account-modal h2 { font-size:26px; }
  .account-whatsapp-button { min-height:56px; font-size:14px; }
  .auth-heading h1 { font-size:33px; }
  .auth-field input { min-height:58px; padding-left:19px; font-size:15px; }
  .remember-row { font-size:13px; }
  .metric-grid { grid-template-columns:1fr 1fr; }
  .metric-card { min-height:112px; }
  .metric-card > strong { font-size:20px; }
  .heading-actions { grid-template-columns:1fr; }
  .page-heading h1 { font-size:27px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; transition-duration:.01ms !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; }
}

@media (max-width: 680px) {
  .topbar { min-width: 0; }
  .global-search { flex: 1 1 0; min-width: 0; width: 0; }
  .topbar-actions { flex: none; }
}


/* ==============================================================
   INICIO RC3 — legibilidad, responsive y menú de cuenta
   ============================================================= */
body[data-page="dashboard"] { font-size:16px; }
body[data-page="dashboard"] .dashboard-shell { grid-template-columns:250px minmax(0,1fr); }
body[data-page="dashboard"] .sidebar { padding:29px 20px 20px; }
body[data-page="dashboard"] .brand-symbol { width:42px; height:42px; }
body[data-page="dashboard"] .brand-symbol svg { width:27px; height:27px; }
body[data-page="dashboard"] .brand-text { font-size:17px; }
body[data-page="dashboard"] .brand-text small { font-size:14px; }
body[data-page="dashboard"] .nav-label { margin:36px 12px 12px; font-size:12px; }
body[data-page="dashboard"] .nav-label-general { margin-top:32px; }
body[data-page="dashboard"] .sidebar-link { min-height:49px; padding-inline:14px; grid-template-columns:24px minmax(0,1fr); gap:12px; border-radius:14px; font-size:15px; }
body[data-page="dashboard"] .sidebar-link svg { width:21px; height:21px; }
body[data-page="dashboard"] .sidebar-promo { min-height:182px; padding:20px; }
body[data-page="dashboard"] .promo-badge { width:34px; height:34px; font-size:12px; }
body[data-page="dashboard"] .sidebar-promo strong { font-size:16px; }
body[data-page="dashboard"] .sidebar-promo small { font-size:12px; line-height:1.55; }
body[data-page="dashboard"] .promo-cta { font-size:12px; }
body[data-page="dashboard"] .workspace { grid-template-rows:82px minmax(0,1fr); }
body[data-page="dashboard"] .topbar { padding:16px clamp(20px,3vw,38px); gap:20px; }
body[data-page="dashboard"] .mobile-menu-button,
body[data-page="dashboard"] .topbar-icon { width:46px; height:46px; border-radius:14px; }
body[data-page="dashboard"] .global-search { width:min(100%,470px); min-height:49px; padding-inline:14px; border-radius:15px; }
body[data-page="dashboard"] .global-search input { font-size:15px; }
body[data-page="dashboard"] .global-search kbd { font-size:11px; }
body[data-page="dashboard"] .topbar-actions { position:relative; gap:10px; }
body[data-page="dashboard"] .profile-button { min-height:52px; padding:5px 10px 5px 6px; grid-template-columns:40px minmax(0,1fr) 18px; gap:10px; }
body[data-page="dashboard"] .profile-avatar { width:40px; height:40px; font-size:14px; }
body[data-page="dashboard"] .profile-name strong { font-size:13px; }
body[data-page="dashboard"] .profile-name small { margin-top:3px; font-size:10px; }
body[data-page="dashboard"] .profile-chevron { transition:transform 160ms ease; }
body[data-page="dashboard"] .profile-button.is-open .profile-chevron { transform:rotate(180deg); }
body[data-page="dashboard"] .profile-menu {
  position:absolute; z-index:80; top:calc(100% + 10px); right:0; width:280px; padding:10px;
  border:1px solid var(--ui-line); border-radius:18px; background:#fff; box-shadow:0 24px 60px rgba(31,56,41,.18);
  animation:profileMenuIn 150ms both ease-out;
}
body[data-page="dashboard"] .profile-menu-header { padding:10px 10px 14px; display:grid; grid-template-columns:44px minmax(0,1fr); align-items:center; gap:11px; border-bottom:1px solid var(--ui-line); }
body[data-page="dashboard"] .profile-menu-header > span:last-child { min-width:0; display:grid; }
body[data-page="dashboard"] .profile-menu-header strong,
body[data-page="dashboard"] .profile-menu-header small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body[data-page="dashboard"] .profile-menu-header strong { font-size:14px; }
body[data-page="dashboard"] .profile-menu-header small { margin-top:3px; color:var(--ui-muted); font-size:11px; }
body[data-page="dashboard"] .profile-menu-avatar { width:44px; height:44px; }
body[data-page="dashboard"] .profile-menu-item { width:100%; min-height:46px; margin-top:6px; padding:0 11px; display:grid; grid-template-columns:22px minmax(0,1fr); align-items:center; gap:11px; border:0; border-radius:12px; color:var(--ui-text); background:transparent; font:inherit; font-size:14px; font-weight:720; text-align:left; cursor:pointer; }
body[data-page="dashboard"] .profile-menu-item:hover { background:#f4f8f5; color:var(--ui-green); }
body[data-page="dashboard"] .profile-menu-item svg { width:20px; height:20px; }
body[data-page="dashboard"] .profile-menu-item-danger { color:#b34848; }
body[data-page="dashboard"] .profile-menu-item-danger:hover { color:#a43737; background:#fff2f2; }
body[data-page="dashboard"] .profile-menu-item:disabled { opacity:.55; cursor:wait; }
body[data-page="dashboard"] .dashboard-content { max-width:1560px; padding:28px clamp(20px,3vw,38px) 44px; }
body[data-page="dashboard"] .page-heading { margin-bottom:22px; }
body[data-page="dashboard"] .page-heading h1 { font-size:clamp(34px,3vw,42px); }
body[data-page="dashboard"] .page-heading p { margin-top:7px; font-size:14px; }
body[data-page="dashboard"] .button { min-height:45px; padding-inline:19px; border-radius:14px; font-size:14px; }
body[data-page="dashboard"] .metric-grid { gap:14px; }
body[data-page="dashboard"] .metric-card { min-height:162px; padding:19px 20px; border-radius:19px; }
body[data-page="dashboard"] .metric-head { font-size:13px; }
body[data-page="dashboard"] .metric-head i { width:31px; height:31px; }
body[data-page="dashboard"] .metric-head svg { width:15px; height:15px; }
body[data-page="dashboard"] .metric-card > strong { margin-top:14px; font-size:37px; }
body[data-page="dashboard"] .metric-card > small { margin-top:8px; font-size:12px; }
body[data-page="dashboard"] .metric-change { padding-top:13px; gap:6px; font-size:10.5px; }
body[data-page="dashboard"] .dashboard-top-grid,
body[data-page="dashboard"] .dashboard-bottom-grid { margin-top:14px; gap:14px; }
body[data-page="dashboard"] .card-heading { padding:20px 20px 12px; }
body[data-page="dashboard"] .card-heading h2 { font-size:16px; }
body[data-page="dashboard"] .card-heading p { margin-top:5px; font-size:11.5px; }
body[data-page="dashboard"] .period-select { min-width:154px; }
body[data-page="dashboard"] .period-select select { min-height:39px; padding-inline:13px 34px; font-size:13px; }
body[data-page="dashboard"] .small-action { min-height:36px; padding-inline:13px; font-size:12px; }
body[data-page="dashboard"] .icon-action { width:37px; height:37px; }
body[data-page="dashboard"] .analytics-card,
body[data-page="dashboard"] .reminders-card,
body[data-page="dashboard"] .activity-card { min-height:345px; }
body[data-page="dashboard"] .analytics-chart-button { height:275px; padding-inline:16px; }
body[data-page="dashboard"] .chart-tooltip strong { font-size:12px; }
body[data-page="dashboard"] .chart-tooltip span { font-size:13px; }
body[data-page="dashboard"] .chart-empty strong { font-size:14px; }
body[data-page="dashboard"] .chart-empty small { font-size:11px; }
body[data-page="dashboard"] .reminder-list,
body[data-page="dashboard"] .activity-list { padding-inline:15px; gap:8px; }
body[data-page="dashboard"] .reminder-item,
body[data-page="dashboard"] .activity-item { padding:11px 9px; gap:11px; }
body[data-page="dashboard"] .reminder-item { grid-template-columns:44px minmax(0,1fr) auto; }
body[data-page="dashboard"] .activity-item { grid-template-columns:42px minmax(0,1fr) auto; }
body[data-page="dashboard"] .reminder-date { width:44px; height:44px; }
body[data-page="dashboard"] .reminder-date b { font-size:13px; }
body[data-page="dashboard"] .reminder-date small { font-size:9px; }
body[data-page="dashboard"] .reminder-copy strong,
body[data-page="dashboard"] .activity-copy strong { font-size:12.5px; }
body[data-page="dashboard"] .reminder-copy small,
body[data-page="dashboard"] .activity-copy small { margin-top:4px; font-size:10px; }
body[data-page="dashboard"] .reminder-status { padding:5px 8px; font-size:10px; }
body[data-page="dashboard"] .activity-avatar { width:42px; height:42px; font-size:11px; }
body[data-page="dashboard"] .activity-amount { font-size:11.5px; }
body[data-page="dashboard"] .card-footer-action { min-height:44px; margin:14px 15px 15px; font-size:12px; }
body[data-page="dashboard"] .compact-empty { min-height:185px; gap:7px; }
body[data-page="dashboard"] .compact-empty > span { width:44px; height:44px; font-size:16px; }
body[data-page="dashboard"] .compact-empty strong { font-size:13px; }
body[data-page="dashboard"] .compact-empty small { font-size:10.5px; }
body[data-page="dashboard"] .portfolio-card,
body[data-page="dashboard"] .progress-card,
body[data-page="dashboard"] .balance-card { min-height:285px; }
body[data-page="dashboard"] .portfolio-status-list { padding:0 15px 16px; gap:7px; }
body[data-page="dashboard"] .portfolio-status-list button { min-height:64px; grid-template-columns:44px minmax(0,1fr) auto; }
body[data-page="dashboard"] .status-avatar { width:44px; height:44px; }
body[data-page="dashboard"] .portfolio-status-list strong { font-size:12.5px; }
body[data-page="dashboard"] .portfolio-status-list small { font-size:10px; }
body[data-page="dashboard"] .portfolio-status-list b { font-size:13px; }
body[data-page="dashboard"] .gauge-center strong { font-size:33px; }
body[data-page="dashboard"] .gauge-center small { font-size:11px; }
body[data-page="dashboard"] .gauge-legend { font-size:10px; }
body[data-page="dashboard"] .balance-card { padding:23px; }
body[data-page="dashboard"] .balance-label { font-size:12px; }
body[data-page="dashboard"] .balance-card > strong { font-size:36px; }
body[data-page="dashboard"] .balance-caption { font-size:11px; }
body[data-page="dashboard"] .balance-grid small { font-size:10px; }
body[data-page="dashboard"] .balance-grid b { font-size:13px; }
body[data-page="dashboard"] .balance-footer { font-size:10px; }
body[data-page="dashboard"] .detail-kicker { font-size:11px; }
body[data-page="dashboard"] .detail-modal h2 { font-size:29px; }
body[data-page="dashboard"] .detail-content { font-size:14px; }
body[data-page="dashboard"] .detail-stat strong { font-size:32px; }
body[data-page="dashboard"] .detail-stat span { font-size:12px; }
body[data-page="dashboard"] .detail-columns span { font-size:11px; }
body[data-page="dashboard"] .detail-columns strong { font-size:14px; }
body[data-page="dashboard"] .detail-list strong { font-size:12px; }
body[data-page="dashboard"] .detail-list small { font-size:10px; }
body[data-page="dashboard"] .detail-list b { font-size:12px; }
body[data-page="dashboard"] .detail-primary { min-height:48px; font-size:14px; }
body[data-page="dashboard"] .dashboard-toast { font-size:13px; }
@keyframes profileMenuIn { from { opacity:0; transform:translateY(-5px) scale(.98); } to { opacity:1; transform:none; } }

@media (max-width:1220px) {
  body[data-page="dashboard"] .dashboard-shell { grid-template-columns:224px minmax(0,1fr); }
}
@media (max-width:900px) {
  body[data-page="dashboard"] .sidebar { width:min(86vw,320px); }
  body[data-page="dashboard"] .workspace { grid-template-rows:auto minmax(0,1fr); }
  body[data-page="dashboard"] .topbar { min-height:74px; padding:13px 17px; }
  body[data-page="dashboard"] .dashboard-content { padding:23px 17px 36px; }
  body[data-page="dashboard"] .metric-grid { gap:12px; }
}
@media (max-width:680px) {
  body[data-page="dashboard"] .profile-menu { position:fixed; top:72px; right:12px; width:min(300px,calc(100vw - 24px)); }
  body[data-page="dashboard"] .page-heading h1 { font-size:35px; }
  body[data-page="dashboard"] .page-heading p { max-width:310px; font-size:13px; }
  body[data-page="dashboard"] .button { min-height:43px; font-size:13px; }
  body[data-page="dashboard"] .metric-card { min-height:148px; padding:17px; }
  body[data-page="dashboard"] .metric-head { font-size:12px; }
  body[data-page="dashboard"] .metric-card > strong { font-size:32px; }
  body[data-page="dashboard"] .metric-card > small { font-size:10.5px; }
  body[data-page="dashboard"] .card-heading h2 { font-size:15px; }
  body[data-page="dashboard"] .card-heading p { font-size:11px; }
  body[data-page="dashboard"] .analytics-chart-button { height:250px; }
}
@media (max-width:460px) {
  body[data-page="dashboard"] .topbar { min-height:68px; padding-inline:12px; }
  body[data-page="dashboard"] .global-search input { font-size:13px; }
  body[data-page="dashboard"] .dashboard-content { padding:21px 12px 32px; }
  body[data-page="dashboard"] .page-heading { gap:15px; }
  body[data-page="dashboard"] .metric-grid { gap:10px; }
  body[data-page="dashboard"] .metric-card { min-height:142px; padding:15px; }
  body[data-page="dashboard"] .metric-head { align-items:flex-start; font-size:11px; line-height:1.25; }
  body[data-page="dashboard"] .metric-card > strong { font-size:28px; }
  body[data-page="dashboard"] .metric-card > small { font-size:10px; line-height:1.35; }
  body[data-page="dashboard"] .card-heading { padding:17px 15px 11px; }
  body[data-page="dashboard"] .period-select { min-width:138px; }
  body[data-page="dashboard"] .period-select select { font-size:12px; }
  body[data-page="dashboard"] .reminder-list,
  body[data-page="dashboard"] .activity-list,
  body[data-page="dashboard"] .portfolio-status-list { padding-inline:10px; }
}
@media (max-width:360px) {
  body[data-page="dashboard"] .metric-grid { grid-template-columns:1fr; }
  body[data-page="dashboard"] .metric-card { min-height:136px; }
}

/* =====================================================================
   CLIENTES RC1 · módulo de cartera, multiaplicación y ficha completa
   ===================================================================== */
body.client-modal-open { overflow: hidden; }
body[data-page="dashboard"] textarea { font: inherit; }
body[data-page="dashboard"] .app-view[hidden] { display: none !important; }
body[data-page="dashboard"] .page-eyebrow { margin:0 0 7px; color:var(--ui-green); font-size:11px; font-weight:850; letter-spacing:.11em; text-transform:uppercase; }

/* Botón flotante disponible en todas las secciones */
.new-client-fab {
  position:fixed; z-index:64; right:max(24px,env(safe-area-inset-right)); bottom:max(24px,env(safe-area-inset-bottom));
  min-height:58px; padding:0 20px; display:flex; align-items:center; justify-content:center; gap:10px;
  border:1px solid #09613e; border-radius:999px; color:#fff; background:linear-gradient(145deg,#15885a,#086d45);
  box-shadow:0 18px 38px rgba(8,109,69,.32),0 4px 10px rgba(8,109,69,.18); cursor:pointer;
  font:inherit; font-size:14px; font-weight:850; transition:transform 160ms ease,box-shadow 160ms ease,filter 160ms ease;
}
.new-client-fab svg { width:23px; height:23px; stroke-width:2.3; }
.new-client-fab:hover { transform:translateY(-3px); filter:brightness(1.04); box-shadow:0 22px 46px rgba(8,109,69,.38),0 5px 12px rgba(8,109,69,.2); }
.new-client-fab:active { transform:translateY(-1px) scale(.98); }

/* Clientes: barra y tarjetas */
.clients-view { min-height:calc(100vh - 82px); }
.clients-heading { align-items:flex-end; }
.clients-toolbar {
  margin-bottom:18px; padding:14px; display:flex; align-items:center; justify-content:space-between; gap:16px;
  min-height:auto; overflow:visible;
}
.clients-search {
  width:min(100%,470px); min-height:48px; padding:0 15px; display:flex; align-items:center; gap:10px;
  border:1px solid var(--ui-line); border-radius:14px; background:#f8faf8;
}
.clients-search svg { width:20px; height:20px; color:#819088; }
.clients-search input { min-width:0; flex:1; border:0; outline:0; color:var(--ui-text); background:transparent; font-size:14px; }
.client-status-tabs { display:flex; align-items:center; gap:5px; padding:4px; border:1px solid var(--ui-line); border-radius:13px; background:#f7f9f7; }
.client-status-tabs button { min-height:38px; padding:0 14px; border:0; border-radius:10px; color:#68766e; background:transparent; cursor:pointer; font:inherit; font-size:12px; font-weight:780; }
.client-status-tabs button:hover { color:var(--ui-green); background:#edf5f0; }
.client-status-tabs button.active { color:#fff; background:var(--ui-green); box-shadow:0 6px 14px rgba(12,112,70,.18); }
.clients-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.client-card {
  position:relative; min-width:0; min-height:360px; padding:18px; display:flex; flex-direction:column;
  border:1px solid var(--ui-line); border-radius:21px; color:var(--ui-text); background:#fff;
  box-shadow:var(--ui-shadow-soft); transition:transform 170ms ease,border-color 170ms ease,box-shadow 170ms ease;
}
.client-card:hover,.client-card:focus-visible { transform:translateY(-3px); border-color:#cbd9cf; box-shadow:var(--ui-shadow); outline:none; }
.client-card-header { position:relative; display:grid; grid-template-columns:48px minmax(0,1fr) auto 36px; align-items:center; gap:11px; }
.client-avatar { width:48px; height:48px; display:grid; place-items:center; flex:none; border-radius:15px; color:#0b6c45; background:linear-gradient(145deg,#dff3e8,#c8e9d8); font-size:14px; font-weight:900; }
.client-card-identity { min-width:0; display:grid; }
.client-card-identity strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:15px; }
.client-card-identity small { margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ui-muted); font-size:11px; }
.client-status { display:inline-flex; align-items:center; justify-content:center; min-height:26px; padding:0 9px; border-radius:999px; font-size:10px; font-weight:850; white-space:nowrap; }
.client-status-active { color:#0b7047; background:#e6f5ec; }
.client-status-expiring { color:#9b6b07; background:#fff3d4; }
.client-status-expired { color:#b94b4b; background:#ffeded; }
.client-card-menu-button { width:36px; height:36px; display:grid; place-items:center; padding:0; border:1px solid var(--ui-line); border-radius:11px; color:#718078; background:#fff; cursor:pointer; }
.client-card-menu-button:hover { color:var(--ui-green); background:#f2f8f4; }
.client-card-menu-button svg { width:19px; height:19px; fill:currentColor; stroke:none; }
.client-card-menu { position:absolute; z-index:20; top:44px; right:0; width:170px; padding:6px; border:1px solid var(--ui-line); border-radius:13px; background:#fff; box-shadow:0 16px 38px rgba(34,62,45,.16); }
.client-card-menu button { width:100%; min-height:38px; padding:0 10px; border:0; border-radius:9px; color:var(--ui-text); background:transparent; text-align:left; cursor:pointer; font:inherit; font-size:12px; font-weight:720; }
.client-card-menu button:hover { color:var(--ui-green); background:#f1f7f3; }
.client-card-main { margin-top:20px; padding:14px; display:grid; grid-template-columns:92px minmax(0,1fr); gap:15px; border-radius:15px; background:#f7faf8; }
.client-card-count { display:flex; flex-direction:column; justify-content:center; border-right:1px solid #e3eae5; }
.client-card-count strong { font-size:28px; line-height:1; letter-spacing:-.04em; }
.client-card-count span { margin-top:5px; color:var(--ui-muted); font-size:10px; }
.client-next-due { min-width:0; display:grid; }
.client-next-due small { color:var(--ui-muted); font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.client-next-due strong { margin-top:5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.client-next-due span { margin-top:4px; color:#718078; font-size:10px; line-height:1.4; }
.client-progress { margin-top:17px; }
.client-progress > span { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:11px; }
.client-progress > span b { font-weight:780; }
.client-progress > span strong { color:var(--ui-green); font-size:12px; }
.client-progress > div,.detail-service-progress > div { height:8px; margin-top:8px; overflow:hidden; border-radius:999px; background:#e9eeea; }
.client-progress i,.detail-service-progress i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#0d7449,#62b88a); transition:width 500ms ease; }
.client-service-summary { margin:16px 0 0; padding:0; display:grid; gap:7px; list-style:none; }
.client-service-summary li { min-width:0; display:grid; grid-template-columns:minmax(0,auto) minmax(0,1fr); align-items:center; gap:7px; }
.client-service-summary li::before { content:""; width:7px; height:7px; border-radius:50%; background:#5fb989; }
.client-service-summary li span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11.5px; font-weight:760; }
.client-service-summary li small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ui-muted); font-size:9.5px; }
.client-service-summary .client-service-extra { display:block; color:var(--ui-green); font-size:10px; font-weight:800; }
.client-service-summary .client-service-extra::before { display:none; }
.client-card footer { margin-top:auto; padding-top:17px; display:flex; align-items:center; justify-content:space-between; gap:10px; border-top:1px solid #edf1ee; }
.client-card footer button { min-height:39px; border:0; border-radius:11px; color:var(--ui-green); background:#edf6f1; cursor:pointer; font:inherit; font-size:11px; font-weight:820; }
.client-card footer button:first-child { flex:1; padding:0 13px; }
.client-card footer button:last-child { width:40px; display:grid; place-items:center; }
.client-card footer button:hover { color:#fff; background:var(--ui-green); }
.client-card footer svg { width:17px; height:17px; }
.client-card-skeleton { overflow:hidden; pointer-events:none; }
.client-card-skeleton::after { content:""; position:absolute; inset:0; background:linear-gradient(100deg,transparent 20%,rgba(255,255,255,.75) 50%,transparent 80%); transform:translateX(-100%); animation:skeletonSlide 1.2s infinite; }
.client-card-skeleton span { height:18px; margin-bottom:18px; border-radius:8px; background:#edf1ee; }
.client-card-skeleton span:nth-child(1) { width:70%; height:48px; }.client-card-skeleton span:nth-child(2){ width:100%; height:92px; }.client-card-skeleton span:nth-child(3){ width:86%; height:72px; }
.clients-empty { min-height:360px; padding:40px; display:grid; place-items:center; align-content:center; text-align:center; }
.clients-empty > span { width:68px; height:68px; display:grid; place-items:center; border-radius:22px; color:var(--ui-green); background:var(--ui-green-soft); }
.clients-empty svg { width:34px; height:34px; }
.clients-empty h2 { margin:18px 0 0; font-size:22px; }.clients-empty p { max-width:420px; margin:9px 0 20px; color:var(--ui-muted); font-size:13px; line-height:1.6; }
.clients-pagination { margin-top:20px; display:flex; align-items:center; justify-content:center; gap:12px; }
.clients-pagination button { min-height:40px; padding:0 16px; border:1px solid var(--ui-line); border-radius:11px; color:var(--ui-text); background:#fff; cursor:pointer; font:inherit; font-size:12px; font-weight:760; }
.clients-pagination button:disabled { opacity:.45; cursor:default; }.clients-pagination span { color:var(--ui-muted); font-size:11px; }

/* Modal de alta y edición */
.client-modal-backdrop { position:fixed; inset:0; z-index:100; background:rgba(15,35,24,.46); -webkit-backdrop-filter:blur(5px); backdrop-filter:blur(5px); }
.client-modal {
  position:fixed; z-index:110; top:3vh; bottom:3vh; left:50%; width:min(1120px,calc(100vw - 38px)); transform:translateX(-50%);
  display:grid; grid-template-rows:auto minmax(0,1fr); overflow:hidden; border:1px solid rgba(255,255,255,.85); border-radius:24px;
  color:var(--ui-text); background:#f5f7f5; box-shadow:0 36px 100px rgba(20,48,31,.28); animation:clientModalIn 180ms both ease-out;
}
.client-modal-header { min-height:94px; padding:19px 24px; display:flex; align-items:center; justify-content:space-between; gap:20px; border-bottom:1px solid var(--ui-line); background:#fff; }
.client-modal-header p { margin:0 0 5px; color:var(--ui-green); font-size:10px; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.client-modal-header h2 { margin:0; font-size:25px; letter-spacing:-.035em; }.client-modal-header span { display:block; margin-top:5px; color:var(--ui-muted); font-size:11.5px; }
.client-modal-close { width:44px; height:44px; flex:none; display:grid; place-items:center; padding:0; border:1px solid var(--ui-line); border-radius:13px; color:#66756c; background:#f8faf8; cursor:pointer; }
.client-modal-close:hover { color:#b34b4b; background:#fff0f0; }.client-modal-close svg { width:21px; height:21px; }
.client-form { min-height:0; display:grid; grid-template-rows:minmax(0,1fr) auto; }
.client-modal-scroll { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:20px; scrollbar-gutter:stable; }
.client-form-section { padding:20px; border:1px solid var(--ui-line); border-radius:20px; background:#fff; box-shadow:0 7px 20px rgba(38,64,49,.04); }
.client-form-section + .client-form-section { margin-top:16px; }
.section-heading { margin-bottom:18px; display:flex; align-items:center; gap:12px; }
.section-icon { width:42px; height:42px; flex:none; display:grid; place-items:center; border-radius:13px; color:var(--ui-green); background:var(--ui-green-soft); }
.section-icon svg { width:21px; height:21px; }.section-heading h3 { margin:0; font-size:17px; letter-spacing:-.02em; }.section-heading p { margin:4px 0 0; color:var(--ui-muted); font-size:11px; }
.form-grid { display:grid; gap:14px; }.form-grid-two { grid-template-columns:repeat(2,minmax(0,1fr)); }.form-grid-four { grid-template-columns:repeat(4,minmax(0,1fr)); }.form-grid-service { grid-template-columns:repeat(4,minmax(0,1fr)); }.provider-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; align-items:end; }.finance-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.form-field { min-width:0; display:grid; gap:7px; }.form-field > span { color:#4c5b52; font-size:11.5px; font-weight:780; }.form-field > span b { color:#c54f4f; }.form-field > span em { margin-left:6px; padding:3px 6px; border-radius:999px; color:#0d7048; background:#e7f5ed; font-size:8.5px; font-style:normal; text-transform:uppercase; letter-spacing:.04em; }
.form-field input,.form-field select,.form-field textarea { width:100%; min-height:46px; padding:0 13px; border:1px solid #dfe6e1; border-radius:12px; outline:0; color:var(--ui-text); background:#f9fbf9; font-size:13px; transition:border-color 150ms ease,box-shadow 150ms ease,background 150ms ease; }
.form-field textarea { min-height:105px; padding-block:12px; resize:vertical; line-height:1.5; }.form-field input:focus,.form-field select:focus,.form-field textarea:focus { border-color:#76ae8c; background:#fff; box-shadow:0 0 0 4px rgba(12,112,70,.1); }.form-field small { margin-top:-2px; color:var(--ui-muted); font-size:9.5px; line-height:1.4; }
.service-form-list { display:grid; gap:16px; }
.service-form-card { position:relative; padding:17px; border:1px solid #dfe7e1; border-radius:18px; background:#fbfcfb; }
.service-card-heading { margin-bottom:14px; display:flex; align-items:center; justify-content:space-between; gap:15px; }
.service-card-heading > div { display:flex; align-items:center; gap:9px; }.service-number { padding:5px 8px; border-radius:8px; color:var(--ui-green); background:var(--ui-green-soft); font-size:9px; font-weight:850; text-transform:uppercase; letter-spacing:.05em; }.service-card-heading h4 { margin:0; font-size:15px; }.service-card-heading h4 b { color:var(--ui-green); }
.remove-service-button { min-height:36px; padding:0 10px; display:flex; align-items:center; gap:6px; border:1px solid #f0d8d8; border-radius:10px; color:#bd5555; background:#fff5f5; cursor:pointer; font:inherit; font-size:10px; font-weight:780; }.remove-service-button:hover { color:#fff; background:#c65d5d; }.remove-service-button:disabled { opacity:.35; cursor:not-allowed; }.remove-service-button svg { width:16px; height:16px; }
.service-block { padding:14px; border:1px solid #ebefec; border-radius:14px; background:#fff; }.service-block + .service-block { margin-top:11px; }.service-block-title { margin-bottom:12px; display:flex; align-items:center; justify-content:space-between; gap:10px; }.service-block-title span { font-size:11px; font-weight:850; text-transform:uppercase; letter-spacing:.05em; }.service-block-title small { color:var(--ui-muted); font-size:9.5px; }
.secret-control { position:relative; display:block; }.secret-control input { padding-right:46px; }.secret-toggle { position:absolute; top:50%; right:5px; width:36px; height:36px; transform:translateY(-50%); display:grid; place-items:center; padding:0; border:0; border-radius:9px; color:#6f7e75; background:transparent; cursor:pointer; }.secret-toggle:hover { color:var(--ui-green); background:#edf5f0; }.secret-toggle svg { width:18px; height:18px; }
.provider-whatsapp { min-height:46px; padding:0 14px; display:flex; align-items:center; justify-content:center; gap:7px; border:1px solid #a8dac0; border-radius:12px; color:#087442; background:#e9f7ef; cursor:pointer; font:inherit; font-size:11px; font-weight:820; }.provider-whatsapp:hover:not(:disabled) { color:#fff; background:#0b7a49; }.provider-whatsapp:disabled { opacity:.45; cursor:not-allowed; }.provider-whatsapp svg { width:18px; height:18px; }
.profit-field { position:relative; }.reset-profit { width:max-content; margin-top:1px; padding:0; border:0; color:var(--ui-green); background:transparent; cursor:pointer; font:inherit; font-size:9.5px; font-weight:800; text-decoration:underline; text-underline-offset:3px; }
.add-service-button { width:100%; min-height:49px; margin-top:15px; display:flex; align-items:center; justify-content:center; gap:9px; border:1px dashed #83b99a; border-radius:14px; color:var(--ui-green); background:#f0f8f3; cursor:pointer; font:inherit; font-size:12px; font-weight:850; }.add-service-button:hover { color:#fff; background:var(--ui-green); border-style:solid; }.add-service-button svg { width:20px; height:20px; }
.client-modal-footer { min-height:76px; padding:14px 22px; display:flex; align-items:center; justify-content:flex-end; gap:10px; border-top:1px solid var(--ui-line); background:#fff; box-shadow:0 -10px 25px rgba(38,64,49,.045); }
.client-modal-footer .button { min-width:140px; }

/* Detalle de cliente */
.client-detail-contact { margin-bottom:15px; padding:12px; display:grid; grid-template-columns:48px minmax(0,1fr) auto; align-items:center; gap:11px; border:1px solid var(--ui-line); border-radius:15px; background:#f8faf8; }
.client-detail-contact > div { min-width:0; display:grid; }.client-detail-contact strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }.client-detail-contact small { margin-top:3px; color:var(--ui-muted); font-size:10px; }.client-detail-contact button { min-height:36px; padding:0 12px; border:0; border-radius:10px; color:#fff; background:var(--ui-green); cursor:pointer; font:inherit; font-size:10px; font-weight:800; }
.client-detail-service { margin-top:12px; padding:14px; border:1px solid var(--ui-line); border-radius:15px; background:#fff; }.client-detail-service header { display:flex; align-items:center; justify-content:space-between; gap:12px; }.client-detail-service header > span { min-width:0; display:grid; }.client-detail-service header strong { font-size:13px; }.client-detail-service header small { margin-top:3px; color:var(--ui-muted); font-size:9.5px; }.detail-service-progress { margin-top:12px; }.detail-service-progress > span { display:flex; align-items:center; justify-content:space-between; gap:12px; }.detail-service-progress small { color:var(--ui-muted); font-size:10px; }.detail-service-progress strong { color:var(--ui-green); font-size:11px; }.detail-provider { margin:12px 0 0; padding-top:11px; display:flex; align-items:center; gap:8px; border-top:1px solid #edf1ee; }.detail-provider > span { color:var(--ui-muted); font-size:9.5px; }.detail-provider > strong { font-size:11px; }.detail-whatsapp { margin-left:auto; color:#087442; font-size:9.5px; font-weight:820; text-decoration:none; }.client-detail-notes { margin-top:12px; padding:14px; border-radius:14px; background:#f7faf8; }.client-detail-notes > span { color:var(--ui-muted); font-size:9.5px; font-weight:800; text-transform:uppercase; }.client-detail-notes p { margin:7px 0 0; color:#526158; font-size:11px; line-height:1.55; }

@keyframes clientModalIn { from { opacity:0; transform:translate(-50%,12px) scale(.985); } to { opacity:1; transform:translate(-50%,0) scale(1); } }
@keyframes skeletonSlide { to { transform:translateX(100%); } }

@media (max-width:1280px) {
  .clients-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .form-grid-four,.form-grid-service { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:900px) {
  .new-client-fab { right:18px; bottom:18px; min-width:56px; width:56px; height:56px; padding:0; }
  .new-client-fab span { display:none; }
  .clients-toolbar { align-items:stretch; flex-direction:column; }.clients-search { width:100%; }.client-status-tabs { width:100%; overflow-x:auto; }.client-status-tabs button { flex:1; min-width:max-content; }
  .client-modal { top:0; bottom:0; width:100vw; border:0; border-radius:0; }.client-modal-scroll { padding:15px; }.client-modal-header { padding:16px 17px; }.client-modal-header h2 { font-size:22px; }
  .form-grid-four,.form-grid-service,.provider-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.provider-whatsapp { grid-column:1/-1; }
}
@media (max-width:680px) {
  .clients-grid { grid-template-columns:1fr; }.client-card { min-height:340px; }.clients-heading { align-items:flex-start; }.clients-heading .heading-actions { width:100%; }.clients-heading .heading-actions .button { width:100%; }
  .form-grid-two,.form-grid-four,.form-grid-service,.provider-grid,.finance-grid { grid-template-columns:1fr; }.client-form-section { padding:15px; }.service-form-card { padding:12px; }.service-block { padding:12px; }
  .client-modal-header span { max-width:250px; }.client-modal-footer { padding:11px 13px; }.client-modal-footer .button { min-width:0; flex:1; }
  .client-card-header { grid-template-columns:44px minmax(0,1fr) auto 36px; }.client-avatar { width:44px; height:44px; border-radius:13px; }.client-status { padding-inline:7px; }
}
@media (max-width:430px) {
  .client-status-tabs { display:grid; grid-template-columns:repeat(2,1fr); }.client-card-main { grid-template-columns:78px minmax(0,1fr); padding:12px; }.client-card { padding:14px; }.client-card-header { grid-template-columns:42px minmax(0,1fr) 34px; }.client-card-header > .client-status { grid-column:2; justify-self:start; }.client-card-menu-button { grid-row:1/3; grid-column:3; }.client-card-menu { top:62px; }
  .client-modal-scroll { padding:10px; }.client-form-section { border-radius:16px; }.section-heading { align-items:flex-start; }.section-icon { width:38px; height:38px; }.section-heading h3 { font-size:15px; }.client-modal-footer { position:relative; }.remove-service-button span { display:none; }.remove-service-button { width:36px; padding:0; justify-content:center; }
}


/* Ajustes finales Clientes RC1 */
.client-card-services li { grid-template-columns:7px minmax(0,auto) minmax(0,1fr); }
.client-card-services li::before { grid-column:1; }
.client-card-services li > span { grid-column:2; min-width:0; }
.client-card-services li > small { grid-column:3; min-width:0; text-align:right; }
body.detail-open { overflow:hidden; }
#detail-modal.detail-modal { width:min(calc(100% - 28px),720px); max-height:min(88dvh,820px); }
#detail-content { min-width:0; }
@media (max-width:680px) {
  #detail-modal.detail-modal { width:100%; max-width:none; max-height:100dvh; height:100dvh; top:0; left:0; transform:none; border-radius:0; }
  .client-card-services li { grid-template-columns:7px minmax(0,1fr); }
  .client-card-services li > span { grid-column:2; }
  .client-card-services li > small { grid-column:2; text-align:left; }
}

/* =====================================================================
   CLIENTES RC2 · móvil alineado, borradores y eliminación permanente
   ===================================================================== */
.draft-nav-count {
  margin-left:auto; min-width:24px; height:24px; padding:0 7px; display:inline-grid; place-items:center;
  border-radius:999px; color:#fff; background:var(--ui-green); font-size:10px; font-weight:900;
}
.draft-save-status { margin-top:8px; display:flex; align-items:center; gap:7px; color:#597066; font-size:10.5px; }
.draft-save-status i { width:8px; height:8px; flex:none; border-radius:50%; background:#24a66a; box-shadow:0 0 0 4px rgba(36,166,106,.12); }
.draft-save-status[data-state="saving"] i,.draft-save-status[data-state="pending"] i { background:#d19a27; box-shadow:0 0 0 4px rgba(209,154,39,.13); }
.draft-save-status[data-state="local"] i { background:#d87545; box-shadow:0 0 0 4px rgba(216,117,69,.13); }
.draft-save-status[data-state="editing"] i { background:#829087; box-shadow:0 0 0 4px rgba(130,144,135,.13); }
.draft-info { min-height:auto; margin-bottom:18px; padding:18px; display:grid; grid-template-columns:48px minmax(0,1fr) auto; align-items:center; gap:14px; }
.draft-info-icon { width:48px; height:48px; display:grid; place-items:center; border-radius:15px; color:var(--ui-green); background:var(--ui-green-soft); }
.draft-info-icon svg { width:24px; height:24px; }
.draft-info strong { display:block; font-size:15px; }
.draft-info p { margin:5px 0 0; color:var(--ui-muted); font-size:12px; line-height:1.5; }
.draft-connection { min-height:32px; padding:0 11px; display:inline-flex; align-items:center; border-radius:999px; color:#087442; background:#e7f5ed; font-size:10.5px; font-weight:850; white-space:nowrap; }
.draft-connection.offline { color:#a76518; background:#fff1dc; }
.drafts-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.draft-card { min-width:0; padding:18px; display:flex; flex-direction:column; gap:13px; border:1px solid var(--ui-line); border-radius:20px; background:#fff; box-shadow:var(--ui-shadow-soft); }
.draft-card header { display:grid; grid-template-columns:46px minmax(0,1fr) auto; align-items:center; gap:11px; }
.draft-card-icon { width:46px; height:46px; display:grid; place-items:center; border-radius:14px; color:var(--ui-green); background:var(--ui-green-soft); }
.draft-card-icon svg { width:22px; height:22px; }
.draft-card header > span:nth-child(2) { min-width:0; display:grid; }
.draft-card header strong,.draft-card header small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.draft-card header strong { font-size:14px; }
.draft-card header small { margin-top:4px; color:var(--ui-muted); font-size:10.5px; }
.draft-card header > b { color:var(--ui-green); font-size:16px; }
.draft-progress { height:8px; overflow:hidden; border-radius:999px; background:#e8eeea; }
.draft-progress i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#0b7549,#3bb57c); }
.draft-card > p { margin:0; display:flex; justify-content:space-between; gap:12px; color:#526158; font-size:11px; font-weight:750; }
.draft-card > small { color:var(--ui-muted); font-size:10px; }
.draft-card footer { margin-top:auto; display:flex; align-items:center; gap:9px; }
.draft-card footer .button { flex:1; min-width:0; }
.draft-delete-button { min-height:42px; padding:0 13px; border:1px solid #efcece; border-radius:12px; color:#b64949; background:#fff7f7; cursor:pointer; font:inherit; font-size:11px; font-weight:820; }
.draft-delete-button:hover { color:#fff; background:#bb4b4b; }
.drafts-empty { padding:48px 20px; text-align:center; }
.drafts-empty > span { width:54px; height:54px; margin:0 auto 13px; display:grid; place-items:center; border-radius:17px; color:var(--ui-green); background:var(--ui-green-soft); }
.drafts-empty svg { width:27px; height:27px; }
.drafts-empty h2 { margin:0; font-size:20px; }
.drafts-empty p { max-width:500px; margin:7px auto 18px; color:var(--ui-muted); font-size:12px; }
.draft-card-skeleton { min-height:220px; overflow:hidden; }
.draft-card-skeleton span { height:18px; border-radius:8px; background:#edf2ee; }
.client-card-menu { width:210px; }
.client-card-menu .danger { color:#b54444; border-top:1px solid #f1e3e3; margin-top:4px; padding-top:10px; }
.client-card-menu .danger:hover { color:#fff; background:#bd4d4d; }

/* Tablet: la información baja en bloques legibles y sin desbordarse. */
@media (max-width:1000px) {
  body[data-page="dashboard"] .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body[data-page="dashboard"] .dashboard-top-grid,
  body[data-page="dashboard"] .dashboard-bottom-grid { grid-template-columns:1fr; }
  body[data-page="dashboard"] .dashboard-card,
  body[data-page="dashboard"] .balance-card { min-width:0; width:100%; }
  .drafts-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* Teléfono: una sola columna real y alineación consistente. */
@media (max-width:680px) {
  body[data-page="dashboard"] .workspace { min-width:0; width:100%; }
  body[data-page="dashboard"] .topbar {
    width:100%; min-width:0; padding:11px 12px; display:grid;
    grid-template-columns:44px minmax(0,1fr) auto; gap:9px; align-items:center;
  }
  body[data-page="dashboard"] .mobile-menu-button { width:44px; height:44px; }
  body[data-page="dashboard"] .global-search { min-width:0; width:100%; }
  body[data-page="dashboard"] .global-search input { min-width:0; width:100%; font-size:14px; }
  body[data-page="dashboard"] .global-search kbd { display:none; }
  body[data-page="dashboard"] .topbar-actions { min-width:0; gap:6px; }
  body[data-page="dashboard"] .notification-button { width:42px; height:42px; }
  body[data-page="dashboard"] .profile-button { min-width:42px; width:42px; height:42px; padding:0; justify-content:center; }
  body[data-page="dashboard"] .profile-name,
  body[data-page="dashboard"] .profile-chevron { display:none; }
  body[data-page="dashboard"] .profile-avatar { width:38px; height:38px; }
  body[data-page="dashboard"] .dashboard-content { width:100%; min-width:0; padding:20px 12px 92px; overflow-x:clip; }
  body[data-page="dashboard"] .page-heading { width:100%; display:flex; flex-direction:column; align-items:stretch; gap:14px; }
  body[data-page="dashboard"] .page-heading > div:first-child { min-width:0; }
  body[data-page="dashboard"] .page-heading h1 { font-size:31px; line-height:1.08; }
  body[data-page="dashboard"] .page-heading p { max-width:none; font-size:13px; line-height:1.55; }
  body[data-page="dashboard"] .heading-actions { width:100%; display:grid; grid-template-columns:1fr 1fr; gap:9px; }
  body[data-page="dashboard"] .heading-actions .button { width:100%; min-width:0; padding-inline:10px; }
  body[data-page="dashboard"] .metric-grid { width:100%; grid-template-columns:1fr; gap:11px; }
  body[data-page="dashboard"] .metric-card { width:100%; min-width:0; min-height:132px; padding:16px; }
  body[data-page="dashboard"] .metric-card > strong { font-size:34px; }
  body[data-page="dashboard"] .dashboard-top-grid,
  body[data-page="dashboard"] .dashboard-bottom-grid { width:100%; grid-template-columns:1fr; gap:12px; }
  body[data-page="dashboard"] .dashboard-card,
  body[data-page="dashboard"] .balance-card { width:100%; min-width:0; max-width:100%; }
  body[data-page="dashboard"] .card-heading { min-width:0; padding:16px 14px 10px; flex-wrap:wrap; align-items:flex-start; gap:10px; }
  body[data-page="dashboard"] .card-heading > div { min-width:0; flex:1 1 180px; }
  body[data-page="dashboard"] .card-heading h2 { font-size:16px; }
  body[data-page="dashboard"] .card-heading p { font-size:11.5px; }
  body[data-page="dashboard"] .period-select { width:100%; min-width:0; }
  body[data-page="dashboard"] .period-select select { width:100%; }
  body[data-page="dashboard"] .analytics-chart-button { width:100%; min-width:0; height:238px; }
  body[data-page="dashboard"] canvas { max-width:100%; }
  body[data-page="dashboard"] .portfolio-status-list button { min-width:0; grid-template-columns:42px minmax(0,1fr) auto; }
  body[data-page="dashboard"] .portfolio-status-list button > span:nth-child(2) { min-width:0; }
  body[data-page="dashboard"] .balance-grid { grid-template-columns:1fr 1fr; }
  .clients-toolbar { width:100%; min-width:0; padding:11px; }
  .clients-search { min-width:0; }
  .client-status-tabs { min-width:0; display:flex; overflow-x:auto; scrollbar-width:none; }
  .client-status-tabs::-webkit-scrollbar { display:none; }
  .client-status-tabs button { flex:0 0 auto; }
  .clients-grid,.drafts-grid { width:100%; grid-template-columns:1fr; }
  .client-card,.draft-card { width:100%; min-width:0; }
  .client-card-header { min-width:0; }
  .client-card-main { min-width:0; }
  .client-next-due { min-width:0; }
  .client-next-due strong,.client-next-due span { overflow-wrap:anywhere; }
  .draft-info { grid-template-columns:44px minmax(0,1fr); padding:14px; }
  .draft-info-icon { width:44px; height:44px; }
  .draft-connection { grid-column:1/-1; justify-self:start; }
  .draft-card footer { align-items:stretch; flex-direction:column; }
  .draft-card footer .button,.draft-delete-button { width:100%; }
  .new-client-fab { right:max(14px,env(safe-area-inset-right)); bottom:max(14px,env(safe-area-inset-bottom)); }
  .client-modal-header { align-items:flex-start; }
  .draft-save-status { max-width:260px; line-height:1.35; }
  .client-modal-scroll { overscroll-behavior:contain; }
}

@media (max-width:430px) {
  body[data-page="dashboard"] .topbar { grid-template-columns:42px minmax(0,1fr) auto; padding-inline:9px; }
  body[data-page="dashboard"] .notification-button { display:none; }
  body[data-page="dashboard"] .dashboard-content { padding-inline:10px; }
  body[data-page="dashboard"] .heading-actions { grid-template-columns:1fr; }
  .client-card { padding:13px; }
  .client-card-header { grid-template-columns:42px minmax(0,1fr) 34px; }
  .client-card-menu { right:0; width:min(220px,calc(100vw - 44px)); }
  .client-modal-footer { padding-bottom:max(11px,env(safe-area-inset-bottom)); }
}


/* LOGIN RC3 — ajustes finales posteriores a los breakpoints generales */
@media (max-width: 760px) {
  body[data-page="login"] .auth-page { padding: 0; }
  body[data-page="login"] .auth-card { margin: 0; border-radius: 0; }
  body[data-page="login"] .auth-heading h2 { color: #fff; }
  body[data-page="login"] .auth-input-wrap input { border-radius: 7px; }
  body[data-page="login"] .auth-submit { border-radius: 7px; }
}
@media (max-width: 430px) {
  body[data-page="login"] .auth-page { padding-inline: 0; }
  body[data-page="login"] .auth-card { padding: 30px 18px 34px; border-radius: 0; }
  body[data-page="login"] .auth-heading h2 { font-size: 30px; }
  body[data-page="login"] .auth-input-wrap input { min-height: 50px; padding-left: 14px; font-size: 14px; }
}

/* =====================================================================
   LOGIN RC4 · pantalla completa y responsive real
   Corrige márgenes exteriores, desbordes y zoom automático en teléfono.
   ===================================================================== */
html,
body[data-page="login"] {
  width: 100%;
  max-width: 100%;
  min-width: 320px;
}
body[data-page="login"] {
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body[data-page="login"] .auth-page,
body[data-page="login"] .auth-shell,
body[data-page="login"] .auth-intro,
body[data-page="login"] .auth-card {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 761px) {
  body[data-page="login"] {
    height: 100dvh;
    overflow: hidden;
  }
  body[data-page="login"] .auth-page {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    display: block;
    background: #050605;
  }
  body[data-page="login"] .auth-shell {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    grid-template-columns: minmax(0, 1.04fr) minmax(390px, .96fr);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  body[data-page="login"] .auth-intro,
  body[data-page="login"] .auth-card {
    height: 100dvh;
    min-height: 0;
  }
  body[data-page="login"] .auth-intro {
    padding: clamp(28px, 5vh, 58px) clamp(34px, 5vw, 72px);
  }
  body[data-page="login"] .auth-card {
    padding: clamp(30px, 5vh, 66px) clamp(36px, 6vw, 86px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #24312b transparent;
  }
  body[data-page="login"] .auth-intro-copy {
    margin: auto 0 clamp(28px, 5vh, 58px);
  }
  body[data-page="login"] .auth-intro-copy h1 {
    font-size: clamp(42px, 5vw, 68px);
  }
  body[data-page="login"] .auth-steps {
    gap: clamp(8px, 1vw, 14px);
  }
  body[data-page="login"] .auth-step {
    min-height: clamp(104px, 15vh, 132px);
    padding: clamp(13px, 2vh, 18px) clamp(12px, 1.4vw, 17px);
  }
}

@media (min-width: 761px) and (max-height: 760px) {
  body[data-page="login"] .auth-intro {
    padding-block: 28px;
  }
  body[data-page="login"] .auth-card {
    padding-block: 28px;
  }
  body[data-page="login"] .auth-logo-mark {
    width: 40px;
    height: 40px;
  }
  body[data-page="login"] .auth-intro-copy {
    margin-bottom: 25px;
  }
  body[data-page="login"] .auth-intro-copy p {
    margin-bottom: 8px;
  }
  body[data-page="login"] .auth-intro-copy h1 {
    font-size: clamp(38px, 4.5vw, 58px);
    line-height: .98;
  }
  body[data-page="login"] .auth-intro-copy > span {
    margin-top: 13px;
    font-size: 13px;
    line-height: 1.5;
  }
  body[data-page="login"] .auth-step {
    min-height: 102px;
    padding: 12px 13px;
  }
  body[data-page="login"] .auth-step > span {
    width: 24px;
    height: 24px;
  }
  body[data-page="login"] .auth-step strong {
    margin-top: 12px;
    font-size: 12px;
  }
  body[data-page="login"] .auth-step small {
    margin-top: 4px;
    font-size: 9px;
  }
  body[data-page="login"] .auth-heading {
    margin-bottom: 22px;
  }
  body[data-page="login"] .auth-heading h2 {
    font-size: clamp(30px, 3vw, 38px);
  }
  body[data-page="login"] .auth-heading > span {
    margin-top: 8px;
  }
  body[data-page="login"] .auth-form {
    gap: 14px;
  }
  body[data-page="login"] .auth-input-wrap input,
  body[data-page="login"] .auth-submit {
    min-height: 48px;
  }
  body[data-page="login"] .auth-access-note {
    margin-top: 15px;
  }
}

@media (max-width: 760px) {
  body[data-page="login"] {
    min-height: 100dvh;
    height: auto;
    overflow-y: auto;
    background: #050605;
  }
  body[data-page="login"] .auth-page {
    width: 100%;
    min-height: 100dvh;
    padding: 0;
    display: block;
    background: #050605;
  }
  body[data-page="login"] .auth-shell {
    width: 100%;
    min-height: 100dvh;
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  body[data-page="login"] .auth-intro {
    width: 100%;
    min-height: 238px;
    padding:
      max(22px, env(safe-area-inset-top))
      max(20px, env(safe-area-inset-right))
      20px
      max(20px, env(safe-area-inset-left));
  }
  body[data-page="login"] .auth-intro-content {
    min-height: 0;
  }
  body[data-page="login"] .auth-intro-copy {
    margin: 10px 0 20px;
  }
  body[data-page="login"] .auth-intro-copy h1 {
    max-width: 560px;
    font-size: clamp(34px, 9.5vw, 48px);
    line-height: 1;
  }
  body[data-page="login"] .auth-intro-copy > span {
    max-width: 520px;
    margin-top: 12px;
    font-size: 13px;
  }
  body[data-page="login"] .auth-steps {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  body[data-page="login"] .auth-step {
    min-height: 80px;
    padding: 10px;
  }
  body[data-page="login"] .auth-step strong {
    font-size: 10px;
  }
  body[data-page="login"] .auth-card {
    width: 100%;
    min-height: auto;
    margin: 0;
    padding:
      30px
      max(20px, env(safe-area-inset-right))
      max(34px, env(safe-area-inset-bottom))
      max(20px, env(safe-area-inset-left));
    border-radius: 0;
    overflow: visible;
  }
  body[data-page="login"] .auth-card > * {
    width: min(100%, 500px);
  }
  body[data-page="login"] .auth-mobile-brand {
    margin-bottom: 22px;
  }
  body[data-page="login"] .auth-heading {
    margin-bottom: 24px;
  }
  body[data-page="login"] .auth-heading h2 {
    font-size: clamp(30px, 8.5vw, 38px);
  }
  body[data-page="login"] .auth-heading > span {
    font-size: 14px;
  }
  body[data-page="login"] .auth-input-wrap input {
    min-height: 56px;
    font-size: 16px;
  }
  body[data-page="login"] .auth-submit {
    min-height: 56px;
    font-size: 15px;
  }
  body[data-page="login"] .remember-row,
  body[data-page="login"] .auth-access-note,
  body[data-page="login"] .account-request-trigger {
    font-size: 13px;
  }
}

@media (max-width: 430px) {
  body[data-page="login"] .auth-intro {
    min-height: 216px;
    padding-inline: 16px;
  }
  body[data-page="login"] .auth-intro-copy {
    margin: 5px 0 16px;
  }
  body[data-page="login"] .auth-intro-copy p {
    margin-bottom: 7px;
    font-size: 9px;
  }
  body[data-page="login"] .auth-intro-copy h1 {
    font-size: clamp(31px, 9.2vw, 38px);
  }
  body[data-page="login"] .auth-intro-copy > span {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.45;
  }
  body[data-page="login"] .auth-steps {
    gap: 6px;
  }
  body[data-page="login"] .auth-step {
    min-height: 70px;
    padding: 8px;
  }
  body[data-page="login"] .auth-step > span {
    width: 22px;
    height: 22px;
    font-size: 8px;
  }
  body[data-page="login"] .auth-step strong {
    margin-top: 8px;
    font-size: 9px;
  }
  body[data-page="login"] .auth-card {
    padding-inline: 16px;
  }
  body[data-page="login"] .auth-mobile-brand {
    margin-bottom: 20px;
  }
  body[data-page="login"] .auth-heading h2 {
    font-size: 31px;
  }
  body[data-page="login"] .auth-heading > span {
    font-size: 13px;
  }
  body[data-page="login"] .auth-input-wrap input {
    min-height: 54px;
    padding-left: 14px;
    font-size: 16px;
  }
  body[data-page="login"] .auth-submit {
    min-height: 54px;
  }
  body[data-page="login"] .auth-access-note {
    display: grid;
    justify-items: center;
    text-align: center;
  }
}


/* =====================================================================
   PANEL RC5 · TEMA OSCURO INTEGRAL
   Unifica Inicio, Clientes, Borradores, modales, formularios y menús con
   la misma identidad negro + verde del acceso. El login RC4 no se altera.
   ===================================================================== */
body[data-page="dashboard"] {
  --ui-bg: #050806;
  --ui-surface: #0b1411;
  --ui-surface-soft: #0e1b17;
  --ui-surface-raised: #11231d;
  --ui-line: rgba(112, 232, 191, .13);
  --ui-line-strong: rgba(112, 232, 191, .24);
  --ui-text: #f3faf6;
  --ui-muted: #91a69d;
  --ui-muted-2: #667d73;
  --ui-green: #39d9a3;
  --ui-green-dark: #20b982;
  --ui-green-soft: rgba(57, 217, 163, .12);
  --ui-mint: #74e8bf;
  --ui-yellow: #f0be57;
  --ui-yellow-soft: rgba(240, 190, 87, .13);
  --ui-red: #ee7180;
  --ui-red-soft: rgba(238, 113, 128, .13);
  --ui-shadow: 0 22px 58px rgba(0, 0, 0, .34);
  --ui-shadow-soft: 0 12px 32px rgba(0, 0, 0, .22);
  --chart-grid: #1b3028;
  --chart-label: #82978e;
  --chart-bar-start: #4be4ad;
  --chart-bar-end: #0b7d54;
  --chart-negative: #ef7180;
  --chart-gauge-track: #1b2e27;
  --chart-gauge-value: #3fe0aa;
  color-scheme: dark;
  background:
    radial-gradient(circle at 78% -10%, rgba(26, 151, 105, .13), transparent 35%),
    radial-gradient(circle at 8% 92%, rgba(57, 217, 163, .07), transparent 28%),
    var(--ui-bg);
}
body[data-page="dashboard"] ::selection { color:#04100b; background:#70e8bf; }
body[data-page="dashboard"] * { scrollbar-color:#21483a #07100d; }
body[data-page="dashboard"] *::-webkit-scrollbar { width:10px; height:10px; }
body[data-page="dashboard"] *::-webkit-scrollbar-track { background:#07100d; }
body[data-page="dashboard"] *::-webkit-scrollbar-thumb { border:2px solid #07100d; border-radius:999px; background:#21483a; }
body[data-page="dashboard"] input,
body[data-page="dashboard"] select,
body[data-page="dashboard"] textarea { color-scheme:dark; }
body[data-page="dashboard"] option { color:var(--ui-text); background:#0b1713; }
body[data-page="dashboard"] input:-webkit-autofill,
body[data-page="dashboard"] input:-webkit-autofill:hover,
body[data-page="dashboard"] input:-webkit-autofill:focus {
  -webkit-text-fill-color:var(--ui-text);
  -webkit-box-shadow:0 0 0 1000px #09140f inset;
  caret-color:var(--ui-text);
}
body[data-page="dashboard"] button:focus-visible,
body[data-page="dashboard"] a:focus-visible,
body[data-page="dashboard"] input:focus-visible,
body[data-page="dashboard"] select:focus-visible,
body[data-page="dashboard"] textarea:focus-visible { outline-color:rgba(80, 229, 177, .5); }

body[data-page="dashboard"] .dashboard-shell,
body[data-page="dashboard"] .workspace,
body[data-page="dashboard"] .dashboard-content { background:transparent; }
body[data-page="dashboard"] .sidebar {
  border-right-color:var(--ui-line);
  background:
    radial-gradient(circle at 45% 88%, rgba(57,217,163,.09), transparent 27%),
    linear-gradient(180deg,#07110e 0%,#050906 100%);
  box-shadow:12px 0 38px rgba(0,0,0,.22);
}
body[data-page="dashboard"] .sidebar-brand { color:var(--ui-text); }
body[data-page="dashboard"] .brand-symbol { color:#63e5b7; background:rgba(57,217,163,.13); box-shadow:inset 0 0 0 1px rgba(112,232,191,.08); }
body[data-page="dashboard"] .brand-text small,
body[data-page="dashboard"] .nav-label { color:var(--ui-muted-2); }
body[data-page="dashboard"] .sidebar-link { color:#91a49b; }
body[data-page="dashboard"] .sidebar-link:hover { color:#75ebc0; background:rgba(57,217,163,.08); }
body[data-page="dashboard"] .sidebar-link.active { color:#f7fffb; background:linear-gradient(90deg,rgba(57,217,163,.16),rgba(57,217,163,.07)); box-shadow:inset 0 0 0 1px rgba(112,232,191,.07); }
body[data-page="dashboard"] .sidebar-link-indicator { background:#50e3ae; box-shadow:0 0 14px rgba(80,227,174,.45); }
body[data-page="dashboard"] .sidebar-close { color:var(--ui-muted); background:var(--ui-surface-soft); }
body[data-page="dashboard"] .sidebar-promo {
  border:1px solid rgba(112,232,191,.15);
  background:radial-gradient(circle at 80% 18%,rgba(75,228,173,.26),transparent 28%),linear-gradient(145deg,#0a2119,#07543a 72%,#0a6d49);
  box-shadow:0 18px 38px rgba(0,0,0,.26);
}
body[data-page="dashboard"] .promo-badge { color:#07110d; background:#8cf1ca; }

body[data-page="dashboard"] .topbar {
  border-bottom-color:var(--ui-line);
  background:rgba(5,8,6,.86);
  box-shadow:0 9px 30px rgba(0,0,0,.12);
}
body[data-page="dashboard"] .mobile-menu-button,
body[data-page="dashboard"] .topbar-icon { color:var(--ui-text); border-color:var(--ui-line); background:#0b1511; }
body[data-page="dashboard"] .mobile-menu-button:hover,
body[data-page="dashboard"] .topbar-icon:hover { color:#70e8bf; border-color:var(--ui-line-strong); background:#10231c; }
body[data-page="dashboard"] .global-search { border-color:var(--ui-line); background:rgba(12,25,20,.9); }
body[data-page="dashboard"] .global-search:focus-within { border-color:rgba(80,227,174,.43); background:#0d1b16; box-shadow:0 0 0 4px rgba(57,217,163,.09); }
body[data-page="dashboard"] .global-search svg { color:#718b80; }
body[data-page="dashboard"] .global-search input { color:var(--ui-text); }
body[data-page="dashboard"] .global-search input::placeholder { color:#62766d; }
body[data-page="dashboard"] .global-search kbd { color:#8aa097; border-color:var(--ui-line); background:#0f1d18; }
body[data-page="dashboard"] .profile-button:hover { background:rgba(57,217,163,.07); }
body[data-page="dashboard"] .profile-avatar { color:#042016; background:linear-gradient(135deg,#7ce9bf,#25ad79); }
body[data-page="dashboard"] .profile-button > svg { color:#748b81; }
body[data-page="dashboard"] .profile-menu { border-color:var(--ui-line); background:#0b1511; box-shadow:0 26px 70px rgba(0,0,0,.5); }
body[data-page="dashboard"] .profile-menu-header { border-bottom-color:var(--ui-line); }
body[data-page="dashboard"] .profile-menu-item { color:var(--ui-text); }
body[data-page="dashboard"] .profile-menu-item:hover { color:#70e8bf; background:rgba(57,217,163,.09); }
body[data-page="dashboard"] .profile-menu-item-danger { color:#ef8290; }
body[data-page="dashboard"] .profile-menu-item-danger:hover { color:#ff9aa6; background:rgba(238,113,128,.1); }
body[data-page="dashboard"] .notification-count { border-color:var(--ui-bg); background:#e96878; }

body[data-page="dashboard"] .page-heading h1,
body[data-page="dashboard"] .card-heading h2,
body[data-page="dashboard"] .section-heading h3,
body[data-page="dashboard"] .service-card-heading h4,
body[data-page="dashboard"] .clients-empty h2,
body[data-page="dashboard"] .drafts-empty h2 { color:var(--ui-text); }
body[data-page="dashboard"] .page-heading p,
body[data-page="dashboard"] .card-heading p,
body[data-page="dashboard"] .section-heading p { color:var(--ui-muted); }
body[data-page="dashboard"] .page-eyebrow { color:#5be4b1; }
body[data-page="dashboard"] .button-primary { color:#03120c; border-color:#42dda7; background:linear-gradient(135deg,#55e6b3,#25bc83); box-shadow:0 12px 28px rgba(37,188,131,.2); }
body[data-page="dashboard"] .button-primary:hover { color:#02110b; background:linear-gradient(135deg,#6cedc0,#32cb91); }
body[data-page="dashboard"] .button-secondary { color:#c7d7cf; border-color:var(--ui-line-strong); background:#0c1813; }
body[data-page="dashboard"] .button-secondary:hover { color:#70e8bf; border-color:#37c893; background:#10241c; }

body[data-page="dashboard"] .dashboard-card,
body[data-page="dashboard"] .metric-card,
body[data-page="dashboard"] .client-card,
body[data-page="dashboard"] .draft-card {
  color:var(--ui-text);
  border-color:var(--ui-line);
  background:linear-gradient(160deg,#0d1915,#09120f);
  box-shadow:var(--ui-shadow-soft);
}
body[data-page="dashboard"] .dashboard-card:hover,
body[data-page="dashboard"] .metric-card:hover,
body[data-page="dashboard"] .client-card:hover { border-color:var(--ui-line-strong); box-shadow:var(--ui-shadow); }
body[data-page="dashboard"] .metric-card-featured { color:#f5fffb; border-color:rgba(90,231,177,.35); background:linear-gradient(145deg,#0b6f4b,#06452f 75%,#073222); box-shadow:0 20px 42px rgba(0,0,0,.32); }
body[data-page="dashboard"] .metric-head i { color:#8ba099; border-color:var(--ui-line); background:#101f1a; }
body[data-page="dashboard"] .metric-card-featured .metric-head i { color:#dcfff2; border-color:rgba(255,255,255,.2); background:rgba(255,255,255,.08); }
body[data-page="dashboard"] .metric-card > small { color:var(--ui-muted); }
body[data-page="dashboard"] .metric-change { color:#6dd9ae; }
body[data-page="dashboard"] .metric-change-warning { color:#efc66e; }
body[data-page="dashboard"] .metric-change-danger,
body[data-page="dashboard"] .metric-change.negative { color:#ef8290; }
body[data-page="dashboard"] .period-select select,
body[data-page="dashboard"] .small-action,
body[data-page="dashboard"] .icon-action { color:#c6d6ce; border-color:var(--ui-line); background:#0d1a15; }
body[data-page="dashboard"] .period-select select:hover,
body[data-page="dashboard"] .small-action:hover,
body[data-page="dashboard"] .icon-action:hover { color:#70e8bf; border-color:var(--ui-line-strong); background:#11251d; }
body[data-page="dashboard"] .chart-empty,
body[data-page="dashboard"] .compact-empty { color:#879b92; }
body[data-page="dashboard"] .chart-empty small,
body[data-page="dashboard"] .compact-empty small { color:#657a70; }
body[data-page="dashboard"] .chart-tooltip { color:#f4fff9; border:1px solid rgba(112,232,191,.18); background:#0b2018; box-shadow:0 14px 34px rgba(0,0,0,.42); }
body[data-page="dashboard"] .chart-tooltip span { color:#72e7bb; }
body[data-page="dashboard"] .reminder-item,
body[data-page="dashboard"] .activity-item,
body[data-page="dashboard"] .portfolio-status-list button { color:var(--ui-text); }
body[data-page="dashboard"] .reminder-item:hover,
body[data-page="dashboard"] .activity-item:hover,
body[data-page="dashboard"] .portfolio-status-list button:hover { border-color:var(--ui-line); background:rgba(57,217,163,.065); }
body[data-page="dashboard"] .activity-avatar { color:#76e8bd; background:rgba(57,217,163,.12); }
body[data-page="dashboard"] .activity-amount { color:#5ee5b4; }
body[data-page="dashboard"] .reminder-status { color:#f0c66d; background:rgba(240,190,87,.12); }
body[data-page="dashboard"] .compact-empty > span { color:#68e8b8; background:rgba(57,217,163,.1); }
body[data-page="dashboard"] .status-green { color:#5ee5b4; background:rgba(57,217,163,.12); }
body[data-page="dashboard"] .status-yellow { color:#f0c66d; background:rgba(240,190,87,.13); }
body[data-page="dashboard"] .status-red { color:#ef8290; background:rgba(238,113,128,.12); }
body[data-page="dashboard"] .portfolio-status-list b { color:#d8e5df; }
body[data-page="dashboard"] .legend-pending { background:#263a32; }
body[data-page="dashboard"] .balance-card { border:1px solid rgba(112,232,191,.16); background:radial-gradient(circle at 88% 18%,rgba(80,227,174,.2),transparent 27%),linear-gradient(145deg,#081a14,#07513a 65%,#08734d); box-shadow:0 22px 50px rgba(0,0,0,.3); }

body[data-page="dashboard"] .clients-toolbar,
body[data-page="dashboard"] .clients-search,
body[data-page="dashboard"] .client-status-tabs { border-color:var(--ui-line); background:#0b1713; }
body[data-page="dashboard"] .clients-search input { color:var(--ui-text); }
body[data-page="dashboard"] .clients-search input::placeholder { color:#657a70; }
body[data-page="dashboard"] .clients-search svg { color:#759087; }
body[data-page="dashboard"] .client-status-tabs button { color:#91a49b; }
body[data-page="dashboard"] .client-status-tabs button:hover { color:#70e8bf; background:rgba(57,217,163,.08); }
body[data-page="dashboard"] .client-status-tabs button.active { color:#03140d; background:#42d9a4; box-shadow:0 7px 18px rgba(37,188,131,.2); }
body[data-page="dashboard"] .client-avatar { color:#6be7b8; background:linear-gradient(145deg,rgba(57,217,163,.18),rgba(57,217,163,.08)); }
body[data-page="dashboard"] .client-status-active { color:#65e5b5; background:rgba(57,217,163,.12); }
body[data-page="dashboard"] .client-status-expiring { color:#f0c66d; background:rgba(240,190,87,.13); }
body[data-page="dashboard"] .client-status-expired { color:#ef8290; background:rgba(238,113,128,.12); }
body[data-page="dashboard"] .client-card-menu-button { color:#94a89f; border-color:var(--ui-line); background:#0e1b16; }
body[data-page="dashboard"] .client-card-menu-button:hover { color:#70e8bf; background:#12271f; }
body[data-page="dashboard"] .client-card-menu { border-color:var(--ui-line); background:#0b1511; box-shadow:0 20px 50px rgba(0,0,0,.48); }
body[data-page="dashboard"] .client-card-menu button { color:var(--ui-text); }
body[data-page="dashboard"] .client-card-menu button:hover { color:#70e8bf; background:rgba(57,217,163,.08); }
body[data-page="dashboard"] .client-card-menu .danger { color:#ef8290; border-top-color:rgba(238,113,128,.16); }
body[data-page="dashboard"] .client-card-menu .danger:hover { color:#fff; background:#b94d5b; }
body[data-page="dashboard"] .client-card-main,
body[data-page="dashboard"] .client-detail-contact,
body[data-page="dashboard"] .client-detail-notes { background:#0e1c17; }
body[data-page="dashboard"] .client-card-count { border-right-color:var(--ui-line); }
body[data-page="dashboard"] .client-next-due span,
body[data-page="dashboard"] .client-detail-notes p,
body[data-page="dashboard"] .draft-card > p { color:#b5c7be; }
body[data-page="dashboard"] .client-progress > div,
body[data-page="dashboard"] .detail-service-progress > div,
body[data-page="dashboard"] .draft-progress { background:#1a2b24; }
body[data-page="dashboard"] .client-progress i,
body[data-page="dashboard"] .detail-service-progress i,
body[data-page="dashboard"] .draft-progress i { background:linear-gradient(90deg,#1db77c,#65e7b7); }
body[data-page="dashboard"] .client-card footer { border-top-color:var(--ui-line); }
body[data-page="dashboard"] .client-card footer button { color:#68e8b8; background:rgba(57,217,163,.1); }
body[data-page="dashboard"] .client-card footer button:hover { color:#03140d; background:#4bdcab; }
body[data-page="dashboard"] .clients-pagination button { color:var(--ui-text); border-color:var(--ui-line); background:#0d1a15; }
body[data-page="dashboard"] .clients-pagination button:not(:disabled):hover { color:#70e8bf; border-color:var(--ui-line-strong); background:#11251d; }
body[data-page="dashboard"] .client-card-skeleton span,
body[data-page="dashboard"] .draft-card-skeleton span { background:#14251e; }
body[data-page="dashboard"] .client-card-skeleton::after { background:linear-gradient(100deg,transparent 20%,rgba(112,232,191,.08) 50%,transparent 80%); }

body[data-page="dashboard"] .draft-nav-count { color:#03140d; background:#47dca8; }
body[data-page="dashboard"] .draft-save-status { color:#9eb1a8; }
body[data-page="dashboard"] .draft-info-icon,
body[data-page="dashboard"] .draft-card-icon,
body[data-page="dashboard"] .drafts-empty > span,
body[data-page="dashboard"] .clients-empty > span { color:#68e8b8; background:rgba(57,217,163,.11); }
body[data-page="dashboard"] .draft-connection { color:#69e5b6; background:rgba(57,217,163,.12); }
body[data-page="dashboard"] .draft-connection.offline { color:#f0bd67; background:rgba(240,190,87,.13); }
body[data-page="dashboard"] .draft-delete-button { color:#ef8290; border-color:rgba(238,113,128,.24); background:rgba(238,113,128,.08); }
body[data-page="dashboard"] .draft-delete-button:hover { color:#fff; background:#b94d5b; }

body[data-page="dashboard"] .detail-backdrop,
body[data-page="dashboard"] .client-modal-backdrop,
body[data-page="dashboard"] .sidebar-backdrop { background:rgba(0,5,3,.72); }
body[data-page="dashboard"] .detail-modal { color:var(--ui-text); border-color:var(--ui-line-strong); background:#09130f; box-shadow:0 34px 100px rgba(0,0,0,.66); }
body[data-page="dashboard"] .detail-close { color:#91a69d; border-color:var(--ui-line); background:#0f1d18; }
body[data-page="dashboard"] .detail-close:hover { color:#fff; background:#162a22; }
body[data-page="dashboard"] .detail-icon { color:#6be8b9; background:rgba(57,217,163,.12); }
body[data-page="dashboard"] .detail-stat { border-color:rgba(57,217,163,.2); background:rgba(57,217,163,.08); }
body[data-page="dashboard"] .detail-stat.warning { border-color:rgba(240,190,87,.24); background:rgba(240,190,87,.09); }
body[data-page="dashboard"] .detail-stat.danger { border-color:rgba(238,113,128,.24); background:rgba(238,113,128,.09); }
body[data-page="dashboard"] .detail-stat.profit { border-color:rgba(57,217,163,.2); background:rgba(57,217,163,.08); }
body[data-page="dashboard"] .detail-list > div { border-color:var(--ui-line); background:#0d1a15; }
body[data-page="dashboard"] .detail-primary { color:#03140d; background:#48dca8; }
body[data-page="dashboard"] .dashboard-toast { color:var(--ui-text); border-color:var(--ui-line-strong); background:#0d1915; box-shadow:0 20px 55px rgba(0,0,0,.52); }
body[data-page="dashboard"] .dashboard-toast.error { color:#ff9aa5; border-color:rgba(238,113,128,.3); }

body[data-page="dashboard"] .client-modal { color:var(--ui-text); border-color:var(--ui-line-strong); background:#060d0a; box-shadow:0 38px 110px rgba(0,0,0,.7); }
body[data-page="dashboard"] .client-modal-header,
body[data-page="dashboard"] .client-modal-footer { border-color:var(--ui-line); background:#09140f; }
body[data-page="dashboard"] .client-modal-footer { box-shadow:0 -14px 30px rgba(0,0,0,.22); }
body[data-page="dashboard"] .client-modal-close { color:#9aada4; border-color:var(--ui-line); background:#101e19; }
body[data-page="dashboard"] .client-modal-close:hover { color:#ff9ba6; background:rgba(238,113,128,.1); }
body[data-page="dashboard"] .client-modal-scroll { background:#060d0a; }
body[data-page="dashboard"] .client-form-section { border-color:var(--ui-line); background:#0b1713; box-shadow:0 9px 24px rgba(0,0,0,.18); }
body[data-page="dashboard"] .section-icon,
body[data-page="dashboard"] .service-number { color:#68e8b8; background:rgba(57,217,163,.11); }
body[data-page="dashboard"] .form-field > span { color:#c2d2ca; }
body[data-page="dashboard"] .form-field > span em { color:#6be8b9; background:rgba(57,217,163,.11); }
body[data-page="dashboard"] .form-field input,
body[data-page="dashboard"] .form-field select,
body[data-page="dashboard"] .form-field textarea { color:var(--ui-text); border-color:var(--ui-line); background:#07100d; }
body[data-page="dashboard"] .form-field input::placeholder,
body[data-page="dashboard"] .form-field textarea::placeholder { color:#566c62; }
body[data-page="dashboard"] .form-field input:focus,
body[data-page="dashboard"] .form-field select:focus,
body[data-page="dashboard"] .form-field textarea:focus { border-color:#3fca96; background:#091711; box-shadow:0 0 0 4px rgba(57,217,163,.09); }
body[data-page="dashboard"] .service-form-card { border-color:var(--ui-line); background:#09130f; }
body[data-page="dashboard"] .service-block,
body[data-page="dashboard"] .client-detail-service { border-color:var(--ui-line); background:#0d1a15; }
body[data-page="dashboard"] .service-block + .service-block { border-top-color:var(--ui-line); }
body[data-page="dashboard"] .secret-toggle { color:#8ca198; }
body[data-page="dashboard"] .secret-toggle:hover { color:#70e8bf; background:rgba(57,217,163,.09); }
body[data-page="dashboard"] .provider-whatsapp { color:#66e5b5; border-color:rgba(57,217,163,.3); background:rgba(57,217,163,.1); }
body[data-page="dashboard"] .provider-whatsapp:hover:not(:disabled) { color:#03140d; background:#47dca8; }
body[data-page="dashboard"] .add-service-button { color:#69e6b6; border-color:rgba(80,227,174,.48); background:rgba(57,217,163,.07); }
body[data-page="dashboard"] .add-service-button:hover { color:#03140d; background:#47dca8; }
body[data-page="dashboard"] .remove-service-button { color:#ef8290; border-color:rgba(238,113,128,.25); background:rgba(238,113,128,.08); }
body[data-page="dashboard"] .remove-service-button:hover { color:#fff; background:#b94d5b; }
body[data-page="dashboard"] .detail-provider { border-top-color:var(--ui-line); }
body[data-page="dashboard"] .detail-whatsapp { color:#68e8b8; }

@media (max-width:900px) {
  body[data-page="dashboard"] .sidebar { box-shadow:24px 0 70px rgba(0,0,0,.55); }
}

/* FINANZAS · ETAPA 1 */
body[data-page="dashboard"].finance-modal-open { overflow: hidden; }
.finance-filter-card { padding: 18px; margin-bottom: 18px; }
.finance-filter-row { display:grid; grid-template-columns: 170px 170px minmax(240px,1fr) auto; gap:14px; align-items:end; }
.finance-search-field { min-width:0; }
.advanced-toggle { margin-top:12px; display:inline-flex; align-items:center; gap:8px; min-height:38px; padding:0 14px; border-radius:999px; border:1px solid var(--ui-line); color:var(--ui-text); background:#0b1814; cursor:pointer; font-weight:800; }
.advanced-toggle svg { width:18px; height:18px; transition:transform var(--transition); }
.advanced-toggle[aria-expanded="true"] svg { transform:rotate(180deg); }
.finance-advanced { display:grid; grid-template-columns: repeat(2, minmax(180px, 260px)); gap:14px; margin-top:14px; padding-top:14px; border-top:1px solid var(--ui-line); }
.finance-metric-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:16px; margin-bottom:18px; }
.finance-kpi { padding:20px; min-height:136px; display:flex; flex-direction:column; justify-content:space-between; }
.finance-kpi span { color:var(--ui-muted); font-weight:900; font-size:.86rem; }
.finance-kpi strong { display:block; margin-top:10px; font-size:clamp(1.9rem,3vw,2.8rem); color:var(--ui-text); letter-spacing:-.05em; }
.finance-kpi small { color:var(--ui-muted); font-weight:750; }
.finance-kpi.featured { border-color:rgba(67,229,190,.36); background:linear-gradient(150deg, rgba(42,188,126,.2), rgba(10,27,21,.92)); }
.finance-layout { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(320px,.55fr); gap:18px; margin-bottom:18px; }
.finance-chart-card, .finance-breakdown-card, .finance-table-card { padding:20px; }
.finance-chart-button { position:relative; display:block; width:100%; height:300px; min-height:0; padding:0; margin-top:8px; border:0; border-radius:20px; color:var(--ui-text); background:#08130f; overflow:hidden; cursor:pointer; }
.finance-chart-button canvas { position:absolute; inset:0; width:100%; height:100%; display:block; max-width:100%; max-height:100%; }
.finance-chart-button .chart-tooltip, .finance-chart-button .chart-empty { z-index:2; }
.finance-top-services { display:grid; gap:12px; margin-top:12px; }
.finance-service-row { position:relative; min-height:76px; overflow:hidden; text-align:left; border:1px solid var(--ui-line); border-radius:18px; background:#0b1814; color:var(--ui-text); cursor:pointer; padding:14px; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; }
.finance-service-row:hover { border-color:rgba(67,229,190,.34); transform:translateY(-1px); }
.finance-service-row strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.finance-service-row small { color:var(--ui-muted); font-weight:750; }
.finance-service-row b { position:relative; z-index:2; color:#65e8b8; }
.finance-service-row b.negative { color:#ff8795; }
.finance-service-row i { position:absolute; left:0; bottom:0; height:3px; border-radius:999px; background:linear-gradient(90deg,#43e5be,#097b56); }
.finance-table-wrap { overflow:auto; border:1px solid var(--ui-line); border-radius:20px; background:#08130f; }
.finance-table { width:100%; border-collapse:separate; border-spacing:0; min-width:840px; }
.finance-table th, .finance-table td { padding:14px 16px; text-align:left; border-bottom:1px solid var(--ui-line); vertical-align:middle; }
.finance-table th { color:var(--ui-muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; background:#0b1814; }
.finance-table td { color:var(--ui-text); font-weight:750; }
.finance-table td small { display:block; color:var(--ui-muted); margin-top:2px; font-weight:700; }
.finance-table tr:last-child td { border-bottom:0; }
.finance-table tr.is-voided { opacity:.58; }
.finance-table b.negative { color:#ff8795; }
.finance-status { display:inline-flex; align-items:center; justify-content:center; min-height:28px; padding:0 10px; border-radius:999px; font-weight:900; font-size:.78rem; }
.finance-status-active { color:#66e8b7; background:rgba(57,217,163,.12); }
.finance-status-voided { color:#ffb1ba; background:rgba(238,113,128,.12); }
.table-action { min-height:34px; padding:0 12px; border-radius:999px; border:1px solid var(--ui-line); background:#0d1d17; color:var(--ui-text); cursor:pointer; font-weight:850; }
.table-action.danger { color:#ff9ca6; border-color:rgba(238,113,128,.25); background:rgba(238,113,128,.08); }
.table-action.danger:hover { background:#b94d5b; color:#fff; }
.muted { color:var(--ui-muted); font-size:.86rem; }
.finance-row-skeleton td span { display:block; height:52px; border-radius:16px; background:linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.08), rgba(255,255,255,.04)); animation:skeleton 1.1s linear infinite; }
.finance-modal-backdrop { position:fixed; inset:0; z-index:80; background:rgba(0,5,3,.72); }
.finance-modal { position:fixed; inset:clamp(16px,4vh,46px) max(18px, calc((100vw - 860px)/2)); z-index:90; display:flex; flex-direction:column; max-height:calc(100dvh - 32px); border:1px solid var(--ui-line-strong); border-radius:28px; color:var(--ui-text); background:#060d0a; box-shadow:0 38px 110px rgba(0,0,0,.7); overflow:hidden; }
.finance-form { display:flex; flex-direction:column; min-height:0; }
.finance-form .span-full { grid-column:1 / -1; }
.finance-empty { margin-top:18px; }
@media (max-width:1100px) {
  .finance-metric-grid { grid-template-columns:repeat(2, minmax(0,1fr)); }
  .finance-layout { grid-template-columns:1fr; }
  .finance-filter-row { grid-template-columns:repeat(2, minmax(0,1fr)); }
  .finance-search-field { grid-column:1 / -1; }
}
@media (max-width:720px) {
  .finance-filter-card, .finance-chart-card, .finance-breakdown-card, .finance-table-card { padding:14px; }
  .finance-filter-row, .finance-advanced, .finance-metric-grid { grid-template-columns:1fr; }
  .finance-kpi { min-height:118px; padding:17px; }
  .finance-chart-button { height:240px; min-height:0; }
  .finance-chart-button canvas { height:100%; }
  .finance-modal { inset:0; max-height:100dvh; border-radius:0; border-left:0; border-right:0; }
}

/* ============================================================
   ETAPA 2 · VENCIMIENTOS Y RENOVACIONES
   ============================================================ */
.expirations-view { animation: viewIn .28s ease both; }
.expiration-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin:20px 0; }
.expiration-kpi { text-align:left; border:1px solid var(--border); padding:18px; min-height:132px; cursor:pointer; transition:transform .18s ease,border-color .18s ease,background .18s ease; }
.expiration-kpi:hover,.expiration-kpi.active { transform:translateY(-2px); border-color:rgba(63,224,170,.55); background:linear-gradient(145deg,rgba(22,42,36,.94),rgba(8,17,18,.96)); }
.expiration-kpi span { color:var(--text-muted); font-weight:800; font-size:.9rem; }
.expiration-kpi strong { display:block; color:var(--text-main); font-size:2.3rem; margin:10px 0 6px; letter-spacing:-.05em; }
.expiration-kpi small { color:var(--text-soft); line-height:1.4; }
.expiration-kpi.danger strong { color:#ff7b7b; }
.expirations-toolbar { margin:0 0 18px; }
.expirations-list { display:grid; gap:14px; }
.expiration-card { display:grid; grid-template-columns:72px minmax(0,1fr) auto; align-items:center; gap:16px; padding:16px; border:1px solid var(--border); background:linear-gradient(145deg,rgba(14,24,25,.94),rgba(8,14,15,.96)); border-radius:24px; box-shadow:var(--shadow-card); }
.expiration-card:hover { border-color:rgba(63,224,170,.42); }
.expiration-expired { border-color:rgba(255,104,104,.35); }
.expiration-today { border-color:rgba(245,190,86,.5); }
.expiration-date { width:64px; height:64px; border-radius:20px; background:rgba(63,224,170,.1); border:1px solid rgba(63,224,170,.24); display:grid; place-items:center; align-content:center; color:var(--accent); }
.expiration-date strong { font-size:1.45rem; line-height:1; }
.expiration-date small { color:var(--text-muted); font-weight:800; }
.expiration-main header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:6px; }
.expiration-main header strong { color:var(--text-main); font-size:1.05rem; }
.expiration-main header small { display:block; color:var(--text-muted); margin-top:2px; }
.expiration-main h3 { margin:0 0 10px; color:var(--text-main); font-size:1.18rem; letter-spacing:-.02em; }
.expiration-progress span { display:flex; justify-content:space-between; gap:12px; margin-bottom:7px; color:var(--text-muted); font-weight:800; }
.expiration-progress div { height:9px; border-radius:999px; background:rgba(255,255,255,.08); overflow:hidden; }
.expiration-progress i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--accent),var(--accent-strong)); }
.expiration-meta { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.expiration-meta span { padding:6px 9px; border-radius:999px; background:rgba(255,255,255,.055); color:var(--text-soft); font-size:.82rem; }
.expiration-actions { display:flex; flex-direction:column; align-items:stretch; gap:8px; min-width:172px; }
.button-small { min-height:38px; padding:0 14px; border-radius:14px; font-size:.9rem; justify-content:center; }
.expiration-card-skeleton { height:142px; background:linear-gradient(90deg,rgba(255,255,255,.04),rgba(255,255,255,.08),rgba(255,255,255,.04)); background-size:200% 100%; animation:skeleton 1.1s linear infinite; }
.renew-context { display:flex; gap:12px; align-items:center; padding:14px; border:1px solid var(--border); border-radius:20px; background:rgba(255,255,255,.045); margin-bottom:16px; }
.renew-context strong { color:var(--text-main); }
.renew-context small { display:block; color:var(--text-muted); margin-top:3px; }

@media (max-width: 980px) { .expiration-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .expiration-card { grid-template-columns:58px minmax(0,1fr); } .expiration-actions { grid-column:1 / -1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); min-width:0; } }
@media (max-width: 560px) { .expiration-summary-grid { grid-template-columns:1fr; gap:10px; } .expiration-kpi { min-height:auto; padding:14px; } .expiration-kpi strong { font-size:2rem; } .expiration-card { grid-template-columns:1fr; padding:14px; border-radius:20px; } .expiration-date { width:100%; height:auto; min-height:58px; display:flex; justify-content:center; gap:6px; } .expiration-actions { grid-template-columns:1fr; } .expiration-main header { align-items:flex-start; flex-direction:column; } .expiration-meta span { width:100%; } }

/* ============================================================
   ETAPA 3 · HISTORIAL DE CLIENTE Y PROVEEDORES
   ============================================================ */
.providers-view { animation:viewIn .28s ease both; }
.providers-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin:20px 0; }
.providers-toolbar { margin:0 0 18px; padding:14px; }
.providers-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.provider-card { border:1px solid var(--border); border-radius:26px; background:linear-gradient(145deg,rgba(13,25,24,.96),rgba(5,12,10,.98)); box-shadow:var(--shadow-card); padding:18px; overflow:hidden; position:relative; }
.provider-card::before { content:""; position:absolute; inset:0; pointer-events:none; background:radial-gradient(circle at 12% 8%,rgba(63,224,170,.13),transparent 34%); opacity:.9; }
.provider-card > * { position:relative; z-index:1; }
.provider-card-header { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.provider-avatar { width:48px; height:48px; border-radius:17px; display:grid; place-items:center; flex:0 0 auto; background:linear-gradient(145deg,var(--accent),#0b6f4d); color:#03100c; font-weight:950; letter-spacing:-.04em; box-shadow:0 12px 28px rgba(20,197,139,.22); }
.provider-card-header strong { display:block; color:var(--text-main); font-size:1.05rem; letter-spacing:-.02em; }
.provider-card-header small { display:block; color:var(--text-muted); font-weight:750; margin-top:2px; }
.provider-card-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:12px 0; }
.provider-card-stats span { border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.04); border-radius:16px; padding:10px; min-width:0; }
.provider-card-stats small { display:block; color:var(--text-muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; margin-bottom:5px; }
.provider-card-stats strong { color:var(--text-main); font-size:.92rem; word-break:break-word; }
.provider-card-stats strong.negative { color:#ff8795; }
.provider-alerts { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.provider-alert { display:inline-flex; min-height:28px; align-items:center; padding:0 10px; border-radius:999px; font-size:.78rem; font-weight:900; }
.provider-alert.ok { color:#69e8bb; background:rgba(63,224,170,.1); border:1px solid rgba(63,224,170,.2); }
.provider-alert.warning { color:#ffd274; background:rgba(245,190,86,.1); border:1px solid rgba(245,190,86,.22); }
.provider-alert.danger { color:#ff9aa6; background:rgba(255,104,104,.1); border:1px solid rgba(255,104,104,.24); }
.provider-platforms { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.provider-platforms span { padding:7px 10px; border-radius:999px; background:rgba(63,224,170,.08); border:1px solid rgba(63,224,170,.16); color:#bdf9df; font-size:.8rem; font-weight:850; }
.provider-service-list { list-style:none; padding:0; margin:12px 0; display:grid; gap:8px; }
.provider-service-list li { margin:0; }
.provider-service-list button, .provider-service-list li > span { width:100%; border:1px solid rgba(255,255,255,.075); background:rgba(255,255,255,.04); color:var(--text-main); border-radius:16px; min-height:48px; padding:10px 12px; display:flex; align-items:center; justify-content:space-between; gap:10px; text-align:left; cursor:pointer; }
.provider-service-list button:hover { border-color:rgba(63,224,170,.32); background:rgba(63,224,170,.08); }
.provider-service-list strong { display:block; color:var(--text-main); font-size:.9rem; }
.provider-service-list small { display:block; color:var(--text-muted); font-size:.78rem; margin-top:2px; }
.provider-service-list b { color:#bdf9df; font-size:.86rem; white-space:nowrap; }
.provider-actions { display:flex; justify-content:space-between; gap:10px; align-items:center; margin-top:14px; }
.provider-card-skeleton { min-height:280px; background:linear-gradient(90deg,rgba(255,255,255,.04),rgba(255,255,255,.08),rgba(255,255,255,.04)); background-size:200% 100%; animation:skeleton 1.1s linear infinite; }
.providers-empty { margin-top:18px; text-align:center; padding:28px; }
.providers-empty span { width:64px; height:64px; margin:0 auto 14px; border-radius:22px; display:grid; place-items:center; color:var(--accent); background:rgba(63,224,170,.1); border:1px solid rgba(63,224,170,.18); }
.providers-empty svg { width:28px; height:28px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.client-history-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:14px 0; }
.client-history-summary article { padding:12px; border:1px solid var(--border); border-radius:18px; background:rgba(255,255,255,.045); }
.client-history-summary span { display:block; color:var(--text-muted); font-size:.78rem; font-weight:850; text-transform:uppercase; letter-spacing:.07em; }
.client-history-summary strong { display:block; color:var(--text-main); margin-top:6px; font-size:1.02rem; }
.client-history-summary strong.negative { color:#ff8795; }
.client-history-block { border:1px solid var(--border); border-radius:22px; padding:14px; background:rgba(255,255,255,.035); margin-top:14px; }
.client-history-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.client-history-heading strong { display:block; color:var(--text-main); }
.client-history-heading small { display:block; color:var(--text-muted); margin-top:2px; }
.client-history-heading button { border:1px solid rgba(63,224,170,.28); background:rgba(63,224,170,.1); color:#bdf9df; min-height:36px; padding:0 12px; border-radius:999px; font-weight:900; cursor:pointer; }
.client-history-block ul { list-style:none; margin:0; padding:0; display:grid; gap:8px; max-height:260px; overflow:auto; }
.client-history-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border-radius:16px; border:1px solid rgba(255,255,255,.07); background:rgba(255,255,255,.035); }
.client-history-row strong { color:var(--text-main); }
.client-history-row small { display:block; color:var(--text-muted); margin-top:2px; }
.client-history-row b { color:#69e8bb; white-space:nowrap; }
.client-history-row b.negative { color:#ff8795; }
.client-history-row.is-voided { opacity:.58; }
@media (max-width:1100px) { .providers-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .providers-grid { grid-template-columns:1fr; } }
@media (max-width:680px) { .providers-summary-grid, .client-history-summary, .provider-card-stats { grid-template-columns:1fr 1fr; } .provider-card { border-radius:22px; padding:14px; } .provider-actions { flex-direction:column; align-items:stretch; } .provider-actions .button { width:100%; } .client-history-heading { align-items:flex-start; flex-direction:column; } .client-history-heading button { width:100%; } }
@media (max-width:440px) { .providers-summary-grid, .client-history-summary { grid-template-columns:1fr; } .provider-card-stats { grid-template-columns:1fr 1fr; } }

/* ============================================================
   ETAPA 4 · REPORTES, CONFIGURACIÓN Y EQUIPO
   ============================================================ */
.reports-view, .settings-view, .team-view { animation:viewIn .28s ease both; }
.reports-filter-card { margin:0 0 18px; padding:16px; }
.reports-range-label { margin:10px 2px 0; color:var(--text-muted); font-weight:850; font-size:.88rem; }
.reports-grid, .settings-layout, .team-layout { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:18px; }
.reports-card, .settings-card, .team-card { padding:18px; border-radius:26px; }
.reports-list { display:grid; gap:10px; }
.reports-row { display:grid; grid-template-columns:36px minmax(0,1fr) auto; gap:12px; align-items:center; min-height:56px; padding:10px 12px; border:1px solid rgba(255,255,255,.075); background:rgba(255,255,255,.04); border-radius:18px; }
.reports-rank { width:34px; height:34px; border-radius:13px; display:grid; place-items:center; background:rgba(63,224,170,.1); color:#bdf9df; font-weight:950; border:1px solid rgba(63,224,170,.18); }
.reports-row strong { display:block; color:var(--text-main); font-size:.96rem; }
.reports-row small { display:block; color:var(--text-muted); margin-top:3px; font-size:.8rem; }
.reports-row b { color:#69e8bb; white-space:nowrap; }
.reports-row b.negative { color:#ff8795; }
.settings-template-help { display:flex; flex-wrap:wrap; gap:8px; align-items:center; color:var(--text-muted); margin:10px 0 14px; font-size:.88rem; }
.settings-template-help span { padding:5px 8px; border-radius:999px; background:rgba(63,224,170,.1); color:#bdf9df; border:1px solid rgba(63,224,170,.16); font-weight:850; }
.settings-preview { border:1px solid rgba(63,224,170,.18); background:rgba(63,224,170,.08); border-radius:20px; padding:14px; color:var(--text-main); }
.settings-preview strong { display:block; margin-bottom:6px; color:#bdf9df; }
.settings-preview p { margin:0 0 8px; color:var(--text-soft); line-height:1.5; }
.settings-preview small { color:var(--text-muted); }
.settings-note { margin-top:16px; color:var(--text-muted); line-height:1.5; }
.team-form { display:grid; gap:12px; }
.team-helper { margin:12px 0 0; color:var(--text-muted); line-height:1.5; }
.team-users { display:grid; gap:10px; }
.team-user-card { display:grid; grid-template-columns:48px minmax(0,1fr) auto; gap:12px; align-items:center; padding:12px; border-radius:20px; border:1px solid rgba(255,255,255,.075); background:rgba(255,255,255,.04); }
.team-user-card.is-paused { opacity:.68; }
.team-avatar { width:48px; height:48px; border-radius:17px; display:grid; place-items:center; background:linear-gradient(145deg,var(--accent),#0b6f4d); color:#03100c; font-weight:950; }
.team-user-card strong { display:block; color:var(--text-main); }
.team-user-card small { display:block; color:var(--text-muted); margin-top:3px; }
.team-user-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.providers-toolbar .finance-search { display:flex; align-items:center; gap:10px; width:100%; }
.providers-toolbar .finance-search svg { width:20px; height:20px; min-width:20px; flex:0 0 20px; color:var(--text-muted); fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.providers-toolbar .finance-search input { flex:1; min-width:0; height:48px; border:1px solid var(--border); border-radius:16px; background:rgba(255,255,255,.045); color:var(--text-main); padding:0 14px; font-weight:750; }
.providers-toolbar .finance-search input:focus { outline:none; border-color:rgba(63,224,170,.46); box-shadow:0 0 0 4px rgba(63,224,170,.1); }
@media (max-width: 980px) { .reports-grid, .settings-layout, .team-layout { grid-template-columns:1fr; } .reports-row { grid-template-columns:34px minmax(0,1fr); } .reports-row b { grid-column:2; justify-self:start; } .team-user-card { grid-template-columns:44px minmax(0,1fr); } .team-user-actions { grid-column:1 / -1; justify-content:stretch; } .team-user-actions .button { flex:1; } }
@media (max-width: 560px) { .reports-filter-card, .reports-card, .settings-card, .team-card { padding:14px; border-radius:22px; } .reports-kpi-grid, .team-kpi-grid { grid-template-columns:1fr; } .reports-row { padding:10px; border-radius:16px; } .settings-template-help { align-items:flex-start; flex-direction:column; } }


/* FIX RC2 · gráfica finanzas estable */
.finance-chart-card { min-width:0; }
.finance-chart-button, .finance-chart-button canvas { box-sizing:border-box; }
@media (max-height:700px) and (max-width:720px) {
  .finance-chart-button { height:220px; }
}


/* FIX RC3 DEFINITIVO · Finanzas vs Costos sin crecimiento vertical */
.finance-chart-card {
  min-width: 0 !important;
  overflow: hidden !important;
}
.finance-chart-button {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 300px !important;
  min-height: 300px !important;
  max-height: 300px !important;
  flex: 0 0 300px !important;
  overflow: hidden !important;
  contain: layout paint size !important;
  box-sizing: border-box !important;
}
.finance-chart-button canvas {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  max-width: 100% !important;
  object-fit: contain !important;
  box-sizing: border-box !important;
}
@media (max-width: 1100px) {
  .finance-chart-button {
    height: 260px !important;
    min-height: 260px !important;
    max-height: 260px !important;
    flex-basis: 260px !important;
  }
}
@media (max-width: 720px) {
  .finance-chart-button {
    height: 230px !important;
    min-height: 230px !important;
    max-height: 230px !important;
    flex-basis: 230px !important;
  }
}
@media (max-width: 560px) {
  .finance-chart-button {
    height: 210px !important;
    min-height: 210px !important;
    max-height: 210px !important;
    flex-basis: 210px !important;
    border-radius: 18px !important;
  }
}
@media (max-height: 700px) and (max-width: 720px) {
  .finance-chart-button {
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
    flex-basis: 200px !important;
  }
}


/* FIX RC4 REAL · Finanzas vs Costos sin canvas ni crecimiento automático */
.finance-chart-card {
  min-width: 0 !important;
  overflow: hidden !important;
}
.finance-chart-button {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 300px !important;
  min-height: 300px !important;
  max-height: 300px !important;
  flex: 0 0 300px !important;
  padding: 16px 16px 12px 16px !important;
  margin-top: 8px !important;
  overflow: hidden !important;
  contain: strict !important;
  box-sizing: border-box !important;
  border: 1px solid rgba(112,232,191,.12) !important;
  background: #08130f !important;
}
.finance-chart-button canvas { display:none !important; }
.finance-chart-html {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: 54px minmax(0,1fr) !important;
  grid-template-rows: minmax(0,1fr) 26px !important;
  gap: 0 10px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
.finance-html-scale {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: 100%;
  padding: 2px 0 20px;
  overflow: hidden;
  color: var(--chart-label);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.finance-html-plot {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.finance-html-lines {
  position:absolute;
  inset: 0 0 20px 0;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  pointer-events:none;
}
.finance-html-lines i {
  display:block;
  height:1px;
  width:100%;
  background:var(--chart-grid);
  opacity:.95;
}
.finance-html-groups {
  position:absolute;
  inset:0;
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(38px,1fr);
  align-items:stretch;
  gap:10px;
  min-width:0;
  overflow:hidden;
}
.finance-html-group {
  min-width:0;
  display:grid;
  grid-template-rows:minmax(0,1fr) 20px;
  align-items:end;
  justify-items:center;
  gap:7px;
  overflow:hidden;
}
.finance-html-bars {
  width:100%;
  min-height:0;
  height:100%;
  display:flex;
  align-items:end;
  justify-content:center;
  gap:4px;
  overflow:hidden;
}
.finance-html-bars b {
  display:block;
  width:clamp(7px, 16%, 15px);
  min-height:2px;
  max-height:100%;
  border-radius:999px 999px 3px 3px;
  box-shadow:0 -8px 22px rgba(0,0,0,.16) inset;
}
.finance-html-bars b.income { background:linear-gradient(180deg,#5ef0bf,#0a8e60); }
.finance-html-bars b.cost { background:linear-gradient(180deg,#ffd679,#b77412); }
.finance-html-bars b.profit { background:linear-gradient(180deg,#42dca8,#087b53); }
.finance-html-bars b.profit.negative { background:linear-gradient(180deg,#ff9aa6,#c43d50); }
.finance-html-group small {
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--chart-label);
  font-size:11px;
  font-weight:900;
  line-height:1;
}
.finance-html-legend {
  grid-column:2;
  grid-row:2;
  min-width:0;
  display:flex;
  justify-content:center;
  align-items:end;
  gap:12px;
  overflow:hidden;
  white-space:nowrap;
  color:var(--ui-muted);
  font-size:11px;
  font-weight:900;
}
.finance-html-legend span { display:inline-flex; align-items:center; gap:6px; min-width:0; }
.finance-html-legend i { width:9px; height:9px; border-radius:999px; flex:0 0 auto; }
.finance-html-legend i.income { background:#49e6b0; }
.finance-html-legend i.cost { background:#ffca6a; }
.finance-html-legend i.profit { background:#22b980; }
@media (max-width: 1100px) {
  .finance-chart-button { height:260px !important; min-height:260px !important; max-height:260px !important; flex-basis:260px !important; }
}
@media (max-width: 720px) {
  .finance-chart-button { height:230px !important; min-height:230px !important; max-height:230px !important; flex-basis:230px !important; padding:13px 12px 10px !important; }
  .finance-chart-html { grid-template-columns: 44px minmax(0,1fr) !important; gap:0 8px !important; }
  .finance-html-scale, .finance-html-group small, .finance-html-legend { font-size:10px; }
  .finance-html-groups { gap:7px; grid-auto-columns:minmax(30px,1fr); }
}
@media (max-width: 560px) {
  .finance-chart-button { height:210px !important; min-height:210px !important; max-height:210px !important; flex-basis:210px !important; border-radius:18px !important; }
  .finance-chart-html { grid-template-columns: 40px minmax(0,1fr) !important; grid-template-rows:minmax(0,1fr) 22px !important; }
  .finance-html-legend { gap:8px; justify-content:flex-start; overflow-x:auto; scrollbar-width:none; }
  .finance-html-bars { gap:3px; }
}
@media (max-height: 700px) and (max-width: 720px) {
  .finance-chart-button { height:200px !important; min-height:200px !important; max-height:200px !important; flex-basis:200px !important; }
}

/* FIX RC5 PC · Finanzas: evitar que el comparativo mensual sea estirado por el grid de escritorio
   Causa encontrada: en PC, .finance-layout estaba en dos columnas y el grid estiraba la tarjeta
   izquierda para igualar la altura de “Servicios con más ganancia”. En Android no pasaba porque el
   layout ya se volvía de una sola columna. */
@media (min-width: 901px) {
  body[data-page="dashboard"] .finance-layout,
  .finance-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: start !important;
    gap: 18px !important;
  }
  body[data-page="dashboard"] .finance-chart-card,
  .finance-chart-card {
    align-self: start !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }
  body[data-page="dashboard"] .finance-breakdown-card,
  .finance-breakdown-card {
    align-self: start !important;
  }
  body[data-page="dashboard"] .finance-chart-button,
  .finance-chart-button {
    height: 260px !important;
    min-height: 260px !important;
    max-height: 260px !important;
    flex: 0 0 260px !important;
  }
  body[data-page="dashboard"] .finance-chart-html,
  .finance-chart-html {
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }
}

/* ============================================================
   RC6 · FIX REAL DE SECCIÓN FINANZAS EN PC
   Problema reportado: “Ingresos vs costos” y “Servicios con más ganancia”
   se expanden hacia abajo en escritorio. En Android no ocurre.

   Solución: rediseñar TODA la zona comparativa de Finanzas en escritorio:
   - se restaura un layout profesional de dos columnas;
   - ambas tarjetas tienen altura fija controlada;
   - la gráfica queda fija y no puede crecer;
   - servicios con más ganancia usa lista compacta con scroll interno;
   - ninguna tarjeta puede empujar la otra hacia abajo.
   ============================================================ */
@media (min-width: 901px) {
  body[data-page="dashboard"] .finance-layout,
  .finance-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr) !important;
    align-items: start !important;
    gap: 18px !important;
    margin-bottom: 18px !important;
  }

  body[data-page="dashboard"] .finance-chart-card,
  body[data-page="dashboard"] .finance-breakdown-card,
  .finance-chart-card,
  .finance-breakdown-card {
    height: 368px !important;
    min-height: 368px !important;
    max-height: 368px !important;
    overflow: hidden !important;
    align-self: start !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  body[data-page="dashboard"] .finance-chart-card .card-heading,
  body[data-page="dashboard"] .finance-breakdown-card .card-heading,
  .finance-chart-card .card-heading,
  .finance-breakdown-card .card-heading {
    flex: 0 0 auto !important;
    min-height: 54px !important;
    margin-bottom: 10px !important;
  }

  body[data-page="dashboard"] .finance-chart-button,
  .finance-chart-button {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin-top: 0 !important;
    overflow: hidden !important;
    contain: layout paint !important;
    box-sizing: border-box !important;
  }

  body[data-page="dashboard"] .finance-chart-html,
  .finance-chart-html {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body[data-page="dashboard"] .finance-top-services,
  .finance-top-services {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: grid !important;
    align-content: start !important;
    gap: 8px !important;
    margin-top: 0 !important;
    padding-right: 3px !important;
    scrollbar-width: thin !important;
  }

  body[data-page="dashboard"] .finance-service-row,
  .finance-service-row {
    min-height: 48px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
    transform: none !important;
  }

  body[data-page="dashboard"] .finance-service-row:hover,
  .finance-service-row:hover {
    transform: none !important;
  }

  body[data-page="dashboard"] .finance-service-row strong,
  .finance-service-row strong {
    font-size: .9rem !important;
    line-height: 1.15 !important;
  }

  body[data-page="dashboard"] .finance-service-row small,
  .finance-service-row small {
    display: block !important;
    margin-top: 2px !important;
    font-size: .74rem !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body[data-page="dashboard"] .finance-service-row b,
  .finance-service-row b {
    font-size: .9rem !important;
    white-space: nowrap !important;
  }

  body[data-page="dashboard"] .finance-service-row i,
  .finance-service-row i {
    height: 2px !important;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  body[data-page="dashboard"] .finance-layout,
  .finance-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, .75fr) !important;
  }
  body[data-page="dashboard"] .finance-chart-card,
  body[data-page="dashboard"] .finance-breakdown-card,
  .finance-chart-card,
  .finance-breakdown-card {
    height: 348px !important;
    min-height: 348px !important;
    max-height: 348px !important;
  }
}

@media (max-width: 900px) {
  body[data-page="dashboard"] .finance-layout,
  .finance-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: start !important;
  }
}

/* ============================================================
   PULIDO PROFESIONAL RC1
   Base: Reportes / Config / Equipo RC6 con Finanzas corregida.
   Objetivo: ordenar visualmente el panel completo sin agregar SQL ni
   cambiar lógica de negocio.
   ============================================================ */
body[data-page="dashboard"] {
  --text-main: var(--ui-text);
  --text-muted: var(--ui-muted);
  --text-soft: #abc1b8;
  --border: var(--ui-line);
  --shadow-card: 0 18px 48px rgba(0,0,0,.28);
  --panel-bg: linear-gradient(150deg, rgba(14, 28, 23, .96), rgba(7, 13, 11, .98));
  --panel-bg-soft: rgba(255,255,255,.045);
  --panel-hover: rgba(67,229,190,.075);
  --focus-ring: 0 0 0 4px rgba(67,229,190,.12);
  --touch: 44px;
  letter-spacing: -.005em;
}
body[data-page="dashboard"] .dashboard-content {
  width: 100%;
  max-width: 1500px;
  padding-top: clamp(18px, 2.4vw, 32px);
  padding-bottom: max(42px, env(safe-area-inset-bottom));
}
body[data-page="dashboard"] .app-view {
  min-width: 0;
  animation: viewIn .22s ease both;
}
body[data-page="dashboard"] .page-heading {
  margin-bottom: clamp(16px, 2.2vw, 24px);
  align-items: flex-start;
}
body[data-page="dashboard"] .page-heading h1 {
  line-height: 1.02;
  text-wrap: balance;
}
body[data-page="dashboard"] .page-heading p {
  max-width: 720px;
  line-height: 1.55;
  font-size: .86rem;
}
body[data-page="dashboard"] .heading-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
body[data-page="dashboard"] .button,
body[data-page="dashboard"] .table-action,
body[data-page="dashboard"] .advanced-toggle,
body[data-page="dashboard"] .small-action,
body[data-page="dashboard"] .icon-action,
body[data-page="dashboard"] .analytics-chart-button,
body[data-page="dashboard"] .gauge-button,
body[data-page="dashboard"] .card-footer-action {
  min-height: var(--touch);
  border-radius: 14px;
}
body[data-page="dashboard"] .button {
  padding-inline: 16px;
  letter-spacing: .01em;
}
body[data-page="dashboard"] .button-primary {
  color: #03120d;
  background: linear-gradient(135deg, #72efc3, #24c78d 62%, #0f8a60);
  border-color: rgba(114,239,195,.7);
  box-shadow: 0 12px 30px rgba(33, 208, 143, .18), inset 0 1px rgba(255,255,255,.22);
}
body[data-page="dashboard"] .button-primary:hover {
  color: #03120d;
  background: linear-gradient(135deg, #83ffd1, #34d99d 64%, #109468);
}
body[data-page="dashboard"] .button-secondary,
body[data-page="dashboard"] .table-action,
body[data-page="dashboard"] .advanced-toggle {
  color: var(--ui-text);
  border-color: rgba(125, 225, 191, .16);
  background: rgba(12, 25, 20, .88);
}
body[data-page="dashboard"] .button-secondary:hover,
body[data-page="dashboard"] .table-action:hover,
body[data-page="dashboard"] .advanced-toggle:hover {
  color: #8cf1ca;
  border-color: rgba(125, 225, 191, .33);
  background: rgba(67,229,190,.08);
}

/* Tarjetas y paneles consistentes */
body[data-page="dashboard"] .dashboard-card,
body[data-page="dashboard"] .metric-card,
body[data-page="dashboard"] .client-card,
body[data-page="dashboard"] .draft-card,
body[data-page="dashboard"] .finance-filter-card,
body[data-page="dashboard"] .finance-chart-card,
body[data-page="dashboard"] .finance-breakdown-card,
body[data-page="dashboard"] .finance-table-card,
body[data-page="dashboard"] .provider-card,
body[data-page="dashboard"] .reports-card,
body[data-page="dashboard"] .reports-filter-card,
body[data-page="dashboard"] .settings-card,
body[data-page="dashboard"] .team-card,
body[data-page="dashboard"] .expiration-card,
body[data-page="dashboard"] .expiration-kpi,
body[data-page="dashboard"] .service-form-card,
body[data-page="dashboard"] .clients-toolbar,
body[data-page="dashboard"] .expirations-toolbar,
body[data-page="dashboard"] .providers-toolbar,
body[data-page="dashboard"] .draft-info,
body[data-page="dashboard"] .clients-empty,
body[data-page="dashboard"] .drafts-empty,
body[data-page="dashboard"] .providers-empty,
body[data-page="dashboard"] .finance-empty,
body[data-page="dashboard"] .compact-empty,
body[data-page="dashboard"] .dashboard-empty {
  border: 1px solid rgba(116, 232, 192, .11);
  background: var(--panel-bg);
  box-shadow: var(--shadow-card);
}
body[data-page="dashboard"] .dashboard-card,
body[data-page="dashboard"] .finance-chart-card,
body[data-page="dashboard"] .finance-breakdown-card,
body[data-page="dashboard"] .finance-table-card,
body[data-page="dashboard"] .reports-card,
body[data-page="dashboard"] .settings-card,
body[data-page="dashboard"] .team-card,
body[data-page="dashboard"] .provider-card,
body[data-page="dashboard"] .client-card,
body[data-page="dashboard"] .draft-card,
body[data-page="dashboard"] .expiration-card {
  border-radius: clamp(20px, 1.6vw, 26px);
}
body[data-page="dashboard"] .dashboard-card:hover,
body[data-page="dashboard"] .client-card:hover,
body[data-page="dashboard"] .draft-card:hover,
body[data-page="dashboard"] .provider-card:hover,
body[data-page="dashboard"] .expiration-card:hover,
body[data-page="dashboard"] .reports-card:hover,
body[data-page="dashboard"] .team-user-card:hover {
  border-color: rgba(116, 232, 192, .22);
  box-shadow: 0 22px 58px rgba(0,0,0,.34);
}
body[data-page="dashboard"] .card-heading,
body[data-page="dashboard"] .section-heading,
body[data-page="dashboard"] .client-history-heading,
body[data-page="dashboard"] .service-card-heading,
body[data-page="dashboard"] .client-card-header,
body[data-page="dashboard"] .provider-card-header {
  min-width: 0;
}
body[data-page="dashboard"] .card-heading h2,
body[data-page="dashboard"] .section-heading h3,
body[data-page="dashboard"] .service-card-heading h3,
body[data-page="dashboard"] .clients-heading h2 {
  letter-spacing: -.035em;
  line-height: 1.12;
}
body[data-page="dashboard"] .card-heading p,
body[data-page="dashboard"] .section-heading p,
body[data-page="dashboard"] .clients-heading p,
body[data-page="dashboard"] .service-card-heading p {
  color: var(--text-soft);
  line-height: 1.5;
}

/* Navegación y barra superior más compactas */
body[data-page="dashboard"] .sidebar {
  padding-top: 22px;
}
body[data-page="dashboard"] .sidebar-nav,
body[data-page="dashboard"] .sidebar-actions {
  gap: 6px;
}
body[data-page="dashboard"] .sidebar-link {
  min-height: 45px;
  border-radius: 15px;
}
body[data-page="dashboard"] .sidebar-link svg {
  width: 18px;
  height: 18px;
}
body[data-page="dashboard"] .nav-label {
  margin-top: 26px;
  margin-bottom: 10px;
}
body[data-page="dashboard"] .topbar {
  min-height: 70px;
}
body[data-page="dashboard"] .global-search,
body[data-page="dashboard"] .clients-search,
body[data-page="dashboard"] .finance-search,
body[data-page="dashboard"] .finance-search-field,
body[data-page="dashboard"] .auth-input-wrap {
  min-width: 0;
}
body[data-page="dashboard"] .global-search svg,
body[data-page="dashboard"] .clients-search svg,
body[data-page="dashboard"] .finance-search svg,
body[data-page="dashboard"] .providers-toolbar .finance-search svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  flex: 0 0 18px !important;
}
body[data-page="dashboard"] .global-search input,
body[data-page="dashboard"] .clients-search input,
body[data-page="dashboard"] .finance-search input,
body[data-page="dashboard"] .form-field input,
body[data-page="dashboard"] .form-field select,
body[data-page="dashboard"] .form-field textarea,
body[data-page="dashboard"] .setup-form input {
  font-size: 16px;
}

/* Grids y espacios generales */
body[data-page="dashboard"] .metric-grid,
body[data-page="dashboard"] .finance-metric-grid,
body[data-page="dashboard"] .expiration-summary-grid,
body[data-page="dashboard"] .providers-summary-grid,
body[data-page="dashboard"] .reports-kpi-grid,
body[data-page="dashboard"] .team-kpi-grid {
  gap: 14px;
}
body[data-page="dashboard"] .clients-grid,
body[data-page="dashboard"] .drafts-grid,
body[data-page="dashboard"] .providers-grid,
body[data-page="dashboard"] .reports-grid,
body[data-page="dashboard"] .settings-layout,
body[data-page="dashboard"] .team-layout {
  gap: 18px;
}
body[data-page="dashboard"] .client-card,
body[data-page="dashboard"] .draft-card,
body[data-page="dashboard"] .provider-card,
body[data-page="dashboard"] .reports-card,
body[data-page="dashboard"] .settings-card,
body[data-page="dashboard"] .team-card {
  padding: clamp(16px, 1.7vw, 21px);
}
body[data-page="dashboard"] .client-card-main,
body[data-page="dashboard"] .draft-card,
body[data-page="dashboard"] .provider-card-header,
body[data-page="dashboard"] .team-user-card,
body[data-page="dashboard"] .reports-row,
body[data-page="dashboard"] .finance-service-row {
  min-width: 0;
}
body[data-page="dashboard"] .client-card-identity,
body[data-page="dashboard"] .client-card-identity > *,
body[data-page="dashboard"] .provider-card-header > div,
body[data-page="dashboard"] .team-user-card > div,
body[data-page="dashboard"] .reports-row > div,
body[data-page="dashboard"] .finance-service-row > div {
  min-width: 0;
}
body[data-page="dashboard"] .client-card-identity strong,
body[data-page="dashboard"] .provider-card-header strong,
body[data-page="dashboard"] .team-user-card strong,
body[data-page="dashboard"] .reports-row strong,
body[data-page="dashboard"] .finance-service-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Formularios y filtros más limpios */
body[data-page="dashboard"] .form-grid,
body[data-page="dashboard"] .form-grid-two,
body[data-page="dashboard"] .form-grid-four,
body[data-page="dashboard"] .form-grid-service,
body[data-page="dashboard"] .finance-filter-row,
body[data-page="dashboard"] .finance-advanced {
  gap: 12px;
}
body[data-page="dashboard"] .form-field {
  min-width: 0;
}
body[data-page="dashboard"] .form-field > span,
body[data-page="dashboard"] .form-field label,
body[data-page="dashboard"] .reports-range-label,
body[data-page="dashboard"] .settings-template-help {
  line-height: 1.35;
}
body[data-page="dashboard"] .form-field input,
body[data-page="dashboard"] .form-field select,
body[data-page="dashboard"] .form-field textarea,
body[data-page="dashboard"] .finance-search input,
body[data-page="dashboard"] .clients-search input,
body[data-page="dashboard"] .providers-toolbar .finance-search input {
  border-radius: 15px;
}
body[data-page="dashboard"] .form-field textarea {
  min-height: 104px;
  resize: vertical;
}
body[data-page="dashboard"] .form-field input:focus,
body[data-page="dashboard"] .form-field select:focus,
body[data-page="dashboard"] .form-field textarea:focus,
body[data-page="dashboard"] .clients-search:focus-within,
body[data-page="dashboard"] .finance-search:focus-within,
body[data-page="dashboard"] .global-search:focus-within {
  box-shadow: var(--focus-ring);
}

/* Modales: menos pesados y más estables */
body[data-page="dashboard"] .client-modal,
body[data-page="dashboard"] .finance-modal,
body[data-page="dashboard"] .detail-modal,
body[data-page="dashboard"] .account-modal {
  border-radius: 26px;
  box-shadow: 0 36px 110px rgba(0,0,0,.72);
}
body[data-page="dashboard"] .client-modal-header,
body[data-page="dashboard"] .client-modal-footer,
body[data-page="dashboard"] .finance-modal .client-modal-header,
body[data-page="dashboard"] .finance-modal .client-modal-footer {
  padding-inline: clamp(16px, 2.4vw, 24px);
}
body[data-page="dashboard"] .client-modal-scroll {
  padding: clamp(14px, 2vw, 22px);
}
body[data-page="dashboard"] .client-form,
body[data-page="dashboard"] .finance-form {
  gap: 14px;
}
body[data-page="dashboard"] .client-form-section,
body[data-page="dashboard"] .service-form-card,
body[data-page="dashboard"] .client-history-block,
body[data-page="dashboard"] .renew-context {
  border-radius: 22px;
}

/* Tablas y listas */
body[data-page="dashboard"] .finance-table-wrap,
body[data-page="dashboard"] .reports-list,
body[data-page="dashboard"] .team-users,
body[data-page="dashboard"] .provider-service-list,
body[data-page="dashboard"] .expirations-list,
body[data-page="dashboard"] .reminder-list,
body[data-page="dashboard"] .activity-list {
  scrollbar-width: thin;
}
body[data-page="dashboard"] .finance-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0a1813;
}
body[data-page="dashboard"] .finance-table tr:hover td {
  background: rgba(67,229,190,.035);
}
body[data-page="dashboard"] .reports-row,
body[data-page="dashboard"] .team-user-card,
body[data-page="dashboard"] .client-history-row,
body[data-page="dashboard"] .provider-service-list button,
body[data-page="dashboard"] .provider-service-list li > span {
  border-color: rgba(255,255,255,.07);
  background: rgba(255,255,255,.038);
}

/* Secciones específicas */
body[data-page="dashboard"] .finance-layout {
  align-items: start;
}
body[data-page="dashboard"] .finance-chart-card,
body[data-page="dashboard"] .finance-breakdown-card {
  border-radius: 24px;
}
body[data-page="dashboard"] .finance-top-services {
  min-height: 0;
}
body[data-page="dashboard"] .finance-service-row i {
  opacity: .85;
}
body[data-page="dashboard"] .provider-card-stats,
body[data-page="dashboard"] .client-history-summary {
  gap: 9px;
}
body[data-page="dashboard"] .provider-platforms span,
body[data-page="dashboard"] .settings-template-help span,
body[data-page="dashboard"] .expiration-meta span {
  border: 1px solid rgba(99, 224, 176, .14);
  background: rgba(99, 224, 176, .075);
}
body[data-page="dashboard"] .providers-toolbar .finance-search {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
}
body[data-page="dashboard"] .providers-toolbar .finance-search input {
  height: 48px;
  border: 0;
  padding: 0;
  background: transparent;
}
body[data-page="dashboard"] .new-client-fab {
  right: max(20px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  box-shadow: 0 20px 46px rgba(28, 213, 145, .24), 0 8px 18px rgba(0,0,0,.34);
}

/* Estados vacíos más discretos */
body[data-page="dashboard"] .clients-empty,
body[data-page="dashboard"] .drafts-empty,
body[data-page="dashboard"] .providers-empty,
body[data-page="dashboard"] .finance-empty,
body[data-page="dashboard"] .dashboard-empty,
body[data-page="dashboard"] .compact-empty {
  padding: clamp(22px, 3vw, 34px);
  text-align: center;
}
body[data-page="dashboard"] .clients-empty span,
body[data-page="dashboard"] .drafts-empty span,
body[data-page="dashboard"] .providers-empty span,
body[data-page="dashboard"] .finance-empty span,
body[data-page="dashboard"] .dashboard-empty span,
body[data-page="dashboard"] .compact-empty span {
  width: 58px;
  height: 58px;
}

/* Responsive: PC, tablet y teléfono */
@media (min-width: 1281px) {
  body[data-page="dashboard"] .clients-grid,
  body[data-page="dashboard"] .providers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1180px) {
  body[data-page="dashboard"] .page-heading {
    flex-direction: column;
    align-items: stretch;
  }
  body[data-page="dashboard"] .heading-actions {
    justify-content: flex-start;
  }
  body[data-page="dashboard"] .reports-grid,
  body[data-page="dashboard"] .settings-layout,
  body[data-page="dashboard"] .team-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  body[data-page="dashboard"] .dashboard-content {
    padding-inline: clamp(14px, 4vw, 22px);
    padding-bottom: max(88px, env(safe-area-inset-bottom));
  }
  body[data-page="dashboard"] .topbar {
    gap: 10px;
    padding-inline: 14px;
  }
  body[data-page="dashboard"] .global-search {
    flex: 1 1 auto;
  }
  body[data-page="dashboard"] .profile-name,
  body[data-page="dashboard"] .global-search kbd {
    display: none;
  }
  body[data-page="dashboard"] .profile-button {
    grid-template-columns: 36px 14px;
    gap: 6px;
    padding-right: 6px;
  }
  body[data-page="dashboard"] .metric-grid,
  body[data-page="dashboard"] .finance-metric-grid,
  body[data-page="dashboard"] .expiration-summary-grid,
  body[data-page="dashboard"] .providers-summary-grid,
  body[data-page="dashboard"] .reports-kpi-grid,
  body[data-page="dashboard"] .team-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body[data-page="dashboard"] .client-modal,
  body[data-page="dashboard"] .finance-modal {
    inset: 0;
    max-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}
@media (max-width: 680px) {
  body[data-page="dashboard"] .dashboard-content {
    padding-top: 16px;
  }
  body[data-page="dashboard"] .page-heading h1 {
    font-size: clamp(25px, 8vw, 32px);
  }
  body[data-page="dashboard"] .heading-actions,
  body[data-page="dashboard"] .heading-actions .button {
    width: 100%;
  }
  body[data-page="dashboard"] .heading-actions .button {
    justify-content: center;
  }
  body[data-page="dashboard"] .metric-grid,
  body[data-page="dashboard"] .finance-metric-grid,
  body[data-page="dashboard"] .expiration-summary-grid,
  body[data-page="dashboard"] .providers-summary-grid,
  body[data-page="dashboard"] .reports-kpi-grid,
  body[data-page="dashboard"] .team-kpi-grid,
  body[data-page="dashboard"] .provider-card-stats,
  body[data-page="dashboard"] .client-history-summary,
  body[data-page="dashboard"] .form-grid,
  body[data-page="dashboard"] .form-grid-two,
  body[data-page="dashboard"] .form-grid-four,
  body[data-page="dashboard"] .finance-filter-row,
  body[data-page="dashboard"] .finance-advanced {
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .topbar-actions {
    gap: 5px;
  }
  body[data-page="dashboard"] .topbar-icon,
  body[data-page="dashboard"] .mobile-menu-button {
    width: 40px;
    height: 40px;
  }
  body[data-page="dashboard"] .button {
    min-height: 46px;
  }
  body[data-page="dashboard"] .client-card,
  body[data-page="dashboard"] .draft-card,
  body[data-page="dashboard"] .provider-card,
  body[data-page="dashboard"] .reports-card,
  body[data-page="dashboard"] .settings-card,
  body[data-page="dashboard"] .team-card,
  body[data-page="dashboard"] .finance-filter-card,
  body[data-page="dashboard"] .finance-chart-card,
  body[data-page="dashboard"] .finance-breakdown-card,
  body[data-page="dashboard"] .finance-table-card {
    border-radius: 20px;
    padding: 14px;
  }
  body[data-page="dashboard"] .reports-row,
  body[data-page="dashboard"] .team-user-card,
  body[data-page="dashboard"] .expiration-card,
  body[data-page="dashboard"] .client-history-row {
    grid-template-columns: 1fr !important;
    align-items: start;
  }
  body[data-page="dashboard"] .expiration-actions,
  body[data-page="dashboard"] .provider-actions,
  body[data-page="dashboard"] .team-user-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
}
@media (max-width: 430px) {
  body[data-page="dashboard"] .dashboard-content {
    padding-inline: 12px;
  }
  body[data-page="dashboard"] .global-search {
    min-height: 40px;
    border-radius: 13px;
  }
  body[data-page="dashboard"] .topbar {
    min-height: 64px;
  }
  body[data-page="dashboard"] .profile-avatar {
    width: 34px;
    height: 34px;
  }
  body[data-page="dashboard"] .new-client-fab span {
    display: none;
  }
  body[data-page="dashboard"] .new-client-fab {
    width: 58px;
    height: 58px;
    border-radius: 22px;
    padding: 0;
  }
}

/* ============================================================
   PARTE 2 · INICIO INTELIGENTE + NOTIFICACIONES RC1
   ============================================================ */
body[data-page="dashboard"] .notification-wrap {
  position: relative;
  display: inline-grid;
}
body[data-page="dashboard"] .notification-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 80;
  width: min(390px, calc(100vw - 26px));
  max-height: min(72vh, 560px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border: 1px solid rgba(116,232,192,.16);
  border-radius: 24px;
  background: linear-gradient(150deg, rgba(11,23,19,.98), rgba(5,10,8,.99));
  box-shadow: 0 30px 90px rgba(0,0,0,.62), inset 0 1px rgba(255,255,255,.04);
}
body[data-page="dashboard"] .notification-panel[hidden] { display:none; }
body[data-page="dashboard"] .notification-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 85% 10%, rgba(85,230,179,.17), transparent 32%);
}
body[data-page="dashboard"] .notification-panel header,
body[data-page="dashboard"] .notification-panel footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
body[data-page="dashboard"] .notification-panel footer {
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
body[data-page="dashboard"] .notification-panel header strong {
  display: block;
  color: var(--ui-text);
  font-size: .96rem;
}
body[data-page="dashboard"] .notification-panel header small {
  display: block;
  margin-top: 3px;
  color: var(--ui-muted);
  font-size: .74rem;
}
body[data-page="dashboard"] .notification-panel header button,
body[data-page="dashboard"] .notification-panel footer button {
  border: 1px solid rgba(116,232,192,.14);
  border-radius: 14px;
  color: var(--ui-text);
  background: rgba(255,255,255,.045);
  min-height: 40px;
  cursor: pointer;
  font-weight: 800;
}
body[data-page="dashboard"] .notification-panel header button {
  width: 40px;
  display: grid;
  place-items: center;
  flex: none;
}
body[data-page="dashboard"] .notification-panel header button svg {
  width: 17px;
  height: 17px;
}
body[data-page="dashboard"] .notification-panel footer button:hover,
body[data-page="dashboard"] .notification-panel header button:hover {
  color: #83ffd1;
  background: rgba(67,229,190,.09);
  border-color: rgba(116,232,192,.3);
}
body[data-page="dashboard"] .notification-list {
  position: relative;
  z-index: 1;
  padding: 10px;
  display: grid;
  gap: 8px;
  overflow: auto;
}
body[data-page="dashboard"] .notification-item {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 18px;
  color: var(--ui-text);
  background: rgba(255,255,255,.035);
  text-align: left;
  cursor: pointer;
}
body[data-page="dashboard"] .notification-item:hover {
  transform: translateY(-1px);
  border-color: rgba(116,232,192,.22);
  background: rgba(67,229,190,.075);
}
body[data-page="dashboard"] .notification-item > span {
  grid-row: 1 / span 2;
  width: 10px;
  height: 10px;
  margin-top: 3px;
  border-radius: 999px;
  background: #74e8bf;
  box-shadow: 0 0 18px rgba(116,232,192,.45);
}
body[data-page="dashboard"] .notification-item.warning > span { background: #f0be57; box-shadow: 0 0 18px rgba(240,190,87,.45); }
body[data-page="dashboard"] .notification-item.danger > span { background: #ee7180; box-shadow: 0 0 18px rgba(238,113,128,.45); }
body[data-page="dashboard"] .notification-item.draft > span { background: #8fb9ff; box-shadow: 0 0 18px rgba(143,185,255,.45); }
body[data-page="dashboard"] .notification-item strong,
body[data-page="dashboard"] .notification-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-page="dashboard"] .notification-item strong { font-size: .86rem; }
body[data-page="dashboard"] .notification-item small { color: var(--ui-muted); font-size: .74rem; }
body[data-page="dashboard"] .notification-empty {
  position: relative;
  z-index: 1;
  padding: 28px 18px;
  text-align: center;
  color: var(--ui-muted);
}
body[data-page="dashboard"] .notification-empty span {
  width: 44px;
  height: 44px;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #04140e;
  background: #74e8bf;
  font-weight: 900;
}
body[data-page="dashboard"] .notification-empty strong { display:block; color:var(--ui-text); }
body[data-page="dashboard"] .notification-empty small { display:block; margin-top:3px; }

body[data-page="dashboard"] .smart-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .95fr);
  gap: 14px;
  margin-bottom: 14px;
}
body[data-page="dashboard"] .smart-main-card,
body[data-page="dashboard"] .smart-mini-card,
body[data-page="dashboard"] .quick-actions-strip {
  border: 1px solid rgba(116,232,192,.12);
  background: linear-gradient(150deg, rgba(14,28,23,.96), rgba(7,13,11,.98));
  box-shadow: var(--shadow-card);
}
body[data-page="dashboard"] .smart-main-card {
  position: relative;
  overflow: hidden;
  min-height: 152px;
  padding: clamp(18px, 2.2vw, 26px);
  border-radius: 28px;
}
body[data-page="dashboard"] .smart-main-card::after {
  content: "";
  position: absolute;
  inset: auto -48px -88px auto;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(85,230,179,.22), transparent 68%);
  pointer-events: none;
}
body[data-page="dashboard"] .smart-kicker {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid rgba(116,232,192,.18);
  border-radius: 999px;
  color: #86f4cc;
  background: rgba(67,229,190,.07);
  font-size: .72rem;
  font-weight: 850;
}
body[data-page="dashboard"] .smart-main-card h2 {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  color: var(--ui-text);
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  letter-spacing: -.055em;
  line-height: 1.04;
  text-wrap: balance;
}
body[data-page="dashboard"] .smart-main-card p {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 8px 0 0;
  color: var(--ui-muted);
  line-height: 1.55;
  font-size: .88rem;
}
body[data-page="dashboard"] .smart-actions {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
body[data-page="dashboard"] .smart-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
body[data-page="dashboard"] .smart-mini-card {
  min-width: 0;
  min-height: 152px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-radius: 24px;
  color: var(--ui-text);
  cursor: pointer;
  text-align: left;
}
body[data-page="dashboard"] .smart-mini-card:hover {
  transform: translateY(-2px);
  border-color: rgba(116,232,192,.28);
  background: linear-gradient(150deg, rgba(18,36,29,.98), rgba(8,16,13,.98));
}
body[data-page="dashboard"] .smart-mini-card span {
  color: var(--ui-muted);
  font-size: .74rem;
  font-weight: 800;
}
body[data-page="dashboard"] .smart-mini-card strong {
  margin-top: auto;
  color: var(--ui-text);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -.06em;
}
body[data-page="dashboard"] .smart-mini-card small {
  margin-top: 7px;
  color: var(--ui-muted);
  font-size: .72rem;
}
body[data-page="dashboard"] .smart-mini-card.warning { border-color: rgba(240,190,87,.18); }
body[data-page="dashboard"] .smart-mini-card.warning strong { color: #f5c86c; }
body[data-page="dashboard"] .smart-mini-card.danger { border-color: rgba(238,113,128,.2); }
body[data-page="dashboard"] .smart-mini-card.danger strong { color: #ff8996; }
body[data-page="dashboard"] .quick-actions-strip {
  margin-bottom: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border-radius: 24px;
}
body[data-page="dashboard"] .quick-actions-strip button {
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(116,232,192,.11);
  border-radius: 17px;
  color: var(--ui-text);
  background: rgba(255,255,255,.035);
  cursor: pointer;
  font-weight: 850;
}
body[data-page="dashboard"] .quick-actions-strip button:hover {
  color: #83ffd1;
  border-color: rgba(116,232,192,.25);
  background: rgba(67,229,190,.08);
}
body[data-page="dashboard"] .quick-actions-strip svg {
  width: 18px;
  height: 18px;
  flex: none;
}
@media (max-width: 1180px) {
  body[data-page="dashboard"] .smart-overview { grid-template-columns: 1fr; }
  body[data-page="dashboard"] .smart-mini-card { min-height: 118px; }
}
@media (max-width: 760px) {
  body[data-page="dashboard"] .smart-mini-grid,
  body[data-page="dashboard"] .quick-actions-strip { grid-template-columns: 1fr 1fr; }
  body[data-page="dashboard"] .smart-main-card { min-height: 0; }
  body[data-page="dashboard"] .notification-panel { position: fixed; top: 72px; left: 12px; right: 12px; width: auto; }
}
@media (max-width: 430px) {
  body[data-page="dashboard"] .smart-mini-grid,
  body[data-page="dashboard"] .quick-actions-strip { grid-template-columns: 1fr; }
  body[data-page="dashboard"] .smart-actions .button { width: 100%; }
  body[data-page="dashboard"] .quick-actions-strip button { justify-content: flex-start; padding-inline: 14px; }
}
body[data-page="dashboard"] .notification-wrap .notification-button { display:grid; }
@media (max-width: 430px) { body[data-page="dashboard"] .notification-wrap .notification-button { display:grid !important; } }

/* ===== Configuración, WhatsApp y Equipo avanzado RC1 ===== */
body[data-page="dashboard"] .settings-template-card {
  min-height: 100%;
}
body[data-page="dashboard"] .settings-template-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}
body[data-page="dashboard"] .settings-template-tabs button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(116,232,192,.12);
  border-radius: 999px;
  color: var(--ui-muted);
  background: rgba(255,255,255,.035);
  cursor: pointer;
  font-weight: 850;
  font-size: .82rem;
}
body[data-page="dashboard"] .settings-template-tabs button.active,
body[data-page="dashboard"] .settings-template-tabs button:hover {
  color: #082016;
  border-color: rgba(88,242,188,.45);
  background: linear-gradient(135deg, #5ff0bd, #20c989);
}
body[data-page="dashboard"] .settings-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
body[data-page="dashboard"] .settings-preview p {
  white-space: pre-wrap;
}
body[data-page="dashboard"] .button-danger {
  color: #ffdbe0;
  border-color: rgba(255,110,128,.28);
  background: rgba(255,100,120,.08);
}
body[data-page="dashboard"] .button-danger:hover {
  color: #fff;
  border-color: rgba(255,110,128,.5);
  background: rgba(255,100,120,.16);
}
body[data-page="dashboard"] .team-user-card {
  align-items: flex-start;
  gap: 14px;
}
body[data-page="dashboard"] .team-user-main {
  min-width: 0;
  flex: 1;
}
body[data-page="dashboard"] .team-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
body[data-page="dashboard"] .team-permission-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(116,232,192,.12);
  border-radius: 999px;
  color: var(--ui-muted);
  background: rgba(255,255,255,.035);
  font-weight: 800;
  font-size: .78rem;
  cursor: pointer;
}
body[data-page="dashboard"] .team-permission-chip input {
  width: 14px;
  height: 14px;
  accent-color: #29d695;
}
body[data-page="dashboard"] .team-permission-chip:has(input:checked) {
  color: #d9fff0;
  border-color: rgba(83,236,183,.28);
  background: rgba(42,214,149,.10);
}
body[data-page="dashboard"] .team-user-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 360px;
}
@media (max-width: 760px) {
  body[data-page="dashboard"] .settings-template-tabs { gap: 6px; }
  body[data-page="dashboard"] .settings-template-tabs button { flex: 1 1 auto; }
  body[data-page="dashboard"] .team-user-card { display: grid; grid-template-columns: auto 1fr; }
  body[data-page="dashboard"] .team-user-actions { grid-column: 1 / -1; max-width: none; justify-content: flex-start; }
}


/* ============================================================
   Buscador global, respaldos y pulido final RC1
   ============================================================ */
.global-search-wrap{position:relative;flex:1;min-width:220px;max-width:680px;z-index:45}
.global-search-wrap .global-search{width:100%;max-width:none}
.global-search-panel{position:absolute;top:calc(100% + 12px);left:0;right:0;background:linear-gradient(180deg,rgba(13,31,32,.98),rgba(5,15,16,.98));border:1px solid rgba(57,255,171,.18);box-shadow:0 22px 70px rgba(0,0,0,.55),0 0 0 1px rgba(255,255,255,.03) inset;border-radius:24px;padding:14px;z-index:90;max-height:min(68vh,620px);overflow:auto;backdrop-filter:blur(20px)}
.global-search-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 4px 12px;border-bottom:1px solid rgba(255,255,255,.07);margin-bottom:10px}
.global-search-head strong{font-size:14px;color:#f5fffb}.global-search-head small{font-size:12px;color:#95bdb4;text-align:right}
.global-result-group{display:grid;gap:8px;margin-top:12px}.global-result-group h3{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:#5ff0bb;margin:0 0 2px}
.global-result-item{width:100%;display:grid;grid-template-columns:38px 1fr;gap:10px;align-items:center;text-align:left;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.07);border-radius:16px;padding:10px;color:#ecfff8;cursor:pointer;transition:background .18s ease,border-color .18s ease,transform .18s ease}
.global-result-item:hover{background:rgba(50,255,174,.1);border-color:rgba(63,244,178,.28);transform:translateY(-1px)}
.global-result-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:14px;background:linear-gradient(135deg,#0e6f55,#22d98e);font-weight:900;color:#001a12;box-shadow:0 10px 28px rgba(20,210,140,.25)}
.global-result-item strong{display:block;font-size:14px;line-height:1.2}.global-result-item small,.global-result-item em{display:block;color:#a8c9c1;font-size:12px;font-style:normal;line-height:1.35;margin-top:2px}.global-result-item em{color:#6f938b}
.global-search-empty{display:grid;place-items:center;text-align:center;gap:6px;padding:30px 18px;color:#9fc8bf}.global-search-empty span{width:44px;height:44px;border-radius:16px;display:grid;place-items:center;background:rgba(74,255,183,.1);color:#58efba;font-size:22px}.global-search-empty strong{color:#f3fff9}.global-search-empty small{max-width:320px}
.backup-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:18px}.backup-layout{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr);gap:18px;align-items:start}.backup-card{min-height:100%}.backup-actions-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.backup-action{display:flex;flex-direction:column;align-items:flex-start;gap:4px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.045);border-radius:18px;padding:16px;color:#effff8;cursor:pointer;text-align:left;min-height:90px;transition:background .18s ease,border-color .18s ease,transform .18s ease}.backup-action:hover{background:rgba(31,224,145,.11);border-color:rgba(67,255,180,.25);transform:translateY(-1px)}.backup-action span{font-weight:850}.backup-action small{color:#9abdb5;line-height:1.35}.backup-checklist{list-style:none;margin:0;padding:0;display:grid;gap:12px}.backup-checklist li{display:grid;grid-template-columns:28px 1fr;gap:10px;align-items:start;color:#b6d4cd;line-height:1.45}.backup-checklist span{width:28px;height:28px;display:grid;place-items:center;border-radius:10px;background:rgba(35,229,151,.12);color:#50f0b4;font-weight:900}.backup-checklist b{color:#f4fffb;margin-right:4px}.backup-last{margin:16px 0 0;color:#7da098;font-size:13px;border-top:1px solid rgba(255,255,255,.07);padding-top:14px}
@media (max-width: 980px){.backup-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.backup-layout{grid-template-columns:1fr}.global-search-wrap{max-width:none}}
@media (max-width: 640px){.global-search-wrap{order:4;flex-basis:100%;min-width:100%}.global-search-panel{position:fixed;left:12px;right:12px;top:82px;max-height:70vh}.backup-summary-grid,.backup-actions-grid{grid-template-columns:1fr}.backup-action{min-height:auto}.backup-layout{gap:14px}}


/* ============================================================
   FIX MÓVIL TELÉFONO RC1
   Corrige ficha/modal de cliente que se desplazaba a la izquierda
   en pantallas pequeñas por conservar width/transform de escritorio.
   ============================================================ */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
body[data-page="dashboard"],
body[data-page="dashboard"] .dashboard-shell,
body[data-page="dashboard"] .workspace,
body[data-page="dashboard"] .dashboard-content,
body[data-page="dashboard"] .clients-view,
body[data-page="dashboard"] .clients-grid,
body[data-page="dashboard"] .client-card,
body[data-page="dashboard"] .client-form,
body[data-page="dashboard"] .client-modal,
body[data-page="dashboard"] .finance-modal {
  min-width: 0;
  max-width: 100%;
}
body[data-page="dashboard"] .client-modal-scroll,
body[data-page="dashboard"] .finance-modal-scroll,
body[data-page="dashboard"] .dashboard-content {
  overflow-x: hidden;
}
body[data-page="dashboard"] input,
body[data-page="dashboard"] select,
body[data-page="dashboard"] textarea,
body[data-page="dashboard"] button {
  max-width: 100%;
}
@media (max-width: 900px) {
  body[data-page="dashboard"].client-modal-open,
  body[data-page="dashboard"].finance-modal-open {
    overflow: hidden !important;
    overscroll-behavior: none;
  }
  body[data-page="dashboard"] .client-modal,
  body[data-page="dashboard"] .finance-modal {
    position: fixed !important;
    inset: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    transform: none !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    animation: mobileModalInRC1 160ms ease-out both !important;
  }
  @supports (width: 100dvw) {
    body[data-page="dashboard"] .client-modal,
    body[data-page="dashboard"] .finance-modal {
      width: 100dvw !important;
    }
  }
  body[data-page="dashboard"] .client-modal {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
  }
  body[data-page="dashboard"] .client-modal-header,
  body[data-page="dashboard"] .finance-modal .client-modal-header {
    min-height: auto !important;
    min-width: 0 !important;
    padding: max(14px, env(safe-area-inset-top)) 14px 13px !important;
    gap: 12px !important;
    align-items: flex-start !important;
  }
  body[data-page="dashboard"] .client-modal-header > div,
  body[data-page="dashboard"] .finance-modal .client-modal-header > div {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  body[data-page="dashboard"] .client-modal-header h2,
  body[data-page="dashboard"] .finance-modal .client-modal-header h2 {
    font-size: clamp(19px, 5.8vw, 22px) !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere !important;
  }
  body[data-page="dashboard"] .client-modal-header span,
  body[data-page="dashboard"] .finance-modal .client-modal-header span {
    max-width: none !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
  }
  body[data-page="dashboard"] .client-modal-close {
    width: 48px !important;
    height: 48px !important;
    border-radius: 16px !important;
  }
  body[data-page="dashboard"] .client-form {
    min-height: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
  }
  body[data-page="dashboard"] .client-modal-scroll,
  body[data-page="dashboard"] .finance-modal-scroll {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-gutter: auto !important;
    overscroll-behavior: contain !important;
  }
  body[data-page="dashboard"] .client-form-section,
  body[data-page="dashboard"] .service-form-card,
  body[data-page="dashboard"] .service-block,
  body[data-page="dashboard"] .finance-filter-card,
  body[data-page="dashboard"] .finance-chart-card,
  body[data-page="dashboard"] .finance-breakdown-card,
  body[data-page="dashboard"] .finance-table-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body[data-page="dashboard"] .form-grid,
  body[data-page="dashboard"] .form-grid-two,
  body[data-page="dashboard"] .form-grid-four,
  body[data-page="dashboard"] .form-grid-service,
  body[data-page="dashboard"] .provider-grid,
  body[data-page="dashboard"] .finance-grid {
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .form-field,
  body[data-page="dashboard"] .secret-control {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body[data-page="dashboard"] .form-field input,
  body[data-page="dashboard"] .form-field select,
  body[data-page="dashboard"] .form-field textarea {
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 16px !important;
  }
  body[data-page="dashboard"] .section-heading,
  body[data-page="dashboard"] .service-card-heading,
  body[data-page="dashboard"] .service-block-title {
    min-width: 0 !important;
    align-items: flex-start !important;
  }
  body[data-page="dashboard"] .service-card-heading > div,
  body[data-page="dashboard"] .service-block-title > span,
  body[data-page="dashboard"] .section-heading > div {
    min-width: 0 !important;
  }
  body[data-page="dashboard"] .client-modal-footer,
  body[data-page="dashboard"] .finance-modal .client-modal-footer {
    position: sticky !important;
    bottom: 0 !important;
    min-height: auto !important;
    padding: 10px 12px max(12px, env(safe-area-inset-bottom)) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
  }
  body[data-page="dashboard"] .client-modal-footer .button,
  body[data-page="dashboard"] .finance-modal .client-modal-footer .button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 54px !important;
    border-radius: 18px !important;
  }
  body[data-page="dashboard"] .client-detail-contact {
    grid-template-columns: 44px minmax(0, 1fr) !important;
  }
  body[data-page="dashboard"] .client-detail-contact button {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
  body[data-page="dashboard"] .client-detail-service header,
  body[data-page="dashboard"] .detail-service-progress > span,
  body[data-page="dashboard"] .detail-provider {
    flex-wrap: wrap !important;
  }
  body[data-page="dashboard"] .detail-whatsapp {
    margin-left: 0 !important;
    width: 100% !important;
  }
  body[data-page="dashboard"] .client-card,
  body[data-page="dashboard"] .dashboard-card,
  body[data-page="dashboard"] .settings-card,
  body[data-page="dashboard"] .team-card,
  body[data-page="dashboard"] .reports-card,
  body[data-page="dashboard"] .provider-card {
    overflow: hidden;
  }
  body[data-page="dashboard"] .global-search-wrap {
    min-width: 0 !important;
    max-width: 100% !important;
  }
}
@media (max-width: 430px) {
  body[data-page="dashboard"] .client-modal-scroll,
  body[data-page="dashboard"] .finance-modal-scroll {
    padding: 10px !important;
  }
  body[data-page="dashboard"] .client-form-section,
  body[data-page="dashboard"] .service-form-card,
  body[data-page="dashboard"] .service-block {
    padding: 12px !important;
    border-radius: 18px !important;
  }
  body[data-page="dashboard"] .section-icon {
    width: 38px !important;
    height: 38px !important;
  }
}
@keyframes mobileModalInRC1 {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   FIX MÓVIL TELÉFONO RC2
   Corrige bloqueo táctil de X/Cancelar y fuerza visibilidad de
   la primera aplicación dentro de la ficha en móviles.
   ============================================================ */
@media (max-width: 900px) {
  body[data-page="dashboard"] .client-modal-backdrop {
    z-index: 5000 !important;
  }
  body[data-page="dashboard"] .client-modal {
    z-index: 5001 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }
  body[data-page="dashboard"] .client-modal *,
  body[data-page="dashboard"] .client-modal button,
  body[data-page="dashboard"] .client-modal input,
  body[data-page="dashboard"] .client-modal select,
  body[data-page="dashboard"] .client-modal textarea {
    pointer-events: auto !important;
  }
  body[data-page="dashboard"] .client-modal-header {
    position: relative !important;
    z-index: 6 !important;
  }
  body[data-page="dashboard"] .client-modal-close {
    position: relative !important;
    z-index: 8 !important;
    touch-action: manipulation !important;
  }
  body[data-page="dashboard"] .client-form {
    position: relative !important;
    z-index: 2 !important;
  }
  body[data-page="dashboard"] .client-modal-scroll {
    position: relative !important;
    z-index: 2 !important;
    padding-bottom: 18px !important;
  }
  body[data-page="dashboard"] .service-form-list {
    display: grid !important;
    gap: 14px !important;
    min-height: 0 !important;
    margin-top: 12px !important;
    margin-bottom: 14px !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  body[data-page="dashboard"] .service-form-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: auto !important;
    overflow: visible !important;
    transform: none !important;
  }
  body[data-page="dashboard"] .add-service-button {
    position: relative !important;
    z-index: 3 !important;
    margin-top: 14px !important;
  }
  body[data-page="dashboard"] .client-modal-footer {
    position: sticky !important;
    z-index: 7 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }
  body[data-page="dashboard"] .client-modal-footer .button,
  body[data-page="dashboard"] #client-cancel,
  body[data-page="dashboard"] #client-save {
    position: relative !important;
    z-index: 8 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }
}


/* ============================================================
   FIX MÓVIL TELÉFONO RC3 — corrección real de cierre
   ============================================================ */
body[data-page="dashboard"] .client-modal[hidden],
body[data-page="dashboard"] .client-modal-backdrop[hidden],
body[data-page="dashboard"] .finance-modal[hidden],
body[data-page="dashboard"] .finance-modal-backdrop[hidden],
body[data-page="dashboard"] .detail-modal[hidden],
body[data-page="dashboard"] .detail-backdrop[hidden] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
body[data-page="dashboard"] .client-modal:not([hidden]),
body[data-page="dashboard"] .client-modal:not([hidden]) .client-modal-close,
body[data-page="dashboard"] .client-modal:not([hidden]) #client-cancel,
body[data-page="dashboard"] .client-modal:not([hidden]) #client-save,
body[data-page="dashboard"] .client-modal:not([hidden]) .add-service-button {
  pointer-events: auto !important;
}
body[data-page="dashboard"] .client-modal-close,
body[data-page="dashboard"] #client-cancel,
body[data-page="dashboard"] #client-save {
  cursor: pointer !important;
  -webkit-tap-highlight-color: rgba(83, 236, 183, .16);
}
body[data-page="dashboard"] .service-form-list:empty::before {
  content: "Pulsa Agregar otra aplicación para capturar el servicio";
  display: block;
  padding: 14px;
  border: 1px dashed rgba(83,236,183,.35);
  border-radius: 16px;
  color: #a8cfc4;
  background: rgba(83,236,183,.055);
  font-size: 14px;
  line-height: 1.35;
}
@media (max-width: 900px) {
  body[data-page="dashboard"] .client-modal:not([hidden]) {
    display: grid !important;
  }
  body[data-page="dashboard"] .client-modal-scroll {
    padding-bottom: calc(18px + env(safe-area-inset-bottom)) !important;
  }
  body[data-page="dashboard"] .service-form-card-fallback .service-block {
    margin-top: 10px;
  }
}


/* ============================================================
   FIX MÓVIL TELÉFONO RC4
   - Corrige amontonamiento de menú/notificaciones/buscador.
   - Corrige textos rotos en respaldo "Qué incluye".
   - Refuerza saltos de línea en tarjetas/resúmenes móviles.
   ============================================================ */
@media (max-width: 680px) {
  body[data-page="dashboard"] .workspace {
    grid-template-rows: auto minmax(0, 1fr) !important;
  }
  body[data-page="dashboard"] .topbar {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) auto !important;
    grid-template-areas:
      "menu . actions"
      "search search search" !important;
    align-items: center !important;
    row-gap: 10px !important;
    column-gap: 10px !important;
    min-height: auto !important;
    padding: 11px 12px !important;
  }
  body[data-page="dashboard"] .mobile-menu-button {
    grid-area: menu !important;
  }
  body[data-page="dashboard"] .topbar-actions {
    grid-area: actions !important;
    margin-left: 0 !important;
    justify-self: end !important;
    min-width: 0 !important;
    gap: 6px !important;
  }
  body[data-page="dashboard"] .global-search-wrap {
    grid-area: search !important;
    grid-column: 1 / -1 !important;
    order: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body[data-page="dashboard"] .global-search,
  body[data-page="dashboard"] .global-search input {
    width: 100% !important;
    min-width: 0 !important;
  }
  body[data-page="dashboard"] .global-search-panel {
    top: calc(100% + 10px) !important;
  }
}
@media (max-width: 430px) {
  body[data-page="dashboard"] .topbar {
    grid-template-columns: 42px minmax(0, 1fr) auto !important;
    grid-template-areas:
      "menu . actions"
      "search search search" !important;
    padding-inline: 10px !important;
  }
  body[data-page="dashboard"] .notification-wrap .notification-button {
    display: grid !important;
  }
  body[data-page="dashboard"] .profile-button {
    min-width: 42px !important;
    width: 42px !important;
    height: 42px !important;
    display: grid !important;
  }
  body[data-page="dashboard"] .dashboard-content {
    padding-top: 14px !important;
  }
}

body[data-page="dashboard"] .backup-checklist li {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  min-width: 0 !important;
  white-space: normal !important;
}
body[data-page="dashboard"] .backup-checklist li > span {
  flex: 0 0 28px !important;
}
body[data-page="dashboard"] .backup-checklist li > b {
  display: inline !important;
  margin-right: 4px !important;
}
body[data-page="dashboard"] .backup-checklist li,
body[data-page="dashboard"] .backup-checklist li small,
body[data-page="dashboard"] .backup-checklist li b,
body[data-page="dashboard"] .reports-row,
body[data-page="dashboard"] .reports-row span,
body[data-page="dashboard"] .reports-row strong,
body[data-page="dashboard"] .reports-row small,
body[data-page="dashboard"] .reports-row b,
body[data-page="dashboard"] .dashboard-card h1,
body[data-page="dashboard"] .dashboard-card h2,
body[data-page="dashboard"] .dashboard-card h3,
body[data-page="dashboard"] .dashboard-card p,
body[data-page="dashboard"] .dashboard-card small,
body[data-page="dashboard"] .dashboard-card strong,
body[data-page="dashboard"] .dashboard-card span {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}
@media (max-width: 560px) {
  body[data-page="dashboard"] .reports-row {
    grid-template-columns: 40px minmax(0, 1fr) !important;
    align-items: start !important;
  }
  body[data-page="dashboard"] .reports-row b {
    grid-column: 2 !important;
    justify-self: start !important;
    margin-top: 4px !important;
  }
  body[data-page="dashboard"] .backup-safe-card,
  body[data-page="dashboard"] .reports-card {
    overflow: hidden !important;
  }
}


/* ============================================================
   WHATSAPP CLIENTE RC1
   Mensajes rápidos al cliente + recibo en imagen.
   ============================================================ */
body[data-page="dashboard"] .client-whatsapp-button,
body[data-page="dashboard"] .client-detail-whatsapp {
  color: #062016 !important;
  border: 1px solid rgba(93, 240, 189, .42) !important;
  background: linear-gradient(135deg, #5ff0bd, #15ba7d) !important;
  box-shadow: 0 12px 30px rgba(14, 190, 122, .20) !important;
}
body[data-page="dashboard"] .client-whatsapp-button svg {
  width: 17px;
  height: 17px;
}
body[data-page="dashboard"] .client-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
body[data-page="dashboard"] .whatsapp-client-backdrop {
  position: fixed;
  inset: 0;
  z-index: 7800;
  background: rgba(3, 8, 7, .64);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
body[data-page="dashboard"] .whatsapp-client-backdrop[hidden],
body[data-page="dashboard"] .whatsapp-client-modal[hidden] {
  display: none !important;
}
body[data-page="dashboard"] .whatsapp-client-modal {
  position: fixed;
  z-index: 7801;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 28px));
  max-height: min(88dvh, 760px);
  overflow: auto;
  padding: 34px 30px 26px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 30px;
  color: #111827;
  background: #ffffff;
  box-shadow: 0 35px 110px rgba(0, 0, 0, .46);
  text-align: center;
}
body[data-page="dashboard"] .whatsapp-client-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 16px;
  color: #475569;
  background: #f4f7f6;
  display: grid;
  place-items: center;
  cursor: pointer;
}
body[data-page="dashboard"] .whatsapp-client-close svg,
body[data-page="dashboard"] .whatsapp-client-options svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body[data-page="dashboard"] .whatsapp-client-icon {
  width: 72px;
  height: 72px;
  margin: 10px auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #14b86f;
  background: #dcfce7;
}
body[data-page="dashboard"] .whatsapp-client-icon svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
body[data-page="dashboard"] .whatsapp-client-modal h2 {
  margin: 0;
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1.05;
  letter-spacing: -.04em;
  color: #0f172a;
}
body[data-page="dashboard"] .whatsapp-client-modal p {
  margin: 12px auto 14px;
  color: #6b7280;
  font-size: 17px;
  line-height: 1.45;
}
body[data-page="dashboard"] .whatsapp-client-meta {
  margin: 0 auto 18px;
  padding: 10px 12px;
  border-radius: 16px;
  color: #334155;
  background: #f8fafc;
  display: grid;
  gap: 3px;
}
body[data-page="dashboard"] .whatsapp-client-meta strong {
  color: #0f172a;
  font-size: 14px;
}
body[data-page="dashboard"] .whatsapp-client-meta small {
  color: #64748b;
  font-size: 12px;
}
body[data-page="dashboard"] .whatsapp-client-options {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
body[data-page="dashboard"] .whatsapp-client-options button {
  min-height: 76px;
  width: 100%;
  display: grid;
  grid-template-columns: 54px minmax(0,1fr);
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  color: #334155;
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
body[data-page="dashboard"] .whatsapp-client-options button:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  background: #ffffff;
}
body[data-page="dashboard"] .whatsapp-client-options b {
  min-width: 0;
  color: #334155;
  font-size: 17px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
body[data-page="dashboard"] .wa-option-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}
body[data-page="dashboard"] .wa-blue { color: #2563eb; background: #dbeafe; }
body[data-page="dashboard"] .wa-yellow { color: #ca8a04; background: #fef3c7; }
body[data-page="dashboard"] .wa-green { color: #059669; background: #d1fae5; }
body[data-page="dashboard"] .wa-red { color: #dc2626; background: #fee2e2; }
body[data-page="dashboard"] .wa-purple { color: #4f46e5; background: #e0e7ff; }
body[data-page="dashboard"] .whatsapp-client-options .wa-option-featured {
  color: #4f46e5;
  border-color: #c7d2fe;
  background: #eef2ff;
}
body[data-page="dashboard"] .whatsapp-client-options .wa-option-featured b {
  color: #4338ca;
}
body[data-page="dashboard"] .whatsapp-client-cancel {
  margin-top: 22px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  color: #6b7280;
  background: transparent;
  font: inherit;
  font-size: 18px;
  font-weight: 850;
  cursor: pointer;
}
body[data-page="dashboard"].whatsapp-client-open {
  overflow: hidden;
}
@media (max-width: 560px) {
  body[data-page="dashboard"] .client-card footer {
    display: grid;
    grid-template-columns: 1fr 1fr 46px;
    gap: 8px;
  }
  body[data-page="dashboard"] .client-card footer button {
    min-width: 0;
  }
  body[data-page="dashboard"] .client-whatsapp-button span {
    display: inline;
  }
  body[data-page="dashboard"] .client-detail-contact {
    grid-template-columns: 46px minmax(0,1fr) !important;
  }
  body[data-page="dashboard"] .client-detail-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  body[data-page="dashboard"] .client-detail-actions button {
    width: 100% !important;
  }
  body[data-page="dashboard"] .whatsapp-client-modal {
    width: calc(100vw - 24px);
    padding: 30px 18px 20px;
    border-radius: 28px;
  }
  body[data-page="dashboard"] .whatsapp-client-options button {
    min-height: 70px;
    grid-template-columns: 48px minmax(0,1fr);
    border-radius: 18px;
    padding: 10px 12px;
  }
  body[data-page="dashboard"] .whatsapp-client-options b {
    font-size: 15px;
  }
}

/* ============================================================
   WHATSAPP / MENÚ VISUAL FIX RC1
   - Corrige alineación del botón de WhatsApp.
   - Cambia el modal/menú de WhatsApp al mismo estilo oscuro del panel.
   ============================================================ */
body[data-page="dashboard"] .client-card footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
body[data-page="dashboard"] .client-card footer button:first-child,
body[data-page="dashboard"] .client-detail-whatsapp {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}
body[data-page="dashboard"] .client-whatsapp-button,
body[data-page="dashboard"] .client-detail-whatsapp {
  min-height: 40px;
  padding-inline: 14px !important;
}
body[data-page="dashboard"] .client-whatsapp-button span,
body[data-page="dashboard"] .client-detail-whatsapp span {
  display: inline-flex;
  align-items: center;
}
body[data-page="dashboard"] .client-whatsapp-button svg,
body[data-page="dashboard"] .client-detail-whatsapp svg {
  flex: none;
}

body[data-page="dashboard"] .whatsapp-client-modal {
  color: var(--ui-text);
  background: linear-gradient(160deg, rgba(13, 24, 20, .98), rgba(6, 11, 9, .99));
  border: 1px solid var(--ui-line);
  box-shadow: 0 36px 110px rgba(0, 0, 0, .58);
}
body[data-page="dashboard"] .whatsapp-client-close {
  color: #9fb4ab;
  border: 1px solid var(--ui-line);
  background: #0f1d18;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
body[data-page="dashboard"] .whatsapp-client-close:hover {
  color: #74e8bf;
  border-color: var(--ui-line-strong);
  background: #12261f;
}
body[data-page="dashboard"] .whatsapp-client-icon {
  color: #74e8bf;
  border: 1px solid rgba(57, 217, 163, .20);
  background: rgba(57, 217, 163, .12);
}
body[data-page="dashboard"] .whatsapp-client-modal h2 {
  color: var(--ui-text);
}
body[data-page="dashboard"] .whatsapp-client-modal p {
  color: #9fb4ab;
}
body[data-page="dashboard"] .whatsapp-client-meta {
  color: #adc1b7;
  border: 1px solid var(--ui-line);
  background: rgba(255, 255, 255, .04);
}
body[data-page="dashboard"] .whatsapp-client-meta strong {
  color: var(--ui-text);
}
body[data-page="dashboard"] .whatsapp-client-meta small {
  color: #8fa49a;
}
body[data-page="dashboard"] .whatsapp-client-options button {
  color: var(--ui-text);
  border-color: var(--ui-line);
  background: rgba(255, 255, 255, .04);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
body[data-page="dashboard"] .whatsapp-client-options button:hover {
  border-color: var(--ui-line-strong);
  background: rgba(57, 217, 163, .08);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .22);
}
body[data-page="dashboard"] .whatsapp-client-options b {
  color: var(--ui-text);
}
body[data-page="dashboard"] .whatsapp-client-options .wa-option-featured {
  color: #74e8bf;
  border-color: rgba(57, 217, 163, .28);
  background: linear-gradient(135deg, rgba(57, 217, 163, .16), rgba(57, 217, 163, .07));
}
body[data-page="dashboard"] .whatsapp-client-options .wa-option-featured b {
  color: #74e8bf;
}
body[data-page="dashboard"] .whatsapp-client-cancel {
  color: #9fb4ab;
  transition: color .16s ease, background .16s ease;
}
body[data-page="dashboard"] .whatsapp-client-cancel:hover {
  color: #74e8bf;
  background: rgba(57, 217, 163, .06);
}

@media (max-width: 560px) {
  body[data-page="dashboard"] .client-card footer {
    align-items: stretch;
  }
  body[data-page="dashboard"] .client-card footer button,
  body[data-page="dashboard"] .client-whatsapp-button {
    width: 100%;
  }
}

/* ============================================================
   FICHA CLIENTE FECHAS RC1
   - Mueve la nota de fechas al encabezado del bloque.
   - Alinea las notas pequeñas como “Opcional” y “Contacto”.
   ============================================================ */
body[data-page="dashboard"] .service-block-title small {
  max-width: 58%;
  text-align: right;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
@media (max-width: 680px) {
  body[data-page="dashboard"] .service-block-title {
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: start !important;
    gap: 4px !important;
  }
  body[data-page="dashboard"] .service-block-title small {
    max-width: none !important;
    text-align: left !important;
  }
}

/* ============================================================
   FICHA CLIENTE DÍAS CALCULADOS RC1
   - Muestra cuántos días hay entre fecha de compra e inicio/final.
   ============================================================ */
body[data-page="dashboard"] .date-calculation-note {
  margin-top: 12px;
  min-height: 54px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 14px;
  border: 1px solid rgba(57, 217, 163, .18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(57, 217, 163, .11), rgba(255, 255, 255, .035));
}
body[data-page="dashboard"] .date-calculation-note > span {
  color: #8fb0a4;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}
body[data-page="dashboard"] .date-calculation-note > strong {
  justify-self: end;
  color: #74e8bf;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}
body[data-page="dashboard"] .date-calculation-note > small {
  grid-column: 1 / -1;
  color: #9fb4ab;
  font-size: 11px;
  line-height: 1.45;
}
body[data-page="dashboard"] .date-calculation-note.is-manual {
  border-color: rgba(240, 190, 87, .24);
  background: linear-gradient(135deg, rgba(240, 190, 87, .11), rgba(255, 255, 255, .035));
}
body[data-page="dashboard"] .date-calculation-note.is-manual > strong {
  color: #f0c66d;
}
body[data-page="dashboard"] .date-calculation-note.is-warning {
  border-color: rgba(238, 113, 128, .26);
  background: linear-gradient(135deg, rgba(238, 113, 128, .13), rgba(255, 255, 255, .035));
}
body[data-page="dashboard"] .date-calculation-note.is-warning > strong {
  color: #ef8290;
}
@media (max-width: 560px) {
  body[data-page="dashboard"] .date-calculation-note {
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .date-calculation-note > strong {
    justify-self: start;
    white-space: normal;
  }
}

/* =====================================================================
   MEJORAS 3 ETAPAS PRIORIDADES RC1
   Etapa 1: resumen antes de guardar, renovar rápido, ficha ejecutiva.
   Etapa 2: copiar/imprimir ficha y resumen más útil.
   Etapa 3: pulido visual premium y microinteracciones.
   ===================================================================== */
body[data-page="dashboard"] .client-save-review-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9200;
  background: rgba(0, 5, 3, .74);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
body[data-page="dashboard"] .client-save-review-modal {
  position: fixed;
  z-index: 9201;
  left: 50%;
  top: 50%;
  width: min(640px, calc(100vw - 26px));
  max-height: min(88dvh, 760px);
  overflow: auto;
  transform: translate(-50%, -50%);
  padding: 24px;
  color: var(--ui-text);
  border: 1px solid var(--ui-line);
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(13,24,20,.98), rgba(5,8,6,.99));
  box-shadow: 0 38px 110px rgba(0,0,0,.62);
}
body[data-page="dashboard"] .client-save-review-modal[hidden],
body[data-page="dashboard"] .client-save-review-backdrop[hidden] { display: none !important; }
body[data-page="dashboard"] .client-save-review-modal header p {
  margin: 0 0 6px;
  color: #74e8bf;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
body[data-page="dashboard"] .client-save-review-modal header h2 {
  margin: 0;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.04;
  letter-spacing: -.05em;
}
body[data-page="dashboard"] .client-save-review-modal header span {
  display: block;
  margin-top: 8px;
  color: #9fb4ab;
  font-size: 13px;
}
body[data-page="dashboard"] .client-save-review-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}
body[data-page="dashboard"] .client-save-review-grid article,
body[data-page="dashboard"] .client-save-review-dates,
body[data-page="dashboard"] .client-save-review-service {
  border: 1px solid var(--ui-line);
  background: rgba(255,255,255,.04);
  border-radius: 16px;
}
body[data-page="dashboard"] .client-save-review-grid article { padding: 13px; }
body[data-page="dashboard"] .client-save-review-grid span,
body[data-page="dashboard"] .client-save-review-dates span {
  display: block;
  color: #8fa49a;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}
body[data-page="dashboard"] .client-save-review-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--ui-text);
  font-size: 18px;
}
body[data-page="dashboard"] .client-save-review-grid .negative { color: #ef8290; }
body[data-page="dashboard"] .client-save-review-dates {
  margin-top: 10px;
  padding: 14px;
}
body[data-page="dashboard"] .client-save-review-dates strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}
body[data-page="dashboard"] .client-save-review-dates small {
  display: block;
  margin-top: 3px;
  color: #9fb4ab;
}
body[data-page="dashboard"] .client-save-review-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
body[data-page="dashboard"] .client-save-review-service {
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
}
body[data-page="dashboard"] .client-save-review-service > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #06140f;
  background: #74e8bf;
  font-size: 11px;
  font-weight: 900;
}
body[data-page="dashboard"] .client-save-review-service div { min-width: 0; display: grid; }
body[data-page="dashboard"] .client-save-review-service strong,
body[data-page="dashboard"] .client-save-review-service small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-page="dashboard"] .client-save-review-service small {
  margin-top: 3px;
  color: #9fb4ab;
  font-size: 11px;
}
body[data-page="dashboard"] .client-save-review-service b {
  color: #74e8bf;
  font-size: 13px;
}
body[data-page="dashboard"] .client-save-review-modal footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
body[data-page="dashboard"].client-save-review-open { overflow: hidden; }

body[data-page="dashboard"] .client-renew-button,
body[data-page="dashboard"] .premium-service-actions button,
body[data-page="dashboard"] .client-executive-actions button,
body[data-page="dashboard"] .client-next-action button {
  min-height: 40px;
  border: 1px solid rgba(240,190,87,.25);
  border-radius: 12px;
  color: #f0c66d;
  background: rgba(240,190,87,.10);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
}
body[data-page="dashboard"] .client-renew-button:hover,
body[data-page="dashboard"] .premium-service-actions button:hover,
body[data-page="dashboard"] .client-executive-actions button:hover {
  color: #07120d;
  background: #f0c66d;
}
body[data-page="dashboard"] .client-card footer {
  align-items: stretch;
}
body[data-page="dashboard"] .client-card footer button {
  min-width: 0;
  padding-inline: 12px;
}

body[data-page="dashboard"] .client-executive-card {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--ui-line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 0 0, rgba(57,217,163,.16), transparent 38%),
    linear-gradient(145deg, rgba(14,28,23,.98), rgba(7,13,11,.98));
}
body[data-page="dashboard"] .client-executive-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0,1fr);
  align-items: center;
  gap: 13px;
}
body[data-page="dashboard"] .client-executive-main .client-avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
}
body[data-page="dashboard"] .client-executive-main p {
  margin: 0 0 4px;
  color: #74e8bf;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
body[data-page="dashboard"] .client-executive-main h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: -.045em;
}
body[data-page="dashboard"] .client-executive-main small {
  display: block;
  margin-top: 6px;
  color: #9fb4ab;
  font-size: 12px;
  line-height: 1.45;
}
body[data-page="dashboard"] .client-executive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body[data-page="dashboard"] .client-executive-actions .client-detail-whatsapp {
  color: #06140f !important;
  background: linear-gradient(135deg, #74e8bf, #39d9a3) !important;
}
body[data-page="dashboard"] .client-executive-actions button {
  padding: 0 13px;
  color: #cce2d9;
  border-color: var(--ui-line);
  background: rgba(255,255,255,.045);
}
body[data-page="dashboard"] .premium-summary {
  margin-top: 12px;
}
body[data-page="dashboard"] .client-next-action {
  margin-top: 12px;
  padding: 14px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(240,190,87,.22);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(240,190,87,.11), rgba(255,255,255,.035));
}
body[data-page="dashboard"] .client-next-action span,
body[data-page="dashboard"] .premium-section-title span {
  color: #f0c66d;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
body[data-page="dashboard"] .client-next-action strong {
  font-size: 15px;
}
body[data-page="dashboard"] .client-next-action small {
  color: #9fb4ab;
}
body[data-page="dashboard"] .premium-section-title {
  margin: 18px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
body[data-page="dashboard"] .premium-section-title small {
  color: #8fa49a;
  font-size: 11px;
}
body[data-page="dashboard"] .premium-service-card {
  background: linear-gradient(145deg, rgba(14,28,23,.96), rgba(8,15,12,.98));
}
body[data-page="dashboard"] .premium-service-actions {
  margin-top: 12px;
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--ui-line);
}
body[data-page="dashboard"] .premium-service-actions span {
  color: #9fb4ab;
  font-size: 11px;
}
body[data-page="dashboard"] .premium-service-actions button {
  padding: 0 13px;
}
body[data-page="dashboard"] .client-timeline {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}
body[data-page="dashboard"] .client-timeline ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
body[data-page="dashboard"] .client-timeline li {
  display: grid;
  grid-template-columns: 18px minmax(0,1fr);
  gap: 10px;
}
body[data-page="dashboard"] .client-timeline li > span {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border: 2px solid #74e8bf;
  border-radius: 50%;
  background: #06140f;
  box-shadow: 0 0 0 5px rgba(57,217,163,.08);
}
body[data-page="dashboard"] .client-timeline strong {
  font-size: 12px;
}
body[data-page="dashboard"] .client-timeline small {
  display: block;
  margin-top: 3px;
  color: #9fb4ab;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 560px) {
  body[data-page="dashboard"] .client-save-review-modal { padding: 18px; border-radius: 22px; }
  body[data-page="dashboard"] .client-save-review-grid { grid-template-columns: 1fr; }
  body[data-page="dashboard"] .client-save-review-modal footer { display: grid; grid-template-columns: 1fr; }
  body[data-page="dashboard"] .client-card footer { grid-template-columns: 1fr 1fr; }
  body[data-page="dashboard"] .client-executive-actions { display: grid; grid-template-columns: 1fr 1fr; }
  body[data-page="dashboard"] .client-executive-actions button { width: 100%; }
}
@media print {
  body[data-page="dashboard"].printing-client-detail * { visibility: hidden !important; }
  body[data-page="dashboard"].printing-client-detail #detail-modal,
  body[data-page="dashboard"].printing-client-detail #detail-modal * { visibility: visible !important; }
  body[data-page="dashboard"].printing-client-detail #detail-modal {
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    transform: none !important;
    box-shadow: none !important;
    border: 0 !important;
    color: #111 !important;
    background: #fff !important;
  }
}

/* Ajuste de botones extra en tarjeta de cliente */
body[data-page="dashboard"] .client-card footer button:first-child {
  flex: 0 1 auto;
}
body[data-page="dashboard"] .client-card footer button:last-child {
  width: auto;
  min-width: 42px;
}
body[data-page="dashboard"] .client-card footer .client-whatsapp-button {
  flex: 1 1 120px;
}
body[data-page="dashboard"] .client-card footer .client-renew-button {
  flex: 0 1 100px;
}
@media (max-width: 560px) {
  body[data-page="dashboard"] .client-card footer button:first-child,
  body[data-page="dashboard"] .client-card footer button:last-child,
  body[data-page="dashboard"] .client-card footer .client-whatsapp-button,
  body[data-page="dashboard"] .client-card footer .client-renew-button {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }
}

/* ============================================================
   ETAPA 2 PRODUCTIVIDAD PRO RC1
   - Reporte HTML/PDF por cliente.
   - Mejor lectura de acciones premium.
   - Filtros de clientes recordados en el navegador.
   ============================================================ */
body[data-page="dashboard"] .client-executive-actions [data-download-client-report] {
  color: #74e8bf;
  border-color: rgba(116, 232, 191, .22);
  background: linear-gradient(135deg, rgba(57,217,163,.13), rgba(255,255,255,.045));
}
body[data-page="dashboard"] .client-executive-actions [data-download-client-report]:hover {
  color: #03140d;
  background: #74e8bf;
}
body[data-page="dashboard"] .client-executive-actions [data-print-client],
body[data-page="dashboard"] .client-executive-actions [data-copy-summary] {
  border-color: rgba(116, 232, 191, .16);
}
@media (max-width: 680px) {
  body[data-page="dashboard"] .client-executive-actions {
    grid-template-columns: 1fr !important;
  }
}
@media print {
  body[data-page="dashboard"].printing-client-detail .client-executive-actions,
  body[data-page="dashboard"].printing-client-detail .premium-service-actions button,
  body[data-page="dashboard"].printing-client-detail .detail-whatsapp,
  body[data-page="dashboard"].printing-client-detail .client-history-heading button {
    display: none !important;
  }
}

/* ============================================================
   ETAPA 3 — PULIDO VISUAL PRO RC1
   - Modo compacto / cómodo.
   - Atajos rápidos.
   - Microinteracciones y acabado visual más profesional.
   ============================================================ */
body[data-page="dashboard"].ui-polished {
  scroll-behavior: smooth;
}
body[data-page="dashboard"].ui-polished * {
  scrollbar-color: rgba(116,232,191,.26) rgba(255,255,255,.035);
}
body[data-page="dashboard"].ui-polished ::selection {
  color: #03140d;
  background: rgba(116,232,191,.86);
}

/* Botones pro en barra superior */
body[data-page="dashboard"] .pro-density-toggle,
body[data-page="dashboard"] .pro-shortcuts-button {
  position: relative;
  overflow: hidden;
  border-color: rgba(116,232,191,.16) !important;
  background: rgba(255,255,255,.045) !important;
}
body[data-page="dashboard"] .pro-density-toggle {
  width: auto !important;
  min-width: 118px !important;
  padding-inline: 12px !important;
  grid-template-columns: 18px auto !important;
  gap: 8px !important;
  font-size: 12px;
  font-weight: 850;
}
body[data-page="dashboard"] .pro-density-toggle span {
  white-space: nowrap;
}
body[data-page="dashboard"] .pro-density-toggle[aria-pressed="true"] {
  color: #03140d !important;
  background: linear-gradient(135deg,#74e8bf,#39d9a3) !important;
  border-color: rgba(116,232,191,.46) !important;
}
body[data-page="dashboard"] .pro-shortcuts-button:hover,
body[data-page="dashboard"] .pro-density-toggle:hover {
  border-color: rgba(116,232,191,.32) !important;
  transform: translateY(-1px);
}

/* Modal de atajos */
body[data-page="dashboard"] .pro-shortcuts-backdrop {
  position: fixed;
  inset: 0;
  z-index: 7900;
  background: rgba(0, 5, 3, .72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
body[data-page="dashboard"] .pro-shortcuts-backdrop[hidden],
body[data-page="dashboard"] .pro-shortcuts-modal[hidden] {
  display: none !important;
}
body[data-page="dashboard"] .pro-shortcuts-modal {
  position: fixed;
  z-index: 7901;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100vw - 26px));
  max-height: min(88dvh, 720px);
  overflow: auto;
  transform: translate(-50%, -50%);
  padding: 30px;
  border: 1px solid var(--ui-line);
  border-radius: 28px;
  color: var(--ui-text);
  background: linear-gradient(155deg, rgba(16, 31, 26, .98), rgba(5, 8, 6, .99));
  box-shadow: 0 36px 110px rgba(0, 0, 0, .58);
}
body[data-page="dashboard"] .pro-shortcuts-modal > p {
  margin: 0 0 8px;
  color: #74e8bf;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}
body[data-page="dashboard"] .pro-shortcuts-modal h2 {
  margin: 0 0 20px;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1;
  letter-spacing: -.05em;
}
body[data-page="dashboard"] .pro-shortcuts-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-line);
  border-radius: 15px;
  color: #9fb4ab;
  background: rgba(255,255,255,.045);
  cursor: pointer;
}
body[data-page="dashboard"] .pro-shortcuts-close svg {
  width: 20px;
  height: 20px;
}
body[data-page="dashboard"] .pro-shortcuts-grid {
  display: grid;
  gap: 10px;
}
body[data-page="dashboard"] .pro-shortcuts-grid article {
  min-height: 58px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
}
body[data-page="dashboard"] .pro-shortcuts-grid article:has(kbd + span) {
  grid-template-columns: auto minmax(0, 1fr);
}
body[data-page="dashboard"] .pro-shortcuts-grid kbd {
  min-width: 35px;
  padding: 7px 9px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(116,232,191,.22);
  border-radius: 10px;
  color: #74e8bf;
  background: rgba(116,232,191,.08);
  font: 900 11px var(--font);
}
body[data-page="dashboard"] .pro-shortcuts-grid span {
  color: #b8cbc3;
  font-size: 13px;
  font-weight: 750;
}

/* Pulido visual general */
body[data-page="dashboard"].ui-polished .dashboard-card,
body[data-page="dashboard"].ui-polished .balance-card,
body[data-page="dashboard"].ui-polished .client-card,
body[data-page="dashboard"].ui-polished .draft-card,
body[data-page="dashboard"].ui-polished .provider-card,
body[data-page="dashboard"].ui-polished .reports-card,
body[data-page="dashboard"].ui-polished .backup-safe-card {
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
body[data-page="dashboard"].ui-polished .dashboard-card::before,
body[data-page="dashboard"].ui-polished .balance-card::before,
body[data-page="dashboard"].ui-polished .client-card::before,
body[data-page="dashboard"].ui-polished .draft-card::before,
body[data-page="dashboard"].ui-polished .provider-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(116,232,191,.08), transparent 34%);
  opacity: .55;
}
body[data-page="dashboard"].ui-polished .client-card:hover,
body[data-page="dashboard"].ui-polished .provider-card:hover,
body[data-page="dashboard"].ui-polished .draft-card:hover {
  transform: translateY(-4px);
  border-color: rgba(116,232,191,.24);
  box-shadow: 0 26px 70px rgba(0,0,0,.32);
}
body[data-page="dashboard"].ui-polished .button,
body[data-page="dashboard"].ui-polished button,
body[data-page="dashboard"].ui-polished a.button {
  transition: transform 120ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
body[data-page="dashboard"].ui-polished button:active,
body[data-page="dashboard"].ui-polished .button:active,
body[data-page="dashboard"].ui-polished a.button:active {
  transform: translateY(1px);
}
body[data-page="dashboard"].ui-polished input:focus-visible,
body[data-page="dashboard"].ui-polished select:focus-visible,
body[data-page="dashboard"].ui-polished textarea:focus-visible,
body[data-page="dashboard"].ui-polished button:focus-visible,
body[data-page="dashboard"].ui-polished a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(116,232,191,.13) !important;
}

/* Ficha de cliente más fluida */
body[data-page="dashboard"] .detail-modal {
  transition: opacity 160ms ease, transform 180ms ease;
}
body[data-page="dashboard"] .detail-modal:not(.is-ready):not([hidden]) {
  opacity: .01;
  transform: translate(-50%, 8px) scale(.985);
}
body[data-page="dashboard"] .client-executive-card {
  border-color: rgba(116,232,191,.2);
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.13), transparent 34%),
    linear-gradient(150deg, rgba(255,255,255,.055), rgba(255,255,255,.026));
}
body[data-page="dashboard"] .client-executive-main h3 {
  letter-spacing: -.035em;
}
body[data-page="dashboard"] .premium-service-card,
body[data-page="dashboard"] .client-history-block,
body[data-page="dashboard"] .client-timeline {
  box-shadow: 0 12px 30px rgba(0,0,0,.16);
}

/* Modo compacto */
body[data-page="dashboard"].compact-mode .dashboard-content {
  padding-top: 16px !important;
}
body[data-page="dashboard"].compact-mode .metric-grid,
body[data-page="dashboard"].compact-mode .dashboard-top-grid,
body[data-page="dashboard"].compact-mode .dashboard-bottom-grid,
body[data-page="dashboard"].compact-mode .clients-grid,
body[data-page="dashboard"].compact-mode .drafts-grid {
  gap: 12px !important;
}
body[data-page="dashboard"].compact-mode .dashboard-card,
body[data-page="dashboard"].compact-mode .balance-card,
body[data-page="dashboard"].compact-mode .client-card,
body[data-page="dashboard"].compact-mode .draft-card,
body[data-page="dashboard"].compact-mode .provider-card {
  padding: 14px !important;
}
body[data-page="dashboard"].compact-mode .client-card {
  min-height: 0 !important;
}
body[data-page="dashboard"].compact-mode .client-card-main {
  margin-top: 13px !important;
  padding: 11px !important;
}
body[data-page="dashboard"].compact-mode .client-service-summary {
  margin-top: 11px !important;
  gap: 5px !important;
}
body[data-page="dashboard"].compact-mode .client-progress {
  margin-top: 12px !important;
}
body[data-page="dashboard"].compact-mode .client-card footer {
  padding-top: 12px !important;
}
body[data-page="dashboard"].compact-mode .service-form-card,
body[data-page="dashboard"].compact-mode .service-block,
body[data-page="dashboard"].compact-mode .client-form-section {
  padding: 12px !important;
}
body[data-page="dashboard"].compact-mode .form-grid {
  gap: 10px !important;
}
body[data-page="dashboard"].compact-mode .form-field input,
body[data-page="dashboard"].compact-mode .form-field select {
  min-height: 42px !important;
}
body[data-page="dashboard"].compact-mode .client-modal-header {
  min-height: 78px !important;
}

/* Responsive */
@media (max-width: 720px) {
  body[data-page="dashboard"] .pro-density-toggle {
    min-width: 46px !important;
    width: 46px !important;
    padding-inline: 0 !important;
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .pro-density-toggle span {
    display: none;
  }
  body[data-page="dashboard"] .pro-shortcuts-grid article,
  body[data-page="dashboard"] .pro-shortcuts-grid article:has(kbd + span) {
    grid-template-columns: auto auto minmax(0, 1fr);
  }
}
@media (max-width: 430px) {
  body[data-page="dashboard"] .pro-shortcuts-button {
    display: none !important;
  }
  body[data-page="dashboard"] .pro-shortcuts-modal {
    width: calc(100vw - 22px);
    padding: 26px 18px 18px;
    border-radius: 24px;
  }
  body[data-page="dashboard"] .pro-shortcuts-grid article,
  body[data-page="dashboard"] .pro-shortcuts-grid article:has(kbd + span) {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="dashboard"].ui-polished *,
  body[data-page="dashboard"].ui-polished *::before,
  body[data-page="dashboard"].ui-polished *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================
   VENTA ÚNICA / GASTOS RC1
   - Botones directos para ventas que no generan ficha.
   - Gasto/reembolso sin contaminar clientes ni vencimientos.
   ============================================================ */
body[data-page="dashboard"] .finance-quick-sale,
body[data-page="dashboard"] .finance-quick-expense {
  border-color: rgba(116,232,191,.18);
  background: rgba(255,255,255,.045);
}
body[data-page="dashboard"] .finance-quick-sale:hover {
  color: #03140d;
  background: linear-gradient(135deg,#74e8bf,#39d9a3);
}
body[data-page="dashboard"] .finance-quick-expense {
  color: #f0c66d;
  border-color: rgba(240,198,109,.24);
}
body[data-page="dashboard"] .finance-quick-expense:hover {
  color: #160f02;
  background: linear-gradient(135deg,#f0c66d,#e6a93e);
}
body[data-page="dashboard"] .manual-operation-field input {
  border-color: rgba(116,232,191,.22);
  background:
    linear-gradient(135deg, rgba(57,217,163,.08), rgba(255,255,255,.035));
}
body[data-page="dashboard"] .movement-preset-helper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}
body[data-page="dashboard"] .movement-preset-helper button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(116,232,191,.16);
  border-radius: 999px;
  color: #9fb4ab;
  background: rgba(255,255,255,.045);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}
body[data-page="dashboard"] .movement-preset-helper button:hover {
  color: #03140d;
  background: #74e8bf;
}
body[data-page="dashboard"] .movement-service-name {
  display: block;
  color: var(--ui-text);
  font-size: 12px;
}
body[data-page="dashboard"] .movement-note {
  display: block;
  margin-top: 4px;
  color: #8fa49a;
  font-size: 10px;
  line-height: 1.35;
}
body[data-page="dashboard"] .finance-row-type-expense .movement-service-name,
body[data-page="dashboard"] .finance-row-type-expense td:nth-child(6) b {
  color: #ef8290;
}
body[data-page="dashboard"] .finance-row-type-sale .movement-service-name {
  color: #74e8bf;
}
body[data-page="dashboard"] .finance-row-type-adjustment .movement-service-name {
  color: #f0c66d;
}
@media (max-width: 900px) {
  body[data-page="dashboard"] .finance-heading .heading-actions {
    grid-template-columns: 1fr 1fr;
  }
  body[data-page="dashboard"] .finance-heading .heading-actions .button {
    width: 100%;
  }
}
@media (max-width: 560px) {
  body[data-page="dashboard"] .finance-heading .heading-actions {
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .movement-preset-helper {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  body[data-page="dashboard"] .movement-preset-helper button {
    width: 100%;
  }
}

/* ============================================================
   TEXTO DE ENTREGA AUTOMÁTICO RC1
   - Genera accesos listos para copiar después de guardar.
   ============================================================ */
body[data-page="dashboard"] .delivery-text-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0, 5, 3, .72);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}
body[data-page="dashboard"] .delivery-text-backdrop[hidden],
body[data-page="dashboard"] .delivery-text-modal[hidden] {
  display: none !important;
}
body[data-page="dashboard"] .delivery-text-modal {
  position: fixed;
  z-index: 8001;
  left: 50%;
  top: 50%;
  width: min(620px, calc(100vw - 26px));
  max-height: min(90dvh, 760px);
  overflow: auto;
  transform: translate(-50%, -50%);
  padding: 30px;
  border: 1px solid rgba(116,232,191,.22);
  border-radius: 30px;
  color: var(--ui-text);
  background:
    radial-gradient(circle at 90% 0%, rgba(116,232,191,.14), transparent 36%),
    linear-gradient(155deg, rgba(16, 31, 26, .98), rgba(5, 8, 6, .99));
  box-shadow: 0 38px 120px rgba(0, 0, 0, .62);
}
body[data-page="dashboard"] .delivery-text-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-line);
  border-radius: 15px;
  color: #9fb4ab;
  background: rgba(255,255,255,.045);
  cursor: pointer;
}
body[data-page="dashboard"] .delivery-text-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
body[data-page="dashboard"] .delivery-text-modal.is-copied .delivery-text-close {
  color: #03140d;
  background: linear-gradient(135deg,#74e8bf,#39d9a3);
  border-color: rgba(116,232,191,.55);
  box-shadow: 0 0 0 6px rgba(116,232,191,.13);
}
body[data-page="dashboard"] .delivery-text-modal header p {
  margin: 0 0 8px;
  color: #74e8bf;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
body[data-page="dashboard"] .delivery-text-modal header h2 {
  margin: 0;
  padding-right: 42px;
  font-size: clamp(26px, 5.6vw, 38px);
  line-height: 1.04;
  letter-spacing: -.05em;
}
body[data-page="dashboard"] .delivery-text-modal header span {
  display: block;
  margin-top: 8px;
  color: #9fb4ab;
  font-size: 13px;
  line-height: 1.5;
}
body[data-page="dashboard"] .delivery-text-preview {
  margin-top: 18px;
  border: 1px solid rgba(116,232,191,.16);
  border-radius: 20px;
  background: rgba(0,0,0,.22);
  overflow: hidden;
}
body[data-page="dashboard"] .delivery-text-preview pre {
  max-height: 390px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #f3faf6;
  white-space: pre-wrap;
  word-break: break-word;
  font: 700 14px/1.62 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
body[data-page="dashboard"] .delivery-text-modal footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
body[data-page="dashboard"].delivery-text-open {
  overflow: hidden;
}
@media (max-width: 560px) {
  body[data-page="dashboard"] .delivery-text-modal {
    width: calc(100vw - 22px);
    padding: 26px 18px 18px;
    border-radius: 24px;
  }
  body[data-page="dashboard"] .delivery-text-modal footer {
    display: grid;
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .delivery-text-modal footer .button {
    width: 100%;
  }
}

/* ============================================================
   MODAL / FICHA TRANSPARENTE FIX RC1
   - Corrige la ficha invisible con fondo oscuro/borroso.
   - Evita fondos bloqueados si un modal queda huérfano.
   ============================================================ */
body[data-page="dashboard"] .detail-modal:not([hidden]) {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate(-50%, 0) scale(1) !important;
  pointer-events: auto !important;
}
body[data-page="dashboard"] .detail-modal[hidden],
body[data-page="dashboard"] .detail-backdrop[hidden],
body[data-page="dashboard"] .delivery-text-modal[hidden],
body[data-page="dashboard"] .delivery-text-backdrop[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body[data-page="dashboard"]:not(.detail-open) .detail-backdrop,
body[data-page="dashboard"]:not(.delivery-text-open) .delivery-text-backdrop {
  display: none !important;
  pointer-events: none !important;
}
body[data-page="dashboard"] .delivery-text-modal:not([hidden]) {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* ============================================================
   FICHA RESPONSIVE + PIN ENTREGA RC1
   - Corrige posición/tamaño de ficha en PC, tablet y celular.
   - Evita que la ficha abra demasiado abajo.
   - Ajusta el modal de texto de entrega.
   ============================================================ */
body[data-page="dashboard"] #detail-modal.detail-modal:not([hidden]) {
  position: fixed !important;
  left: 50% !important;
  top: max(12px, env(safe-area-inset-top)) !important;
  width: min(760px, calc(100vw - 28px)) !important;
  height: auto !important;
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  overflow: auto !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  padding: clamp(18px, 2.4vw, 28px) !important;
  border-radius: clamp(20px, 2.4vw, 28px) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
body[data-page="dashboard"] #detail-modal.detail-modal:not(.is-ready):not([hidden]) {
  opacity: 1 !important;
  transform: translateX(-50%) !important;
}
body[data-page="dashboard"] #detail-modal.detail-modal .detail-close {
  position: sticky !important;
  top: 0 !important;
  margin-left: auto !important;
  z-index: 5 !important;
}
body[data-page="dashboard"] #detail-modal.detail-modal .client-executive-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}
body[data-page="dashboard"] #detail-modal.detail-modal .client-executive-actions button,
body[data-page="dashboard"] #detail-modal.detail-modal .client-executive-actions a {
  min-width: max-content;
}

/* Texto de entrega: siempre visible completo y fácil de copiar */
body[data-page="dashboard"] #delivery-text-modal.delivery-text-modal:not([hidden]) {
  position: fixed !important;
  left: 50% !important;
  top: max(12px, env(safe-area-inset-top)) !important;
  width: min(660px, calc(100vw - 28px)) !important;
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  overflow: auto !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
}
body[data-page="dashboard"] .delivery-text-preview pre {
  white-space: pre-wrap !important;
  word-break: break-word !important;
}

/* Celular: ficha y texto ocupan pantalla completa como app real */
@media (max-width: 680px) {
  body[data-page="dashboard"] #detail-modal.detail-modal:not([hidden]),
  body[data-page="dashboard"] #delivery-text-modal.delivery-text-modal:not([hidden]) {
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    transform: none !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    padding: max(16px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)) !important;
  }
  body[data-page="dashboard"] #detail-modal.detail-modal .client-executive-card {
    padding: 14px !important;
  }
  body[data-page="dashboard"] #detail-modal.detail-modal .client-executive-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }
  body[data-page="dashboard"] #detail-modal.detail-modal .client-executive-actions button,
  body[data-page="dashboard"] #detail-modal.detail-modal .client-executive-actions a {
    width: 100% !important;
    min-width: 0 !important;
  }
  body[data-page="dashboard"] #detail-modal.detail-modal h2,
  body[data-page="dashboard"] .client-executive-main h3 {
    font-size: clamp(23px, 8vw, 32px) !important;
    line-height: 1.05 !important;
    word-break: break-word !important;
  }
  body[data-page="dashboard"] .delivery-text-modal footer {
    position: sticky !important;
    bottom: 0 !important;
    padding-top: 12px !important;
    background: linear-gradient(180deg, rgba(8,15,12,0), rgba(8,15,12,.98) 34%) !important;
  }
}
@media (max-width: 420px) {
  body[data-page="dashboard"] #detail-modal.detail-modal .client-executive-actions {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   CLIENTES LAYOUT RESPONSIVE PRO RC1
   - Corrige tarjetas demasiado anchas o apretadas.
   - Mejora PC, laptop, tablet y teléfono.
   - Fuerza una sola columna cuando no hay espacio real.
   ============================================================ */

/* Evita que el contenido se desborde horizontalmente */
html,
body[data-page="dashboard"] {
  max-width: 100%;
  overflow-x: hidden !important;
}
body[data-page="dashboard"] .dashboard-shell,
body[data-page="dashboard"] .dashboard-main,
body[data-page="dashboard"] .dashboard-content,
body[data-page="dashboard"] .app-view,
body[data-page="dashboard"] .clients-layout,
body[data-page="dashboard"] .clients-grid,
body[data-page="dashboard"] .client-card {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* El área principal debe respirar mejor en escritorio */
body[data-page="dashboard"] .dashboard-content {
  width: 100% !important;
  max-width: 1240px !important;
  margin-inline: auto !important;
  padding-inline: clamp(16px, 2.4vw, 34px) !important;
}

/* Barra de búsqueda/filtros: que no se corte */
body[data-page="dashboard"] .clients-toolbar,
body[data-page="dashboard"] .view-toolbar,
body[data-page="dashboard"] .clients-filter-bar {
  width: 100% !important;
  min-width: 0 !important;
}
body[data-page="dashboard"] .clients-toolbar,
body[data-page="dashboard"] .section-toolbar {
  display: grid !important;
  grid-template-columns: minmax(240px, 1fr) auto !important;
  gap: 14px !important;
  align-items: center !important;
}

/* Tarjetas: auto-fit real, no dos columnas forzadas si no cabe */
body[data-page="dashboard"] .clients-grid {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)) !important;
  gap: clamp(14px, 1.8vw, 22px) !important;
  align-items: stretch !important;
}
body[data-page="dashboard"] .client-card {
  width: 100% !important;
  max-width: none !important;
  min-height: auto !important;
  overflow: hidden !important;
}
body[data-page="dashboard"] .client-card header,
body[data-page="dashboard"] .client-card-main,
body[data-page="dashboard"] .client-card footer {
  min-width: 0 !important;
}
body[data-page="dashboard"] .client-card header {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto auto !important;
  gap: 10px !important;
}
body[data-page="dashboard"] .client-card header strong,
body[data-page="dashboard"] .client-card header small,
body[data-page="dashboard"] .client-card-main strong,
body[data-page="dashboard"] .client-service-summary strong,
body[data-page="dashboard"] .client-service-summary small {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body[data-page="dashboard"] .client-card footer {
  display: grid !important;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) 48px !important;
  gap: 10px !important;
}
body[data-page="dashboard"] .client-card footer .button,
body[data-page="dashboard"] .client-card footer button,
body[data-page="dashboard"] .client-card footer a {
  min-width: 0 !important;
  width: 100% !important;
  white-space: nowrap !important;
}

/* Laptop chica / tablet horizontal: una sola columna, más limpio */
@media (max-width: 1180px) {
  body[data-page="dashboard"] .dashboard-content {
    max-width: 860px !important;
  }
  body[data-page="dashboard"] .clients-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Tablet y celular: toolbar apilado */
@media (max-width: 860px) {
  body[data-page="dashboard"] .dashboard-content {
    max-width: none !important;
    padding-inline: 14px !important;
    padding-bottom: 92px !important;
  }
  body[data-page="dashboard"] .clients-toolbar,
  body[data-page="dashboard"] .section-toolbar {
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .client-filter-tabs,
  body[data-page="dashboard"] .filter-tabs {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    overflow: visible !important;
  }
  body[data-page="dashboard"] .client-filter-tabs button,
  body[data-page="dashboard"] .filter-tabs button {
    width: 100% !important;
    min-width: 0 !important;
    padding-inline: 6px !important;
    font-size: 12px !important;
  }
}

/* Teléfono: tarjetas tipo app, botones apilados y legibles */
@media (max-width: 640px) {
  body[data-page="dashboard"] .dashboard-content {
    padding-inline: 10px !important;
  }
  body[data-page="dashboard"] .clients-grid {
    gap: 12px !important;
  }
  body[data-page="dashboard"] .client-card {
    border-radius: 20px !important;
    padding: 14px !important;
  }
  body[data-page="dashboard"] .client-card header {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
  }
  body[data-page="dashboard"] .client-card header .client-card-menu,
  body[data-page="dashboard"] .client-card header [data-client-menu] {
    grid-column: 3 !important;
  }
  body[data-page="dashboard"] .client-card-main {
    grid-template-columns: 70px minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 13px !important;
  }
  body[data-page="dashboard"] .client-card-main > div:first-child {
    border-right: 1px solid rgba(255,255,255,.08) !important;
  }
  body[data-page="dashboard"] .client-service-summary li,
  body[data-page="dashboard"] .client-card-services li {
    grid-template-columns: 8px minmax(0, 1fr) !important;
  }
  body[data-page="dashboard"] .client-service-summary li > small,
  body[data-page="dashboard"] .client-card-services li > small {
    grid-column: 2 !important;
    text-align: left !important;
    white-space: normal !important;
  }
  body[data-page="dashboard"] .client-card footer {
    grid-template-columns: 1fr 1fr !important;
  }
  body[data-page="dashboard"] .client-card footer > *:last-child {
    grid-column: auto !important;
  }
  body[data-page="dashboard"] .floating-action,
  body[data-page="dashboard"] .fab,
  body[data-page="dashboard"] #client-new-floating,
  body[data-page="dashboard"] [data-new-client-floating] {
    right: 14px !important;
    bottom: 16px !important;
    max-width: calc(100vw - 28px) !important;
  }
}

/* Teléfono angosto: todo en una columna, sin cortes */
@media (max-width: 430px) {
  body[data-page="dashboard"] .client-filter-tabs,
  body[data-page="dashboard"] .filter-tabs {
    grid-template-columns: 1fr 1fr !important;
  }
  body[data-page="dashboard"] .client-card-main {
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .client-card-main > div:first-child {
    border-right: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    padding-bottom: 10px !important;
  }
  body[data-page="dashboard"] .client-card footer {
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .client-card footer button,
  body[data-page="dashboard"] .client-card footer a {
    min-height: 44px !important;
  }
}

/* ============================================================
   SIDEBAR RESPONSIVE PRO RC1
   - Corrige la barra lateral izquierda en PC, tablet y teléfono.
   - Desktop grande: menú completo fijo.
   - Laptop/tablet: barra compacta con iconos.
   - Móvil: menú deslizable con botón.
   ============================================================ */

:root {
  --sidebar-full-width: 250px;
  --sidebar-rail-width: 82px;
}

/* Base: elimina el comportamiento rígido de grid/sticky */
body[data-page="dashboard"] .dashboard-shell {
  display: block !important;
  min-height: 100dvh !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}
body[data-page="dashboard"] .workspace {
  min-width: 0 !important;
  width: 100% !important;
  transition: padding-left 180ms ease !important;
}
body[data-page="dashboard"] .sidebar {
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  scrollbar-width: thin !important;
}

/* PC grande: menú completo fijo y siempre visible */
@media (min-width: 1281px) {
  body[data-page="dashboard"] .workspace {
    padding-left: var(--sidebar-full-width) !important;
  }
  body[data-page="dashboard"] .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: var(--sidebar-full-width) !important;
    height: 100dvh !important;
    min-height: 0 !important;
    padding: 22px 16px 18px !important;
    transform: none !important;
    border-right: 1px solid var(--ui-line) !important;
    background: rgba(5, 13, 10, .97) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    backdrop-filter: blur(16px) !important;
    box-shadow: 14px 0 40px rgba(0, 0, 0, .24) !important;
  }
  body[data-page="dashboard"] .sidebar-close,
  body[data-page="dashboard"] .mobile-menu-button,
  body[data-page="dashboard"] .sidebar-backdrop {
    display: none !important;
  }
}

/* Laptop/tablet: barra compacta con iconos para no robar espacio */
@media (min-width: 961px) and (max-width: 1280px) {
  body[data-page="dashboard"] .workspace {
    padding-left: var(--sidebar-rail-width) !important;
  }
  body[data-page="dashboard"] .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: var(--sidebar-rail-width) !important;
    height: 100dvh !important;
    min-height: 0 !important;
    padding: 16px 10px !important;
    transform: none !important;
    border-right: 1px solid var(--ui-line) !important;
    background: rgba(5, 13, 10, .97) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    backdrop-filter: blur(16px) !important;
    box-shadow: 12px 0 34px rgba(0,0,0,.22) !important;
  }
  body[data-page="dashboard"] .sidebar-close,
  body[data-page="dashboard"] .mobile-menu-button,
  body[data-page="dashboard"] .sidebar-backdrop,
  body[data-page="dashboard"] .brand-text,
  body[data-page="dashboard"] .nav-label,
  body[data-page="dashboard"] .sidebar-promo,
  body[data-page="dashboard"] .sidebar-spacer,
  body[data-page="dashboard"] .sidebar-link > span:not(.sidebar-link-indicator):not(.draft-nav-count) {
    display: none !important;
  }
  body[data-page="dashboard"] .sidebar-brand-row {
    justify-content: center !important;
    padding: 0 !important;
    margin-bottom: 18px !important;
  }
  body[data-page="dashboard"] .sidebar-brand {
    justify-content: center !important;
  }
  body[data-page="dashboard"] .brand-symbol {
    width: 48px !important;
    height: 48px !important;
    border-radius: 16px !important;
  }
  body[data-page="dashboard"] .sidebar-nav,
  body[data-page="dashboard"] .sidebar-actions {
    display: grid !important;
    gap: 10px !important;
  }
  body[data-page="dashboard"] .sidebar-link {
    width: 58px !important;
    min-height: 54px !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    place-items: center !important;
    border-radius: 17px !important;
  }
  body[data-page="dashboard"] .sidebar-link svg {
    width: 22px !important;
    height: 22px !important;
  }
  body[data-page="dashboard"] .sidebar-link-indicator {
    left: -10px !important;
    top: 11px !important;
    bottom: 11px !important;
  }
  body[data-page="dashboard"] .draft-nav-count {
    position: absolute !important;
    right: 4px !important;
    top: 4px !important;
    display: inline-grid !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 4px !important;
    font-size: 9px !important;
  }
}

/* Móvil/tablet chica: drawer real, no columna rota */
@media (max-width: 960px) {
  body[data-page="dashboard"] .dashboard-shell {
    display: block !important;
  }
  body[data-page="dashboard"] .workspace {
    padding-left: 0 !important;
  }
  body[data-page="dashboard"] .sidebar {
    position: fixed !important;
    z-index: 9000 !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(86vw, 318px) !important;
    height: 100dvh !important;
    min-height: 0 !important;
    padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)) !important;
    transform: translateX(-108%) !important;
    transition: transform 220ms cubic-bezier(.2,.7,.3,1) !important;
    border-right: 1px solid var(--ui-line) !important;
    background: rgba(5, 13, 10, .985) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    backdrop-filter: blur(18px) !important;
    box-shadow: 22px 0 70px rgba(0,0,0,.48) !important;
  }
  body[data-page="dashboard"].sidebar-open .sidebar {
    transform: translateX(0) !important;
  }
  body[data-page="dashboard"] .sidebar-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 8990 !important;
    background: rgba(0, 5, 3, .64) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    backdrop-filter: blur(6px) !important;
  }
  body[data-page="dashboard"] .sidebar-backdrop[hidden] {
    display: none !important;
  }
  body[data-page="dashboard"] .mobile-menu-button {
    display: grid !important;
  }
  body[data-page="dashboard"] .sidebar-close {
    display: grid !important;
  }
  body[data-page="dashboard"] .sidebar-brand-row {
    padding: 0 4px !important;
  }
  body[data-page="dashboard"] .nav-label {
    margin-top: 22px !important;
  }
  body[data-page="dashboard"] .sidebar-link {
    min-height: 48px !important;
    border-radius: 14px !important;
  }
  body[data-page="dashboard"] .sidebar-promo {
    margin-top: 14px !important;
  }
}

/* Teléfono angosto: drawer ancho completo controlado */
@media (max-width: 420px) {
  body[data-page="dashboard"] .sidebar {
    width: min(92vw, 340px) !important;
  }
}

/* El contenido principal nunca debe quedar debajo de una sidebar vieja */
body[data-page="dashboard"] .dashboard-main,
body[data-page="dashboard"] .dashboard-content {
  min-width: 0 !important;
}

/* ============================================================
   GANANCIAS POR PERIODO PRO RC1
   - Inicio y Finanzas con ventas, costos, ganancia y margen.
   ============================================================ */
body[data-page="dashboard"] .profit-period-panel {
  padding: clamp(16px, 2vw, 22px) !important;
  border-color: rgba(116,232,191,.16);
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.10), transparent 34%),
    rgba(255,255,255,.035);
}
body[data-page="dashboard"] .profit-period-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
body[data-page="dashboard"] .profit-period-heading h2 {
  margin: 2px 0 4px;
  color: var(--ui-text);
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: -.04em;
}
body[data-page="dashboard"] .profit-period-heading span {
  color: #9fb4ab;
  font-size: 12px;
  line-height: 1.45;
}
body[data-page="dashboard"] .panel-eyebrow {
  margin: 0;
  color: #74e8bf;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
body[data-page="dashboard"] .profit-period-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
body[data-page="dashboard"] .profit-period-card {
  position: relative;
  min-width: 0;
  min-height: 168px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--ui-line);
  border-radius: 19px;
  color: var(--ui-text);
  background:
    linear-gradient(155deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  cursor: pointer;
  text-align: left;
  font: inherit;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
body[data-page="dashboard"] .profit-period-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 88% 0%, rgba(116,232,191,.14), transparent 38%);
  opacity: .75;
}
body[data-page="dashboard"] .profit-period-card:hover {
  transform: translateY(-3px);
  border-color: rgba(116,232,191,.30);
  box-shadow: 0 22px 52px rgba(0,0,0,.28);
}
body[data-page="dashboard"] .profit-period-card[aria-disabled="true"] {
  cursor: default;
}
body[data-page="dashboard"] .profit-period-card[aria-disabled="true"]:hover {
  transform: none;
}
body[data-page="dashboard"] .profit-period-card > * {
  position: relative;
  z-index: 1;
}
body[data-page="dashboard"] .profit-period-card > span {
  color: #9fb4ab;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
body[data-page="dashboard"] .profit-period-card > strong {
  color: #74e8bf;
  font-size: clamp(23px, 2.4vw, 33px);
  line-height: .96;
  letter-spacing: -.05em;
  word-break: break-word;
}
body[data-page="dashboard"] .profit-period-card > small {
  color: #90a79c;
  font-size: 11px;
  line-height: 1.35;
}
body[data-page="dashboard"] .profit-period-breakdown {
  margin-top: 4px;
  padding-top: 10px;
  display: grid;
  gap: 7px;
  border-top: 1px solid rgba(255,255,255,.08);
}
body[data-page="dashboard"] .profit-period-breakdown b {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ui-text);
  font-size: 11px;
  font-weight: 850;
}
body[data-page="dashboard"] .profit-period-breakdown em {
  color: #82978e;
  font-style: normal;
  font-weight: 760;
}
body[data-page="dashboard"] .profit-period-card.is-loss {
  border-color: rgba(239,130,144,.26);
}
body[data-page="dashboard"] .profit-period-card.is-loss::before {
  background: radial-gradient(circle at 88% 0%, rgba(239,130,144,.15), transparent 38%);
}
body[data-page="dashboard"] .profit-period-card.is-loss > strong {
  color: #ef8290;
}
body[data-page="dashboard"] .profit-period-card.is-best {
  border-color: rgba(116,232,191,.34);
  background:
    radial-gradient(circle at 86% 0%, rgba(116,232,191,.18), transparent 40%),
    linear-gradient(155deg, rgba(116,232,191,.09), rgba(255,255,255,.028));
}
body[data-page="dashboard"] .profit-period-card.is-loading {
  opacity: .72;
  pointer-events: none;
}
body[data-page="dashboard"] .finance-profit-period-panel {
  margin-top: 0;
}
@media (max-width: 1180px) {
  body[data-page="dashboard"] .profit-period-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body[data-page="dashboard"] .profit-period-card:last-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  body[data-page="dashboard"] .profit-period-heading {
    display: grid;
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .profit-period-heading .small-action {
    width: 100%;
  }
  body[data-page="dashboard"] .profit-period-grid {
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .profit-period-card,
  body[data-page="dashboard"] .profit-period-card:last-child {
    grid-column: auto;
  }
}

/* ============================================================
   INICIO PRO SALUDO + ORDEN RC1
   - Inicio con saludo automático por horario local.
   - Menos tarjetas repetidas.
   - Resumen principal mejor alineado.
   - Progreso de cartera centrado.
   ============================================================ */
body[data-page="dashboard"] #view-inicio {
  display: grid;
  gap: clamp(14px, 1.8vw, 20px);
}
body[data-page="dashboard"] .home-hero-pro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid rgba(116,232,191,.16);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.12), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.052), rgba(255,255,255,.026));
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
}
body[data-page="dashboard"] .home-section-kicker {
  margin: 0 0 8px;
  color: #74e8bf;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}
body[data-page="dashboard"] .home-hero-pro h1 {
  margin: 0;
  color: var(--ui-text);
  font-size: clamp(30px, 5vw, 52px);
  line-height: .98;
  letter-spacing: -.06em;
}
body[data-page="dashboard"] .home-hero-pro #home-welcome {
  display: block;
  margin-top: 10px;
  color: #9fb4ab;
  font-size: clamp(13px, 1.6vw, 16px);
  line-height: 1.5;
}
body[data-page="dashboard"] .home-hero-actions {
  align-self: start;
}
body[data-page="dashboard"] .home-actions-pro {
  margin: 0;
}
body[data-page="dashboard"] .home-summary-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 12px;
}
body[data-page="dashboard"] .home-summary-card {
  position: relative;
  min-width: 0;
  min-height: 154px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--ui-line);
  border-radius: 22px;
  color: var(--ui-text);
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.10), transparent 36%),
    rgba(255,255,255,.038);
  cursor: pointer;
  text-align: left;
  font: inherit;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
body[data-page="dashboard"] .home-summary-card:hover {
  transform: translateY(-3px);
  border-color: rgba(116,232,191,.28);
  box-shadow: 0 22px 52px rgba(0,0,0,.28);
}
body[data-page="dashboard"] .home-summary-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #74e8bf;
  background: rgba(116,232,191,.10);
}
body[data-page="dashboard"] .home-summary-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
body[data-page="dashboard"] .home-summary-label {
  color: #9fb4ab;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .07em;
}
body[data-page="dashboard"] .home-summary-card strong {
  color: #74e8bf;
  font-size: clamp(25px, 3vw, 38px);
  line-height: .98;
  letter-spacing: -.055em;
}
body[data-page="dashboard"] .home-summary-card small {
  color: #9fb4ab;
  font-size: 11px;
  line-height: 1.35;
}
body[data-page="dashboard"] .home-summary-card em {
  margin-top: 4px;
  color: #82978e;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
}
body[data-page="dashboard"] .home-summary-card.is-danger {
  border-color: rgba(239,130,144,.23);
}
body[data-page="dashboard"] .home-summary-card.is-danger strong,
body[data-page="dashboard"] .home-summary-card.is-danger .home-summary-icon {
  color: #ef8290;
}
body[data-page="dashboard"] .home-summary-card.is-warning {
  border-color: rgba(240,198,109,.24);
}
body[data-page="dashboard"] .home-summary-card.is-warning strong,
body[data-page="dashboard"] .home-summary-card.is-warning .home-summary-icon {
  color: #f0c66d;
}
body[data-page="dashboard"] .home-active-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: clamp(17px, 2vw, 22px) !important;
  border-color: rgba(116,232,191,.16);
}
body[data-page="dashboard"] .home-active-copy h2 {
  margin: 2px 0 5px;
  color: var(--ui-text);
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: -.04em;
}
body[data-page="dashboard"] .home-active-copy span {
  color: #9fb4ab;
  font-size: 12px;
}
body[data-page="dashboard"] .home-active-count {
  min-width: 190px;
  min-height: 96px;
  padding: 16px 20px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(116,232,191,.20);
  border-radius: 22px;
  color: var(--ui-text);
  background: rgba(116,232,191,.08);
  cursor: pointer;
  font: inherit;
}
body[data-page="dashboard"] .home-active-count strong {
  color: #74e8bf;
  font-size: clamp(34px, 4vw, 56px);
  line-height: .9;
  letter-spacing: -.06em;
}
body[data-page="dashboard"] .home-active-count span {
  color: #9fb4ab;
  font-size: 12px;
  font-weight: 850;
}

/* Evita repetir el bloque antiguo de métricas cuando existan clases anteriores en caché */
body[data-page="dashboard"] #view-inicio > .metric-grid {
  display: none !important;
}
body[data-page="dashboard"] #view-inicio > .smart-overview {
  display: none !important;
}

/* Progreso de cartera: centrado real */
body[data-page="dashboard"] .progress-card {
  display: grid !important;
  align-content: start !important;
  justify-items: center !important;
}
body[data-page="dashboard"] .progress-card .card-heading {
  width: 100% !important;
}
body[data-page="dashboard"] .gauge-button {
  width: min(260px, 100%) !important;
  height: 168px !important;
  margin-inline: auto !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
}
body[data-page="dashboard"] .gauge-button canvas {
  width: min(240px, 100%) !important;
  height: 168px !important;
  margin-inline: auto !important;
}
body[data-page="dashboard"] .gauge-center {
  left: 50% !important;
  top: 62% !important;
  transform: translate(-50%, -50%) !important;
  text-align: center !important;
}
body[data-page="dashboard"] .gauge-legend {
  width: 100% !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  padding-inline: 0 !important;
}

/* Responsive Inicio */
@media (max-width: 1120px) {
  body[data-page="dashboard"] .home-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  body[data-page="dashboard"] .home-hero-pro,
  body[data-page="dashboard"] .home-active-panel {
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .home-hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  body[data-page="dashboard"] .home-hero-actions .button {
    width: 100%;
  }
  body[data-page="dashboard"] .home-summary-grid {
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .home-summary-card {
    min-height: 136px;
  }
  body[data-page="dashboard"] .home-active-count {
    width: 100%;
    min-width: 0;
  }
}
@media (max-width: 430px) {
  body[data-page="dashboard"] .home-hero-pro {
    padding: 17px;
    border-radius: 22px;
  }
  body[data-page="dashboard"] .home-hero-actions {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   EQUIPO + MI CUENTA + INICIO AJUSTES RC1
   - KPI de Equipo clicables.
   - Mi cuenta permite cambiar nombre visible.
   - Actualizar se mueve a barra superior.
   - Inicio no repite el nombre y muestra clientes activos arriba.
   ============================================================ */

/* Botón actualizar global */
body[data-page="dashboard"] .topbar-refresh-button {
  color: #74e8bf !important;
  border-color: rgba(116,232,191,.22) !important;
  background: rgba(116,232,191,.08) !important;
}
body[data-page="dashboard"] .topbar-refresh-button:hover {
  color: #03140d !important;
  background: linear-gradient(135deg,#74e8bf,#39d9a3) !important;
  border-color: rgba(116,232,191,.48) !important;
}
body[data-page="dashboard"] .topbar-refresh-button svg {
  transition: transform .25s ease;
}
body[data-page="dashboard"] .topbar-refresh-button:hover svg {
  transform: rotate(90deg);
}

/* Inicio: clientes activos dentro del encabezado */
body[data-page="dashboard"] .home-hero-account {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 320px) !important;
}
body[data-page="dashboard"] .home-hero-active {
  min-height: 128px;
  padding: 18px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 7px;
  border: 1px solid rgba(116,232,191,.24);
  border-radius: 24px;
  color: var(--ui-text);
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.18), transparent 40%),
    rgba(116,232,191,.08);
  cursor: pointer;
  text-align: left;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
body[data-page="dashboard"] .home-hero-active:hover {
  border-color: rgba(116,232,191,.40);
  transform: translateY(-2px);
}
body[data-page="dashboard"] .home-hero-active span {
  color: #9fb4ab;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
body[data-page="dashboard"] .home-hero-active strong {
  color: #74e8bf;
  font-size: clamp(42px, 5vw, 70px);
  line-height: .85;
  letter-spacing: -.07em;
}
body[data-page="dashboard"] .home-hero-active small {
  color: #9fb4ab;
  font-size: 12px;
  line-height: 1.35;
}

/* Si por caché queda un botón viejo de actualizar/ver resumen dentro del hero, ocultarlo */
body[data-page="dashboard"] #view-inicio .home-hero-pro .home-hero-actions,
body[data-page="dashboard"] #view-inicio .page-heading .heading-actions {
  display: none !important;
}

/* Equipo: tarjetas KPI como filtros */
body[data-page="dashboard"] .team-filter-kpi {
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
body[data-page="dashboard"] .team-filter-kpi:hover {
  transform: translateY(-3px);
  border-color: rgba(116,232,191,.28);
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
}
body[data-page="dashboard"] .team-filter-kpi.is-selected {
  border-color: rgba(116,232,191,.42) !important;
  background:
    radial-gradient(circle at 90% 0%, rgba(116,232,191,.18), transparent 42%),
    rgba(116,232,191,.08) !important;
}
body[data-page="dashboard"] .team-filter-kpi.is-selected::after {
  content: "Viendo";
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #03140d;
  background: #74e8bf;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
body[data-page="dashboard"] .team-users-card {
  scroll-margin-top: 92px;
}
body[data-page="dashboard"] .team-users-card #team-users-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
body[data-page="dashboard"] .team-user-card {
  transition: transform 140ms ease, border-color 160ms ease, background 160ms ease;
}
body[data-page="dashboard"] .team-user-card:hover {
  transform: translateY(-2px);
  border-color: rgba(116,232,191,.22);
}

/* Mi cuenta */
body[data-page="dashboard"] .profile-name-form {
  margin-top: 14px;
  padding: 14px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(116,232,191,.18);
  border-radius: 16px;
  background: rgba(116,232,191,.06);
}
body[data-page="dashboard"] .profile-name-form .button {
  justify-self: start;
}
body[data-page="dashboard"] .profile-name-form > small {
  color: #9fb4ab;
  font-size: 11px;
  line-height: 1.45;
}

/* Responsive */
@media (max-width: 760px) {
  body[data-page="dashboard"] .home-hero-account {
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .home-hero-active {
    width: 100%;
    min-height: 116px;
  }
}
@media (max-width: 560px) {
  body[data-page="dashboard"] .team-filter-kpi.is-selected::after {
    position: static;
    width: max-content;
    margin-top: 6px;
  }
  body[data-page="dashboard"] .profile-name-form .button {
    width: 100%;
  }
}

/* ============================================================
   SOPORTE RC1
   - Sección para cuentas con falla.
   - Calcula días de soporte y permite reponerlos al cliente.
   ============================================================ */
body[data-page="dashboard"] .support-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
body[data-page="dashboard"] .support-create-card,
body[data-page="dashboard"] .support-list-card {
  border-color: rgba(116,232,191,.16);
}
body[data-page="dashboard"] .support-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
body[data-page="dashboard"] .support-form .span-full {
  grid-column: 1 / -1;
}
body[data-page="dashboard"] .support-case-list {
  display: grid;
  gap: 12px;
}
body[data-page="dashboard"] .support-case-card {
  padding: 15px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.10), transparent 35%),
    rgba(255,255,255,.035);
}
body[data-page="dashboard"] .support-case-card.is-resolved {
  opacity: .82;
}
body[data-page="dashboard"] .support-case-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
body[data-page="dashboard"] .support-case-card header span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
body[data-page="dashboard"] .support-case-card header strong {
  color: var(--ui-text);
  font-size: 14px;
}
body[data-page="dashboard"] .support-case-card header small {
  color: #9fb4ab;
  font-size: 11px;
}
body[data-page="dashboard"] .support-status {
  padding: 6px 9px;
  border-radius: 999px;
  color: #03140d;
  background: #74e8bf;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
body[data-page="dashboard"] .support-case-card.is-resolved .support-status {
  color: #a7bbaf;
  background: rgba(255,255,255,.07);
}
body[data-page="dashboard"] .support-case-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
body[data-page="dashboard"] .support-case-meta span {
  min-width: 0;
  padding: 10px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}
body[data-page="dashboard"] .support-case-meta em {
  color: #82978e;
  font-style: normal;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .05em;
}
body[data-page="dashboard"] .support-case-meta strong {
  color: var(--ui-text);
  font-size: 11px;
}
body[data-page="dashboard"] .support-note,
body[data-page="dashboard"] .support-resolution {
  margin: 0;
  color: #9fb4ab;
  font-size: 12px;
  line-height: 1.55;
}
body[data-page="dashboard"] .support-resolution {
  color: #74e8bf;
}
body[data-page="dashboard"] .support-case-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 1120px) {
  body[data-page="dashboard"] .support-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  body[data-page="dashboard"] .support-form,
  body[data-page="dashboard"] .support-case-meta {
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .support-case-card footer .button {
    width: 100%;
  }
}

/* ============================================================
   INICIO REFINADO + COMBOS + CAMPOS DE DINERO RC1
   ============================================================ */

/* Quitar balance repetido y reacomodar parte inferior */
body[data-page="dashboard"] #view-inicio .balance-card {
  display: none !important;
}
body[data-page="dashboard"] #view-inicio .dashboard-bottom-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, .85fr) !important;
}

/* Actualizado dentro de Resumen por periodo */
body[data-page="dashboard"] .profit-period-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
body[data-page="dashboard"] .profit-period-updated {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(116,232,191,.16);
  border-radius: 999px;
  color: #9fb4ab;
  background: rgba(116,232,191,.07);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
body[data-page="dashboard"] .profit-period-updated i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #74e8bf;
  box-shadow: 0 0 0 4px rgba(116,232,191,.12);
}
body[data-page="dashboard"] .profit-period-updated b {
  color: #b9c8c1;
  font-weight: 850;
}

/* Gráfica con más espacio para cantidades */
body[data-page="dashboard"] .analytics-card {
  min-width: 0 !important;
  overflow: hidden !important;
}
body[data-page="dashboard"] .analytics-chart-button {
  min-width: 0 !important;
  overflow: hidden !important;
}
body[data-page="dashboard"] #profit-chart {
  max-width: 100% !important;
}

/* Recordatorios ordenados */
body[data-page="dashboard"] .reminder-item-pro {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 13px !important;
}
body[data-page="dashboard"] .reminder-item-pro .reminder-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
body[data-page="dashboard"] .reminder-item-pro .reminder-copy strong,
body[data-page="dashboard"] .activity-item-pro .activity-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-page="dashboard"] .reminder-item-pro .reminder-copy small,
body[data-page="dashboard"] .activity-item-pro .activity-copy small {
  min-width: 0;
  color: #8fa49a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-page="dashboard"] .reminder-days {
  width: 62px;
  min-height: 54px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(116,232,191,.16);
  border-radius: 16px;
  background: rgba(116,232,191,.08);
}
body[data-page="dashboard"] .reminder-days b {
  color: #74e8bf;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -.04em;
}
body[data-page="dashboard"] .reminder-days small {
  margin-top: 3px;
  color: #9fb4ab;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

/* Actividad reciente con total de venta */
body[data-page="dashboard"] .activity-item-pro {
  grid-template-columns: 38px minmax(0, 1fr) auto !important;
  gap: 11px !important;
  align-items: center !important;
}
body[data-page="dashboard"] .activity-item-pro .activity-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
body[data-page="dashboard"] .activity-item-pro > b {
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #74e8bf;
}

/* Combo rápido en ficha */
body[data-page="dashboard"] .combo-capture-panel {
  margin-bottom: 14px;
  padding: 15px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1.35fr);
  gap: 14px;
  align-items: end;
  border: 1px solid rgba(116,232,191,.20);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.14), transparent 35%),
    rgba(116,232,191,.06);
}
body[data-page="dashboard"] .combo-capture-panel[hidden] {
  display: none !important;
}
body[data-page="dashboard"] .combo-capture-copy {
  display: grid;
  gap: 5px;
}
body[data-page="dashboard"] .combo-capture-copy span {
  color: #74e8bf;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .14em;
  text-transform: uppercase;
}
body[data-page="dashboard"] .combo-capture-copy strong {
  color: var(--ui-text);
  font-size: 17px;
  letter-spacing: -.03em;
}
body[data-page="dashboard"] .combo-capture-copy small {
  color: #9fb4ab;
  font-size: 12px;
  line-height: 1.45;
}
body[data-page="dashboard"] .combo-capture-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
body[data-page="dashboard"] .service-form-list.combo-capture-active .combo-extra-card .finance-block {
  display: none !important;
}
body[data-page="dashboard"] .combo-master-card .finance-block .service-block-title small {
  font-size: 0 !important;
}
body[data-page="dashboard"] .combo-master-card .finance-block .service-block-title small::after {
  content: "Total del combo completo";
  font-size: 11px;
}
body[data-page="dashboard"] .combo-extra-card::after {
  content: "Importe incluido en el total del combo";
  display: block;
  margin: -4px 0 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(116,232,191,.22);
  border-radius: 14px;
  color: #9fb4ab;
  background: rgba(116,232,191,.045);
  font-size: 11px;
  font-weight: 800;
}

/* Campos de dinero más claros al editar */
body[data-page="dashboard"] input[inputmode="decimal"]:focus,
body[data-page="dashboard"] input[type="number"][step="0.01"]:focus {
  border-color: rgba(116,232,191,.50) !important;
  box-shadow: 0 0 0 4px rgba(116,232,191,.12) !important;
}

/* Responsive */
@media (max-width: 1120px) {
  body[data-page="dashboard"] #view-inicio .dashboard-bottom-grid {
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .combo-capture-panel,
  body[data-page="dashboard"] .combo-capture-grid {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 720px) {
  body[data-page="dashboard"] .profit-period-actions {
    justify-content: stretch;
  }
  body[data-page="dashboard"] .profit-period-actions .small-action,
  body[data-page="dashboard"] .profit-period-updated {
    width: 100%;
    justify-content: center;
  }
  body[data-page="dashboard"] .activity-item-pro {
    grid-template-columns: 34px minmax(0, 1fr) !important;
  }
  body[data-page="dashboard"] .activity-item-pro > b {
    grid-column: 2;
    justify-self: start;
    max-width: 100%;
  }
  body[data-page="dashboard"] .reminder-days {
    width: 56px;
  }
}

/* ============================================================
   FINANZAS LIMPIO RC3
   - Quita KPI repetidos debajo de Ganancia por periodo.
   - Movimientos queda integrado dentro del corte financiero.
   ============================================================ */
body[data-page="dashboard"] .finance-profit-period-panel {
  padding: clamp(18px, 2.2vw, 28px) !important;
}
body[data-page="dashboard"] .finance-profit-period-panel .profit-period-heading {
  align-items: start !important;
  gap: 16px !important;
  margin-bottom: 18px !important;
}
body[data-page="dashboard"] .finance-profit-period-panel .panel-eyebrow {
  margin-bottom: 8px !important;
  letter-spacing: .18em !important;
}
body[data-page="dashboard"] .finance-profit-period-panel .profit-period-heading h2 {
  line-height: 1.05 !important;
  margin-bottom: 10px !important;
}
body[data-page="dashboard"] .finance-period-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
body[data-page="dashboard"] .finance-movement-pill {
  min-width: clamp(220px, 24vw, 300px);
  min-height: 120px;
  padding: 16px 18px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(116,232,191,.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 0%, rgba(116,232,191,.20), transparent 42%),
    linear-gradient(135deg, rgba(116,232,191,.12), rgba(116,232,191,.04)),
    rgba(116,232,191,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  text-align: left;
}
body[data-page="dashboard"] .finance-movement-pill small {
  color: #a7bbb2;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}
body[data-page="dashboard"] .finance-movement-pill strong {
  color: #74e8bf;
  font-size: clamp(38px, 4vw, 56px);
  line-height: .9;
  letter-spacing: -.07em;
}
body[data-page="dashboard"] .finance-movement-pill em {
  color: #92a89e;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}
body[data-page="dashboard"] #view-finanzas > .finance-metric-grid:not(.reports-kpi-grid):not(.team-kpi-grid) {
  display: none !important;
}
body[data-page="dashboard"] #view-finanzas .finance-layout {
  margin-top: 0 !important;
}
body[data-page="dashboard"] .finance-profit-period-panel .profit-period-grid {
  gap: clamp(10px, 1.2vw, 16px) !important;
}
body[data-page="dashboard"] .finance-profit-period-panel .profit-period-card {
  min-width: 0 !important;
}
@media (max-width: 880px) {
  body[data-page="dashboard"] .finance-profit-period-panel .profit-period-heading {
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .finance-period-toolbar,
  body[data-page="dashboard"] .finance-period-toolbar .small-action,
  body[data-page="dashboard"] .finance-movement-pill {
    width: 100%;
  }
  body[data-page="dashboard"] .finance-period-toolbar .small-action {
    justify-content: center;
  }
}
@media (max-width: 560px) {
  body[data-page="dashboard"] .finance-movement-pill {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  body[data-page="dashboard"] .finance-movement-pill small,
  body[data-page="dashboard"] .finance-movement-pill em {
    grid-column: 1;
  }
  body[data-page="dashboard"] .finance-movement-pill strong {
    grid-row: 1 / span 2;
    grid-column: 2;
  }
}

/* Ajuste visual: Movimientos más grande en Finanzas */
body[data-page="dashboard"] .finance-period-toolbar {
  align-items: stretch;
}
body[data-page="dashboard"] .finance-period-toolbar .small-action {
  min-height: 56px;
  align-self: center;
}
@media (min-width: 881px) {
  body[data-page="dashboard"] .finance-profit-period-panel .profit-period-heading {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }
}
@media (max-width: 880px) {
  body[data-page="dashboard"] .finance-movement-pill {
    min-height: 96px;
  }
}

/* ============================================================
   INICIO CARTERA LIMPIO RC5
   - Quita "Estado de la cartera" del inicio.
   - Deja solo "Progreso de cartera" y lo expande mejor.
   ============================================================ */
body[data-page="dashboard"] #view-inicio .dashboard-bottom-grid {
  grid-template-columns: 1fr !important;
}
body[data-page="dashboard"] #view-inicio .dashboard-bottom-grid .progress-card {
  max-width: none !important;
}
body[data-page="dashboard"] #view-inicio .dashboard-bottom-grid .gauge-button {
  min-height: 260px;
}
@media (max-width: 720px) {
  body[data-page="dashboard"] #view-inicio .dashboard-bottom-grid .gauge-button {
    min-height: 220px;
  }
}

/* ============================================================
   CARTERA RC1
   - Historial comercial de clientes activos y sin renovar.
   ============================================================ */
body[data-page="dashboard"] .portfolio-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
body[data-page="dashboard"] .portfolio-kpi {
  position: relative;
  min-height: 142px;
  padding: 17px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--ui-line);
  border-radius: 22px;
  color: var(--ui-text);
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.10), transparent 38%),
    rgba(255,255,255,.038);
  text-align: left;
  font: inherit;
}
body[data-page="dashboard"] button.portfolio-kpi {
  cursor: pointer;
}
body[data-page="dashboard"] button.portfolio-kpi:hover,
body[data-page="dashboard"] button.portfolio-kpi.is-selected {
  transform: translateY(-2px);
  border-color: rgba(116,232,191,.34);
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.18), transparent 38%),
    rgba(116,232,191,.07);
}
body[data-page="dashboard"] .portfolio-kpi span {
  color: #9fb4ab;
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: .10em;
  text-transform: uppercase;
}
body[data-page="dashboard"] .portfolio-kpi strong {
  color: #74e8bf;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: .95;
  letter-spacing: -.06em;
}
body[data-page="dashboard"] .portfolio-kpi small {
  color: #92a89e;
  font-size: 11px;
  line-height: 1.4;
}
body[data-page="dashboard"] .portfolio-kpi.featured {
  border-color: rgba(116,232,191,.26);
  background:
    radial-gradient(circle at 90% 0%, rgba(116,232,191,.22), transparent 42%),
    linear-gradient(135deg, rgba(116,232,191,.12), rgba(255,255,255,.035));
}
body[data-page="dashboard"] .portfolio-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 14px;
  align-items: center;
}
body[data-page="dashboard"] .cartera-status-tabs {
  justify-content: flex-end;
  flex-wrap: wrap;
}
body[data-page="dashboard"] .portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}
body[data-page="dashboard"] .portfolio-client-card {
  min-width: 0;
  padding: 16px;
  display: grid;
  gap: 14px;
  border-color: rgba(116,232,191,.16);
}
body[data-page="dashboard"] .portfolio-client-card:hover {
  border-color: rgba(116,232,191,.30);
  transform: translateY(-2px);
}
body[data-page="dashboard"] .portfolio-client-card header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
body[data-page="dashboard"] .portfolio-client-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #74e8bf;
  background: rgba(116,232,191,.10);
  font-weight: 950;
}
body[data-page="dashboard"] .portfolio-client-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}
body[data-page="dashboard"] .portfolio-client-title strong {
  min-width: 0;
  color: var(--ui-text);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-page="dashboard"] .portfolio-client-title small {
  color: #9fb4ab;
  font-size: 11px;
}
body[data-page="dashboard"] .portfolio-status {
  padding: 7px 10px;
  border-radius: 999px;
  color: #03140d;
  background: #74e8bf;
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}
body[data-page="dashboard"] .portfolio-status-expiring {
  background: #f0c66d;
}
body[data-page="dashboard"] .portfolio-status-inactive,
body[data-page="dashboard"] .portfolio-status-no_services {
  color: #f5dede;
  background: rgba(239,130,144,.18);
}
body[data-page="dashboard"] .portfolio-client-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
body[data-page="dashboard"] .portfolio-client-meta span {
  min-width: 0;
  padding: 10px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}
body[data-page="dashboard"] .portfolio-client-meta em {
  color: #82978e;
  font-style: normal;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}
body[data-page="dashboard"] .portfolio-client-meta strong {
  color: var(--ui-text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-page="dashboard"] .portfolio-client-history {
  padding: 12px;
  border-radius: 16px;
  background: rgba(116,232,191,.055);
  border: 1px solid rgba(116,232,191,.12);
}
body[data-page="dashboard"] .portfolio-client-history p {
  margin: 0;
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}
body[data-page="dashboard"] .portfolio-client-history small {
  display: block;
  margin-top: 6px;
  color: #9fb4ab;
  font-size: 11px;
  line-height: 1.45;
}
body[data-page="dashboard"] .portfolio-client-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body[data-page="dashboard"] .portfolio-client-card footer .button {
  min-height: 34px;
}
body[data-page="dashboard"] .portfolio-client-card.is-loading {
  min-height: 250px;
  opacity: .7;
}
body[data-page="dashboard"] .portfolio-client-card.is-loading span {
  display: block;
  height: 28px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(116,232,191,.10), rgba(255,255,255,.04));
}
body[data-page="dashboard"] .portfolio-client-card.is-loading span:nth-child(2) {
  height: 80px;
}
@media (max-width: 1120px) {
  body[data-page="dashboard"] .portfolio-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body[data-page="dashboard"] .portfolio-toolbar {
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .cartera-status-tabs {
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  body[data-page="dashboard"] .portfolio-kpi-grid,
  body[data-page="dashboard"] .portfolio-grid {
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .portfolio-client-card header {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  body[data-page="dashboard"] .portfolio-status {
    grid-column: 1 / -1;
    width: max-content;
  }
  body[data-page="dashboard"] .portfolio-client-meta {
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .portfolio-client-card footer .button {
    width: 100%;
  }
}

/* ============================================================
   CARTERA LAYOUT RC2
   - Más separación entre resumen, búsqueda/filtros y fichas.
   - Fichas menos amontonadas y mejor alineadas.
   ============================================================ */
body[data-page="dashboard"] #view-cartera {
  display: grid !important;
  gap: clamp(18px, 2vw, 26px) !important;
}
body[data-page="dashboard"] #view-cartera .portfolio-heading {
  margin-bottom: 2px !important;
}
body[data-page="dashboard"] #view-cartera .portfolio-kpi-grid {
  margin-bottom: 0 !important;
  gap: clamp(14px, 1.6vw, 20px) !important;
}
body[data-page="dashboard"] #view-cartera .portfolio-toolbar {
  margin-top: 2px !important;
  margin-bottom: 2px !important;
  padding: clamp(16px, 1.8vw, 22px) !important;
  border-radius: 24px !important;
  gap: clamp(14px, 1.6vw, 20px) !important;
}
body[data-page="dashboard"] #view-cartera .portfolio-toolbar .clients-search {
  min-height: 56px !important;
}
body[data-page="dashboard"] #view-cartera .cartera-status-tabs {
  gap: 8px !important;
}
body[data-page="dashboard"] #view-cartera .cartera-status-tabs button {
  min-height: 44px !important;
  padding-inline: 18px !important;
}
body[data-page="dashboard"] #view-cartera .portfolio-grid {
  margin-top: 2px !important;
  gap: clamp(18px, 2vw, 24px) !important;
  align-items: stretch !important;
}
body[data-page="dashboard"] #view-cartera .portfolio-client-card {
  padding: clamp(17px, 1.8vw, 22px) !important;
  gap: 16px !important;
  border-radius: 24px !important;
}
body[data-page="dashboard"] #view-cartera .portfolio-client-card header {
  gap: 14px !important;
}
body[data-page="dashboard"] #view-cartera .portfolio-client-meta {
  gap: 10px !important;
}
body[data-page="dashboard"] #view-cartera .portfolio-client-history {
  margin-top: 2px !important;
}
body[data-page="dashboard"] #view-cartera .portfolio-client-card footer {
  margin-top: 2px !important;
  gap: 10px !important;
}
body[data-page="dashboard"] #view-cartera .portfolio-kpi {
  min-height: 154px !important;
  border-radius: 24px !important;
}

/* En pantallas medianas el buscador y filtros se separan en dos líneas limpias */
@media (max-width: 1180px) {
  body[data-page="dashboard"] #view-cartera .portfolio-toolbar {
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] #view-cartera .cartera-status-tabs {
    justify-content: flex-start !important;
  }
}

/* En celular, más respiración vertical */
@media (max-width: 700px) {
  body[data-page="dashboard"] #view-cartera {
    gap: 16px !important;
  }
  body[data-page="dashboard"] #view-cartera .portfolio-kpi-grid {
    gap: 12px !important;
  }
  body[data-page="dashboard"] #view-cartera .portfolio-toolbar {
    padding: 14px !important;
  }
  body[data-page="dashboard"] #view-cartera .cartera-status-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
  }
  body[data-page="dashboard"] #view-cartera .cartera-status-tabs button {
    width: 100% !important;
  }
  body[data-page="dashboard"] #view-cartera .portfolio-grid {
    gap: 14px !important;
  }
}
@media (max-width: 430px) {
  body[data-page="dashboard"] #view-cartera .cartera-status-tabs {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   WHATSAPP ICONOS PRO RC3
   - Quita los iconos con colores tipo celular.
   - Los convierte al estilo premium del panel.
   ============================================================ */
body[data-page="dashboard"] .whatsapp-client-options button {
  grid-template-columns: 52px minmax(0, 1fr) !important;
  min-height: 74px !important;
  border-color: rgba(116,232,191,.16) !important;
  background:
    radial-gradient(circle at 94% 0%, rgba(116,232,191,.08), transparent 42%),
    rgba(255,255,255,.035) !important;
}
body[data-page="dashboard"] .whatsapp-client-options button:hover {
  border-color: rgba(116,232,191,.34) !important;
  background:
    radial-gradient(circle at 94% 0%, rgba(116,232,191,.14), transparent 42%),
    rgba(116,232,191,.065) !important;
}
body[data-page="dashboard"] .wa-option-icon,
body[data-page="dashboard"] .wa-blue,
body[data-page="dashboard"] .wa-yellow,
body[data-page="dashboard"] .wa-green,
body[data-page="dashboard"] .wa-red,
body[data-page="dashboard"] .wa-purple {
  width: 44px !important;
  height: 44px !important;
  border-radius: 15px !important;
  color: #74e8bf !important;
  background:
    linear-gradient(145deg, rgba(116,232,191,.14), rgba(116,232,191,.045)) !important;
  border: 1px solid rgba(116,232,191,.22) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
}
body[data-page="dashboard"] .wa-option-icon svg {
  width: 21px !important;
  height: 21px !important;
  stroke-width: 2.15 !important;
}
body[data-page="dashboard"] .whatsapp-client-options b {
  color: #f3faf6 !important;
  font-weight: 900 !important;
}
body[data-page="dashboard"] .whatsapp-client-options .wa-option-featured {
  border-color: rgba(116,232,191,.26) !important;
  background:
    radial-gradient(circle at 94% 0%, rgba(116,232,191,.18), transparent 42%),
    linear-gradient(135deg, rgba(116,232,191,.12), rgba(116,232,191,.05)) !important;
}
body[data-page="dashboard"] .whatsapp-client-options .wa-option-featured .wa-option-icon {
  color: #03140d !important;
  background: linear-gradient(135deg, #74e8bf, #39d9a3) !important;
  border-color: rgba(116,232,191,.45) !important;
}
body[data-page="dashboard"] .whatsapp-client-options .wa-option-featured b {
  color: #74e8bf !important;
}
body[data-page="dashboard"] .whatsapp-client-options button:focus-visible {
  outline: 3px solid rgba(116,232,191,.35) !important;
  outline-offset: 3px !important;
}
@media (max-width: 560px) {
  body[data-page="dashboard"] .whatsapp-client-options button {
    grid-template-columns: 48px minmax(0, 1fr) !important;
  }
  body[data-page="dashboard"] .wa-option-icon,
  body[data-page="dashboard"] .wa-blue,
  body[data-page="dashboard"] .wa-yellow,
  body[data-page="dashboard"] .wa-green,
  body[data-page="dashboard"] .wa-red,
  body[data-page="dashboard"] .wa-purple {
    width: 42px !important;
    height: 42px !important;
  }
}

/* ============================================================
   CARTERA HIDDEN FIX RC4
   - Corrige que Cartera se mezclara con otras secciones.
   - Cartera solo se muestra cuando la ruta activa es #cartera.
   ============================================================ */
body[data-page="dashboard"] #view-cartera[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body[data-page="dashboard"] #view-cartera:not([hidden]) {
  display: grid !important;
  visibility: visible !important;
  pointer-events: auto !important;
  gap: clamp(18px, 2vw, 26px) !important;
}

/* Protección general: ninguna vista oculta debe aparecer aunque tenga CSS de layout */
body[data-page="dashboard"] .app-view[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ============================================================
   PROVEEDORES KPIS PRO RC5
   - Encierra los números superiores de Proveedores en tarjetas.
   - Mejora alineación en PC, tablet y teléfono.
   ============================================================ */
body[data-page="dashboard"] #view-proveedores .providers-summary-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: clamp(14px, 1.6vw, 20px) !important;
  margin: clamp(20px, 2.4vw, 30px) 0 clamp(18px, 2vw, 24px) !important;
}
body[data-page="dashboard"] #view-proveedores .provider-summary-card,
body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi {
  position: relative !important;
  min-width: 0 !important;
  min-height: 150px !important;
  padding: clamp(16px, 1.7vw, 22px) !important;
  display: grid !important;
  align-content: start !important;
  gap: 8px !important;
  border: 1px solid rgba(116,232,191,.18) !important;
  border-radius: 24px !important;
  color: var(--ui-text) !important;
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.13), transparent 38%),
    linear-gradient(145deg, rgba(255,255,255,.052), rgba(255,255,255,.028)) !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.05) !important;
  overflow: hidden !important;
}
body[data-page="dashboard"] #view-proveedores .provider-summary-card.featured,
body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi:nth-child(4) {
  border-color: rgba(116,232,191,.28) !important;
  background:
    radial-gradient(circle at 90% 0%, rgba(116,232,191,.22), transparent 42%),
    linear-gradient(135deg, rgba(116,232,191,.12), rgba(255,255,255,.035)) !important;
}
body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi span {
  color: #9fb4ab !important;
  font-size: 10.5px !important;
  font-weight: 950 !important;
  letter-spacing: .10em !important;
  text-transform: uppercase !important;
}
body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi strong {
  color: #f3faf6 !important;
  font-size: clamp(34px, 4vw, 56px) !important;
  line-height: .95 !important;
  letter-spacing: -.07em !important;
  overflow-wrap: anywhere !important;
}
body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi:nth-child(4) strong {
  color: #74e8bf !important;
}
body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi small {
  max-width: 90% !important;
  color: #9fb4ab !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
}

/* Search más separado después de las tarjetas */
body[data-page="dashboard"] #view-proveedores .providers-toolbar {
  margin-top: 0 !important;
  margin-bottom: clamp(18px, 2vw, 24px) !important;
  padding: clamp(15px, 1.7vw, 20px) !important;
  border-radius: 24px !important;
}

/* Responsive */
@media (max-width: 1180px) {
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 640px) {
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  body[data-page="dashboard"] #view-proveedores .provider-summary-card,
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi {
    min-height: 126px !important;
    padding: 16px !important;
  }
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi strong {
    font-size: 40px !important;
  }
}

/* ============================================================
   PROVEEDORES KPIS COMPACTOS RC6
   - Reduce el tamaño de las fichas superiores.
   - Evita que montos grandes se partan en varias líneas.
   - Se adapta mejor a PC, tablet y teléfono.
   ============================================================ */
body[data-page="dashboard"] #view-proveedores .providers-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: clamp(10px, 1.2vw, 16px) !important;
  margin: clamp(16px, 2vw, 22px) 0 clamp(14px, 1.6vw, 18px) !important;
}
body[data-page="dashboard"] #view-proveedores .provider-summary-card,
body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi {
  min-height: 118px !important;
  padding: clamp(13px, 1.25vw, 16px) !important;
  gap: 6px !important;
  border-radius: 20px !important;
  align-content: center !important;
}
body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi span {
  font-size: 9.5px !important;
  letter-spacing: .08em !important;
  line-height: 1.25 !important;
}
body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi strong {
  max-width: 100% !important;
  color: #f3faf6 !important;
  font-size: clamp(28px, 3.2vw, 44px) !important;
  line-height: .98 !important;
  letter-spacing: -.06em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}
body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi:nth-child(4) strong {
  color: #74e8bf !important;
  font-size: clamp(26px, 3vw, 40px) !important;
}
body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi small {
  max-width: 100% !important;
  font-size: 10.5px !important;
  line-height: 1.28 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
body[data-page="dashboard"] #view-proveedores .providers-toolbar {
  margin-bottom: clamp(16px, 1.7vw, 20px) !important;
}

/* Tablet: dos columnas, sin aplastar los montos */
@media (max-width: 1180px) {
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi strong {
    font-size: clamp(30px, 5vw, 46px) !important;
  }
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi:nth-child(4) strong {
    font-size: clamp(28px, 4.5vw, 42px) !important;
  }
}

/* Teléfono: una columna limpia */
@media (max-width: 640px) {
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  body[data-page="dashboard"] #view-proveedores .provider-summary-card,
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi {
    min-height: 104px !important;
    padding: 14px !important;
    border-radius: 18px !important;
  }
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi strong,
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi:nth-child(4) strong {
    font-size: clamp(30px, 10vw, 42px) !important;
  }
}

/* Teléfonos muy angostos: permite reducir más para que no corte */
@media (max-width: 380px) {
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi strong,
  body[data-page="dashboard"] #view-proveedores .providers-summary-grid > .finance-kpi:nth-child(4) strong {
    font-size: 30px !important;
  }
}

/* ============================================================
   PANEL LIMPIEZA VISUAL GLOBAL RC1
   - Capa segura de normalización visual.
   - No borra funciones; unifica tarjetas, botones, campos y errores.
   ============================================================ */

/* Seguridad: ninguna vista oculta debe mostrarse ni mezclarse */
body[data-page="dashboard"] .app-view[hidden],
body[data-page="dashboard"] #view-cartera[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Separación base por sección */
body[data-page="dashboard"] .app-view:not([hidden]) {
  gap: clamp(16px, 1.8vw, 24px);
}
body[data-page="dashboard"] .dashboard-content {
  scroll-margin-top: 96px;
}

/* Tarjetas globales más consistentes */
body[data-page="dashboard"] .dashboard-card,
body[data-page="dashboard"] .finance-kpi.dashboard-card,
body[data-page="dashboard"] .portfolio-kpi,
body[data-page="dashboard"] .provider-summary-card,
body[data-page="dashboard"] .support-case-card,
body[data-page="dashboard"] .client-card,
body[data-page="dashboard"] .provider-card {
  border-color: rgba(116,232,191,.16);
  box-shadow: 0 18px 48px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.035);
}
body[data-page="dashboard"] .dashboard-card:hover,
body[data-page="dashboard"] .client-card:hover,
body[data-page="dashboard"] .provider-card:hover,
body[data-page="dashboard"] .portfolio-client-card:hover {
  border-color: rgba(116,232,191,.28);
}

/* Botones unificados */
body[data-page="dashboard"] .button,
body[data-page="dashboard"] .small-action,
body[data-page="dashboard"] .icon-action,
body[data-page="dashboard"] .topbar-icon {
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}
body[data-page="dashboard"] .button:hover,
body[data-page="dashboard"] .small-action:hover,
body[data-page="dashboard"] .icon-action:hover,
body[data-page="dashboard"] .topbar-icon:hover {
  transform: translateY(-1px);
}
body[data-page="dashboard"] .button:focus-visible,
body[data-page="dashboard"] .small-action:focus-visible,
body[data-page="dashboard"] .icon-action:focus-visible,
body[data-page="dashboard"] .topbar-icon:focus-visible,
body[data-page="dashboard"] input:focus-visible,
body[data-page="dashboard"] textarea:focus-visible,
body[data-page="dashboard"] select:focus-visible {
  outline: 3px solid rgba(116,232,191,.32) !important;
  outline-offset: 2px !important;
}

/* Inputs, buscadores y filtros */
body[data-page="dashboard"] input,
body[data-page="dashboard"] textarea,
body[data-page="dashboard"] select {
  min-width: 0;
}
body[data-page="dashboard"] .clients-search,
body[data-page="dashboard"] .finance-search,
body[data-page="dashboard"] .form-field input,
body[data-page="dashboard"] .form-field textarea,
body[data-page="dashboard"] .form-field select {
  border-color: rgba(116,232,191,.14);
}
body[data-page="dashboard"] .clients-search:focus-within,
body[data-page="dashboard"] .finance-search:focus-within,
body[data-page="dashboard"] .form-field:focus-within input,
body[data-page="dashboard"] .form-field:focus-within textarea,
body[data-page="dashboard"] .form-field:focus-within select {
  border-color: rgba(116,232,191,.40) !important;
  box-shadow: 0 0 0 4px rgba(116,232,191,.10) !important;
}

/* Mensajes de error por sección */
body[data-page="dashboard"] .section-error-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border-color: rgba(239,130,144,.28) !important;
  background:
    radial-gradient(circle at 92% 0%, rgba(239,130,144,.14), transparent 40%),
    rgba(239,130,144,.055) !important;
}
body[data-page="dashboard"] .section-error-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #ff9aa6;
  background: rgba(239,130,144,.11);
  border: 1px solid rgba(239,130,144,.22);
}
body[data-page="dashboard"] .section-error-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
body[data-page="dashboard"] .section-error-card strong {
  color: #f6f3f2;
  font-size: 14px;
}
body[data-page="dashboard"] .section-error-card small {
  display: block;
  margin-top: 3px;
  color: #d0aeb0;
  font-size: 12px;
  line-height: 1.4;
}

/* Skeletons uniformes */
body[data-page="dashboard"] .is-loading,
body[data-page="dashboard"] .client-card-skeleton,
body[data-page="dashboard"] .finance-row-skeleton span,
body[data-page="dashboard"] .portfolio-client-card.is-loading span {
  position: relative;
  overflow: hidden;
}
body[data-page="dashboard"] .is-loading::after,
body[data-page="dashboard"] .client-card-skeleton::after,
body[data-page="dashboard"] .finance-row-skeleton span::after,
body[data-page="dashboard"] .portfolio-client-card.is-loading span::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(116,232,191,.12), transparent);
  animation: panelSkeletonSweep 1.25s linear infinite;
}
@keyframes panelSkeletonSweep {
  to { transform: translateX(100%); }
}

/* Modales más consistentes */
body[data-page="dashboard"] .detail-modal,
body[data-page="dashboard"] .client-modal,
body[data-page="dashboard"] .finance-modal,
body[data-page="dashboard"] .whatsapp-client-modal,
body[data-page="dashboard"] .renew-modal {
  border-color: rgba(116,232,191,.18) !important;
}

/* Responsive general */
@media (max-width: 760px) {
  body[data-page="dashboard"] .section-error-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  body[data-page="dashboard"] .section-error-card .button {
    grid-column: 1 / -1;
    width: 100%;
  }
  body[data-page="dashboard"] .dashboard-content {
    gap: 14px;
  }
}

/* ============================================================
   INICIO ALERTAS PRO RC1
   - Centro de alertas en Inicio.
   - Vencidos, vencen hoy, sin renovar, soporte, gastos y margen.
   ============================================================ */
body[data-page="dashboard"] .home-alert-center {
  padding: clamp(18px, 2.2vw, 26px) !important;
  border-color: rgba(116,232,191,.18) !important;
}
body[data-page="dashboard"] .home-alert-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}
body[data-page="dashboard"] .home-alert-heading h2 {
  margin: 2px 0 6px;
  color: var(--ui-text);
  font-size: clamp(22px, 2.6vw, 32px);
  letter-spacing: -.045em;
}
body[data-page="dashboard"] .home-alert-heading span {
  color: #9fb4ab;
  font-size: 12px;
  line-height: 1.45;
}
body[data-page="dashboard"] .home-alert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
body[data-page="dashboard"] .home-alert-card {
  min-width: 0;
  min-height: 128px;
  padding: 15px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid rgba(116,232,191,.14);
  border-radius: 20px;
  color: var(--ui-text);
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.10), transparent 36%),
    rgba(255,255,255,.035);
  text-align: left;
  font: inherit;
}
button.home-alert-card {
  cursor: pointer;
}
button.home-alert-card:hover {
  transform: translateY(-2px);
  border-color: rgba(116,232,191,.30);
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.15), transparent 36%),
    rgba(116,232,191,.055);
}
body[data-page="dashboard"] .home-alert-badge {
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #03140d;
  background: #74e8bf;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
body[data-page="dashboard"] .home-alert-card strong {
  color: #f3faf6;
  font-size: 14px;
  line-height: 1.25;
}
body[data-page="dashboard"] .home-alert-card small {
  color: #9fb4ab;
  font-size: 11.5px;
  line-height: 1.4;
}
body[data-page="dashboard"] .home-alert-danger {
  border-color: rgba(239,130,144,.28);
  background:
    radial-gradient(circle at 92% 0%, rgba(239,130,144,.16), transparent 36%),
    rgba(239,130,144,.055);
}
body[data-page="dashboard"] .home-alert-danger .home-alert-badge {
  color: #fff4f4;
  background: #ef8290;
}
body[data-page="dashboard"] .home-alert-warning {
  border-color: rgba(240,198,109,.30);
  background:
    radial-gradient(circle at 92% 0%, rgba(240,198,109,.15), transparent 36%),
    rgba(240,198,109,.055);
}
body[data-page="dashboard"] .home-alert-warning .home-alert-badge {
  color: #201606;
  background: #f0c66d;
}
body[data-page="dashboard"] .home-alert-support .home-alert-badge {
  color: #03140d;
  background: #84d8ff;
}
body[data-page="dashboard"] .home-alert-cartera .home-alert-badge {
  color: #03140d;
  background: #a7f3d0;
}
body[data-page="dashboard"] .home-alert-draft .home-alert-badge {
  color: #03140d;
  background: #c4b5fd;
}
body[data-page="dashboard"] .home-alert-card.is-ok {
  grid-column: 1 / -1;
  min-height: 104px;
  align-content: center;
  border-color: rgba(116,232,191,.20);
}
body[data-page="dashboard"] .home-alert-card.is-loading span,
body[data-page="dashboard"] .home-alert-card.is-loading strong,
body[data-page="dashboard"] .home-alert-card.is-loading small {
  display: block;
  min-height: 15px;
  border-radius: 10px;
  color: transparent !important;
  background: rgba(255,255,255,.06);
}
body[data-page="dashboard"] .home-alert-card.is-loading strong {
  width: 70%;
}
body[data-page="dashboard"] .home-alert-card.is-loading small {
  width: 92%;
}
@media (max-width: 1120px) {
  body[data-page="dashboard"] .home-alert-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  body[data-page="dashboard"] .home-alert-heading {
    grid-template-columns: 1fr;
  }
  body[data-page="dashboard"] .home-alert-heading .small-action {
    width: 100%;
    justify-content: center;
  }
  body[data-page="dashboard"] .home-alert-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   CARTERA SEGUIMIENTO PRO RC1
   - Etiquetas, estado, notas y próxima fecha de contacto.
   ============================================================ */
body[data-page="dashboard"] .portfolio-follow-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: -2px;
}
body[data-page="dashboard"] .portfolio-follow-strip span,
body[data-page="dashboard"] .portfolio-tag {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #9fb4ab;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
  font-weight: 900;
}
body[data-page="dashboard"] .portfolio-tag-vip {
  color: #03140d !important;
  background: #74e8bf !important;
  border-color: rgba(116,232,191,.45) !important;
}
body[data-page="dashboard"] .portfolio-tag-frecuente {
  color: #bdf9df !important;
  background: rgba(116,232,191,.12) !important;
  border-color: rgba(116,232,191,.24) !important;
}
body[data-page="dashboard"] .portfolio-tag-recuperar,
body[data-page="dashboard"] .portfolio-tag-no_responde {
  color: #ffd6d9 !important;
  background: rgba(239,130,144,.11) !important;
  border-color: rgba(239,130,144,.26) !important;
}
body[data-page="dashboard"] .portfolio-tag-interesado {
  color: #ffe7ad !important;
  background: rgba(240,198,109,.11) !important;
  border-color: rgba(240,198,109,.26) !important;
}
body[data-page="dashboard"] .portfolio-follow-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 16px;
  color: #dce8e2;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(116,232,191,.12);
  font-size: 12px;
  line-height: 1.45;
}
body[data-page="dashboard"] .cartera-follow-backdrop {
  position: fixed;
  inset: 0;
  z-index: 7900;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(8px);
}
body[data-page="dashboard"] .cartera-follow-backdrop[hidden],
body[data-page="dashboard"] .cartera-follow-modal[hidden] {
  display: none !important;
}
body[data-page="dashboard"] .cartera-follow-modal {
  position: fixed;
  z-index: 7901;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(620px, calc(100vw - 28px));
  max-height: min(88dvh, 760px);
  overflow: auto;
  padding: 26px;
  border: 1px solid rgba(116,232,191,.20);
  border-radius: 28px;
  color: var(--ui-text);
  background: linear-gradient(160deg, rgba(13,24,20,.98), rgba(6,11,9,.99));
  box-shadow: 0 36px 110px rgba(0,0,0,.58);
}
body[data-page="dashboard"] .cartera-follow-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(116,232,191,.14);
  border-radius: 15px;
  color: #9fb4ab;
  background: rgba(255,255,255,.04);
  display: grid;
  place-items: center;
  cursor: pointer;
}
body[data-page="dashboard"] .cartera-follow-close:hover {
  color: #74e8bf;
  border-color: rgba(116,232,191,.28);
}
body[data-page="dashboard"] .cartera-follow-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
body[data-page="dashboard"] .cartera-follow-form header {
  padding-right: 46px;
  margin-bottom: 18px;
}
body[data-page="dashboard"] .cartera-follow-form h2 {
  margin: 2px 0 6px;
  color: var(--ui-text);
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -.05em;
}
body[data-page="dashboard"] .cartera-follow-form header span {
  color: #9fb4ab;
  font-size: 13px;
  line-height: 1.45;
}
body[data-page="dashboard"] .cartera-follow-form footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
body[data-page="dashboard"].cartera-follow-open {
  overflow: hidden;
}
@media (max-width: 640px) {
  body[data-page="dashboard"] .cartera-follow-modal {
    padding: 22px 16px;
    border-radius: 24px;
  }
  body[data-page="dashboard"] .cartera-follow-form footer {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   OPERACIÓN PRO RC1
   - Soporte con filtros, prioridad y WhatsApp a proveedor.
   - Reportes con resumen ejecutivo copiable.
   ============================================================ */
body[data-page="dashboard"] .reports-executive-card {
  padding: clamp(18px, 2vw, 24px) !important;
}
body[data-page="dashboard"] .reports-executive-summary {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(116,232,191,.14);
  border-radius: 18px;
  background: rgba(255,255,255,.035);
}
body[data-page="dashboard"] .reports-executive-summary strong {
  color: #74e8bf;
  font-size: 15px;
}
body[data-page="dashboard"] .reports-executive-summary span {
  color: #dce8e2;
  font-size: 12.5px;
  line-height: 1.45;
}
body[data-page="dashboard"] .support-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
body[data-page="dashboard"] .support-filter-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(116,232,191,.14);
  border-radius: 999px;
  color: #9fb4ab;
  background: rgba(255,255,255,.04);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
body[data-page="dashboard"] .support-filter-tabs button.active,
body[data-page="dashboard"] .support-filter-tabs button:hover {
  color: #03140d;
  background: #74e8bf;
  border-color: rgba(116,232,191,.45);
}
body[data-page="dashboard"] .support-priority-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -2px 0 10px;
}
body[data-page="dashboard"] .support-priority-row span {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #9fb4ab;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
  font-weight: 900;
}
body[data-page="dashboard"] .support-priority {
  color: #03140d !important;
  background: #74e8bf !important;
  border-color: rgba(116,232,191,.45) !important;
}
body[data-page="dashboard"] .support-priority-urgente {
  color: #fff4f4 !important;
  background: #ef8290 !important;
  border-color: rgba(239,130,144,.45) !important;
}
body[data-page="dashboard"] .support-priority-proveedor {
  color: #201606 !important;
  background: #f0c66d !important;
  border-color: rgba(240,198,109,.45) !important;
}
body[data-page="dashboard"] .support-priority-cerrado {
  color: #dce8e2 !important;
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
}
@media (max-width: 720px) {
  body[data-page="dashboard"] .support-filter-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  body[data-page="dashboard"] .support-filter-tabs button {
    width: 100%;
  }
}
@media (max-width: 420px) {
  body[data-page="dashboard"] .support-filter-tabs {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   REPORTES MENSUALES PRO RC1
   - Periodos rápidos y descarga de resumen ejecutivo.
   ============================================================ */
body[data-page="dashboard"] .reports-quick-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
body[data-page="dashboard"] .reports-quick-periods button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(116,232,191,.14);
  border-radius: 999px;
  color: #9fb4ab;
  background: rgba(255,255,255,.04);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}
body[data-page="dashboard"] .reports-quick-periods button:hover,
body[data-page="dashboard"] .reports-quick-periods button.active {
  color: #03140d;
  background: #74e8bf;
  border-color: rgba(116,232,191,.45);
  transform: translateY(-1px);
}
body[data-page="dashboard"] .reports-executive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
@media (max-width: 720px) {
  body[data-page="dashboard"] .reports-quick-periods,
  body[data-page="dashboard"] .reports-executive-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  body[data-page="dashboard"] .reports-quick-periods button,
  body[data-page="dashboard"] .reports-executive-actions .button {
    width: 100%;
    justify-content: center;
  }
}
@media (max-width: 420px) {
  body[data-page="dashboard"] .reports-quick-periods,
  body[data-page="dashboard"] .reports-executive-actions {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   RENDIMIENTO Y CÓDIGO ORDENADO RC1
   - Menos parpadeo al recargar secciones.
   - Animaciones más ligeras en equipos lentos/móvil.
   - Contención visual segura para tarjetas.
   ============================================================ */
body[data-page="dashboard"] .dashboard-card,
body[data-page="dashboard"] .client-card,
body[data-page="dashboard"] .provider-card,
body[data-page="dashboard"] .portfolio-client-card,
body[data-page="dashboard"] .support-case-card,
body[data-page="dashboard"] .reports-card,
body[data-page="dashboard"] .backup-card {
  contain: layout paint;
}

body[data-page="dashboard"] .app-view[hidden] * {
  animation: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="dashboard"] *,
  body[data-page="dashboard"] *::before,
  body[data-page="dashboard"] *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 760px) {
  body[data-page="dashboard"] .reveal,
  body[data-page="dashboard"] .home-summary-card,
  body[data-page="dashboard"] .dashboard-card {
    animation-duration: .16s !important;
  }
  body[data-page="dashboard"] .dashboard-card,
  body[data-page="dashboard"] .client-card,
  body[data-page="dashboard"] .provider-card,
  body[data-page="dashboard"] .portfolio-client-card {
    box-shadow: 0 12px 32px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.03) !important;
  }
}

/* ============================================================
   FICHA CLIENTE PRO RC1
   - Ficha más clara, compacta y profesional.
   - Servicios con acciones Renovar / Soporte / Editar.
   - Mejor adaptación en celular.
   ============================================================ */
body[data-page="dashboard"] .detail-modal {
  width: min(1120px, calc(100vw - 30px)) !important;
}
body[data-page="dashboard"] .detail-content {
  display: grid !important;
  gap: 16px !important;
}
body[data-page="dashboard"] .client-executive-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 16px !important;
  padding: clamp(16px, 2vw, 22px) !important;
  border: 1px solid rgba(116,232,191,.18) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.16), transparent 36%),
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.025)) !important;
}
body[data-page="dashboard"] .client-executive-main {
  min-width: 0 !important;
}
body[data-page="dashboard"] .client-executive-main h3 {
  font-size: clamp(24px, 3.5vw, 38px) !important;
  line-height: .98 !important;
  letter-spacing: -.06em !important;
}
body[data-page="dashboard"] .client-executive-main small {
  color: #9fb4ab !important;
  line-height: 1.45 !important;
}
body[data-page="dashboard"] .client-executive-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  max-width: 430px !important;
}
body[data-page="dashboard"] .client-executive-actions button,
body[data-page="dashboard"] .ficha-pro-service-actions button,
body[data-page="dashboard"] .ficha-pro-service-actions a {
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 950 !important;
}
body[data-page="dashboard"] .premium-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
}
body[data-page="dashboard"] .premium-summary article {
  min-height: 92px !important;
  padding: 14px !important;
  border-radius: 18px !important;
}
body[data-page="dashboard"] .ficha-pro-title {
  margin-top: 2px !important;
}
body[data-page="dashboard"] .ficha-pro-service {
  display: grid !important;
  gap: 12px !important;
  padding: clamp(15px, 1.8vw, 20px) !important;
  border-radius: 22px !important;
}
body[data-page="dashboard"] .ficha-pro-service header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 12px !important;
}
body[data-page="dashboard"] .ficha-pro-service header strong {
  font-size: 16px !important;
  line-height: 1.25 !important;
}
body[data-page="dashboard"] .ficha-pro-service-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 9px !important;
}
body[data-page="dashboard"] .ficha-pro-mini {
  min-width: 0 !important;
  padding: 11px !important;
  border: 1px solid rgba(116,232,191,.12) !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.035) !important;
}
body[data-page="dashboard"] .ficha-pro-mini span {
  display: block !important;
  margin-bottom: 5px !important;
  color: #9fb4ab !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}
body[data-page="dashboard"] .ficha-pro-mini strong {
  display: block !important;
  color: #f3faf6 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  overflow-wrap: anywhere !important;
}
body[data-page="dashboard"] .ficha-pro-service-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
}
body[data-page="dashboard"] .ficha-pro-service-actions [data-support-from-service] {
  color: #03140d !important;
  background: #f0c66d !important;
  border-color: rgba(240,198,109,.45) !important;
}
body[data-page="dashboard"] .ficha-pro-history ul {
  max-height: 420px !important;
  overflow: auto !important;
  padding-right: 4px !important;
}

/* Formulario de ficha más respirado */
body[data-page="dashboard"] .client-modal {
  width: min(1120px, calc(100vw - 26px)) !important;
}
body[data-page="dashboard"] .client-modal-header,
body[data-page="dashboard"] .client-modal-footer {
  border-color: rgba(116,232,191,.14) !important;
}
body[data-page="dashboard"] .client-form-section,
body[data-page="dashboard"] .service-form-card {
  border-color: rgba(116,232,191,.16) !important;
}
body[data-page="dashboard"] .service-card-heading {
  position: sticky !important;
  top: -1px !important;
  z-index: 2 !important;
  padding-top: 2px !important;
  padding-bottom: 10px !important;
  background: linear-gradient(180deg, rgba(8,17,14,.98), rgba(8,17,14,.88)) !important;
  backdrop-filter: blur(10px) !important;
}
body[data-page="dashboard"] .service-block {
  border-radius: 18px !important;
}
body[data-page="dashboard"] .service-block-title span {
  letter-spacing: -.01em !important;
}

/* Responsive */
@media (max-width: 980px) {
  body[data-page="dashboard"] .client-executive-card {
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .client-executive-actions {
    justify-content: stretch !important;
    max-width: none !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  body[data-page="dashboard"] .client-executive-actions button {
    width: 100% !important;
  }
  body[data-page="dashboard"] .premium-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  body[data-page="dashboard"] .ficha-pro-service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 620px) {
  body[data-page="dashboard"] .detail-modal,
  body[data-page="dashboard"] .client-modal {
    width: calc(100vw - 16px) !important;
    border-radius: 24px !important;
  }
  body[data-page="dashboard"] .client-executive-actions,
  body[data-page="dashboard"] .premium-summary,
  body[data-page="dashboard"] .ficha-pro-service-grid {
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .ficha-pro-service header {
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .ficha-pro-service-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }
  body[data-page="dashboard"] .ficha-pro-service-actions button,
  body[data-page="dashboard"] .ficha-pro-service-actions a {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }
  body[data-page="dashboard"] .service-card-heading {
    position: static !important;
  }
}

/* ============================================================
   WHATSAPP PLANTILLAS PRO RC1
   - Enviar accesos usa la plantilla original de entrega.
   - La opción de accesos queda visualmente clara.
   ============================================================ */
body[data-page="dashboard"] .whatsapp-client-options [data-whatsapp-action="welcome"] {
  border-color: rgba(116,232,191,.30) !important;
  background:
    radial-gradient(circle at 92% 0%, rgba(116,232,191,.15), transparent 34%),
    rgba(116,232,191,.055) !important;
}
body[data-page="dashboard"] .whatsapp-client-options [data-whatsapp-action="welcome"] b::after {
  content: " · plantilla de ficha";
  color: #74e8bf;
  font-size: 10px;
  font-weight: 900;
}
@media (max-width: 520px) {
  body[data-page="dashboard"] .whatsapp-client-options [data-whatsapp-action="welcome"] b::after {
    display: block;
    margin-top: 3px;
  }
}
