/* ═══════════════════════════════════════════════════
   CRM Peralta Rojas — Estilos corporativos
   Color principal: #a10c0c (rojo granate)
   ═══════════════════════════════════════════════════ */

:root {
  --brand-red:              #a10c0c;
  --brand-red-dark:         #7a0909;
  --brand-red-soft:         #f5e6e6;
  --sidebar-bg:             #1c1c1c;
  --sidebar-hover:          #2e2e2e;
  --sidebar-active:         #a10c0c;
  --sidebar-width:          240px;
  --sidebar-collapsed-width: 64px;
  --topbar-height:          52px;
  --text-primary:           #1a1a1a;
  --text-muted:             #6b7280;
  --border-color:           #e5e7eb;
  --bg-page:                #f4f4f4;
}

/* ── Overrides Bootstrap primario ── */
.btn-primary         { background: var(--brand-red); border-color: var(--brand-red); }
.btn-primary:hover   { background: var(--brand-red-dark); border-color: var(--brand-red-dark); }
.btn-primary:focus   { box-shadow: 0 0 0 3px rgba(161,12,12,.25); }
.btn-outline-primary { color: var(--brand-red); border-color: var(--brand-red); }
.btn-outline-primary:hover { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }
.text-primary        { color: var(--brand-red) !important; }
.bg-primary          { background: var(--brand-red) !important; }
.form-control:focus, .form-select:focus { border-color: var(--brand-red); box-shadow: 0 0 0 3px rgba(161,12,12,.1); }
a { color: var(--brand-red); }
a:hover { color: var(--brand-red-dark); }

/* ── Layout ── */
body { background: var(--bg-page); font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; color: var(--text-primary); }
#wrapper { min-height: 100vh; }

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: #c9c9c9;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: width .22s ease, padding .22s ease;
}

#sidebar .nav-link {
  color: #9ca3af;
  border-radius: 6px;
  padding: .45rem .75rem;
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: background .15s, color .15s;
  white-space: nowrap;
  position: relative;
}
#sidebar .nav-link:hover  { background: var(--sidebar-hover); color: #f3f4f6; }
#sidebar .nav-link.active { background: var(--sidebar-active); color: #fff; }
#sidebar .nav-link i      { width: 1.1rem; text-align: center; flex-shrink: 0; }

/* Textos que se ocultan al colapsar */
.sidebar-link-text,
.sidebar-chevron { transition: opacity .15s ease; }

/* ── Sidebar colapsado (solo iconos) ── */
#sidebar.sidebar-collapsed {
  width: var(--sidebar-collapsed-width);
  padding-left: .5rem !important;
  padding-right: .5rem !important;
}
#sidebar.sidebar-collapsed .sidebar-link-text,
#sidebar.sidebar-collapsed .sidebar-chevron,
#sidebar.sidebar-collapsed .brand-text,
#sidebar.sidebar-collapsed .sidebar-user-name,
#sidebar.sidebar-collapsed .sidebar-submenu,
#sidebar.sidebar-collapsed .sidebar-dial-text,
#sidebar.sidebar-collapsed .sidebar-section-label { display: none; }

#sidebar.sidebar-collapsed .sidebar-section-divider { margin: .3rem .25rem; }

#sidebar.sidebar-collapsed .nav-link    { justify-content: center; padding: .45rem; gap: 0; }
#sidebar.sidebar-collapsed .sidebar-brand { justify-content: center; gap: 0; }
#sidebar.sidebar-collapsed .sidebar-dial-btn { padding: .45rem; min-width: 0; justify-content: center; }

/* Tooltip al hover en modo colapsado */
#sidebar.sidebar-collapsed .nav-link[data-label]:hover::after,
#sidebar.sidebar-collapsed .sidebar-dial-btn[data-label]:hover::after {
  content: attr(data-label);
  position: fixed;
  left: calc(var(--sidebar-collapsed-width) + 8px);
  background: #333;
  color: #fff;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: .78rem;
  white-space: nowrap;
  z-index: 1050;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* Botón de toggle */
#sidebar-toggle-btn {
  background: none;
  border: none;
  color: #9ca3af;
  padding: .3rem .5rem;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  margin-left: auto;
  flex-shrink: 0;
}
#sidebar-toggle-btn:hover { background: var(--sidebar-hover); color: #fff; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: white;
  text-decoration: none;
}
.brand-icon {
  width: 40px; height: 40px;
  background: var(--brand-red);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; color: white; flex-shrink: 0;
}
.brand-text span       { font-size: .95rem; font-weight: 700; color: white; letter-spacing: .02em; }
.brand-text small      { color: #9ca3af; font-size: .72rem; }
.avatar-sm {
  width: 32px; height: 32px;
  background: var(--brand-red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: .82rem; flex-shrink: 0;
}

/* ── Top bar ── */
.topbar {
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Cards ── */
.card { border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card-header { border-bottom: 1px solid var(--border-color); background: #fafafa; border-radius: 8px 8px 0 0 !important; }

/* ── Stat cards ── */
.stat-card {
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  color: white;
  display: flex; align-items: center; gap: 1rem;
}
.stat-card .stat-icon {
  width: 48px; height: 48px;
  background: rgba(255,255,255,.18);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-card .stat-value  { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label  { font-size: .8rem; opacity: .88; margin-top: .2rem; }

.stat-blue   { background: linear-gradient(135deg, var(--brand-red), #c41212); }
.stat-green  { background: linear-gradient(135deg, #1a6b3c, #238d51); }
.stat-orange { background: linear-gradient(135deg, #b45309, #d97706); }
.stat-red    { background: linear-gradient(135deg, #7f1d1d, #991b1b); }

/* ── Badges / Status ── */
.badge-status { font-size: .72rem; padding: .3em .65em; border-radius: 5px; font-weight: 600; letter-spacing: .01em; }
.status-activo          { background: #dcfce7; color: #14532d; }
.status-pendiente       { background: #fef9c3; color: #713f12; }
.status-contacto        { background: #fde8e8; color: var(--brand-red-dark); }
.status-cerrado_ganado  { background: #d1fae5; color: #064e3b; }
.status-cerrado_perdido { background: #fee2e2; color: #7f1d1d; }
.status-cerrado_acuerdo { background: #ede9fe; color: #3b0764; }
.status-archivado       { background: #f3f4f6; color: #4b5563; }

.urgency-alta   { background: #fee2e2; color: #7f1d1d; }
.urgency-media  { background: #fef9c3; color: #713f12; }
.urgency-baja   { background: #f0fdf4; color: #14532d; }

.alert-level-danger  { background: #fff5f5; border-left: 3px solid #a10c0c; }
.alert-level-warning { background: #fffbeb; border-left: 3px solid #d97706; }
.alert-level-ok      { background: #f0fdf4; border-left: 3px solid #22c55e; }
.alert-level-none    { }

.payment-pendiente { background: #fef9c3; color: #713f12; }
.payment-pagado    { background: #dcfce7; color: #14532d; }
.payment-vencido   { background: #fee2e2; color: #7f1d1d; }
.payment-parcial   { background: #ede9fe; color: #3b0764; }

/* ── Tables ── */
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; border-top: none; background: #fafafa; }
.table td { vertical-align: middle; font-size: .875rem; }
.table tbody tr:hover { background: #fdf5f5; }
.table-link { color: var(--brand-red); text-decoration: none; font-weight: 600; }
.table-link:hover { color: var(--brand-red-dark); text-decoration: underline; }

/* ── Forms ── */
.form-label { font-size: .75rem; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .35rem; }
.form-control, .form-select { border-radius: 6px; border-color: #d1d5db; font-size: .9rem; }
.section-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #9ca3af; font-weight: 700; margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border-color); }

/* ── Page header ── */
.page-header { margin-bottom: 1.5rem; padding-top: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); letter-spacing: -.01em; }
.breadcrumb-item a { color: var(--brand-red); text-decoration: none; font-size: .82rem; }
.breadcrumb-item.active { color: var(--text-muted); font-size: .82rem; }

/* ── Login ── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #1c1c1c 0%, #3a0505 60%, #a10c0c 100%);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.login-box {
  background: white;
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%; max-width: 400px;
  box-shadow: 0 25px 60px rgba(0,0,0,.4);
}
.login-logo {
  width: 56px; height: 56px;
  background: var(--brand-red);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: white;
}

/* ── OneDrive link ── */
.onedrive-link {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--brand-red-soft); color: var(--brand-red);
  padding: .35rem .75rem; border-radius: 6px; font-size: .85rem;
  text-decoration: none; font-weight: 600;
}
.onedrive-link:hover { background: #efcbcb; color: var(--brand-red-dark); }

/* ── Pagination ── */
.page-link { color: var(--brand-red); }
.page-link:hover { color: var(--brand-red-dark); }
.page-item.active .page-link { background: var(--brand-red); border-color: var(--brand-red); }

/* ── Misc ── */
.empty-state { text-align: center; padding: 3rem; color: #9ca3af; }
.empty-state i { font-size: 3rem; display: block; margin-bottom: 1rem; color: #d1d5db; }
.action-buttons .btn { padding: .25rem .55rem; font-size: .78rem; }
.contact-code { font-family: 'Courier New', monospace; font-size: .78rem; color: #6b7280; background: #f3f4f6; padding: .15rem .45rem; border-radius: 4px; }

/* ── Sidebar collapsible admin menu ── */
.sidebar-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
}
.sidebar-collapse-btn[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
}
.sidebar-chevron {
  transition: transform .2s ease;
  font-size: .7rem;
  opacity: .6;
  margin-left: auto;
}
.sidebar-submenu {
  padding-left: .75rem;
  margin-top: .1rem;
  border-left: 2px solid rgba(255,255,255,.1);
  margin-left: .5rem;
}
.sidebar-submenu .nav-link {
  font-size: .82rem;
  padding: .35rem .65rem;
}

/* ── Responsive sidebar ── */
@media (max-width: 768px) {
  #sidebar { position: fixed; z-index: 1000; transform: translateX(-100%); transition: transform .25s ease; }
  #sidebar.show { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.3); }
  #page-content { width: 100%; }
}


/* ── Sorting headers & filter chips ── */
.sort-header { color: var(--text-primary); transition: color .15s; }
.sort-header:hover { color: var(--brand-red); }
.sort-header.active-sort { color: var(--brand-red); }
.chip-filter {
  background: var(--brand-red-soft);
  color: var(--brand-red);
  border: 1px solid rgba(161,12,12,.2);
  font-size: .75rem;
  padding: .25rem .6rem;
  transition: background .15s;
}
.chip-filter:hover { background: var(--brand-red); color: #fff; }

/* ── Filter panel collapsible ── */
.filter-panel-toggle { cursor: pointer; user-select: none; }
.filter-panel-toggle .chevron { transition: transform .2s; }
.filter-panel-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }


/* ══════════════════════════════════════════════════════════════════
   EXTENSIÓN DEL SISTEMA DE DISEÑO — añadido en cohesión v2
   ══════════════════════════════════════════════════════════════════ */

/* ── Variables semánticas ─────────────────────────────────────────── */
:root {
  /* Colores semánticos centralizados */
  --color-success:           #22c55e;
  --color-success-bg:        #f0fdf4;
  --color-success-dark:      #14532d;
  --color-warning:           #f59e0b;
  --color-warning-bg:        #fef9c3;
  --color-warning-dark:      #713f12;
  --color-danger:            #ef4444;
  --color-danger-bg:         #fee2e2;
  --color-danger-dark:       #7f1d1d;
  --color-info:              #3b82f6;
  --color-info-bg:           #eff6ff;
  --color-info-dark:         #1e3a8a;
  --color-purple:            #8b5cf6;
  --color-purple-bg:         #ede9fe;
  --color-purple-dark:       #3b0764;

  /* Colores por área de práctica */
  --area-extranjeria-bg:     #eff6ff;
  --area-extranjeria-color:  #1d4ed8;
  --area-familia-bg:         #fdf4ff;
  --area-familia-color:      #7e22ce;
  --area-inmobiliario-bg:    #f0fdf4;
  --area-inmobiliario-color: #15803d;
  --area-civil-bg:           #fef3c7;
  --area-civil-color:        #92400e;
  --area-penal-bg:           #fff1f2;
  --area-penal-color:        #be123c;
  --area-laboral-bg:         #f0fdfa;
  --area-laboral-color:      #0f766e;
  --area-mercantil-bg:       #fefce8;
  --area-mercantil-color:    #854d0e;
  --area-herencias-bg:       #faf5ff;
  --area-herencias-color:    #6b21a8;
  --area-otro-bg:            #f9fafb;
  --area-otro-color:         #374151;

  /* Acento Netelip (centralizado) */
  --netelip-accent:          #fd7e14;
  --netelip-accent-dark:     #e06900;

  /* Tipografía */
  --font-base: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
}

/* ── Stat cards — alias correcto ──────────────────────────────────── */
/* OBSOLETO: .stat-blue usa gradiente rojo — usar .stat-primary */
.stat-primary { background: linear-gradient(135deg, var(--brand-red), #c41212); }
.stat-blue    { background: linear-gradient(135deg, var(--brand-red), #c41212); } /* alias OBSOLETO */

/* ── Áreas de práctica — clases centralizadas ─────────────────────── */
.area-badge {
  display: inline-block;
  padding: .2em .6em;
  border-radius: 5px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.4;
}
.area-extranjeria  { background: var(--area-extranjeria-bg);  color: var(--area-extranjeria-color); }
.area-familia      { background: var(--area-familia-bg);      color: var(--area-familia-color); }
.area-inmobiliario { background: var(--area-inmobiliario-bg); color: var(--area-inmobiliario-color); }
.area-civil        { background: var(--area-civil-bg);        color: var(--area-civil-color); }
.area-penal        { background: var(--area-penal-bg);        color: var(--area-penal-color); }
.area-laboral      { background: var(--area-laboral-bg);      color: var(--area-laboral-color); }
.area-mercantil    { background: var(--area-mercantil-bg);    color: var(--area-mercantil-color); }
.area-herencias    { background: var(--area-herencias-bg);    color: var(--area-herencias-color); }
.area-nie_residencia { background: var(--area-extranjeria-bg); color: var(--area-extranjeria-color); }
.area-otro         { background: var(--area-otro-bg);         color: var(--area-otro-color); }

/* ── Etapas del pipeline de leads ────────────────────────────────── */
.stage-nuevo       { background: #eff6ff;  color: #1d4ed8; }
.stage-contactado  { background: #fef9c3;  color: #713f12; }
.stage-consulta    { background: #f0fdfa;  color: #0f766e; }
.stage-presupuesto { background: #fdf4ff;  color: #7e22ce; }
.stage-negociando  { background: #fff7ed;  color: #9a3412; }
.stage-ganado      { background: #dcfce7;  color: #14532d; }
.stage-perdido     { background: #fee2e2;  color: #7f1d1d; }

/* ── Empty states — extensión ────────────────────────────────────── */
.empty-state .empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: .35rem;
}
.empty-state .empty-body {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ── Toast notifications — sistema centralizado ──────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99990;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
#toast-container .crm-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  border-left: 4px solid #64748b;
  padding: .75rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  animation: toastIn .25s ease;
  font-size: .875rem;
}
#toast-container .crm-toast.toast-success { border-left-color: var(--color-success); }
#toast-container .crm-toast.toast-danger  { border-left-color: var(--color-danger); }
#toast-container .crm-toast.toast-warning { border-left-color: var(--color-warning); }
#toast-container .crm-toast.toast-info    { border-left-color: var(--color-info); }
#toast-container .crm-toast .toast-icon  { font-size: 1rem; flex-shrink: 0; margin-top: .1rem; }
#toast-container .crm-toast.toast-success .toast-icon { color: var(--color-success); }
#toast-container .crm-toast.toast-danger  .toast-icon { color: var(--color-danger); }
#toast-container .crm-toast.toast-warning .toast-icon { color: var(--color-warning); }
#toast-container .crm-toast.toast-info    .toast-icon { color: var(--color-info); }
#toast-container .crm-toast .toast-body  { flex-grow: 1; line-height: 1.4; }
#toast-container .crm-toast .toast-close {
  background: none; border: none; color: #9ca3af; cursor: pointer;
  font-size: .85rem; padding: 0; line-height: 1; flex-shrink: 0;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Netelip popups — clases centralizadas ───────────────────────── */
.netelip-popup {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 340px;
  z-index: 99999;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  background: #fff;
  border: 2px solid var(--netelip-accent);
  overflow: hidden;
  font-family: var(--font-base);
}
.netelip-popup-header {
  background: var(--netelip-accent);
  padding: .65rem 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.netelip-popup-header .popup-title {
  color: #fff;
  font-weight: 700;
  font-size: .92rem;
  flex: 1;
}
.netelip-popup-header .popup-timer { color: #fff; font-size: .8rem; opacity: .9; font-variant-numeric: tabular-nums; }
.netelip-popup-dismiss {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  margin-left: .3rem;
  padding: 0;
}
.netelip-popup-body { padding: .9rem 1rem 0 1rem; }
.netelip-popup-name { font-size: 1.05rem; font-weight: 700; color: #1e293b; }
.netelip-popup-number { font-size: .82rem; color: #64748b; margin-bottom: .3rem; }
.netelip-popup-last-comm {
  font-size: .75rem; color: #94a3b8; margin-bottom: .5rem;
  padding: .3rem .5rem; background: #f8fafc; border-radius: 5px; display: none;
}
.netelip-popup-matters-label { font-size: .75rem; font-weight: 600; color: #475569; margin-bottom: .3rem; display: none; }
.netelip-popup-matters { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .6rem; }
.netelip-popup-footer { padding: .6rem 1rem .9rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.netelip-popup-btn-contact {
  display: none; padding: .35rem .75rem; border-radius: 6px;
  background: var(--brand-red); color: #fff;
  font-size: .8rem; font-weight: 600; text-decoration: none; text-align: center;
}
.netelip-popup-btn-contact:hover { background: var(--brand-red-dark); color: #fff; }
.netelip-popup-btn-newcontact, .netelip-popup-btn-newlead {
  display: none; padding: .35rem .75rem; border-radius: 6px;
  font-size: .8rem; font-weight: 600; border: none; cursor: pointer; width: 100%;
}
.netelip-popup-btn-newcontact { background: #2563eb; color: #fff; }
.netelip-popup-btn-newcontact:hover { background: #1d4ed8; }
.netelip-popup-btn-newlead { background: var(--color-success); color: #fff; }
.netelip-popup-btn-newlead:hover { background: #16a34a; }
.netelip-popup-btn-dismiss {
  padding: .3rem .75rem; border-radius: 6px; border: 1px solid #e2e8f0;
  background: #f8fafc; color: #475569; font-size: .8rem; cursor: pointer;
}
.netelip-scheduled-popup {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 300px;
  z-index: 99998;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  background: #fff;
  border: 2px solid #2563eb;
  overflow: hidden;
  font-family: var(--font-base);
}
.netelip-scheduled-header {
  background: #2563eb;
  padding: .55rem .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ── Sidebar separadores visuales ────────────────────────────────── */
.sidebar-section-label {
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #4b5563;
  padding: .6rem .75rem .2rem;
  font-weight: 700;
}
.sidebar-section-divider {
  border-color: rgba(255,255,255,.07);
  margin: .4rem .5rem;
}

/* ── Leads — Kanban board ────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
}
.kanban-col {
  flex: 0 0 240px;
  min-width: 240px;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 0;
  border: 1px solid #e2e8f0;
}
.kanban-col-header {
  padding: .6rem 1rem;
  border-radius: 10px 10px 0 0;
  font-weight: 600;
  font-size: .82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-cards {
  min-height: 80px;
  padding: .5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.lead-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: .65rem .75rem;
  cursor: grab;
  transition: box-shadow .15s;
  font-size: .83rem;
}
.lead-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.lead-card.is-stale  { border-left: 3px solid #dc3545; }
.lead-card.is-urgent { border-left: 3px solid #ffc107; }
.lead-card.is-stale.is-urgent { border-left: 3px solid #dc3545; }
.sortable-ghost { opacity: .4; }
/* Column header colors */
.col-primary .kanban-col-header  { background: #dbeafe; color: #1e40af; }
.col-info    .kanban-col-header  { background: #e0f2fe; color: #075985; }
.col-indigo  .kanban-col-header  { background: #ede9fe; color: #5b21b6; }
.col-warning .kanban-col-header  { background: #fef3c7; color: #92400e; }
.col-orange  .kanban-col-header  { background: #ffedd5; color: #c2410c; }

/* ── Reports — Mission Control CSS ───────────────────────────────── */
.mc-header {
  border-radius: 14px;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1035 60%, #0d0820 100%);
  margin-bottom: 1.5rem;
}
.mc-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.mc-brand-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.mc-brand-icon {
  width: 44px; height: 44px; background: rgba(139,92,246,.25);
  border: 1px solid rgba(139,92,246,.4); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #a78bfa;
}
.mc-brand-name { color: #fff; font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.mc-brand-sub  { color: rgba(255,255,255,.45); font-size: .72rem; }
.mc-clock-row  { display: flex; align-items: center; gap: .75rem; }
.mc-clock { color: #a78bfa; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.mc-date  { color: rgba(255,255,255,.5); font-size: .78rem; }
.mc-center { flex: 0 0 auto; }
.mc-gauge-wrap { position: relative; }
.mc-gauge-svg  { width: 180px; height: 120px; display: block; }
.mc-gauge-label { text-align: center; color: rgba(255,255,255,.45); font-size: .7rem; margin-top: -.3rem; }
.mc-right { flex: 0 0 auto; }
.mc-quick-stats { display: flex; flex-direction: column; gap: .5rem; }
.mc-qstat { text-align: right; }
.mc-qstat-val { font-size: 1.6rem; font-weight: 800; color: rgba(255,255,255,.9); line-height: 1; font-variant-numeric: tabular-nums; }
.mc-qstat-lbl { font-size: .65rem; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .06em; }
.mc-qstat-danger .mc-qstat-val { color: #fca5a5; }
.mc-qstat-warn  .mc-qstat-val  { color: #fde68a; }
.mc-subnav { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.mc-pill {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.65); border-radius: 20px; padding: .2rem .7rem;
  font-size: .72rem; text-decoration: none; transition: all .15s;
}
.mc-pill:hover { background: rgba(255,255,255,.18); color: #fff; }
.mc-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: .85rem; }
.mc-card {
  background: #fff; border-radius: 12px; padding: 1.1rem 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.mc-card-dark {
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  border-color: rgba(139,92,246,.2);
}
.mc-span-2  { grid-column: span 2; }
.mc-span-3  { grid-column: span 3; }
.mc-span-4  { grid-column: span 4; }
.mc-span-6  { grid-column: span 6; }
.mc-span-8  { grid-column: span 8; }
.mc-span-12 { grid-column: span 12; }
.mc-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; font-weight: 700; margin-bottom: .2rem; }
.mc-value { font-size: 1.75rem; font-weight: 800; color: #0f172a; line-height: 1; font-variant-numeric: tabular-nums; }
.mc-value-sm { font-size: 1.15rem; }
.mc-sub { font-size: .72rem; color: #94a3b8; margin-top: .15rem; }
.mc-alert {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .85rem; border-radius: 8px; font-size: .78rem; font-weight: 600;
  text-decoration: none;
}
.mc-alert-danger  { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.mc-alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.mc-alert-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.mc-alert-pulse { animation: alertPulse 2s ease infinite; }
.mc-alerts-wrap { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
@keyframes alertPulse {
  0%, 100% { opacity: 1; } 50% { opacity: .7; }
}
@media (max-width: 768px) {
  .mc-grid { grid-template-columns: repeat(6,1fr); }
  .mc-span-3 { grid-column: span 3; }
  .mc-span-4 { grid-column: span 6; }
  .mc-span-6 { grid-column: span 6; }
  .mc-span-8 { grid-column: span 6; }
}

/* ── Reports — Pipeline / SR header ─────────────────────────────── */
.sr-header { border-radius: 14px; padding: 1.1rem 1.4rem; }
.sr-header-cyan  { background: linear-gradient(135deg, #001c20 0%, #003040 60%, #001518 100%); }
.sr-header-green { background: linear-gradient(135deg, #052e16 0%, #14532d 60%, #022c22 100%); }
.sr-header-red   { background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 60%, #3b0606 100%); }
.sr-header-blue  { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #0f0b30 100%); }
.sr-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.sr-back { color: rgba(255,255,255,.5); font-size: .75rem; text-decoration: none; display: block; margin-bottom: .3rem; }
.sr-back:hover { color: rgba(255,255,255,.8); }
.sr-title  { color: #fff; font-size: 1.3rem; font-weight: 800; }
.sr-period { color: rgba(255,255,255,.5); font-size: .75rem; }
.sr-right  { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.sr-filter-form { display: flex; }
.sr-period-pills { display: flex; gap: .3rem; flex-wrap: wrap; }
.sr-pill { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.65); border-radius: 20px; padding: .2rem .65rem; font-size: .72rem; cursor: pointer; transition: all .15s; }
.sr-pill:hover { background: rgba(255,255,255,.15); color: #fff; }
.sr-pill-cyan-active  { background: rgba(8,145,178,.4)!important; border-color: #22d3ee!important; color: #cffafe!important; }
.sr-pill-green-active { background: rgba(22,163,74,.4)!important; border-color: #86efac!important; color: #dcfce7!important; }
.sr-pill-red-active   { background: rgba(220,38,38,.4)!important; border-color: #fca5a5!important; color: #fee2e2!important; }
.sr-pill-blue-active  { background: rgba(99,102,241,.4)!important; border-color: #a5b4fc!important; color: #e0e7ff!important; }
.sr-export-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.7); border-radius: 8px; padding: .3rem .7rem; font-size: .75rem; text-decoration: none; transition: all .15s; white-space: nowrap; }
.sr-export-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Bento grid (Reports) */
.bento-grid  { display: grid; grid-template-columns: repeat(12, 1fr); gap: .85rem; }
.bento-span-3  { grid-column: span 3; }
.bento-span-4  { grid-column: span 4; }
.bento-span-6  { grid-column: span 6; }
.bento-span-8  { grid-column: span 8; }
.bento-span-12 { grid-column: span 12; }
.bento-card {
  background: #fff; border-radius: 12px; padding: 1.1rem 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex; flex-direction: column;
}
.bento-card.bento-blue   { background: linear-gradient(135deg,#1e40af,#2563eb); color: #fff; }
.bento-card.bento-green  { background: linear-gradient(135deg,#14532d,#16a34a); color: #fff; }
.bento-card.bento-red    { background: linear-gradient(135deg,#7f1d1d,#b91c1c); color: #fff; }
.bento-card.bento-purple { background: linear-gradient(135deg,#3b0764,#7e22ce); color: #fff; }
.bento-card-title  { font-size: .85rem; font-weight: 700; color: #1e293b; display: flex; align-items: center; }
.bento-card-header { display: flex; align-items: center; justify-content: space-between; }
.bento-icon-circle { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; margin-bottom: .5rem; }
.bento-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: #94a3b8; font-weight: 700; }
.bento-value { font-size: 2rem; font-weight: 800; line-height: 1.1; color: #0f172a; font-variant-numeric: tabular-nums; }
.bento-sub   { font-size: .72rem; color: #94a3b8; margin-top: .2rem; }
.bento-card.bento-blue .bento-label,
.bento-card.bento-green .bento-label,
.bento-card.bento-red .bento-label,
.bento-card.bento-purple .bento-label { color: rgba(255,255,255,.6); }
.bento-card.bento-blue .bento-value,
.bento-card.bento-green .bento-value,
.bento-card.bento-red .bento-value,
.bento-card.bento-purple .bento-value { color: #fff; }
.big-funnel { width: 100%; max-width: 280px; }
.bf-stage   { text-align: center; padding: .75rem; background: #f8fafc; border-radius: 10px; margin-bottom: .15rem; }
.bf-count   { font-size: 1.6rem; font-weight: 800; color: #111827; line-height: 1; font-variant-numeric: tabular-nums; }
.bf-label   { font-size: .72rem; color: #6b7280; margin: .25rem 0 .5rem; }
.bf-bar     { height: 4px; border-radius: 2px; margin: 0 auto; transition: width 1.2s cubic-bezier(.22,.61,.36,1); }
.bf-arrow   { text-align: center; color: #d1d5db; font-size: .85rem; line-height: 1.5; }
.rate-ring-wrap { position: relative; }
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }
@media (max-width: 768px) {
  .bento-grid { grid-template-columns: repeat(6, 1fr); }
  .bento-span-3 { grid-column: span 3; }
  .bento-span-4 { grid-column: span 6; }
  .bento-span-5 { grid-column: span 6; }
  .bento-span-6 { grid-column: span 6; }
  .bento-span-8 { grid-column: span 6; }
}
@media (max-width: 992px) {
  .mc-header-inner { grid-template-columns: 1fr; text-align: center; }
  .mc-right { align-items: center; }
  .mc-subnav { justify-content: center; }
  .bento-span-3,.bento-span-4,.bento-span-5,.bento-span-8 { grid-column: span 6; }
  .quick-nav-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .bento-span-3,.bento-span-4,.bento-span-5,.bento-span-8 { grid-column: span 12; }
  .quick-nav-grid { grid-template-columns: repeat(2, 1fr); }
  .mc-quick-stats { justify-content: center; }
}

/* Bento reveal animation */
.bento-card { opacity: 1; transform: none; }
.bento-card.revealed { animation: bentoReveal .4s cubic-bezier(.22,.61,.36,1) var(--delay, 0s) both; }
@keyframes bentoReveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.bento-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
/* Border-left bento variants (reports/index) — distintos de los de bg completo del pipeline */
.bento-blue  { border-left: 3px solid #2563eb; }
.bento-green { border-left: 3px solid #16a34a; }
.bento-red   { border-left: 3px solid #dc2626; }
.bento-meta { flex: 1; }
.bento-delta { font-size: .72rem; display: flex; align-items: center; gap: .2rem; font-weight: 500; }
.delta-up      { color: #16a34a; }
.delta-down    { color: #dc2626; }
.delta-neutral { color: #9ca3af; }
.bento-sparkbar { height: 3px; border-radius: 3px; background: linear-gradient(90deg, #2563eb30, #2563eb); margin-top: .75rem; }
.bento-link { font-size: .72rem; color: #9ca3af; text-decoration: none; transition: color .15s; }
.bento-link:hover { color: #374151; }
/* Rate ring */
.rate-ring-wrap { width: 110px; height: 110px; margin: 0 auto .5rem; }
.rate-ring-svg  { width: 100%; height: 100%; }
/* Ops rows */
.ops-row { display: flex; align-items: center; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid #f3f4f6; }
.ops-row:last-child { border-bottom: none; }
.ops-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; }
.ops-purple { background: #faf5ff; color: #7c3aed; }
.ops-blue   { background: #eff6ff; color: #2563eb; }
.ops-green  { background: #f0fdf4; color: #16a34a; }
.ops-red    { background: #fef2f2; color: #dc2626; }
.ops-orange { background: #fffbeb; color: #d97706; }
.ops-val { font-size: 1rem; font-weight: 700; color: #111827; line-height: 1; }
.ops-lbl { font-size: .68rem; color: #9ca3af; }
/* Leaderboard */
.leader-row { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid #f3f4f6; }
.leader-row:last-of-type { border-bottom: none; }
.leader-medal { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }
.leader-pos { font-size: .75rem; font-weight: 700; color: #9ca3af; }
.leader-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; flex-shrink: 0; }
.leader-info { flex: 1; min-width: 0; }
.leader-name { font-size: .8rem; font-weight: 600; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader-bar-wrap { height: 4px; background: #f1f5f9; border-radius: 2px; margin-top: 4px; overflow: hidden; }
.leader-bar { height: 100%; border-radius: 2px; transition: width 1.2s cubic-bezier(.22,.61,.36,1); width: 0; }
.leader-score { text-align: right; flex-shrink: 0; }
.leader-score-num { font-size: .9rem; font-weight: 800; color: #374151; line-height: 1; }
.leader-score-lbl { font-size: .6rem; color: #9ca3af; }
/* Deadlines */
.deadline-row { display: flex; align-items: center; gap: .65rem; padding: .45rem 0; border-bottom: 1px solid #f3f4f6; color: inherit; text-decoration: none; }
.deadline-row:last-child { border-bottom: none; }
.deadline-row:hover { background: #f9fafb; border-radius: 6px; }
.deadline-badge { font-size: .65rem; font-weight: 700; padding: .2rem .4rem; border-radius: 6px; flex-shrink: 0; min-width: 36px; text-align: center; }
.dl-today  { background: #fef2f2; color: #dc2626; }
.dl-urgent { background: #fffbeb; color: #92400e; }
.dl-ok     { background: #f0fdf4; color: #15803d; }
.deadline-info  { flex: 1; min-width: 0; }
.deadline-title { font-size: .8rem; font-weight: 600; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deadline-sub   { font-size: .68rem; color: #9ca3af; }
.deadline-days  { font-size: .78rem; flex-shrink: 0; }
/* Funnel (pipeline report) */
.funnel-stage  { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 10px; background: #f8fafc; margin-bottom: .15rem; }
.funnel-top    { background: linear-gradient(90deg, #eff6ff, #f8fafc); }
.funnel-bottom { background: linear-gradient(90deg, #f0fdf4, #f8fafc); }
.funnel-icon   { font-size: 1.1rem; color: #94a3b8; width: 24px; text-align: center; }
.funnel-val    { font-size: 1.15rem; font-weight: 800; color: #111827; line-height: 1; font-variant-numeric: tabular-nums; }
.funnel-lbl    { font-size: .68rem; color: #9ca3af; }
.funnel-arrow  { text-align: center; color: #d1d5db; font-size: .9rem; line-height: 1; margin: .1rem 0; }
/* Quick nav */
.quick-nav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #9ca3af; font-weight: 600; margin-bottom: .75rem; }
.quick-nav-grid  { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; }
.qnav-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1rem .75rem; text-align: center; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.qnav-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.qnav-icon  { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin: 0 auto .6rem; }
.qnav-label { font-size: .82rem; font-weight: 700; color: #374151; }
.qnav-sub   { font-size: .68rem; color: #9ca3af; margin-top: 2px; }
/* Alerts ok strip */
.mc-ok-strip { display: flex; align-items: center; background: linear-gradient(90deg, #f0fdf4, #dcfce7); border: 1px solid #86efac; border-radius: 12px; padding: .65rem 1rem; color: #15803d; font-size: .88rem; font-weight: 500; gap: .5rem; }
.mc-ok-confetti { font-size: 1.1rem; animation: bounce .6s ease infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-4px); } }
.mc-alert-arrow { margin-left: .2rem; font-size: .7rem; opacity: .7; }
@keyframes qstatPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.3); }
  50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}
.mc-qstat-danger { background: rgba(220,38,38,.2) !important; border-color: rgba(220,38,38,.4) !important; animation: qstatPulse 2s ease-in-out infinite; }
.mc-qstat-warn   { background: rgba(217,119,6,.2)  !important; border-color: rgba(217,119,6,.4)  !important; }
