/* ============================================================
   YoSoyVendedor CRM — Estilos Principales
   Diseño inspirado en Jampack/ThemeCRM
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* ── Variables de diseño ───────────────────────────────────── */
:root {
  --crm-primary:        #007D88;
  --crm-primary-light:  rgba(0, 125, 136, 0.12);
  --crm-primary-dark:   #005f68;
  --crm-success:        #00D67F;
  --crm-danger:         #dc3545;
  --crm-warning:        #ffc400;
  --crm-info:           #18DDEF;

  --crm-sidebar-width:  270px;
  --crm-header-height:  65px;
  --crm-font:           'DM Sans', system-ui, sans-serif;

  --crm-bg:             #f4f6f9;
  --crm-surface:        #ffffff;
  --crm-border:         #e5e9ef;
  --crm-border-light:   #f0f2f5;

  --crm-text:           #2F343A;
  --crm-text-muted:     #6c757d;
  --crm-text-light:     #9e9e9e;

  --crm-menu-bg:        #ffffff;
  --crm-menu-border:    #e5e9ef;
  --crm-menu-text:      #2F343A;
  --crm-menu-text-muted:#6c757d;
  --crm-menu-active-bg: rgba(0, 125, 136, 0.10);
  --crm-menu-active:    #007D88;

  --crm-shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --crm-shadow:         0 2px 12px rgba(0,0,0,.10);
  --crm-shadow-lg:      0 8px 24px rgba(0,0,0,.12);

  --crm-radius:         0.5rem;
  --crm-radius-sm:      0.375rem;
  --crm-radius-lg:      0.75rem;
  --crm-radius-xl:      1.25rem;

  --crm-transition:     0.2s ease;
}

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--crm-font);
  background:  var(--crm-bg);
  color:       var(--crm-text);
  font-size:   0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--crm-primary); text-decoration: none; }
a:hover { color: var(--crm-primary-dark); }

/* ── Layout ────────────────────────────────────────────────── */
.crm-wrapper {
  display:   flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.crm-sidebar {
  width:      var(--crm-sidebar-width);
  position:   fixed;
  top:        0;
  left:       0;
  height:     100vh;
  background: var(--crm-menu-bg);
  border-right: 1px solid var(--crm-menu-border);
  display:    flex;
  flex-direction: column;
  z-index:    1040;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--crm-transition), box-shadow var(--crm-transition);
}

.crm-sidebar::-webkit-scrollbar { width: 4px; }
.crm-sidebar::-webkit-scrollbar-track { background: transparent; }
.crm-sidebar::-webkit-scrollbar-thumb { background: var(--crm-border); border-radius: 4px; }

/* Logo brand en sidebar */
.crm-brand {
  display:     flex;
  align-items: center;
  gap:         0.75rem;
  padding:     1.25rem 1.5rem;
  height:      var(--crm-header-height);
  border-bottom: 1px solid var(--crm-menu-border);
  flex-shrink: 0;
}
.crm-brand-icon {
  width:       34px;
  height:      34px;
  background:  var(--crm-primary);
  border-radius: var(--crm-radius-sm);
  display:     flex;
  align-items: center;
  justify-content: center;
  color:       #fff;
  font-size:   1rem;
  flex-shrink: 0;
}
.crm-brand-name {
  font-size:   0.875rem;
  font-weight: 700;
  color:       var(--crm-text);
  line-height: 1.2;
}
.crm-brand-sub {
  font-size:   0.7rem;
  color:       var(--crm-text-muted);
  font-weight: 400;
}

/* Menú de navegación */
.crm-nav {
  flex:    1;
  padding: 1rem 0.75rem;
}
.crm-nav-block {
  margin-bottom: .35rem;
}
.crm-nav-dashboard {
  margin-bottom: .65rem;
  border-bottom: 1px solid var(--crm-menu-border);
  border-radius: var(--crm-radius-sm);
}
.crm-nav-section-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size:   0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color:       var(--crm-text-light);
  padding:     0.7rem 0.75rem 0.45rem;
  border-radius: var(--crm-radius-sm);
  cursor: pointer;
  transition: background var(--crm-transition), color var(--crm-transition);
}
.crm-nav-section-toggle:hover,
.crm-nav-section-toggle:focus-visible {
  background: var(--crm-border-light);
  color: var(--crm-text);
  outline: none;
}
.crm-nav-section-toggle i {
  font-size: 1rem;
  transition: transform var(--crm-transition);
}
.crm-nav-block.open .crm-nav-section-toggle i {
  transform: rotate(180deg);
}
.crm-nav-block-items[hidden] {
  display: none !important;
}
.crm-nav-block-items {
  padding-top: .1rem;
}
.crm-nav-item {
  display:     flex;
  align-items: center;
  gap:         0.625rem;
  padding:     0.6rem 0.875rem;
  border-radius: var(--crm-radius-sm);
  color:       var(--crm-menu-text-muted);
  font-size:   0.875rem;
  font-weight: 500;
  transition:  background var(--crm-transition), color var(--crm-transition);
  cursor:      pointer;
  margin-bottom: 2px;
}
.crm-nav-item:hover {
  background: var(--crm-border-light);
  color:      var(--crm-text);
}
.crm-nav-item.active {
  background: var(--crm-primary);
  color:      #fff;
  font-weight: 600;
}
.crm-nav-item.active .crm-nav-icon { color: #fff; }
.crm-nav-icon {
  font-size:  1.1rem;
  width:      20px;
  text-align: center;
  flex-shrink: 0;
}
.crm-nav-badge {
  margin-left: auto;
  font-size:   0.7rem;
  padding:     1px 7px;
  border-radius: 20px;
  background: var(--crm-primary);
  color:      #fff;
  font-weight: 600;
}
.crm-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.48);
  z-index: 1035;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--crm-transition), visibility var(--crm-transition);
}
.crm-sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Footer del sidebar (usuario) */
.crm-sidebar-media {
  margin: .25rem .75rem .5rem;
  padding: .7rem .875rem;
  border-radius: var(--crm-radius-sm);
  display: flex;
  align-items: center;
  gap: .625rem;
  color: var(--crm-menu-text-muted);
  font-size: .875rem;
  font-weight: 600;
  flex-shrink: 0;
}
.crm-sidebar-media:hover { background: var(--crm-border-light); color: var(--crm-text); }
.crm-sidebar-media.active { background: var(--crm-primary); color: #fff; }
.crm-sidebar-account { position: relative; flex-shrink: 0; }
.crm-sidebar-account-menu {
  position: absolute;
  left: .75rem;
  right: .75rem;
  bottom: calc(100% + .5rem);
  padding: .45rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: 10px;
  box-shadow: 0 -12px 32px rgba(15,23,42,.16);
  z-index: 20;
}
.crm-sidebar-account-menu[hidden] { display: none!important; }
.crm-sidebar-account-menu a {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .65rem .7rem;
  border-radius: 7px;
  color: var(--crm-menu-text-muted);
  font-size: .84rem;
  font-weight: 500;
}
.crm-sidebar-account-menu a:hover,
.crm-sidebar-account-menu a.active { background: var(--crm-border-light); color: var(--crm-text); }
.crm-sidebar-account-menu .crm-sidebar-account-logout { border-top: 1px solid var(--crm-border); margin-top: .35rem; padding-top: .75rem; color: var(--crm-danger); }
.crm-sidebar-user {
  width: 100%;
  border: 0;
  background: transparent;
  padding:      1rem 1.25rem;
  border-top:   1px solid var(--crm-menu-border);
  display:      flex;
  align-items:  center;
  gap:          0.625rem;
  flex-shrink:  0;
  text-align: left;
  cursor: pointer;
}
.crm-sidebar-user:hover,
.crm-sidebar-user:focus-visible { background: var(--crm-border-light); outline: none; }
.crm-sidebar-user-copy { min-width: 0; flex: 1; display: block; }
.crm-sidebar-account-chevron { margin-left: auto; color: var(--crm-text-muted); transition: transform var(--crm-transition); }
.crm-sidebar-user[aria-expanded="true"] .crm-sidebar-account-chevron {
  transform: rotate(180deg);
}
.crm-sidebar-avatar {
  width:        34px;
  height:       34px;
  border-radius: 50%;
  background:   var(--crm-primary);
  display:      flex;
  align-items:  center;
  justify-content: center;
  color:        #fff;
  font-size:    0.8125rem;
  font-weight:  700;
  flex-shrink:  0;
}
.crm-sidebar-user-name {
  display: block;
  font-size:    0.8125rem;
  font-weight:  600;
  color:        var(--crm-text);
  line-height:  1.2;
}
.crm-sidebar-user-role {
  display: block;
  font-size:    0.7rem;
  color:        var(--crm-text-muted);
}

/* ── Topbar ────────────────────────────────────────────────── */
.crm-topbar {
  height:     var(--crm-header-height);
  position:   fixed;
  top:        0;
  left:       var(--crm-sidebar-width);
  right:      0;
  background: var(--crm-surface);
  border-bottom: 1px solid var(--crm-border);
  display:    flex;
  align-items: center;
  padding:    0 1.5rem;
  gap:        1rem;
  z-index:    1030;
  box-shadow: var(--crm-shadow-sm);
  transition: left var(--crm-transition);
}
.crm-topbar-title {
  font-size:   1.0625rem;
  font-weight: 600;
  color:       var(--crm-text);
  flex:        1;
}
.crm-topbar-search {
  position:   relative;
  max-width:  280px;
  width:      100%;
}
.crm-topbar-search input {
  background: var(--crm-bg);
  border:     1px solid var(--crm-border);
  border-radius: 20px;
  padding:    0.4rem 1rem 0.4rem 2.25rem;
  font-size:  0.8125rem;
  width:      100%;
  outline:    none;
  color:      var(--crm-text);
  transition: border-color var(--crm-transition), box-shadow var(--crm-transition);
}
.crm-topbar-search input:focus {
  border-color: var(--crm-primary);
  box-shadow:   0 0 0 3px rgba(0,125,136,.12);
}
.crm-topbar-search-icon {
  position:  absolute;
  left:      0.75rem;
  top:       50%;
  transform: translateY(-50%);
  color:     var(--crm-text-muted);
  font-size: 0.875rem;
}
.crm-topbar-actions {
  display:    flex;
  align-items: center;
  gap:        0.5rem;
}
.crm-topbar-btn {
  width:      36px;
  height:     36px;
  border-radius: 50%;
  display:    flex;
  align-items: center;
  justify-content: center;
  color:      var(--crm-text-muted);
  background: transparent;
  border:     none;
  cursor:     pointer;
  font-size:  1.1rem;
  transition: background var(--crm-transition), color var(--crm-transition);
  position:   relative;
}
.crm-topbar-btn:hover {
  background: var(--crm-bg);
  color:      var(--crm-text);
}
.crm-topbar-badge {
  position:   absolute;
  top:        4px;
  right:      4px;
  width:      9px;
  height:     9px;
  background: var(--crm-danger);
  border-radius: 50%;
  border:     2px solid #fff;
}
.crm-topbar-badge[hidden] { display: none; }
.crm-topbar-divider {
  width:      1px;
  height:     24px;
  background: var(--crm-border);
}
.crm-topbar-user {
  display:    flex;
  align-items: center;
  gap:        0.5rem;
  cursor:     pointer;
  padding:    0.25rem 0.5rem;
  border-radius: var(--crm-radius-sm);
  transition: background var(--crm-transition);
  border:     0;
  background: transparent;
  color:      inherit;
}
.crm-topbar-user:hover { background: var(--crm-bg); }
.crm-topbar-user:focus-visible {
  outline: 2px solid var(--crm-primary);
  outline-offset: 2px;
}
.crm-topbar-user-chevron {
  color: var(--crm-text-muted);
  font-size: 1rem;
  transition: transform var(--crm-transition);
}
.crm-topbar-user[aria-expanded="true"] .crm-topbar-user-chevron { transform: rotate(180deg); }
.crm-topbar-avatar {
  width:       32px;
  height:      32px;
  border-radius: 50%;
  background:  var(--crm-primary);
  display:     flex;
  align-items: center;
  justify-content: center;
  color:       #fff;
  font-size:   0.8125rem;
  font-weight: 700;
}
.crm-topbar-user-info { line-height: 1.25; }
.crm-topbar-user-name {
  font-size:   0.8125rem;
  font-weight: 600;
  color:       var(--crm-text);
}
.crm-topbar-user-role {
  font-size:   0.7rem;
  color:       var(--crm-text-muted);
}
.crm-user-dropdown {
  min-width: 230px;
  padding: .5rem;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow: var(--crm-shadow-lg);
}
.crm-user-dropdown-head {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .55rem .7rem .35rem;
}
.crm-user-dropdown-head strong { color: var(--crm-text); font-size: .875rem; }
.crm-user-dropdown-head span { color: var(--crm-text-muted); font-size: .75rem; word-break: break-word; }
.crm-user-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem .7rem;
  border-radius: var(--crm-radius-sm);
  font-size: .85rem;
  font-weight: 600;
}
.crm-user-dropdown .dropdown-item i { font-size: 1rem; }
.crm-notification-panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 5.5rem;
  width: min(380px, calc(100vw - 2rem));
  max-height: 520px;
  overflow: hidden;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow: var(--crm-shadow-lg);
  z-index: 1060;
}
.crm-notification-panel[hidden] { display: none; }
.crm-notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--crm-border);
}
.crm-notification-panel-head strong {
  display: block;
  color: var(--crm-text);
  font-size: .95rem;
}
.crm-notification-panel-head span {
  display: block;
  color: var(--crm-text-muted);
  font-size: .76rem;
  margin-top: .12rem;
}
.crm-notification-list {
  display: flex;
  flex-direction: column;
  max-height: 390px;
  overflow-y: auto;
}
.crm-notification-item {
  width: 100%;
  padding: .9rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--crm-border);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.crm-notification-item:hover { background: var(--crm-bg); }
.crm-notification-item.unread { background: rgba(0,125,136,.07); }
.crm-notification-item strong {
  display: block;
  color: var(--crm-text);
  font-size: .86rem;
  margin-bottom: .2rem;
}
.crm-notification-item span {
  display: block;
  color: var(--crm-text-muted);
  font-size: .8rem;
  line-height: 1.4;
}
.crm-notification-item small {
  display: block;
  color: var(--crm-text-muted);
  font-size: .7rem;
  margin-top: .35rem;
}
.crm-notification-empty {
  padding: 1.5rem 1rem;
  color: var(--crm-text-muted);
  font-size: .84rem;
  text-align: center;
}

/* ── Contenido principal ───────────────────────────────────── */
.crm-content {
  margin-left:  var(--crm-sidebar-width);
  margin-top:   var(--crm-header-height);
  padding:      1.75rem;
  min-height:   calc(100vh - var(--crm-header-height));
  flex:         1;
  transition: margin-left var(--crm-transition);
}

@media (min-width: 992px) {
  body.crm-sidebar-collapsed .crm-sidebar {
    transform: translateX(-100%);
  }
  body.crm-sidebar-collapsed .crm-topbar {
    left: 0;
  }
  body.crm-sidebar-collapsed .crm-content {
    margin-left: 0;
  }
}

/* ── Tarjetas / Cards ──────────────────────────────────────── */
.crm-card {
  background:    var(--crm-surface);
  border-radius: var(--crm-radius);
  border:        1px solid var(--crm-border);
  box-shadow:    var(--crm-shadow-sm);
  padding:       1.5rem;
}
.crm-card-header {
  display:       flex;
  align-items:   center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.crm-card-title {
  font-size:     1rem;
  font-weight:   600;
  color:         var(--crm-text);
  margin:        0;
}
.crm-card-subtitle {
  font-size:     0.8125rem;
  color:         var(--crm-text-muted);
  margin-top:    0.125rem;
}

/* ── Métricas / Stat Cards ─────────────────────────────────── */
.crm-stat {
  background:    var(--crm-surface);
  border-radius: var(--crm-radius);
  border:        1px solid var(--crm-border);
  box-shadow:    var(--crm-shadow-sm);
  padding:       1.25rem 1.5rem;
  display:       flex;
  align-items:   center;
  gap:           1rem;
  transition:    box-shadow var(--crm-transition), transform var(--crm-transition);
}
.crm-stat:hover {
  box-shadow: var(--crm-shadow);
  transform:  translateY(-1px);
}
.crm-stat-icon {
  width:        48px;
  height:       48px;
  border-radius: var(--crm-radius-sm);
  display:      flex;
  align-items:  center;
  justify-content: center;
  font-size:    1.375rem;
  flex-shrink:  0;
}
.crm-stat-value {
  font-size:   1.625rem;
  font-weight: 700;
  color:       var(--crm-text);
  line-height: 1;
}
.crm-stat-label {
  font-size:   0.8rem;
  color:       var(--crm-text-muted);
  margin-top:  0.25rem;
}
.crm-stat-change {
  font-size:   0.75rem;
  margin-top:  0.25rem;
  font-weight: 500;
}
.crm-stat-change.up   { color: var(--crm-success); }
.crm-stat-change.down { color: var(--crm-danger); }

/* Icon color variants */
.crm-icon-primary { background: rgba(0,125,136,.12); color: var(--crm-primary); }
.crm-icon-success { background: rgba(0,214,127,.12); color: #00a862; }
.crm-icon-warning { background: rgba(255,196,0,.15); color: #cc9900; }
.crm-icon-info    { background: rgba(24,221,239,.12); color: #0fa0b2; }
.crm-icon-danger  { background: rgba(220,53,69,.12);  color: var(--crm-danger); }
.crm-icon-purple  { background: rgba(111,66,193,.12); color: #6f42c1; }

/* ── Page header ───────────────────────────────────────────── */
.crm-page-header {
  display:       flex;
  align-items:   center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap:     wrap;
  gap:           1rem;
}
.crm-page-title {
  font-size:     1.25rem;
  font-weight:   700;
  color:         var(--crm-text);
  margin:        0;
}
.crm-breadcrumb {
  font-size:     0.8125rem;
  color:         var(--crm-text-muted);
  margin-top:    0.125rem;
}
.crm-breadcrumb a { color: var(--crm-primary); }

/* ── Tablas ────────────────────────────────────────────────── */
.crm-table-wrap {
  overflow-x: auto;
}
.crm-table {
  width:         100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size:     0.875rem;
}
.crm-table thead th {
  background:    var(--crm-bg);
  border-bottom: 2px solid var(--crm-border);
  padding:       0.75rem 1rem;
  font-size:     0.75rem;
  font-weight:   600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color:         var(--crm-text-muted);
  white-space:   nowrap;
}
.crm-table thead th:first-child { border-radius: var(--crm-radius-sm) 0 0 0; }
.crm-table thead th:last-child  { border-radius: 0 var(--crm-radius-sm) 0 0; }
.crm-table tbody td {
  padding:       0.875rem 1rem;
  border-bottom: 1px solid var(--crm-border-light);
  color:         var(--crm-text);
  vertical-align: middle;
}
.crm-table tbody tr:last-child td { border-bottom: none; }
.crm-table tbody tr {
  transition: background var(--crm-transition);
}
.crm-table tbody tr:hover td { background: rgba(0,125,136,.03); }

/* ── Badges ────────────────────────────────────────────────── */
.crm-badge {
  display:       inline-flex;
  align-items:   center;
  gap:           0.25rem;
  padding:       0.25rem 0.625rem;
  border-radius: 20px;
  font-size:     0.7rem;
  font-weight:   600;
  line-height:   1;
  letter-spacing: 0.02em;
}
.crm-badge-primary  { background: rgba(0,125,136,.12);  color: var(--crm-primary); }
.crm-badge-success  { background: rgba(0,214,127,.12);  color: #00a862; }
.crm-badge-warning  { background: rgba(255,196,0,.15);  color: #9a7300; }
.crm-badge-danger   { background: rgba(220,53,69,.12);  color: #b02a37; }
.crm-badge-info     { background: rgba(24,221,239,.12); color: #0e8a9a; }
.crm-badge-gray     { background: #f0f2f5; color: #6c757d; }
.crm-badge-purple   { background: rgba(111,66,193,.12); color: #6f42c1; }
.crm-badge-new          { background: #f0f2f5; color: #6c757d; }
.crm-badge-qualified    { background: rgba(13,110,253,.12); color: #0d6efd; }
.crm-badge-proposal     { background: rgba(253,126,20,.12);  color: #d4690a; }
.crm-badge-negotiation  { background: rgba(255,196,0,.15);  color: #9a7300; }
.crm-badge-won          { background: rgba(25,135,84,.12);   color: #198754; }
.crm-badge-lost         { background: rgba(220,53,69,.12);   color: #b02a37; }

/* ── Botones ───────────────────────────────────────────────── */
.crm-btn {
  display:       inline-flex;
  align-items:   center;
  gap:           0.375rem;
  padding:       0.5rem 1.125rem;
  border-radius: var(--crm-radius-sm);
  font-size:     0.875rem;
  font-weight:   500;
  border:        none;
  cursor:        pointer;
  transition:    background var(--crm-transition), box-shadow var(--crm-transition), transform var(--crm-transition);
  white-space:   nowrap;
  font-family:   var(--crm-font);
  line-height:   1.4;
}
.crm-btn:active { transform: translateY(0) scale(.98); }
.crm-btn-primary {
  background: var(--crm-primary);
  color:      #fff;
  box-shadow: 0 2px 8px rgba(0,125,136,.28);
  transition: background .15s ease, box-shadow .15s ease, transform .12s ease;
}
.crm-btn-primary:hover { background: var(--crm-primary-dark); box-shadow: 0 4px 16px rgba(0,125,136,.38); color: #fff; transform: translateY(-1px); }
.crm-btn-outline {
  background: transparent;
  color:      var(--crm-primary);
  border:     1.5px solid var(--crm-primary);
}
.crm-btn-outline:hover { background: var(--crm-primary-light); }
.crm-btn-ghost {
  background: transparent;
  color:      var(--crm-text-muted);
  padding:    0.5rem 0.75rem;
}
.crm-btn-ghost:hover { background: var(--crm-bg); color: var(--crm-text); }
.crm-btn-sm {
  padding:   0.3rem 0.75rem;
  font-size: 0.8125rem;
}
.crm-btn-icon {
  width:      32px;
  height:     32px;
  padding:    0;
  display:    inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--crm-radius-sm);
}

/* ── Formularios ───────────────────────────────────────────── */
.crm-form-label {
  font-size:   0.8125rem;
  font-weight: 500;
  color:       var(--crm-text);
  margin-bottom: 0.375rem;
  display:     block;
}
.crm-form-control {
  width:         100%;
  padding:       0.5rem 0.875rem;
  font-size:     0.875rem;
  font-family:   var(--crm-font);
  color:         var(--crm-text);
  background:    var(--crm-surface);
  border:        1.5px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  outline:       none;
  transition:    border-color var(--crm-transition), box-shadow var(--crm-transition);
  line-height:   1.5;
}
.crm-form-control:focus {
  border-color: var(--crm-primary);
  box-shadow:   0 0 0 3px rgba(0,125,136,.12);
}
.crm-form-control::placeholder { color: var(--crm-text-light); }

/* ── Aliases (catálogo usa crm-label / crm-input / crm-select) */
.crm-label {
  font-size:   0.8125rem;
  font-weight: 600;
  color:       var(--crm-text);
  margin-bottom: 0.375rem;
  display:     block;
  letter-spacing: 0.01em;
}
.crm-input,
.crm-select {
  width:         100%;
  padding:       0.5rem 0.875rem;
  font-size:     0.875rem;
  font-family:   var(--crm-font);
  color:         var(--crm-text);
  background:    var(--crm-surface);
  border:        1.5px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  outline:       none;
  transition:    border-color .15s ease, box-shadow .15s ease;
  line-height:   1.5;
  display:       block;
}
.crm-input:focus,
.crm-select:focus {
  border-color: var(--crm-primary);
  box-shadow:   0 0 0 3.5px rgba(0,125,136,.14);
}
.crm-input:hover:not(:focus):not(:disabled),
.crm-select:hover:not(:focus):not(:disabled) {
  border-color: #c2cad5;
}
.crm-input::placeholder { color: var(--crm-text-light); }
.crm-select { appearance: auto; cursor: pointer; }
textarea.crm-input { resize: vertical; min-height: 70px; }

.crm-phone-input {
  display: grid;
  grid-template-columns: minmax(7.25rem, 8rem) 1fr;
  gap: .5rem;
}
.crm-phone-code {
  font-weight: 600;
  padding-left: .65rem;
  padding-right: .65rem;
}
.crm-more-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .62rem .8rem;
  border: 1.5px dashed var(--crm-border);
  border-radius: var(--crm-radius-sm);
  background: var(--crm-bg);
  color: var(--crm-text-muted);
  font-family: var(--crm-font);
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--crm-transition), color var(--crm-transition), background var(--crm-transition);
}
.crm-more-toggle:hover,
.crm-more-toggle.open {
  border-color: var(--crm-primary);
  background: var(--crm-primary-light);
  color: var(--crm-primary);
}
.crm-contact-more {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid var(--crm-border);
}
.crm-contact-more[hidden] { display: none; }
.crm-company-card {
  background: var(--crm-bg);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  padding: 1rem;
}
.crm-company-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .9rem;
}
.crm-company-card-title {
  color: var(--crm-text);
  font-size: .95rem;
  font-weight: 700;
}
.crm-company-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--crm-text-muted);
  font-size: .75rem;
  font-weight: 700;
  margin: .4rem 0 1rem;
  text-transform: uppercase;
}
.crm-company-divider::before,
.crm-company-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--crm-border);
}
.crm-place-suggestions {
  position: absolute;
  z-index: 1060;
  top: calc(100% - .1rem);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  box-shadow: var(--crm-shadow-lg);
}
.crm-place-suggestion {
  width: 100%;
  display: grid;
  gap: .2rem;
  border: 0;
  border-bottom: 1px solid var(--crm-border);
  background: transparent;
  color: var(--crm-text);
  font-family: var(--crm-font);
  padding: .7rem .85rem;
  text-align: left;
  cursor: pointer;
}
.crm-place-suggestion:last-child { border-bottom: 0; }
.crm-place-suggestion:hover,
.crm-place-suggestion:focus {
  background: var(--crm-bg);
  outline: none;
}
.crm-place-suggestion strong {
  font-size: .9rem;
  font-weight: 700;
}
.crm-place-suggestion span {
  color: var(--crm-text-muted);
  font-size: .78rem;
  line-height: 1.3;
}
.crm-place-live {
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  background: var(--crm-bg);
  padding: .8rem;
}
.crm-form-group { margin-bottom: 1rem; }
.crm-form-hint {
  font-size:  0.75rem;
  color:      var(--crm-text-muted);
  margin-top: 0.25rem;
}

/* ── Modal ─────────────────────────────────────────────────── */
.crm-modal-overlay {
  display:         none;
  position:        fixed;
  inset:           0;
  background:      rgba(12, 17, 27, .52);
  z-index:         1050;
  align-items:     center;
  justify-content: center;
  padding:         1rem;
  backdrop-filter: blur(6px) saturate(1.3);
  -webkit-backdrop-filter: blur(6px) saturate(1.3);
}
.crm-modal-overlay.open { display: flex; }
.crm-modal {
  background:    var(--crm-surface);
  border-radius: var(--crm-radius-lg);
  box-shadow:    0 24px 64px rgba(0,0,0,.2), 0 4px 12px rgba(0,0,0,.1);
  width:         100%;
  max-width:     560px;
  max-height:    90vh;
  overflow-y:    auto;
  animation:     modalIn .28s cubic-bezier(.34,1.56,.64,1) both;
  border-top:    3px solid var(--crm-primary);
}
@keyframes modalIn {
  0%   { opacity: 0; transform: scale(.92) translateY(-14px); }
  55%  { opacity: 1; transform: scale(1.015) translateY(2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.crm-modal-header {
  display:       flex;
  align-items:   center;
  justify-content: space-between;
  gap:           0.75rem;
  padding:       1.25rem 1.5rem;
  border-bottom: 1px solid var(--crm-border);
}
.crm-modal-title {
  font-size:      1rem;
  font-weight:    700;
  letter-spacing: -0.015em;
  color:          var(--crm-text);
  margin:         0;
  display:        flex;
  align-items:    center;
  gap:            0.625rem;
  flex:           1;
}
.crm-modal-title-icon {
  width:           34px;
  height:          34px;
  border-radius:   8px;
  background:      var(--crm-primary-light);
  color:           var(--crm-primary);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       1rem;
  flex-shrink:     0;
}
.crm-modal-close {
  width:       30px;
  height:      30px;
  border-radius: 6px;
  display:     flex;
  align-items: center;
  justify-content: center;
  background:  transparent;
  border:      none;
  cursor:      pointer;
  color:       var(--crm-text-muted);
  font-size:   1rem;
  transition:  background .12s ease, color .12s ease;
  flex-shrink: 0;
}
.crm-modal-close:hover { background: var(--crm-bg); color: var(--crm-text); }
.crm-modal-body    { padding: 1.5rem; }
.crm-modal-footer  { padding: 1rem 1.5rem; border-top: 1px solid var(--crm-border); background: var(--crm-bg); border-radius: 0 0 var(--crm-radius-lg) var(--crm-radius-lg); display: flex; align-items: center; justify-content: flex-end; gap: .625rem; }

/* ── Progress bar ──────────────────────────────────────────── */
.crm-progress {
  height:        7px;
  background:    var(--crm-border-light);
  border-radius: 10px;
  overflow:      hidden;
}
.crm-progress-bar {
  height:        100%;
  background:    var(--crm-primary);
  border-radius: 10px;
  transition:    width .4s ease;
}
.crm-progress-bar.success { background: var(--crm-success); }
.crm-progress-bar.warning { background: var(--crm-warning); }
.crm-progress-bar.danger  { background: var(--crm-danger); }

/* ── Score / mini barra ────────────────────────────────────── */
.crm-score-bar {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
}
.crm-score-bar .crm-progress { flex: 1; }
.crm-score-label {
  font-size:   0.75rem;
  font-weight: 600;
  color:       var(--crm-text-muted);
  min-width:   28px;
  text-align:  right;
}

/* ── Avatar ────────────────────────────────────────────────── */
.crm-avatar {
  border-radius: 50%;
  display:       inline-flex;
  align-items:   center;
  justify-content: center;
  font-weight:   600;
  color:         #fff;
  background:    var(--crm-primary);
  flex-shrink:   0;
}
.crm-avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }
.crm-avatar-md { width: 36px; height: 36px; font-size: 0.85rem; }
.crm-avatar-lg { width: 48px; height: 48px; font-size: 1rem; }

/* ── Tabs ──────────────────────────────────────────────────── */
.crm-tabs {
  display:       inline-flex;
  flex-wrap:     wrap;
  gap:           2px;
  border-bottom: none;
  margin-bottom: 1.5rem;
  background:    var(--crm-bg);
  border:        1px solid var(--crm-border);
  border-radius: calc(var(--crm-radius) + 2px);
  padding:       3px;
}
.crm-tab {
  padding:       0.45rem 0.9rem;
  font-size:     0.875rem;
  font-weight:   500;
  color:         var(--crm-text-muted);
  cursor:        pointer;
  border-bottom: none;
  margin-bottom: 0;
  border-radius: var(--crm-radius-sm);
  transition:    background .15s ease, color .15s ease, box-shadow .15s ease;
  border:        none;
  background:    transparent;
  font-family:   var(--crm-font);
  display:       flex;
  align-items:   center;
  gap:           0.375rem;
  white-space:   nowrap;
}
.crm-tab:hover:not(.active) { background: rgba(0,0,0,.04); color: var(--crm-text); }
.crm-tab.active { background: var(--crm-surface); color: var(--crm-primary); font-weight: 600; box-shadow: 0 1px 5px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.04); border-bottom: none; }

/* ── Funnel de ventas ──────────────────────────────────────── */
.crm-funnel {
  padding: 1rem 0;
}
.crm-funnel-stage {
  display:       flex;
  align-items:   center;
  gap:           1rem;
  margin-bottom: 0.625rem;
  cursor:        pointer;
  padding:       0.5rem;
  border-radius: var(--crm-radius-sm);
  transition:    background var(--crm-transition);
}
.crm-funnel-stage:hover { background: var(--crm-bg); }
.crm-funnel-stage.selected { background: var(--crm-primary-light); }
.crm-funnel-label {
  min-width:   100px;
  font-size:   0.8125rem;
  font-weight: 600;
  color:       var(--crm-text);
  text-align:  right;
}
.crm-funnel-bar-wrap {
  flex: 1;
  height: 38px;
  background: var(--crm-bg);
  border-radius: var(--crm-radius-sm);
  overflow: hidden;
  position: relative;
}
.crm-funnel-bar {
  height:        100%;
  border-radius: var(--crm-radius-sm);
  display:       flex;
  align-items:   center;
  padding-left:  0.75rem;
  min-width:     60px;
  transition:    width .5s cubic-bezier(.4,0,.2,1);
}
.crm-funnel-bar-text {
  font-size:   0.75rem;
  font-weight: 700;
  color:       #fff;
  white-space: nowrap;
}
.crm-funnel-meta {
  min-width:   120px;
  text-align:  right;
}
.crm-funnel-count { font-size: 0.875rem; font-weight: 700; color: var(--crm-text); }
.crm-funnel-value { font-size: 0.75rem; color: var(--crm-text-muted); }

/* ── Kanban ────────────────────────────────────────────────── */
.crm-kanban {
  display:    flex;
  gap:        1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}
.crm-kanban::-webkit-scrollbar { height: 6px; }
.crm-kanban::-webkit-scrollbar-track { background: transparent; }
.crm-kanban::-webkit-scrollbar-thumb { background: var(--crm-border); border-radius: 3px; }
.crm-kanban-col {
  min-width:     260px;
  max-width:     260px;
  background:    var(--crm-bg);
  border-radius: var(--crm-radius);
  padding:       0.875rem;
  flex-shrink:   0;
}
.crm-kanban-col-header {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  margin-bottom: 0.875rem;
}
.crm-kanban-col-dot {
  width:        8px;
  height:       8px;
  border-radius: 50%;
  flex-shrink:  0;
}
.crm-kanban-col-name {
  font-size:   0.8125rem;
  font-weight: 600;
  color:       var(--crm-text);
  flex:        1;
}
.crm-kanban-col-count {
  font-size:   0.7rem;
  font-weight: 600;
  background:  var(--crm-border);
  color:       var(--crm-text-muted);
  padding:     1px 7px;
  border-radius: 20px;
}
.crm-kanban-card {
  background:    var(--crm-surface);
  border-radius: var(--crm-radius-sm);
  border:        1px solid var(--crm-border);
  padding:       0.875rem;
  margin-bottom: 0.5rem;
  box-shadow:    var(--crm-shadow-sm);
  transition:    box-shadow var(--crm-transition), transform var(--crm-transition);
  cursor:        pointer;
}
.crm-kanban-card:hover {
  box-shadow: var(--crm-shadow);
  transform:  translateY(-1px);
}
.crm-kanban-card-title {
  font-size:   0.875rem;
  font-weight: 600;
  color:       var(--crm-text);
  margin-bottom: 0.375rem;
}
.crm-kanban-card-company {
  font-size:  0.775rem;
  color:      var(--crm-text-muted);
  margin-bottom: 0.5rem;
  display:    flex;
  align-items: center;
  gap:        0.25rem;
}
.crm-kanban-card-value {
  font-size:   0.9375rem;
  font-weight: 700;
  color:       var(--crm-primary);
  margin-bottom: 0.5rem;
}
.crm-kanban-card-footer {
  display:     flex;
  align-items: center;
  justify-content: space-between;
  font-size:   0.75rem;
  color:       var(--crm-text-muted);
}
.crm-kanban-card-move {
  display:    flex;
  gap:        0.25rem;
  margin-top: 0.5rem;
}
.crm-kanban-move-btn {
  font-size:   0.7rem;
  padding:     2px 8px;
  border-radius: 20px;
  border:      1px solid var(--crm-border);
  background:  transparent;
  color:       var(--crm-text-muted);
  cursor:      pointer;
  transition:  all var(--crm-transition);
  font-family: var(--crm-font);
}
.crm-kanban-move-btn:hover { border-color: var(--crm-primary); color: var(--crm-primary); background: var(--crm-primary-light); }

/* ── Chat / Conversaciones ─────────────────────────────────── */
.crm-chat-layout {
  display:       flex;
  gap:           0;
  height:        calc(100vh - var(--crm-header-height) - 8rem);
  min-height:    500px;
  background:    var(--crm-surface);
  border-radius: var(--crm-radius);
  border:        1px solid var(--crm-border);
  overflow:      hidden;
}
.crm-chat-list {
  width:         320px;
  border-right:  1px solid var(--crm-border);
  display:       flex;
  flex-direction: column;
  flex-shrink:   0;
}
.crm-chat-list-header {
  padding:       1rem 1.25rem;
  border-bottom: 1px solid var(--crm-border);
}
.crm-chat-list-title {
  font-size:   0.9375rem;
  font-weight: 600;
  margin:      0;
}
.crm-chat-list-body { overflow-y: auto; flex: 1; }
.crm-chat-item {
  display:     flex;
  gap:         0.75rem;
  padding:     0.875rem 1.25rem;
  cursor:      pointer;
  border-bottom: 1px solid var(--crm-border-light);
  transition:  background var(--crm-transition);
  align-items: flex-start;
}
.crm-chat-item:hover { background: var(--crm-bg); }
.crm-chat-item.active { background: var(--crm-primary-light); }
.crm-chat-item-info { flex: 1; min-width: 0; }
.crm-chat-item-name {
  font-size:   0.875rem;
  font-weight: 600;
  color:       var(--crm-text);
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
}
.crm-chat-item-preview {
  font-size:   0.775rem;
  color:       var(--crm-text-muted);
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
  margin-top:  0.125rem;
}
.crm-chat-item-time { font-size: 0.7rem; color: var(--crm-text-light); white-space: nowrap; }
.crm-chat-item-unread {
  width:         18px;
  height:        18px;
  background:    var(--crm-primary);
  color:         #fff;
  border-radius: 50%;
  font-size:     0.65rem;
  font-weight:   700;
  display:       flex;
  align-items:   center;
  justify-content: center;
  flex-shrink:   0;
}
.crm-chat-main {
  flex:          1;
  display:       flex;
  flex-direction: column;
  min-width:     0;
}
.crm-chat-main-header {
  padding:       1rem 1.5rem;
  border-bottom: 1px solid var(--crm-border);
  display:       flex;
  align-items:   center;
  gap:           0.75rem;
}
.crm-chat-messages {
  flex:           1;
  overflow-y:     auto;
  padding:        1.25rem 1.5rem;
  display:        flex;
  flex-direction: column;
  gap:            0.75rem;
  scroll-behavior: smooth;
}
.crm-msg {
  display:    flex;
  gap:        0.5rem;
  max-width:  75%;
}
.crm-msg.outbound { flex-direction: row-reverse; align-self: flex-end; }
.crm-msg.inbound  { align-self: flex-start; }
.crm-msg-bubble {
  padding:       0.625rem 0.875rem;
  border-radius: var(--crm-radius);
  font-size:     0.875rem;
  line-height:   1.5;
  position:      relative;
}
.crm-msg.inbound  .crm-msg-bubble { background: var(--crm-bg); color: var(--crm-text); border-radius: 0 var(--crm-radius) var(--crm-radius) var(--crm-radius); }
.crm-msg.outbound .crm-msg-bubble { background: var(--crm-primary); color: #fff; border-radius: var(--crm-radius) 0 var(--crm-radius) var(--crm-radius); }
.crm-msg-time { font-size: 0.675rem; margin-top: 0.25rem; color: var(--crm-text-light); }
.crm-msg.outbound .crm-msg-time { text-align: right; color: var(--crm-text-light); }
.crm-chat-input-area {
  padding:       1rem 1.5rem;
  border-top:    1px solid var(--crm-border);
  display:       flex;
  gap:           0.75rem;
  align-items:   flex-end;
}
.crm-chat-input {
  flex:          1;
  border:        1.5px solid var(--crm-border);
  border-radius: var(--crm-radius);
  padding:       0.625rem 1rem;
  font-size:     0.875rem;
  font-family:   var(--crm-font);
  resize:        none;
  outline:       none;
  transition:    border-color var(--crm-transition);
  color:         var(--crm-text);
  background:    var(--crm-surface);
  min-height:    44px;
  max-height:    120px;
}
.crm-chat-input:focus { border-color: var(--crm-primary); }
.crm-chat-send {
  width:         40px;
  height:        40px;
  border-radius: 50%;
  background:    var(--crm-primary);
  color:         #fff;
  border:        none;
  cursor:        pointer;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     1.1rem;
  flex-shrink:   0;
  transition:    background var(--crm-transition);
}
.crm-chat-send:hover { background: var(--crm-primary-dark); }

/* ── Toast / Notificaciones ────────────────────────────────── */
.crm-toast-container {
  position:  fixed;
  top:       1.25rem;
  right:     1.25rem;
  z-index:   9999;
  display:   flex;
  flex-direction: column;
  gap:       0.5rem;
}
.crm-toast {
  min-width:     280px;
  background:    var(--crm-surface);
  border:        1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow:    var(--crm-shadow-lg);
  padding:       0.875rem 1.125rem;
  display:       flex;
  align-items:   center;
  gap:           0.75rem;
  animation:     toastIn .25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.crm-toast.success { border-left: 4px solid var(--crm-success); }
.crm-toast.error   { border-left: 4px solid var(--crm-danger); }
.crm-toast.warning { border-left: 4px solid var(--crm-warning); }
.crm-toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.crm-toast.success .crm-toast-icon { color: var(--crm-success); }
.crm-toast.error   .crm-toast-icon { color: var(--crm-danger); }
.crm-toast.warning .crm-toast-icon { color: var(--crm-warning); }
.crm-toast-msg { flex: 1; font-size: 0.875rem; color: var(--crm-text); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 991px) {
  .crm-sidebar {
    transform: translateX(-100%);
  }
  .crm-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--crm-shadow-lg);
  }
  .crm-topbar  { left: 0; }
  .crm-content { margin-left: 0; }
  body.crm-sidebar-mobile-open { overflow: hidden; }
  .crm-nav {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
  .crm-nav-section-toggle {
    min-height: 44px;
  }
  .crm-nav-item {
    min-height: 44px;
  }
}
@media (max-width: 767px) {
  .crm-content { padding: 1rem; }
  .crm-topbar { padding: 0 .75rem; gap: .5rem; }
  .crm-topbar-title {
    font-size: .95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .crm-sidebar { width: min(88vw, 320px); }
  .crm-topbar-search { display: none; }
  .crm-chat-list { width: 100%; display: none; }
  .crm-chat-list.show { display: flex; }
}

/* ── Empty state ───────────────────────────────────────────── */
.crm-empty {
  text-align: center;
  padding:    3rem 1.5rem;
  color:      var(--crm-text-muted);
}
.crm-empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: .4; }
.crm-empty-text { font-size: 0.9375rem; }

/* ── Utilities ─────────────────────────────────────────────── */
.fw-600 { font-weight: 600; }
.text-primary { color: var(--crm-primary) !important; }
.text-muted   { color: var(--crm-text-muted) !important; }
.text-sm      { font-size: 0.8125rem; }
.text-xs      { font-size: 0.75rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }

/* ── Login Page ────────────────────────────────────────────── */
.crm-login-page {
  min-height:    100vh;
  display:       flex;
  align-items:   center;
  justify-content: center;
  background:    linear-gradient(135deg, #007D88 0%, #005f68 50%, #003d44 100%);
  padding:       1rem;
}
.crm-login-card {
  background:    #fff;
  border-radius: var(--crm-radius-xl);
  box-shadow:    0 20px 60px rgba(0,0,0,.2);
  padding:       2.5rem;
  width:         100%;
  max-width:     420px;
}
.crm-login-logo {
  display:       flex;
  align-items:   center;
  gap:           0.75rem;
  margin-bottom: 2rem;
}
.crm-login-logo-icon {
  width:         44px;
  height:        44px;
  background:    var(--crm-primary);
  border-radius: var(--crm-radius-sm);
  display:       flex;
  align-items:   center;
  justify-content: center;
  color:         #fff;
  font-size:     1.375rem;
}
.crm-login-logo-text { font-size: 1.125rem; font-weight: 700; color: var(--crm-text); }
.crm-login-logo-sub  { font-size: 0.75rem; color: var(--crm-text-muted); }
.crm-login-title { font-size: 1.375rem; font-weight: 700; margin-bottom: 0.375rem; }
.crm-login-subtitle { color: var(--crm-text-muted); font-size: 0.9rem; margin-bottom: 1.75rem; }
.crm-login-btn {
  width:         100%;
  padding:       0.75rem;
  background:    var(--crm-primary);
  color:         #fff;
  border:        none;
  border-radius: var(--crm-radius-sm);
  font-size:     1rem;
  font-weight:   600;
  cursor:        pointer;
  font-family:   var(--crm-font);
  transition:    background var(--crm-transition), box-shadow var(--crm-transition);
  margin-top:    0.5rem;
}
.crm-login-btn:hover { background: var(--crm-primary-dark); box-shadow: 0 4px 20px rgba(0,125,136,.35); }
.crm-login-hint {
  text-align:  center;
  font-size:   0.8rem;
  color:       var(--crm-text-muted);
  margin-top:  1.5rem;
  padding-top: 1.25rem;
  border-top:  1px solid var(--crm-border-light);
}

/* ── Botones sociales en login ──────────────────────────────── */
.crm-social-btn {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             0.6rem;
  width:           100%;
  padding:         0.7rem 1rem;
  border-radius:   var(--crm-radius-sm);
  border:          1px solid #d1d5db;
  background:      #fff;
  color:           #374151;
  font-size:       0.9rem;
  font-weight:     500;
  font-family:     var(--crm-font);
  cursor:          pointer;
  text-decoration: none;
  transition:      background 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow:      0 1px 3px rgba(0,0,0,.06);
}
.crm-social-btn:hover {
  background:    #f9fafb;
  border-color:  #9ca3af;
  box-shadow:    0 2px 8px rgba(0,0,0,.1);
  color:         #111827;
  text-decoration: none;
}
.crm-social-btn.disabled {
  opacity:       0.45;
  cursor:        not-allowed;
  pointer-events: none;
}
.crm-social-divider {
  display:       flex;
  align-items:   center;
  gap:           0.75rem;
  margin:        1.1rem 0;
  color:         #9ca3af;
  font-size:     0.78rem;
}
.crm-social-divider::before,
.crm-social-divider::after {
  content:       '';
  flex:          1;
  height:        1px;
  background:    #e5e7eb;
}
.crm-alert {
  padding:       0.75rem 1rem;
  border-radius: var(--crm-radius-sm);
  font-size:     0.875rem;
  margin-bottom: 1rem;
  display:       flex;
  align-items:   center;
  gap:           0.5rem;
}
.crm-alert-danger {
  background: rgba(220,53,69,.1);
  border:     1px solid rgba(220,53,69,.25);
  color:      #b02a37;
}
.crm-alert-success {
  background: rgba(0,214,127,.1);
  border:     1px solid rgba(0,214,127,.25);
  color:      #00a862;
}

/* ── Quote lines table ─────────────────────────────────────── */
.quote-lines-table td input {
  border:        1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  padding:       0.3rem 0.5rem;
  font-size:     0.8125rem;
  width:         100%;
  outline:       none;
  font-family:   var(--crm-font);
}
.quote-lines-table td input:focus { border-color: var(--crm-primary); }

/* ── Conversaciones tipo WhatsApp ──────────────────────────── */
.crm-conversations-page {
  padding: 1rem;
  height: calc(100vh - var(--crm-header-height));
}
.crm-wa-shell {
  height: 100%;
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  overflow: hidden;
  box-shadow: var(--crm-shadow-sm);
}
.crm-icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--crm-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background var(--crm-transition), color var(--crm-transition);
}
.crm-icon-btn:hover { background: var(--crm-bg); color: var(--crm-text); }
.crm-icon-btn.recording { color: #dc2626; background: #fee2e2; }
.crm-wa-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--crm-border);
  background: #fff;
}
.crm-wa-sidebar-head {
  min-height: 74px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--crm-border-light);
}
.crm-wa-sidebar-head h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.crm-wa-sidebar-head p {
  margin: .125rem 0 0;
  color: var(--crm-text-muted);
  font-size: .8rem;
}
.crm-wa-search {
  margin: .75rem;
  height: 42px;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 .85rem;
  background: #f1f5f9;
  border-radius: 999px;
  color: var(--crm-text-muted);
}
.crm-wa-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  color: var(--crm-text);
  font-size: .9rem;
}
.crm-wa-filters {
  display: flex;
  gap: .4rem;
  padding: 0 .75rem .75rem;
  overflow-x: auto;
}
.crm-wa-filters button {
  border: 0;
  border-radius: 999px;
  padding: .35rem .7rem;
  background: #f1f5f9;
  color: var(--crm-text-muted);
  white-space: nowrap;
  font-size: .78rem;
}
.crm-wa-filters button.active { background: #d9fdd3; color: #176b5b; }
.crm-wa-list {
  flex: 1;
  overflow: auto;
}
.crm-wa-chat {
  width: 100%;
  border: 0;
  background: #fff;
  display: flex;
  gap: .75rem;
  padding: .78rem .9rem;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}
.crm-wa-chat:hover,
.crm-wa-chat.active { background: #f8fafc; }
.crm-wa-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d8f3ef;
  color: #007d70;
  font-weight: 700;
}
.crm-wa-chat-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.crm-wa-chat-top,
.crm-wa-chat-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-width: 0;
}
.crm-wa-chat-top strong,
.crm-wa-chat-bottom span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-wa-chat-top strong { color: var(--crm-text); font-size: .92rem; }
.crm-wa-chat-top em {
  color: var(--crm-text-light);
  font-size: .72rem;
  font-style: normal;
  flex-shrink: 0;
}
.crm-wa-chat-bottom {
  color: var(--crm-text-muted);
  font-size: .8rem;
}
.crm-wa-chat-bottom b {
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
}
.crm-wa-thread {
  min-width: 0;
  background: #efeae2;
  position: relative;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.crm-wa-thread::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(17, 24, 39, .06) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}
.crm-wa-empty {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #64748b;
  padding: 2rem;
}
.crm-wa-empty i { font-size: 4rem; color: #94a3b8; }
.crm-wa-empty h2 { margin: .75rem 0 .25rem; font-size: 1.35rem; color: #334155; }
.crm-wa-active {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.crm-wa-thread-head {
  min-height: 74px;
  padding: .75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--crm-border-light);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.crm-wa-back { display: none; }
.crm-wa-contact {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.crm-wa-contact strong {
  font-size: .98rem;
  color: var(--crm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-wa-contact span {
  font-size: .78rem;
  color: var(--crm-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-wa-actions {
  display: flex;
  gap: .45rem;
  flex-shrink: 0;
}
.crm-wa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 4%;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.crm-wa-date {
  align-self: center;
  padding: .35rem .75rem;
  border-radius: .5rem;
  background: rgba(255,255,255,.82);
  color: #64748b;
  font-size: .72rem;
  margin: .65rem 0;
  box-shadow: 0 1px 2px rgba(15,23,42,.08);
}
.crm-wa-msg {
  max-width: min(72%, 640px);
  display: flex;
}
.crm-wa-msg.inbound { align-self: flex-start; }
.crm-wa-msg.outbound { align-self: flex-end; }
.crm-wa-bubble {
  border-radius: .55rem;
  padding: .45rem .55rem .28rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.12);
  overflow-wrap: anywhere;
}
.crm-wa-msg.inbound .crm-wa-bubble { background: #fff; border-top-left-radius: .1rem; }
.crm-wa-msg.outbound .crm-wa-bubble { background: #d9fdd3; border-top-right-radius: .1rem; }
.crm-wa-text {
  color: #111827;
  font-size: .92rem;
  line-height: 1.42;
  white-space: normal;
}
.crm-wa-time {
  text-align: right;
  color: #667781;
  font-size: .68rem;
  margin-top: .2rem;
  white-space: nowrap;
}
.crm-wa-media-img,
.crm-wa-media-video {
  display: block;
  width: min(360px, 100%);
  max-height: 330px;
  object-fit: cover;
  border-radius: .45rem;
  margin-bottom: .35rem;
  background: #0f172a;
}
.crm-wa-media-audio {
  width: min(320px, 70vw);
  display: block;
}
.crm-wa-media-doc {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: min(280px, 70vw);
  padding: .75rem;
  background: rgba(255,255,255,.75);
  border-radius: .45rem;
  color: #0f172a;
  text-decoration: none;
  margin-bottom: .35rem;
}
.crm-wa-media-doc i { font-size: 1.45rem; color: #64748b; }
.crm-wa-attachment-preview {
  margin: 0 1rem .5rem;
  background: #fff;
  border-radius: .75rem;
  padding: .55rem .65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  box-shadow: 0 2px 8px rgba(15,23,42,.1);
}
.crm-wa-attachment-preview span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-wa-attachment-preview em {
  color: var(--crm-text-muted);
  font-size: .75rem;
  font-style: normal;
  margin-left: .35rem;
}
.crm-wa-composer {
  padding: .75rem 1rem;
  background: #f0f2f5;
  display: flex;
  align-items: flex-end;
  gap: .45rem;
}
.crm-wa-input-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}
.crm-wa-input-wrap textarea {
  width: 100%;
  min-height: 42px;
  max-height: 140px;
  border: 0;
  border-radius: 1.25rem;
  padding: .65rem 1rem;
  resize: none;
  outline: 0;
  font-family: var(--crm-font);
  color: var(--crm-text);
  background: #fff;
}
.crm-wa-emoji {
  position: absolute;
  bottom: calc(100% + .55rem);
  left: 0;
  display: flex;
  gap: .35rem;
  padding: .5rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: var(--crm-shadow);
}
.crm-wa-emoji button {
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
}
.crm-wa-send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  cursor: pointer;
}
.crm-wa-list-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--crm-text-muted);
}
@media (max-width: 900px) {
  .crm-conversations-page { padding: 0; }
  .crm-wa-shell {
    height: calc(100vh - var(--crm-header-height));
    min-height: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    display: block;
    position: relative;
  }
  .crm-wa-sidebar,
  .crm-wa-thread {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
  .crm-wa-thread { transform: translateX(100%); transition: transform .18s ease; }
  .crm-wa-shell.thread-open .crm-wa-thread { transform: translateX(0); }
  .crm-wa-shell.thread-open .crm-wa-sidebar { visibility: hidden; }
  .crm-wa-back { display: inline-flex; }
  .crm-wa-actions .crm-btn { padding: .45rem .6rem; font-size: .78rem; }
  .crm-wa-msg { max-width: 88%; }
  .crm-wa-messages { padding: 1rem .75rem; }
}


/* ============================================================
   UX REFRESH 2026 — SmartCRM UI Improvements
   Overrides & enhancements — no existing styles modified
   ============================================================ */

/* ── Animaciones globales ──────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

/* ── Modals — rediseño completo ────────────────────────────── */
.crm-modal-overlay {
  background: rgba(12, 17, 27, .52);
  backdrop-filter: blur(6px) saturate(1.3);
  -webkit-backdrop-filter: blur(6px) saturate(1.3);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
@keyframes modalIn {
  0%   { opacity: 0; transform: scale(.92) translateY(-14px); }
  55%  { opacity: 1; transform: scale(1.015) translateY(2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.crm-modal {
  animation: modalIn .28s cubic-bezier(.34,1.56,.64,1) both;
  box-shadow: 0 24px 64px rgba(0,0,0,.22), 0 4px 12px rgba(0,0,0,.1);
}
.crm-modal-header {
  border-top: 3px solid var(--crm-primary);
  border-radius: var(--crm-radius-lg) var(--crm-radius-lg) 0 0;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.crm-modal-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--crm-text);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1;
}
.crm-modal-title-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--crm-primary-light);
  color: var(--crm-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.crm-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--crm-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, color .12s ease;
  flex-shrink: 0;
  font-size: 1rem;
}
.crm-modal-close:hover {
  background: var(--crm-bg);
  color: var(--crm-text);
}
.crm-modal-body {
  padding: 1.5rem;
}
.crm-modal-footer {
  background: var(--crm-bg);
  border-top: 1px solid var(--crm-border);
  border-radius: 0 0 var(--crm-radius-lg) var(--crm-radius-lg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
}

/* ── Formularios — jerarquía y estados ─────────────────────── */
.crm-form-label {
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--crm-text);
}
.crm-form-label.required::after {
  content: " *";
  color: var(--crm-danger);
  font-weight: 700;
}
.crm-form-control:hover:not(:focus):not(:disabled):not([readonly]) {
  border-color: #c2cad5;
}
.crm-form-control:focus {
  box-shadow: 0 0 0 3.5px rgba(0, 125, 136, .14);
  background: #fff;
}
.crm-form-control.is-invalid {
  border-color: var(--crm-danger) !important;
  background-image: none;
}
.crm-form-control.is-invalid:focus {
  box-shadow: 0 0 0 3.5px rgba(220, 53, 69, .14) !important;
}
.crm-invalid-feedback {
  display: none;
  font-size: 0.75rem;
  color: var(--crm-danger);
  margin-top: 0.25rem;
  font-weight: 500;
}
.crm-form-control.is-invalid ~ .crm-invalid-feedback {
  display: block;
  animation: fadeInUp .15s ease;
}
.crm-form-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
}
.crm-form-hint i {
  font-size: 0.875rem;
  margin-top: 0.05rem;
  flex-shrink: 0;
}
.crm-form-group {
  margin-bottom: 1.125rem;
}

/* ── Botones — elevated + loading state ────────────────────── */
.crm-btn {
  transition: background .15s ease, box-shadow .15s ease, transform .12s ease, opacity .15s ease;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.crm-btn:active {
  transform: translateY(0) scale(.98) !important;
}
.crm-btn-primary:not(:disabled):not(.loading) {
  box-shadow: 0 2px 8px rgba(0, 125, 136, .28);
}
.crm-btn-primary:not(:disabled):not(.loading):hover {
  box-shadow: 0 4px 16px rgba(0, 125, 136, .38);
  transform: translateY(-1px);
}
.crm-btn.loading {
  pointer-events: none;
  opacity: .72;
  gap: 0 !important;
}
.crm-btn.loading::after {
  content: '';
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: rgba(255, 255, 255, .9);
  border-radius: 50%;
  animation: spin .55s linear infinite;
  margin-left: 0.5rem;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.crm-btn-outline.loading::after,
.crm-btn-ghost.loading::after {
  border-color: rgba(0, 125, 136, .25);
  border-top-color: var(--crm-primary);
}
.crm-btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8125rem; }
.crm-btn-danger:not(:disabled):not(.loading) {
  box-shadow: 0 2px 8px rgba(220, 53, 69, .22);
}
.crm-btn-danger:not(:disabled):not(.loading):hover {
  box-shadow: 0 4px 14px rgba(220, 53, 69, .32);
  transform: translateY(-1px);
}

/* ── Tabs — pill style ─────────────────────────────────────── */
.crm-tabs {
  border-bottom: none;
  background: var(--crm-bg);
  border: 1px solid var(--crm-border);
  border-radius: calc(var(--crm-radius) + 2px);
  padding: 3px;
  gap: 2px;
  display: inline-flex;
  flex-wrap: wrap;
}
.crm-tab {
  border-bottom: none !important;
  border-radius: var(--crm-radius-sm);
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  color: var(--crm-text-muted);
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  margin-bottom: 0 !important;
  white-space: nowrap;
}
.crm-tab:hover:not(.active) {
  background: rgba(0, 0, 0, .04);
  color: var(--crm-text);
}
.crm-tab.active {
  background: var(--crm-surface) !important;
  color: var(--crm-primary) !important;
  font-weight: 600;
  box-shadow: 0 1px 5px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.04);
  border-bottom: none !important;
}

/* ── Tablas — mejor scannability ───────────────────────────── */
.crm-table thead th {
  background: linear-gradient(to bottom, #f8fafc, var(--crm-bg));
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--crm-text-muted);
  padding: 0.8rem 1rem;
  border-bottom: 2px solid var(--crm-border);
  white-space: nowrap;
}
.crm-table tbody tr {
  transition: background .1s ease;
}
.crm-table tbody tr:hover {
  background: rgba(0, 125, 136, .035);
}
.crm-table tbody td {
  vertical-align: middle;
}
.crm-table tbody td:first-child {
  font-weight: 500;
}
.row-actions {
  opacity: 0;
  transition: opacity .15s ease;
}
.crm-table tbody tr:hover .row-actions {
  opacity: 1;
}

/* ── Stat Cards — más impacto ──────────────────────────────── */
.crm-stat {
  border: 1px solid var(--crm-border) !important;
  transition: transform .2s ease, box-shadow .2s ease !important;
}
.crm-stat:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.09) !important;
}
.crm-stat-value {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.crm-stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Toasts — floating card style ─────────────────────────── */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(28px) scale(.94); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.crm-toast-container {
  top: 1.25rem;
  right: 1.25rem;
  gap: 0.625rem;
  display: flex;
  flex-direction: column;
}
.crm-toast {
  border-left: none !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 24px rgba(0,0,0,.14), 0 1px 4px rgba(0,0,0,.08) !important;
  padding: 0.875rem 1rem !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
  min-width: 290px !important;
  background: rgba(255, 255, 255, .97) !important;
  backdrop-filter: blur(8px);
  animation: toastIn .22s cubic-bezier(.34,1.3,.64,1) both !important;
}
.crm-toast-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0;
}
.crm-toast.success .crm-toast-icon { background: rgba(0,214,127,.14); color: #00a862; }
.crm-toast.error   .crm-toast-icon { background: rgba(220,53,69,.12); color: #dc3545; }
.crm-toast.warning .crm-toast-icon { background: rgba(255,196,0,.14); color: #b38000; }
.crm-toast-msg {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--crm-text);
  line-height: 1.45;
  padding-top: 0.375rem;
}

/* ── Empty States ──────────────────────────────────────────── */
.crm-empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  animation: fadeInUp .25s ease;
}
.crm-empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: var(--crm-bg);
  border: 1px solid var(--crm-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.625rem;
  margin: 0 auto 1.125rem;
  color: var(--crm-text-muted);
}
.crm-empty-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--crm-text);
  margin-bottom: 0.325rem;
}
.crm-empty-desc {
  font-size: 0.8125rem;
  color: var(--crm-text-muted);
  margin-bottom: 1.25rem;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Cards — micro elevación ───────────────────────────────── */
.crm-card {
  transition: box-shadow .2s ease;
}
.crm-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  row-gap: 0.625rem;
}
.crm-card-title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── Badges — refinados ────────────────────────────────────── */
.crm-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
}

/* ── Skeleton loader ───────────────────────────────────────── */
.crm-skeleton {
  background: linear-gradient(90deg, var(--crm-bg) 25%, #e8ecf0 50%, var(--crm-bg) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--crm-radius-sm);
  display: inline-block;
}

/* ── Page title ────────────────────────────────────────────── */
.crm-page-title {
  font-weight: 800;
  letter-spacing: -0.025em;
}

/* ── Sidebar nav — refinado ────────────────────────────────── */
.crm-nav-item {
  transition: background .12s ease, color .12s ease, padding-left .12s ease;
}
.crm-brand-logo {
  width:        34px;
  height:       34px;
  border-radius: var(--crm-radius-sm);
  object-fit:   cover;
  flex-shrink:  0;
}

/* ── Responsive modals ─────────────────────────────────────── */
@media (max-width: 600px) {
  .crm-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .crm-modal {
    border-radius: var(--crm-radius-lg) var(--crm-radius-lg) 0 0 !important;
    max-width: 100% !important;
    width: 100%;
    max-height: 92vh;
    animation: none;
  }
  .crm-toast-container {
    right: 0.75rem;
    left: 0.75rem;
  }
  .crm-toast {
    min-width: 0 !important;
    width: 100%;
  }
}
/* ── Dashboard Beewards ───────────────────────────────────── */
.beewards-dashboard{margin-bottom:1.5rem;border:1px solid rgba(0,125,136,.18);border-radius:1.25rem;background:linear-gradient(145deg,#fff 0%,#f7fffe 55%,#fffdf5 100%);box-shadow:0 16px 44px rgba(0,72,78,.09);overflow:hidden}
.beewards-dashboard-hero{display:flex;align-items:center;justify-content:space-between;gap:1.25rem;padding:1.25rem 1.35rem;background:linear-gradient(115deg,#004f56 0%,#007d88 62%,#009d92 100%);color:#fff}
.beewards-dashboard-brand{display:flex;align-items:center;gap:1rem;min-width:0}
.beewards-dashboard-logo{width:48px;height:48px;border-radius:15px;display:grid;place-items:center;flex:0 0 auto;background:#ffc928;color:#273036;font-size:1.55rem;font-weight:900;box-shadow:0 8px 20px rgba(0,0,0,.18)}
.beewards-dashboard-eyebrow{text-transform:uppercase;letter-spacing:.11em;font-size:.67rem;font-weight:800;color:#aaf7ed;margin-bottom:.15rem}
.beewards-dashboard h2{font-size:1.25rem;margin:0;color:#fff}
.beewards-dashboard-brand p{font-size:.82rem;margin:.22rem 0 0;color:rgba(255,255,255,.75);max-width:650px}
.beewards-dashboard-actions{display:flex;align-items:center;justify-content:flex-end;gap:.55rem;flex-wrap:wrap}
.beewards-dashboard-actions .crm-btn-ghost{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.25);color:#fff}
.beewards-dashboard-actions .crm-btn-ghost:hover{background:rgba(255,255,255,.18);color:#fff}
.beewards-dashboard-actions .crm-btn-primary{background:#ffc928;border-color:#ffc928;color:#273036}
.beewards-dashboard-updated{font-size:.7rem;color:rgba(255,255,255,.7);width:100%;text-align:right}
.beewards-dashboard-overview{display:grid;grid-template-columns:minmax(170px,.7fr) minmax(360px,2fr) minmax(180px,.8fr);gap:1rem;padding:1.15rem 1.35rem;border-bottom:1px solid rgba(0,125,136,.1)}
.beewards-dashboard-total,.beewards-dashboard-birthday{border-radius:1rem;padding:1rem;background:#fff;border:1px solid rgba(0,125,136,.11)}
.beewards-dashboard-total span{display:block;color:#64748b;font-size:.73rem;font-weight:700}
.beewards-dashboard-total strong{display:block;font-size:1.75rem;line-height:1.15;color:#004f56;margin:.25rem 0}
.beewards-dashboard-total small{color:#008579;font-size:.68rem;font-weight:650}
.beewards-dashboard-distribution{padding:.55rem .2rem}
.beewards-dashboard-distribution-head{display:flex;justify-content:space-between;align-items:end;gap:1rem;margin-bottom:.75rem}
.beewards-dashboard-distribution-head strong{font-size:.8rem;color:#273036}
.beewards-dashboard-distribution-head span{font-size:.68rem;color:#84909c}
.beewards-segment-bar{height:14px;display:flex;gap:3px;border-radius:999px;overflow:hidden;background:#e9eef2}
.beewards-segment{display:block;min-width:3px;transition:filter .2s ease}
.beewards-segment:hover{filter:brightness(.9)}
.beewards-tone-active{background:#00b983!important}.beewards-tone-warm{background:#18bcd0!important}.beewards-tone-attention{background:#f3ad22!important}.beewards-tone-risk{background:#f06464!important}
.beewards-segment-legend{display:flex;gap:.45rem 1rem;flex-wrap:wrap;margin-top:.72rem}
.beewards-segment-legend span{font-size:.67rem;color:#65717d;display:flex;align-items:center;gap:.3rem}
.beewards-segment-legend i{width:7px;height:7px;border-radius:50%;display:inline-block}
.beewards-segment-legend strong{color:#2f343a;margin-left:.1rem}
.beewards-dashboard-birthday{display:flex;align-items:center;gap:.75rem;background:linear-gradient(135deg,#fff8df,#fff);border-color:#f5dc88}
.beewards-dashboard-birthday>i{font-size:1.6rem;color:#d88900;width:40px;height:40px;border-radius:12px;background:#fff0b8;display:grid;place-items:center}
.beewards-dashboard-birthday div{min-width:0;flex:1}.beewards-dashboard-birthday strong{display:block;font-size:1.45rem;line-height:1;color:#8c5d00}.beewards-dashboard-birthday span{display:block;font-size:.68rem;color:#786942;margin-top:.25rem}.beewards-dashboard-birthday a{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#ffc928;color:#273036}
.beewards-dashboard-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:.75rem;padding:1.15rem 1.35rem 1.35rem}
.beewards-metric{position:relative;display:flex;gap:.7rem;align-items:flex-start;padding:.9rem;border:1px solid #e7ecef;border-radius:.9rem;background:rgba(255,255,255,.88);min-width:0;overflow:hidden}
.beewards-metric:after{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#8b98a5}
.beewards-metric-active:after{background:#00b983}.beewards-metric-warm:after{background:#18bcd0}.beewards-metric-attention:after{background:#f3ad22}.beewards-metric-risk:after{background:#f06464}.beewards-metric-birthday:after{background:#d99a00}.beewards-metric-total:after{background:#007d88}
.beewards-metric-icon{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;flex:0 0 auto;background:#edf7f7;color:#007d88}
.beewards-metric-risk .beewards-metric-icon{background:#fff0f0;color:#d74747}.beewards-metric-birthday .beewards-metric-icon{background:#fff5cf;color:#ba7a00}
.beewards-metric-copy{min-width:0}.beewards-metric-copy strong{display:block;font-size:1.2rem;line-height:1.1;color:#273036}.beewards-metric-copy span{display:block;font-size:.68rem;line-height:1.25;color:#4e5963;margin-top:.25rem}.beewards-metric-copy small{display:block;font-size:.61rem;color:#929ca5;margin-top:.25rem}
@media(max-width:1199.98px){.beewards-dashboard-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.beewards-dashboard-overview{grid-template-columns:1fr 2fr}.beewards-dashboard-birthday{grid-column:1/-1}}
@media(max-width:767.98px){.beewards-dashboard-hero{align-items:flex-start;flex-direction:column}.beewards-dashboard-actions{justify-content:flex-start;width:100%}.beewards-dashboard-updated{text-align:left}.beewards-dashboard-overview{grid-template-columns:1fr}.beewards-dashboard-birthday{grid-column:auto}.beewards-dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.beewards-dashboard-distribution-head{align-items:flex-start;flex-direction:column;gap:.15rem}}
@media(max-width:479.98px){.beewards-dashboard-grid{grid-template-columns:1fr}.beewards-dashboard-brand{align-items:flex-start}.beewards-dashboard-logo{width:42px;height:42px}.beewards-dashboard-actions .crm-btn{flex:1}.beewards-segment-legend{display:grid;grid-template-columns:1fr 1fr}}
