/* FINVERZ CRM V2.7.7 · Corporate Executive Interface */
:root {
  --fv277-ink: #071a33;
  --fv277-navy: #08264d;
  --fv277-navy-2: #0d376b;
  --fv277-blue: #1d5fd1;
  --fv277-cyan: #2aa7c9;
  --fv277-silver: #d9e3ee;
  --fv277-canvas: #f2f5f9;
  --fv277-panel: rgba(255, 255, 255, 0.96);
  --fv277-muted: #66778c;
  --fv277-line: #dce4ed;
  --fv277-shadow: 0 12px 34px rgba(7, 26, 51, 0.08);
  --fv277-shadow-strong: 0 18px 48px rgba(7, 26, 51, 0.14);
  color: var(--fv277-ink);
  background: var(--fv277-canvas);
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
}

html {
  background: var(--fv277-canvas);
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 88% 4%, rgba(29, 95, 209, 0.08), transparent 27rem),
    radial-gradient(circle at 16% 96%, rgba(42, 167, 201, 0.07), transparent 25rem),
    var(--fv277-canvas);
}

::selection {
  color: #fff;
  background: var(--fv277-blue);
}

button,
a,
input,
select,
textarea,
summary {
  outline-offset: 3px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(42, 167, 201, 0.36);
}

.app-shell {
  background:
    linear-gradient(rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.38)),
    radial-gradient(circle at 100% 0, rgba(29, 95, 209, 0.09), transparent 32rem),
    var(--fv277-canvas);
}

.topbar {
  height: 88px;
  min-height: 88px;
  border-bottom: 1px solid rgba(8, 38, 77, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 30px rgba(7, 26, 51, 0.06);
  backdrop-filter: blur(18px) saturate(150%);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--fv277-navy), var(--fv277-blue) 52%, var(--fv277-cyan));
  opacity: 0.88;
}

.topbar-brand-group .brand {
  border-right-color: rgba(8, 38, 77, 0.13);
}

.brand-compact .brand-logo {
  height: 61px;
  filter: drop-shadow(0 4px 10px rgba(7, 26, 51, 0.1));
}

.crm-version {
  color: var(--fv277-navy);
  letter-spacing: 0.02em;
}

.crm-version strong {
  color: var(--fv277-blue);
}

.user-avatar {
  background: linear-gradient(145deg, var(--fv277-navy), var(--fv277-blue));
  box-shadow: 0 8px 18px rgba(8, 38, 77, 0.2);
}

.user-menu strong {
  color: var(--fv277-navy);
}

.app-workspace {
  grid-template-columns: 258px minmax(0, 1fr);
  min-height: calc(100vh - 88px);
}

.sidebar {
  top: 88px;
  height: calc(100vh - 88px);
  padding: 24px 15px 20px;
  border-right: 0;
  background:
    radial-gradient(circle at 0 100%, rgba(42, 167, 201, 0.16), transparent 17rem),
    linear-gradient(175deg, #071b35, #0a2b55 58%, #092447);
  box-shadow: 10px 0 32px rgba(7, 26, 51, 0.08);
}

.main-tabs {
  gap: 8px;
}

.main-tab {
  min-height: 48px;
  color: rgba(240, 246, 255, 0.76);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 720;
  letter-spacing: 0.005em;
}

.main-tab svg {
  color: rgba(129, 190, 255, 0.92);
}

.main-tab:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.main-tab.active {
  color: var(--fv277-navy);
  border-color: rgba(255, 255, 255, 0.72);
  background: linear-gradient(135deg, #fff, #eef5ff);
  box-shadow: 0 10px 24px rgba(0, 8, 22, 0.25);
}

.main-tab.active svg {
  color: var(--fv277-blue);
}

.sidebar-support {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.sidebar-support svg {
  color: #74c7df;
}

.sidebar-support strong {
  color: #fff;
}

.sidebar-support span {
  color: rgba(233, 242, 252, 0.7);
}

.dashboard {
  max-width: 1660px;
  padding: 34px clamp(24px, 3.3vw, 52px) 64px;
}

.welcome-row {
  position: relative;
  overflow: hidden;
  margin-bottom: 25px;
  padding: 22px 24px;
  border: 1px solid rgba(8, 38, 77, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 255, 0.94)),
    #fff;
  box-shadow: var(--fv277-shadow);
}

.welcome-row::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -45px;
  width: 240px;
  height: 190px;
  border: 34px solid rgba(29, 95, 209, 0.055);
  border-radius: 50%;
  transform: rotate(-14deg);
  pointer-events: none;
}

.welcome-row h1 {
  position: relative;
  color: var(--fv277-ink);
  font-size: clamp(27px, 3vw, 38px);
  letter-spacing: -0.025em;
}

.welcome-row p,
.module-header p,
.section-heading p {
  color: var(--fv277-muted);
}

.eyebrow {
  color: var(--fv277-blue);
  letter-spacing: 0.14em;
}

.refresh-button {
  position: relative;
  z-index: 1;
}

.button {
  border-radius: 10px;
  transition: transform 0.14s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--fv277-navy), var(--fv277-blue));
  box-shadow: 0 7px 16px rgba(29, 95, 209, 0.18);
}

.button-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0b3264, #2470e7);
  box-shadow: 0 10px 22px rgba(29, 95, 209, 0.24);
}

.button-secondary {
  color: var(--fv277-navy);
  border-color: #cfdae7;
  background: rgba(255, 255, 255, 0.9);
}

.button-secondary:hover:not(:disabled) {
  border-color: #9db4ce;
  background: #f5f9fe;
}

.field {
  color: #35475c;
}

.field input,
.field textarea,
.field select {
  min-height: 45px;
  border-color: #cfdae6;
  border-radius: 10px;
  background: #fbfdff;
}

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: #aebfd2;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--fv277-blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(29, 95, 209, 0.1);
}

.metrics-grid,
.metrics-wide {
  gap: 16px;
}

.metric-card {
  min-height: 124px;
  padding: 20px 19px 18px 23px;
  border: 1px solid var(--fv277-line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(29, 95, 209, 0.08), transparent 8rem),
    #fff;
  box-shadow: var(--fv277-shadow);
}

.metric-card::before {
  width: 5px;
  background: linear-gradient(180deg, var(--fv277-blue), var(--fv277-cyan));
}

.metric-card:nth-child(2n)::before,
.metric-card:nth-child(5n)::before {
  background: linear-gradient(180deg, var(--fv277-navy), var(--fv277-blue));
}

.metric-card span {
  color: #65778c;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  font-size: 11px;
}

.metric-card strong {
  color: var(--fv277-ink);
  font-size: 30px;
  letter-spacing: -0.025em;
}

.metric-button:hover {
  border-color: #abc0d7;
  box-shadow: var(--fv277-shadow-strong);
}

.metric-critical {
  background:
    radial-gradient(circle at 100% 0, rgba(191, 35, 53, 0.08), transparent 8rem),
    #fff;
}

.metric-critical::before {
  background: linear-gradient(180deg, #d94a5b, #a91f31);
}

.panel-card,
.prospect-card,
.filters-bar,
.detail-section,
.modal,
.v25-security-card,
.v275-portfolio-focus {
  border-color: var(--fv277-line);
  border-radius: 16px;
  background: var(--fv277-panel);
  box-shadow: var(--fv277-shadow);
}

.panel-card,
.prospect-card {
  transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.panel-card:hover,
.prospect-card:hover {
  border-color: #bdcde0;
  box-shadow: var(--fv277-shadow-strong);
}

.prospect-card:hover {
  transform: translateY(-2px);
}

.panel-title {
  border-bottom-color: #e7edf4;
}

.module-header {
  margin-bottom: 20px;
}

.module-header h2 {
  color: var(--fv277-ink);
  letter-spacing: -0.02em;
}

.count-badge {
  border-radius: 12px;
  background: linear-gradient(145deg, var(--fv277-navy), var(--fv277-blue));
  box-shadow: 0 8px 20px rgba(8, 38, 77, 0.18);
}

.filters-bar {
  position: relative;
  overflow: hidden;
  border-top: 0;
  padding: 19px;
}

.filters-bar::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--fv277-navy), var(--fv277-blue), var(--fv277-cyan));
}

.card-head h2,
.panel-card > h2,
.panel-title h2,
.detail-section > h3,
.modal-head h2 {
  color: var(--fv277-ink);
}

.base-origin-strip {
  border-color: #d9e4ef;
  background: linear-gradient(135deg, #f6f9fd, #eef5fb);
}

.status-badge,
.code-badge,
.interest,
.incident-badge,
.channel-chip,
.priority {
  letter-spacing: 0.025em;
}

.code-badge {
  background: linear-gradient(135deg, var(--fv277-navy), var(--fv277-blue));
}

.status-badge,
.status-free,
.channel-chip {
  color: #174f9f;
  background: #eaf2ff;
}

.work-base-banner {
  border: 1px solid #cbd9e8;
  border-left: 5px solid var(--fv277-blue);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(42, 167, 201, 0.1), transparent 15rem),
    linear-gradient(135deg, #fff, #f3f8fd);
  box-shadow: var(--fv277-shadow);
}

.base-stats span {
  border-color: #d4e0ec;
  background: rgba(255, 255, 255, 0.92);
}

.base-stats b {
  color: var(--fv277-blue);
}

.v25-multiselect {
  overflow: hidden;
  border: 1px solid #cedae7;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.v25-multiselect[open] {
  border-color: #9cb5d1;
  box-shadow: 0 12px 28px rgba(7, 26, 51, 0.12);
}

.v25-multiselect summary {
  min-height: 45px;
  padding: 12px 14px;
  color: var(--fv277-navy);
  background: linear-gradient(135deg, #fff, #f6f9fd);
}

.v25-base-list {
  border-top-color: #e0e8f1;
  background: #f8fafc;
}

.v25-check-row {
  border-radius: 10px;
  transition: background 0.14s ease, transform 0.14s ease;
}

.v25-check-row:hover {
  background: #edf4fc;
}

.v25-access-ok {
  border: 1px solid #b9dfcd;
  border-radius: 11px;
  background: linear-gradient(135deg, #effbf5, #e8f8f0);
}

.v275-portfolio-focus {
  border-left: 5px solid var(--fv277-blue);
  background:
    radial-gradient(circle at 100% 0, rgba(42, 167, 201, 0.11), transparent 13rem),
    linear-gradient(135deg, #fff, #f1f7fd);
}

.modal-backdrop,
.v26-overlay,
.v23-overlay,
.v24-overlay,
.v275-status-overlay {
  background: rgba(3, 17, 35, 0.7);
  backdrop-filter: blur(9px);
}

.modal,
.v26-modal,
.v23-modal,
.v24-modal,
.v275-status-dialog {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  box-shadow: 0 34px 95px rgba(2, 15, 32, 0.34);
}

.auth-shell {
  background:
    radial-gradient(circle at 85% 12%, rgba(42, 167, 201, 0.25), transparent 24rem),
    radial-gradient(circle at 10% 88%, rgba(29, 95, 209, 0.3), transparent 26rem),
    linear-gradient(145deg, #041326, #082a53 62%, #0a3866);
}

.auth-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-top: 0;
  border-radius: 22px;
  box-shadow: 0 34px 90px rgba(0, 8, 20, 0.38);
}

.auth-card::before {
  content: "";
  display: block;
  height: 4px;
  margin: -32px -32px 28px;
  background: linear-gradient(90deg, var(--fv277-navy), var(--fv277-blue), var(--fv277-cyan));
}

/* Transición visual de módulo: no bloquea clics ni agrega espera operativa. */
#finverz-v277-transition {
  position: fixed;
  inset: 0;
  z-index: 12050;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(242, 246, 251, 0.3);
  backdrop-filter: blur(1.5px);
  transition: opacity 70ms ease, visibility 0s linear 320ms;
}

#finverz-v277-transition.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 65ms ease;
}

.fv277-transition-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 228px;
  padding: 12px 18px 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 0 0, rgba(42, 167, 201, 0.28), transparent 8rem),
    linear-gradient(135deg, #061a34, #0b376b);
  box-shadow: 0 20px 55px rgba(4, 20, 40, 0.3);
}

.fv277-transition-copy {
  display: grid;
  gap: 2px;
}

.fv277-transition-copy strong {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.fv277-transition-copy span {
  color: rgba(235, 245, 255, 0.7);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.fv277-dragonfly-stage {
  position: relative;
  width: 78px;
  height: 47px;
  flex: 0 0 78px;
  overflow: hidden;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 1px rgba(8, 38, 77, 0.08);
  perspective: 240px;
}

.fv277-dragonfly-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.82) 48%, transparent 70%);
  transform: translateX(-120%);
}

#finverz-v277-transition.is-active .fv277-dragonfly-stage::after {
  animation: fv277Shine 310ms ease-out;
}

.fv277-dragonfly-logo {
  width: 88px;
  height: auto;
  max-width: none;
  margin: 0 0 0 -5px;
  transform-origin: 50% 38%;
  filter: contrast(1.08) saturate(0.9);
}

#finverz-v277-transition.is-active .fv277-dragonfly-logo {
  animation: fv277Dragonfly 310ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

@keyframes fv277Dragonfly {
  0% {
    opacity: 0;
    transform: translateY(4px) rotateY(0deg) scale(0.84);
  }
  42% {
    opacity: 1;
    transform: translateY(-2px) rotateY(185deg) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateY(360deg) scale(1);
  }
}

@keyframes fv277Shine {
  to {
    transform: translateX(120%);
  }
}

@media (max-width: 1100px) {
  .app-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .topbar {
    height: 76px;
    min-height: 76px;
  }

  .app-workspace {
    min-height: calc(100vh - 76px);
  }

  .sidebar {
    top: 76px;
    height: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(90deg, #071b35, #0a2f5c);
    box-shadow: 0 8px 22px rgba(7, 26, 51, 0.14);
  }

  .main-tab {
    min-height: 42px;
  }

  .welcome-row {
    padding: 19px;
  }
}

@media (max-width: 620px) {
  .dashboard {
    padding: 18px 12px 46px;
  }

  .welcome-row {
    border-radius: 15px;
  }

  .metric-card {
    min-height: 110px;
    padding: 17px 13px 15px 17px;
  }

  .metric-card strong {
    font-size: 24px;
  }

  .panel-card,
  .prospect-card,
  .filters-bar,
  .detail-section,
  .v25-security-card,
  .v275-portfolio-focus {
    border-radius: 14px;
  }

  .fv277-transition-card {
    min-width: 0;
    width: min(100%, 286px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #finverz-v277-transition {
    display: none !important;
  }
}
