:root {
  --color-primary: #4f789d;
  --color-primary-soft: #dbe8f4;
  --color-secondary: #148ee7;
  --color-secondary-dark: #0c62a6;
  --color-background: #dfe5eb;
  --color-surface: #e9eef3;
  --color-surface-strong: #f4f7fa;
  --color-surface-alt: #d8e0e8;
  --color-border: rgba(124, 141, 158, 0.48);
  --color-border-strong: rgba(94, 111, 129, 0.62);
  --color-text-primary: #172330;
  --color-text-secondary: #516173;
  --color-text-muted: #748294;
  --color-success: #3e9d70;
  --color-success-soft: #dff2ea;
  --color-warning: #e09835;
  --color-warning-soft: #fff0d8;
  --color-danger: #dc5350;
  --color-danger-soft: #fae4e3;
  --color-info: #3d7ead;
  --color-info-soft: #dcebf6;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --shadow-soft: 14px 16px 28px rgba(103, 119, 136, 0.28), -10px -10px 22px rgba(255, 255, 255, 0.72);
  --shadow-subtle: 7px 8px 16px rgba(103, 119, 136, 0.22), -6px -6px 14px rgba(255, 255, 255, 0.76);
  --shadow-raised: 10px 12px 20px rgba(84, 101, 119, 0.3), -8px -8px 18px rgba(255, 255, 255, 0.82);
  --shadow-pressed: inset 6px 7px 13px rgba(103, 119, 136, 0.26), inset -6px -6px 12px rgba(255, 255, 255, 0.82);
  --shadow-blue: 0 0 0 2px rgba(65, 194, 255, 0.7), 0 8px 18px rgba(0, 125, 221, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --sidebar-width: 252px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 74px;
  --transition-fast: 160ms ease;
}

body {
  color: var(--color-text-primary);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.92), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(190, 204, 219, 0.82), transparent 30%),
    linear-gradient(135deg, #eef3f7 0%, #d8e0e8 48%, #cbd5df 100%);
  background-attachment: fixed;
}

.workspace,
.main-content {
  background: transparent !important;
}

.main-content {
  padding: 22px 24px 34px;
}

.sidebar {
  margin: 12px 0 12px 12px;
  height: calc(100vh - 24px);
  color: var(--color-text-primary);
  background: linear-gradient(145deg, #f2f5f8, #d5dde6) !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-soft) !important;
  overflow-x: hidden;
  overflow-y: auto;
}

.brand {
  min-height: var(--topbar-height);
  padding: 14px 18px;
  color: var(--color-text-primary);
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.brand-mark,
.nav-icon,
.avatar,
.activity-icon,
.alert-icon,
.kpi-icon {
  color: #405468 !important;
  background: linear-gradient(145deg, #f7fafc, #ccd6e0) !important;
  border: 1px solid rgba(255, 255, 255, 0.78) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-subtle) !important;
}

.brand-copy strong,
.brand-copy span,
.sidebar-user-copy strong,
.sidebar-user-copy span {
  color: var(--color-text-primary) !important;
}

.sidebar-nav {
  border: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 2px 10px 0;
}

.nav-section-title {
  color: var(--color-text-muted) !important;
  background: transparent !important;
  border: 0 !important;
  font-weight: 800;
}

.nav-item {
  min-height: 48px;
  margin: 4px 10px;
  padding: 0 12px;
  color: var(--color-text-primary) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: var(--radius-md) !important;
  box-shadow: none !important;
}

.nav-item:hover,
.nav-item:focus-visible {
  background: linear-gradient(145deg, #f5f8fb, #d4dde6) !important;
  box-shadow: var(--shadow-subtle) !important;
}

.nav-item.active {
  color: #ffffff !important;
  background: linear-gradient(145deg, #6cccf5, #0875d4) !important;
  border: 1px solid rgba(255, 255, 255, 0.66) !important;
  box-shadow: var(--shadow-blue) !important;
}

.nav-item.active .nav-icon {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.16) !important;
  box-shadow: inset 3px 3px 8px rgba(0, 52, 104, 0.22), inset -3px -3px 8px rgba(255, 255, 255, 0.26) !important;
}

.nav-badge,
.notification-count {
  border-radius: 9px !important;
  box-shadow: var(--shadow-subtle) !important;
}

.sidebar-user {
  margin: auto 12px 12px;
  padding: 12px;
  background: linear-gradient(145deg, #edf2f6, #d2dbe5) !important;
  border: 1px solid rgba(255, 255, 255, 0.76) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-subtle) !important;
}

.topbar {
  top: 12px;
  margin: 12px 12px 0;
  min-height: var(--topbar-height);
  color: var(--color-text-primary);
  background: rgba(232, 238, 244, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.78) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(20px);
}

.section-title p,
.section-title h1 {
  color: var(--color-text-primary) !important;
}

.section-title h1 {
  font-weight: 900;
}

.global-search input,
input,
select,
textarea,
.view-select,
.filter-control select,
.filter-control input,
.clients-search input,
.follow-ups-search input,
.tasks-search input,
.visits-search input,
.negotiations-search input,
.report-search input {
  color: var(--color-text-primary) !important;
  background: linear-gradient(145deg, #e3eaf1, #f4f8fb) !important;
  border: 1.5px solid rgba(126, 145, 165, 0.5) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-pressed) !important;
  outline: none;
}

textarea {
  border-radius: var(--radius-lg) !important;
}

input:focus,
select:focus,
textarea:focus,
.view-select:focus,
.filter-control select:focus,
.filter-control input:focus,
.global-search input:focus {
  border-color: #50bdec !important;
  box-shadow: var(--shadow-pressed), 0 0 0 3px rgba(70, 190, 243, 0.45) !important;
}

.icon-button,
.user-button,
.primary-action,
.secondary-action,
.ghost-action,
.mini-button,
.quick-tab,
.alert-tab,
.analytics-tab,
.link-button {
  border-radius: var(--radius-md) !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  box-shadow: var(--shadow-subtle) !important;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.icon-button,
.user-button,
.secondary-action,
.ghost-action,
.mini-button,
.quick-tab,
.alert-tab,
.analytics-tab {
  color: var(--color-text-primary) !important;
  background: linear-gradient(145deg, #f6f9fb, #d3dce6) !important;
}

.primary-action,
.kpi-card.featured,
.analytics-tab.active,
.alert-tab.active,
.quick-tab.active {
  color: #ffffff !important;
  background: linear-gradient(145deg, #62d5ff, #0b79d7) !important;
  border-color: rgba(255, 255, 255, 0.72) !important;
  box-shadow: var(--shadow-blue) !important;
}

.topbar .primary-action,
.topbar .view-select,
.topbar .icon-button,
.topbar .user-button {
  min-height: 46px;
}

.primary-action:hover,
.secondary-action:hover,
.ghost-action:hover,
.mini-button:hover,
.icon-button:hover,
.user-button:hover,
.quick-tab:hover,
.alert-tab:hover,
.analytics-tab:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-raised) !important;
}

.primary-action:active,
.secondary-action:active,
.ghost-action:active,
.mini-button:active,
.icon-button:active,
.user-button:active,
.quick-tab:active,
.alert-tab:active,
.analytics-tab:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-pressed) !important;
}

.card,
.dashboard-hero,
.clients-hero,
.client-detail-hero,
.follow-ups-hero,
.pipeline-hero,
.reports-hero,
.tasks-hero,
.visits-hero,
.negotiations-hero,
.alerts-hero,
.analytics-hero,
.clients-toolbar,
.follow-ups-toolbar,
.pipeline-toolbar,
.report-toolbar,
.tasks-toolbar,
.visits-toolbar,
.negotiations-toolbar,
.dashboard-filters,
.alerts-filters,
.analytics-filters,
.task-card,
.visit-card,
.negotiation-card,
.pipeline-card,
.opportunity-card,
.client-card,
.property-card,
.detail-alert-card,
.alert-smart-card,
.alert-detail-drawer,
.alert-group-card,
.analytics-kpi,
.metric-tile,
.forecast-card,
.reports-saved-card {
  color: var(--color-text-primary);
  background: linear-gradient(145deg, #f3f7fa, #d8e1ea) !important;
  border: 1px solid rgba(255, 255, 255, 0.76) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(18px);
}

.dashboard-hero,
.clients-hero,
.client-detail-hero,
.follow-ups-hero,
.pipeline-hero,
.reports-hero,
.tasks-hero,
.visits-hero,
.negotiations-hero,
.alerts-hero,
.analytics-hero {
  border-top: 0 !important;
}

.card-header {
  background: rgba(255, 255, 255, 0.2) !important;
  border-bottom: 1px solid rgba(126, 145, 165, 0.28) !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.card-header h2,
.card-header h3,
.dashboard-hero h2,
.clients-hero h2,
.client-detail-hero h2,
.follow-ups-hero h2,
.pipeline-hero h2,
.reports-hero h2,
.tasks-hero h2,
.visits-hero h2,
.negotiations-hero h2,
.alerts-hero h2,
.analytics-hero h2 {
  color: var(--color-text-primary) !important;
  font-weight: 900;
}

.card-header p,
.dashboard-hero p,
.clients-hero p,
.client-detail-hero p,
.follow-ups-hero p,
.pipeline-hero p,
.reports-hero p,
.tasks-hero p,
.visits-hero p,
.negotiations-hero p,
.alerts-hero p,
.analytics-hero p,
.muted,
.meta-row {
  color: var(--color-text-secondary) !important;
}

.badge {
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 11px !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  box-shadow: 3px 4px 9px rgba(103, 119, 136, 0.18), -3px -3px 8px rgba(255, 255, 255, 0.75) !important;
}

.badge.info,
.badge.neutral {
  color: #31536a !important;
  background: linear-gradient(145deg, #eef6fb, #cfe0ec) !important;
}

.badge.success {
  color: #236a4c !important;
  background: linear-gradient(145deg, #effaf4, #cce9da) !important;
}

.badge.warning {
  color: #875516 !important;
  background: linear-gradient(145deg, #fff7e8, #efd9b8) !important;
}

.badge.danger {
  color: #9b2f2c !important;
  background: linear-gradient(145deg, #fff1f0, #efc9c8) !important;
}

table,
.clients-table,
.follow-ups-table,
.tasks-table,
.visits-table,
.negotiations-table,
.report-table,
.analytics-table,
.pipeline-table {
  background: transparent !important;
  border-collapse: separate !important;
  border-spacing: 0 8px !important;
}

th,
.clients-table th,
.follow-ups-table th,
.tasks-table th,
.visits-table th,
.negotiations-table th,
.report-table th,
.analytics-table th,
.pipeline-table th {
  color: var(--color-text-secondary) !important;
  background: transparent !important;
  border: 0 !important;
}

td,
.clients-table td,
.follow-ups-table td,
.tasks-table td,
.visits-table td,
.negotiations-table td,
.report-table td,
.analytics-table td,
.pipeline-table td {
  background: rgba(244, 247, 250, 0.62) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.72) !important;
  border-bottom: 1px solid rgba(126, 145, 165, 0.24) !important;
  box-shadow: 4px 5px 10px rgba(103, 119, 136, 0.12), -3px -3px 8px rgba(255, 255, 255, 0.58);
}

td:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.72) !important;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
}

td:last-child {
  border-right: 1px solid rgba(126, 145, 165, 0.24) !important;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
}

tbody tr:hover td,
.clients-table tbody tr:hover td {
  background: rgba(234, 243, 251, 0.92) !important;
  box-shadow: var(--shadow-subtle) !important;
}

.dropdown-menu,
.dropdown-panel,
.modal,
.toast {
  background: rgba(237, 243, 248, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.78) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(18px);
}

.dropdown-menu button:hover,
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.42) !important;
  box-shadow: var(--shadow-pressed) !important;
}

.modal-backdrop {
  background: rgba(52, 67, 82, 0.34) !important;
  backdrop-filter: blur(5px);
}

.empty-state {
  color: var(--color-text-secondary) !important;
  background: rgba(241, 246, 250, 0.66) !important;
  border: 1.5px dashed rgba(126, 145, 165, 0.58) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-pressed) !important;
}

.kpi-card,
.analytics-kpi,
.alert-kpi {
  min-height: 128px;
}

.kpi-value,
.analytics-kpi strong,
.alert-kpi strong,
.metric-tile strong {
  color: var(--color-primary) !important;
}

.pipeline-row-fill,
.chart-bar-fill,
.analytics-bar i,
.alert-bar-row i {
  background: linear-gradient(90deg, #5dd8ff, #0a75d7) !important;
  box-shadow: 0 0 14px rgba(33, 155, 233, 0.42);
}

.risk-cell,
.heat-cell,
.alert-mini-row,
.analytics-ranking article,
.analytics-root article,
.analytics-findings article,
.analytics-saved article,
.alert-group-card,
.alert-saved-views article {
  background: linear-gradient(145deg, #eef3f7, #d5dee8) !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-subtle) !important;
}

.alert-smart-card {
  border-left-width: 5px !important;
}

.alert-detail-drawer {
  top: 96px;
  right: 14px;
  max-height: calc(100vh - 112px);
  width: min(440px, calc(100vw - 28px));
}

.alert-detail-grid div {
  background: linear-gradient(145deg, #f5f8fb, #d5dee7) !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-subtle);
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: #d8e0e8;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(145deg, #f5f8fb, #aebdca);
  border: 2px solid #d8e0e8;
  border-radius: 999px;
}

*:focus-visible {
  outline: 3px solid rgba(70, 190, 243, 0.72) !important;
  outline-offset: 3px;
}

body,
body * {
  background-image: none !important;
}

body {
  background: #d8e0e8;
}

.sidebar {
  background: #d5dde6 !important;
}

.brand-mark,
.nav-icon,
.avatar,
.activity-icon,
.alert-icon,
.kpi-icon {
  background: #ccd6e0 !important;
}

.nav-item:hover,
.nav-item:focus-visible,
.sidebar-user,
.card,
.dashboard-hero,
.clients-hero,
.client-detail-hero,
.follow-ups-hero,
.pipeline-hero,
.reports-hero,
.tasks-hero,
.visits-hero,
.negotiations-hero,
.alerts-hero,
.analytics-hero,
.clients-toolbar,
.follow-ups-toolbar,
.pipeline-toolbar,
.report-toolbar,
.tasks-toolbar,
.visits-toolbar,
.negotiations-toolbar,
.dashboard-filters,
.alerts-filters,
.analytics-filters,
.task-card,
.visit-card,
.negotiation-card,
.pipeline-card,
.opportunity-card,
.client-card,
.property-card,
.detail-alert-card,
.alert-smart-card,
.alert-detail-drawer,
.alert-group-card,
.analytics-kpi,
.metric-tile,
.forecast-card,
.reports-saved-card {
  background: #d8e1ea !important;
}

.topbar,
.dropdown-menu,
.dropdown-panel,
.modal,
.toast {
  background: #e0e7ee !important;
}

.global-search input,
input,
select,
textarea,
.view-select,
.filter-control select,
.filter-control input,
.clients-search input,
.follow-ups-search input,
.tasks-search input,
.visits-search input,
.negotiations-search input,
.report-search input {
  background: #dce5ee !important;
}

.icon-button,
.user-button,
.secondary-action,
.ghost-action,
.mini-button,
.quick-tab,
.alert-tab,
.analytics-tab {
  background: #d6dfe8 !important;
}

.primary-action,
.kpi-card.featured,
.analytics-tab.active,
.alert-tab.active,
.quick-tab.active,
.nav-item.active {
  background: #0b79d7 !important;
}

.badge.info,
.badge.neutral {
  background: #cfe0ec !important;
}

.badge.success {
  background: #cce9da !important;
}

.badge.warning {
  background: #efd9b8 !important;
}

.badge.danger {
  background: #efc9c8 !important;
}

.risk-cell,
.heat-cell,
.alert-mini-row,
.analytics-ranking article,
.analytics-root article,
.analytics-findings article,
.analytics-saved article,
.alert-group-card,
.alert-saved-views article,
.alert-detail-grid div {
  background: #d5dee8 !important;
}

.pipeline-row-fill,
.chart-bar-fill,
.analytics-bar i,
.alert-bar-row i {
  background: #0a75d7 !important;
}

.app-shell.sidebar-collapsed .sidebar {
  margin-right: 0;
}

@media (max-width: 920px) {
  .sidebar {
    margin: 0;
    height: 100vh;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0 !important;
  }

  .topbar {
    top: 0;
    margin: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
  }

  .main-content {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: 12px;
  }

  .card,
  .dashboard-hero,
  .clients-hero,
  .client-detail-hero,
  .follow-ups-hero,
  .pipeline-hero,
  .reports-hero,
  .tasks-hero,
  .visits-hero,
  .negotiations-hero,
  .alerts-hero,
  .analytics-hero {
    border-radius: var(--radius-md) !important;
  }
}

/* Clientes: ajustes de legibilidad y menus flotantes */
.clients-view {
  min-width: 0;
}

.clients-hero {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-start !important;
  gap: 18px !important;
  overflow: visible;
}

.clients-hero > div:first-child {
  flex: 1 1 430px;
  min-width: min(100%, 320px);
  max-width: 740px;
}

.clients-hero h2,
.clients-hero p,
.clients-hero .meta-row {
  max-width: 640px;
}

.clients-hero p {
  line-height: 1.45;
}

.clients-hero-actions {
  flex: 1 1 360px;
  min-width: min(100%, 300px);
  justify-content: flex-end;
}

.clients-list-card {
  overflow: visible !important;
}

.clients-list-card .table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding: 0 0 12px;
}

.clients-table {
  border-collapse: separate !important;
  border-spacing: 0 10px !important;
  table-layout: auto;
}

.clients-table--table {
  min-width: 1980px !important;
}

.clients-table--compact {
  min-width: 1280px !important;
}

.clients-table thead th {
  position: static !important;
  z-index: auto !important;
  height: 42px;
  padding: 12px 12px 8px !important;
  white-space: nowrap;
  line-height: 1.15;
  vertical-align: bottom;
}

.clients-table tbody td {
  padding: 18px 12px !important;
  line-height: 1.35;
}

.clients-table td,
.clients-table td * {
  max-width: 100%;
}

.clients-table .client-identity {
  width: 100%;
  max-width: 430px;
}

.clients-table .client-select-col {
  width: 46px;
  min-width: 46px;
}

.clients-table .client-col--cliente {
  min-width: 300px;
  width: 300px;
}

.clients-table--compact .client-col--cliente {
  min-width: 280px;
  width: 280px;
}

.clients-table .client-col--tiposCliente {
  min-width: 190px;
  width: 190px;
}

.clients-table .client-col--tipoOperacion,
.clients-table .client-col--lineaNegocio,
.clients-table .client-col--nivelInteres,
.clients-table .client-col--prioridad,
.clients-table .client-col--estado {
  min-width: 140px;
  width: 140px;
}

.clients-table .client-col--requerimiento {
  min-width: 230px;
  width: 230px;
}

.clients-table .client-col--zonasInteres {
  min-width: 240px;
  width: 240px;
}

.clients-table .client-col--asesorNombre {
  min-width: 180px;
  width: 180px;
}

.clients-table .client-col--etapa {
  min-width: 180px;
  width: 180px;
}

.clients-table .client-col--score {
  min-width: 120px;
  width: 120px;
}

.clients-table .client-col--fechaUltimaInteraccion,
.clients-table .client-col--fechaProximaAccion,
.clients-table .client-col--diasSinSeguimiento {
  min-width: 160px;
  width: 160px;
}

.clients-table .client-col--proximaAccion {
  min-width: 250px;
  width: 250px;
}

.clients-table .client-col--acciones {
  min-width: 130px;
  width: 130px;
}

.clients-table .client-identity > span:last-child,
.client-card .client-identity > span:last-child {
  min-width: 0;
}

.clients-table .client-identity strong,
.clients-table .client-identity small,
.client-card .client-identity strong,
.client-card .client-identity small {
  overflow-wrap: anywhere;
}

.clients-table .badge,
.client-card .badge {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  text-align: left;
}

.client-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
  align-items: stretch;
}

.client-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.client-card * {
  min-width: 0;
}

.client-card-top {
  width: 100%;
}

.client-card-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.client-card-body > div {
  min-width: 0;
  overflow: hidden;
}

.client-card-body strong,
.client-card-body small,
.client-card-body span,
.next-action {
  overflow-wrap: anywhere;
}

.client-card .row-actions {
  margin-top: auto;
}

.client-floating-menu {
  position: fixed !important;
  right: auto !important;
  bottom: auto !important;
  width: min(250px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 24px));
  overflow: auto;
  z-index: 9999 !important;
}

.client-floating-menu[hidden] {
  display: none !important;
}

.client-floating-menu button {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  text-align: left;
}

@media (max-width: 1120px) {
  .clients-hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .clients-hero > div:first-child,
  .clients-hero-actions {
    flex-basis: 100%;
  }

  .client-card-body {
    grid-template-columns: 1fr;
  }
}

/* Sistema: botones sin halo brillante */
.primary-action,
.secondary-action,
.ghost-action,
.mini-button,
.quick-tab,
.alert-tab,
.analytics-tab,
.icon-button,
.user-button,
.dropdown-menu button,
.dropdown-item,
.nav-item,
.nav-item.active,
.quick-tab.active,
.alert-tab.active,
.analytics-tab.active,
.topbar .primary-action {
  box-shadow: var(--shadow-subtle) !important;
}

.primary-action:hover,
.secondary-action:hover,
.ghost-action:hover,
.mini-button:hover,
.quick-tab:hover,
.alert-tab:hover,
.analytics-tab:hover,
.icon-button:hover,
.user-button:hover,
.dropdown-menu button:hover,
.dropdown-item:hover {
  box-shadow: 4px 5px 10px rgba(103, 119, 136, 0.16) !important;
}

/* Sistema: bordes sobrios sin halos brillantes */
.card,
.client-card,
.task-card,
.visit-card,
.negotiation-card,
.opportunity-card,
.forecast-card,
.alert-smart-card,
.detail-alert-card,
.drawer-section,
.task-detail-section,
.visit-detail-section,
.negotiation-detail-section,
.pipeline-card,
.task-column,
.task-calendar-day,
.visit-calendar-day,
.negotiation-column {
  border-color: rgba(126, 145, 165, 0.32) !important;
}

.badge,
.score-pill,
.avatar,
.task-calendar-chip,
.visit-calendar-chip {
  border-color: rgba(126, 145, 165, 0.28) !important;
  box-shadow: var(--shadow-subtle) !important;
}

/* Planner Light System: referencia visual clara, minimalista y operativa */
:root {
  --color-primary: #101c33;
  --color-primary-soft: #d6e2ec;
  --color-secondary: #426f9a;
  --color-secondary-dark: #294b6f;
  --color-background: #dce8f0;
  --color-surface: #edf4f9;
  --color-surface-strong: #e5eef5;
  --color-surface-alt: #f6fafc;
  --color-border: rgba(112, 134, 153, 0.28);
  --color-border-strong: rgba(88, 110, 130, 0.38);
  --color-text-primary: #0f1d2c;
  --color-text-secondary: #526a80;
  --color-text-muted: #7d8e9d;
  --color-info: #426f9a;
  --color-info-soft: #d5e5f0;
  --color-success: #237047;
  --color-success-soft: #d7eadf;
  --color-warning: #986c20;
  --color-warning-soft: #efe0c4;
  --color-danger: #a33a37;
  --color-danger-soft: #efd2d1;
  --shadow-soft: 0 18px 40px rgba(79, 102, 121, 0.14);
  --shadow-subtle: 0 8px 22px rgba(79, 102, 121, 0.12);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --radius-sm: 13px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --topbar-height: 68px;
}

html,
body {
  color: var(--color-text-primary);
  background: #dce8f0 !important;
}

body,
body * {
  background-image: none !important;
}

.app-shell {
  gap: 18px;
  padding: 16px;
}

.sidebar,
.topbar,
.card,
.dashboard-hero,
.clients-hero,
.client-detail-hero,
.follow-ups-hero,
.pipeline-hero,
.reports-hero,
.tasks-hero,
.visits-hero,
.negotiations-hero,
.alerts-hero,
.analytics-hero,
.clients-toolbar,
.follow-ups-toolbar,
.pipeline-toolbar,
.reports-toolbar,
.tasks-toolbar,
.visits-toolbar,
.negotiations-toolbar,
.dashboard-filters,
.alerts-filters,
.analytics-filters,
.task-card,
.visit-card,
.negotiation-card,
.pipeline-card,
.opportunity-card,
.client-card,
.property-card,
.forecast-card,
.report-nav-button,
.report-kpi,
.report-chart,
.report-insight,
.reports-saved-card,
.alert-smart-card,
.alert-group-card,
.detail-alert-card,
.drawer-section,
.task-detail-section,
.visit-detail-section,
.negotiation-detail-section {
  color: var(--color-text-primary) !important;
  background: #edf4f9 !important;
  border: 1px solid rgba(112, 134, 153, 0.28) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: none !important;
}

.topbar {
  min-height: var(--topbar-height);
  border-radius: 26px !important;
}

.sidebar {
  border-radius: 26px !important;
}

.main-content {
  padding-top: 18px;
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(112, 134, 153, 0.18) !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.card-header h2,
.card-header h3,
.section-title h1,
h1,
h2,
h3,
h4,
strong {
  color: var(--color-text-primary) !important;
}

.card-header p,
.section-title p,
.muted,
small,
.reports-hero p,
.alerts-hero p,
.negotiations-hero p,
.tasks-hero p,
.visits-hero p,
.pipeline-hero p,
.clients-hero p {
  color: var(--color-text-secondary) !important;
}

.brand-mark,
.nav-icon,
.avatar,
.activity-icon,
.alert-icon,
.kpi-icon {
  color: var(--color-text-primary) !important;
  background: #e7f0f6 !important;
  border-color: rgba(112, 134, 153, 0.26) !important;
  box-shadow: var(--shadow-subtle) !important;
}

.nav-item {
  min-height: 44px;
  color: var(--color-text-secondary) !important;
  background: transparent !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: var(--color-text-primary) !important;
  background: #e7f0f6 !important;
  box-shadow: var(--shadow-subtle) !important;
}

.nav-item.active,
.quick-tab.active,
.alert-tab.active,
.analytics-tab.active,
.primary-action {
  color: #ffffff !important;
  background: #101c33 !important;
  border-color: rgba(16, 28, 51, 0.72) !important;
  box-shadow: 0 10px 24px rgba(16, 28, 51, 0.18) !important;
}

.nav-item.active .nav-icon {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

.nav-badge {
  color: var(--color-text-primary) !important;
  background: #dce8f0 !important;
  border-color: rgba(112, 134, 153, 0.24) !important;
}

.sidebar-user,
.dropdown-menu,
.dropdown-panel,
.modal,
.toast,
.placeholder-card {
  color: var(--color-text-primary) !important;
  background: #edf4f9 !important;
  border: 1px solid rgba(112, 134, 153, 0.28) !important;
  box-shadow: var(--shadow-soft) !important;
}

input,
select,
textarea,
.view-select,
.global-search input,
.filter-control select,
.filter-control input,
.clients-search input,
.follow-ups-search input,
.tasks-search input,
.visits-search input,
.negotiations-search input,
.reports-search input,
.report-search input {
  color: var(--color-text-primary) !important;
  background: #f6fafc !important;
  border: 1px solid rgba(112, 134, 153, 0.28) !important;
  box-shadow: none !important;
}

input::placeholder,
textarea::placeholder {
  color: #7d8e9d !important;
}

.secondary-action,
.ghost-action,
.mini-button,
.icon-button,
.user-button,
.quick-tab,
.alert-tab,
.analytics-tab,
.dropdown-item,
.dropdown-menu button {
  color: var(--color-text-primary) !important;
  background: #e7f0f6 !important;
  border: 1px solid rgba(112, 134, 153, 0.25) !important;
  box-shadow: var(--shadow-subtle) !important;
}

.secondary-action:hover,
.ghost-action:hover,
.mini-button:hover,
.icon-button:hover,
.user-button:hover,
.quick-tab:hover,
.alert-tab:hover,
.analytics-tab:hover,
.dropdown-item:hover,
.dropdown-menu button:hover {
  background: #f3f8fb !important;
  box-shadow: 0 10px 22px rgba(79, 102, 121, 0.12) !important;
}

.badge {
  border: 1px solid rgba(112, 134, 153, 0.22) !important;
  box-shadow: none !important;
}

.badge.info,
.badge.neutral {
  color: #2c5d80 !important;
  background: #d5e5f0 !important;
}

.badge.success {
  color: #237047 !important;
  background: #d7eadf !important;
}

.badge.warning {
  color: #986c20 !important;
  background: #efe0c4 !important;
}

.badge.danger {
  color: #a33a37 !important;
  background: #efd2d1 !important;
}

.report-nav-button.active,
.kpi-card.featured {
  color: #ffffff !important;
  background: #426f9a !important;
  border-color: rgba(66, 111, 154, 0.7) !important;
}

.report-nav-button.active strong,
.report-nav-button.active p,
.report-nav-button.active span,
.kpi-card.featured * {
  color: #ffffff !important;
}

table th,
.clients-table th,
.tasks-table th,
.visits-table th,
.negotiations-table th,
.report-table th {
  color: var(--color-text-secondary) !important;
  background: #edf4f9 !important;
}

table td,
.clients-table td,
.tasks-table td,
.visits-table td,
.negotiations-table td,
.report-table td {
  color: var(--color-text-primary) !important;
  background: #f2f7fb !important;
  border-color: rgba(112, 134, 153, 0.18) !important;
}

.modal-backdrop,
.mobile-backdrop,
.alert-detail-drawer,
.task-detail-drawer,
.visit-detail-drawer,
.negotiation-detail-drawer {
  background: rgba(32, 45, 58, 0.32) !important;
}

/* Iconografia funcional */
.nav-icon,
.menu-item-icon,
.button-icon,
.kpi-icon,
.activity-icon,
.timeline-icon,
.alert-icon {
  font-family: "Segoe UI Symbol", "Segoe UI", Arial, sans-serif;
  line-height: 1;
}

.nav-icon {
  flex-basis: 30px;
  width: 30px;
  height: 30px;
  font-size: 1rem;
  border-radius: 12px !important;
}

.nav-item.active .nav-icon {
  background: rgba(255, 255, 255, 0.18) !important;
}

.primary-action,
.secondary-action,
.ghost-action,
.mini-button,
.icon-button,
.user-button,
.quick-tab,
.alert-tab,
.analytics-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.menu-icon-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}

.menu-item-icon {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #294b6f;
  background: #dbe8f1;
  border: 1px solid rgba(112, 134, 153, 0.24);
  border-radius: 10px;
}

.primary-action .button-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: inherit;
  font-weight: 800;
}

.brand-mark {
  position: relative;
  overflow: hidden;
}

.brand-mark::before {
  content: "";
  width: 17px;
  height: 22px;
  border: 2px solid currentColor;
  border-bottom-width: 3px;
  transform: skewY(-18deg);
}

.brand-mark {
  font-size: 0 !important;
}

/* Iconos dentro de modulos, vistas, filtros y tarjetas */
.dashboard-hero h2::before,
.clients-hero h2::before,
.follow-ups-hero h2::before,
.tasks-hero h2::before,
.pipeline-hero h2::before,
.visits-hero h2::before,
.negotiations-hero h2::before,
.alerts-hero h2::before,
.reports-hero h2::before,
.analytics-hero h2::before {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-right: 10px;
  place-items: center;
  color: #294b6f;
  background: #dbe8f1;
  border: 1px solid rgba(112, 134, 153, 0.24);
  border-radius: 12px;
  font-family: "Segoe UI Symbol", "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  vertical-align: 3px;
}

.dashboard-hero h2::before { content: "⌂"; }
.clients-hero h2::before { content: "◉"; }
.follow-ups-hero h2::before { content: "☏"; }
.tasks-hero h2::before { content: "☑"; }
.pipeline-hero h2::before { content: "⇄"; }
.visits-hero h2::before { content: "⌖"; }
.negotiations-hero h2::before { content: "$"; }
.alerts-hero h2::before { content: "!"; }
.reports-hero h2::before { content: "▥"; }
.analytics-hero h2::before { content: "⌁"; }

.filter-control label,
.clients-sort-row label,
.tasks-sort-row label,
.visits-sort-row label,
.negotiation-sort-row label,
.reports-filter-grid label,
.alerts-filters .filter-control,
.advanced-filters .filter-field {
  position: relative;
}

.filter-control label::before,
.clients-sort-row label::before,
.tasks-sort-row label::before,
.visits-sort-row label::before,
.negotiation-sort-row label::before,
.reports-filter-grid label::before,
.advanced-filters .filter-field::before {
  content: "⌕";
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  place-items: center;
  color: #426f9a;
  font-family: "Segoe UI Symbol", "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  vertical-align: -1px;
}

.quick-tab::before,
.alert-tab::before,
.analytics-tab::before {
  content: "○";
  color: #426f9a;
  font-family: "Segoe UI Symbol", "Segoe UI", Arial, sans-serif;
}

.quick-tab.active::before,
.alert-tab.active::before,
.analytics-tab.active::before {
  content: "●";
  color: inherit;
}

[data-client-view="table"]::before,
[data-task-view="list"]::before,
[data-visit-view="list"]::before,
[data-negotiation-view="list"]::before { content: "▤"; }

[data-client-view="compact"]::before,
[data-task-view="kanban"]::before,
[data-negotiation-view="kanban"]::before { content: "▦"; }

[data-client-view="cards"]::before,
[data-task-view="responsible"]::before,
[data-visit-view="advisor"]::before,
[data-negotiation-view="advisor"]::before { content: "▧"; }

[data-task-view="calendar"]::before,
[data-visit-view="calendar"]::before { content: "◷"; }

[data-visit-view="property"]::before,
[data-negotiation-view="property"]::before { content: "⌂"; }

[data-negotiation-view="comparison"]::before { content: "≍"; }
[data-negotiation-view="deadlines"]::before { content: "◷"; }
[data-negotiation-view="manager"]::before { content: "▥"; }

.client-metric::before,
.task-metric::before,
.visit-metric::before,
.negotiation-metric::before,
.alert-kpi::before,
.report-kpi::before,
.analytics-kpi::before,
.metric-tile::before,
.forecast-card::before {
  display: grid;
  width: 30px;
  height: 30px;
  margin-bottom: 8px;
  place-items: center;
  color: #294b6f;
  background: #dbe8f1;
  border: 1px solid rgba(112, 134, 153, 0.24);
  border-radius: 11px;
  font-family: "Segoe UI Symbol", "Segoe UI", Arial, sans-serif;
  font-size: 0.95rem;
}

.client-metric::before { content: "◉"; }
.task-metric::before { content: "☑"; }
.visit-metric::before { content: "⌖"; }
.negotiation-metric::before { content: "$"; }
.alert-kpi::before { content: "!"; }
.report-kpi::before { content: "▥"; }
.analytics-kpi::before,
.metric-tile::before { content: "⌁"; }
.forecast-card::before { content: "$"; }

.report-nav-button::before,
.task-card::before,
.visit-card::before,
.negotiation-card::before,
.opportunity-card::before,
.client-card::before,
.alert-smart-card::before {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #294b6f;
  background: #dbe8f1;
  border: 1px solid rgba(112, 134, 153, 0.22);
  border-radius: 10px;
  font-family: "Segoe UI Symbol", "Segoe UI", Arial, sans-serif;
}

.report-nav-button::before { content: "▥"; }
.task-card::before { content: "☑"; }
.visit-card::before { content: "⌖"; }
.negotiation-card::before { content: "$"; }
.opportunity-card::before { content: "⇄"; }
.client-card::before { content: "◉"; }
.alert-smart-card::before { content: "!"; }

.client-card-top,
.task-card .pipeline-column-title,
.visit-card .pipeline-column-title,
.negotiation-card .pipeline-column-title,
.opportunity-card-header {
  align-items: flex-start;
}

.task-card,
.visit-card,
.negotiation-card,
.opportunity-card,
.client-card,
.alert-smart-card {
  position: relative;
}

.task-card::before,
.visit-card::before,
.negotiation-card::before,
.opportunity-card::before,
.client-card::before,
.alert-smart-card::before {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
}

.task-card .pipeline-column-title,
.visit-card .pipeline-column-title,
.negotiation-card .pipeline-column-title,
.opportunity-card-header,
.client-card-top,
.alert-card-main {
  padding-right: 42px;
}

/* Correcciones de legibilidad posteriores a la iconografia */
.dashboard-filters {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)) !important;
  align-items: end !important;
  gap: 16px !important;
}

.dashboard-filters .filter-control {
  min-width: 0 !important;
}

.dashboard-filters .filter-control label {
  display: flex;
  align-items: center;
  min-height: 20px;
  gap: 6px;
  white-space: nowrap;
}

.dashboard-filters .filter-control label::before {
  flex: 0 0 18px;
  margin-right: 0;
}

.dashboard-filters select,
.dashboard-filters input {
  min-width: 0 !important;
  width: 100% !important;
}

.report-nav-button.active {
  color: #ffffff !important;
  background: #10233a !important;
  border-color: rgba(16, 35, 58, 0.72) !important;
}

.report-nav-button.active,
.report-nav-button.active *,
.report-nav-button.active strong,
.report-nav-button.active p,
.report-nav-button.active span {
  color: #ffffff !important;
}

.report-nav-button.active::before {
  color: #10233a !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.34) !important;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--color-text-secondary);
  font-size: 0.76rem;
  line-height: 1.35;
}

.checkbox-fieldset {
  grid-column: 1 / -1;
  border: 0;
}

.checkbox-fieldset legend {
  margin-bottom: 8px;
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
}

.checkbox-list {
  max-height: 190px;
  overflow-y: auto;
  padding: 6px;
  background: #f6fafc;
  border: 1px solid rgba(112, 134, 153, 0.32);
  border-radius: 14px;
}

.checkbox-list-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 6px;
  color: var(--color-text-primary);
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.2;
}

.checkbox-list-option:hover {
  background: #e7f0f6;
}

.checkbox-list-option input {
  width: 14px !important;
  height: 14px !important;
  margin: 0;
  accent-color: #101c33;
  box-shadow: none !important;
}

.checkbox-list-option:has(input:checked) {
  color: #0d223d;
  background: #dceaf4;
}

/* Ajuste final de topbar: el buscador no debe invadir el titulo de seccion. */
@media (min-width: 1025px) {
  .topbar {
    grid-template-columns: minmax(320px, 1fr) minmax(210px, 300px) auto !important;
    gap: 12px !important;
  }

  .global-search {
    width: 100% !important;
    max-width: 300px !important;
    justify-self: end !important;
  }

  .global-search input {
    height: 40px !important;
    padding-left: 16px !important;
    padding-right: 34px !important;
    font-size: 0.9rem !important;
  }
}

@media (min-width: 1025px) and (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(300px, 1fr) minmax(180px, 240px) auto !important;
  }

  .global-search {
    max-width: 240px !important;
  }
}
