/* ==========================================================================
   CRM Inmobiliario Web — ZYS Inmobiliaria
   Identidad visual ZYS: rojo, blanco y negro.
   ========================================================================== */

:root {
  --color-primary: #c81e2b;
  --color-primary-dark: #a31621;
  --color-primary-light: #fff1f2;
  --color-black: #16181d;
  --color-black-soft: #21242c;
  --color-bg: #f6f7fb;
  --color-surface: #ffffff;
  --color-sidebar: #16181d;
  --color-sidebar-hover: #24272f;
  --color-sidebar-active: #c81e2b;
  --color-text: #1a1d24;
  --color-text-muted: #6b7280;
  --color-border: #e7e8ee;
  --color-success: #16a34a;
  --color-success-bg: #dcfce7;
  --color-warning: #d97706;
  --color-warning-bg: #fef3c7;
  --color-danger: #dc2626;
  --color-danger-bg: #fee2e2;
  --color-info: #2563eb;
  --color-info-bg: #e8f0fe;

  --oro: #7a5b00;
  --oro-bg: #f6b300;
  --plata: #4b5563;
  --plata-bg: #e5e7eb;
  --bronce: #ffffff;
  --bronce-bg: #b3541e;
  --cobre: #ffffff;
  --cobre-bg: #c2703a;

  --prioridad-alta: #dc2626;
  --prioridad-alta-bg: #fee2e2;
  --prioridad-normal: #4b5563;
  --prioridad-normal-bg: #e5e7eb;
  --prioridad-baja: #0284c7;
  --prioridad-baja-bg: #e0f2fe;

  --avatar-colors: #c81e2b, #2563eb, #16a34a, #db2777, #7c3aed, #0d9488, #ea580c, #4b5563;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.16);
  --sidebar-width: 246px;
}

/* ========================================================================== */
/* PROYECTOS E INVENTARIO                                                     */
/* ========================================================================== */
.project-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:14px; margin-bottom:22px; }
.project-summary-card { appearance:none; border:1px solid var(--border); background:#fff; border-radius:14px; padding:16px; display:flex; align-items:center; gap:12px; text-align:left; cursor:pointer; box-shadow:var(--shadow); }
.project-summary-card:hover,.project-summary-card.active { border-color:#c81e2b; box-shadow:0 0 0 2px rgba(200,30,43,.16); }
.project-summary-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:12px; background:#fff1f2; font-size:24px; }
.project-summary-content { flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.project-summary-content strong { font-size:15px; color:#111827; }
.project-summary-content span { font-size:12px; color:#6b7280; }
.project-summary-stats { display:flex; gap:5px; }
.inventory-dot { min-width:25px; height:25px; padding:0 6px; display:grid; place-items:center; border-radius:999px; font-size:11px; font-weight:800; }
.inventory-dot.available { background:#dcfce7; color:#087443; }
.inventory-dot.reserved { background:#fff3cd; color:#9a6700; }
.inventory-dot.sold { background:#ede9fe; color:#6d28d9; }
.project-detail-header { display:flex; justify-content:space-between; align-items:center; gap:16px; margin:0 2px 14px; }
.project-detail-header h2 { margin:0 0 3px; }
.inventory-kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; margin-bottom:14px; }
.inventory-kpi { background:#fff; border:1px solid var(--border); border-radius:12px; padding:14px 16px; display:flex; flex-direction:column; gap:5px; }
.inventory-kpi span { color:#64748b; font-size:11px; text-transform:uppercase; font-weight:700; }
.inventory-kpi strong { color:#111827; font-size:20px; }
.inventory-kpi.available strong { color:#079455; }
.inventory-kpi.reserved strong { color:#d38b00; }
.inventory-kpi.sold strong { color:#7c3aed; }
.inventory-table-card { padding:0; overflow:hidden; }
.inventory-table { min-width:1450px; }
.inventory-table th,.inventory-table td { white-space:nowrap; padding:11px 12px; }
.inventory-row.status-separado { background:#fffbea; }
.inventory-row.status-vendido { background:#effcf5; }
.inventory-status { display:inline-flex; padding:5px 9px; border-radius:999px; font-size:11px; font-weight:800; text-transform:uppercase; }
.inventory-status.disponible { background:#dcfce7; color:#087443; }
.inventory-status.separado { background:#fff0bf; color:#a36200; }
.inventory-status.vendido { background:#ede9fe; color:#6d28d9; }
.project-generation-preview,.unit-calculation { margin:12px 0 16px; padding:12px 14px; border-radius:10px; background:#fff1f2; color:#881923; font-size:13px; }
.text-danger { color:#dc2626 !important; }
@media (max-width:900px) { .inventory-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; }

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

h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 700; line-height: 1.3; color: var(--color-black); }
h1 { font-size: 23px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }

button { font-family: inherit; cursor: pointer; }

/* ---------- Loader inicial ---------- */
.boot-loader { display: flex; align-items: center; justify-content: center; height: 100vh; }
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--color-border); border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Pantalla de login (split-screen ZYS) ---------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  background: var(--color-surface);
}
.auth-side {
  flex: 0 0 50%;
  max-width: 50%;
  background: linear-gradient(135deg, #e62b3a 0%, #c81e2b 45%, #a31621 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
}
.auth-side::before, .auth-side::after {
  content: '';
  position: absolute;
  background: rgba(0,0,0,0.06);
  transform: skewX(-12deg);
}
.auth-side::before { width: 180px; height: 160%; top: -30%; left: 8%; }
.auth-side::after { width: 90px; height: 160%; top: -30%; left: 34%; background: rgba(0,0,0,0.04); }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.auth-brand .logo-mark {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--color-black); transform: rotate(-8deg);
}
.auth-brand .logo-text { font-size: 40px; font-weight: 900; letter-spacing: 0.02em; color: var(--color-black); line-height: 1; }
.auth-brand .logo-sub { font-size: 12px; font-weight: 700; letter-spacing: 0.35em; color: rgba(0,0,0,0.65); margin-top: 6px; padding-left: 2px; border-top: 2px solid rgba(0,0,0,0.5); padding-top: 6px; }

.auth-main {
  flex: 0 0 50%;
  max-width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30%;
  background: linear-gradient(180deg, #ffffff 0%, #f8f8f9 100%);
}
.auth-card { width: 100%; max-width: 460px; }
.auth-card h1 { font-size: 32px; margin-bottom: 5px; }
.auth-subtitle { color: var(--color-text-muted); margin-bottom: 26px; font-size: 13.5px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: #374151;
}
.form-group .hint { font-size: 11.5px; color: var(--color-text-muted); margin-top: 4px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .icon-left {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #9aa0ab; font-size: 14px; pointer-events: none; line-height: 1;
}
.input-icon-wrap .icon-right {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #9aa0ab; font-size: 13px; cursor: pointer; padding: 4px;
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="month"], input[type="time"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
}

.input-icon-wrap input {
  padding-left: 40px;
  padding-right: 40px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
textarea { resize: vertical; min-height: 64px; }

.checkbox-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #374151; }
.checkbox-row input[type="checkbox"] { width: auto; accent-color: var(--color-primary-dark); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.12s, border-color 0.12s, opacity .12s, transform .08s;
  white-space: nowrap;
}
.btn-primary { background: var(--color-primary); color: var(--color-black); }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }
.btn-secondary:hover { background: #f5f6f9; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-dark { background: var(--color-black); color: #fff; }
.btn-dark:hover { background: var(--color-black-soft); }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: #f3f4f6; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.auth-error {
  background: var(--color-danger-bg); color: #991b1b; padding: 9px 12px;
  border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 14px;
}
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12.5px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: var(--color-text-muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }
.btn-google { background: #fff; border-color: var(--color-border); color: #374151; }
.btn-google:hover { background: #f9fafb; }
.security-note {
  display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 14px;
  background: #fff1f2; border: 1px solid #fecdd3; border-radius: var(--radius-sm);
  font-size: 12px; color: #881923;
}
.security-note .ic { font-size: 18px; }

/* ---------- Layout principal ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--color-sidebar);
  color: #b8bbc4;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px;
  background: linear-gradient(120deg, #e62b3a, #c81e2b);
}
.sidebar-brand .logo-mark { font-size: 22px; color: var(--color-black); }
.sidebar-brand .logo-text { font-weight: 900; font-size: 19px; color: var(--color-black); letter-spacing: 0.01em; line-height: 1.05; }
.sidebar-brand .logo-sub { font-size: 8.5px; font-weight: 700; letter-spacing: 0.22em; color: rgba(0,0,0,0.6); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sidebar-section-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  color: #565b68; margin: 16px 10px 6px;
}
.sidebar-section-label:first-child { margin-top: 0; }
.sidebar-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: #c3c6d0; font-size: 13.5px; font-weight: 600;
  cursor: pointer; margin-bottom: 3px;
}
.sidebar-link:hover { background: var(--color-sidebar-hover); text-decoration: none; color: #fff; }
.sidebar-link.active { background: var(--color-sidebar-active); color: var(--color-black); }
.sidebar-link .icon { font-size: 15px; width: 18px; text-align: center; }
.sidebar-footer {
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px; color: #9aa2c0; display: flex; align-items: center; gap: 10px;
}
.sidebar-version { padding: 10px 16px 16px; font-size: 10.5px; color: #565b68; line-height: 1.5; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 19px; font-weight: 800; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.user-chip .name { font-weight: 700; }
.user-chip .role { font-size: 11px; color: var(--color-text-muted); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-primary); color: var(--color-black); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12.5px;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--color-border);
  background: var(--color-surface); display: flex; align-items: center; justify-content: center; font-size: 15px;
  color: var(--color-text);
}
.icon-btn .dot-badge {
  position: absolute; top: -3px; right: -3px; background: var(--color-danger); color: #fff;
  font-size: 9.5px; font-weight: 800; border-radius: 999px; min-width: 15px; height: 15px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px; border: 2px solid var(--color-surface);
}
.role-badge {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: 999px; background: var(--color-primary-light); color: #a31621;
}

.content { padding: 24px 26px 60px; flex: 1; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-header .subtitle { color: var(--color-text-muted); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Tarjetas / grillas ---------- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 8px; }
.card-header h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr);} }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card .stat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.stat-card .stat-icon {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; background: var(--color-primary-light);
}
.stat-card .label { font-size: 11.5px; color: var(--color-text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.stat-card .value { font-size: 26px; font-weight: 800; }
.stat-card .sub { font-size: 12px; color: var(--color-text-muted); }
.stat-card .sub.danger { color: var(--color-danger); font-weight: 600; }
.stat-card .sub.success { color: var(--color-success); font-weight: 600; }

.progress-bar { width: 100%; height: 9px; background: #eef0f5; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress-bar-fill { height: 100%; background: var(--color-primary); border-radius: 999px; transition: width .3s; }
.progress-bar-fill.complete { background: var(--color-success); }
.progress-ring-wrap { display: flex; align-items: center; gap: 22px; }
.progress-ring-num { font-size: 40px; font-weight: 800; color: var(--color-black); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--color-text-muted); font-weight: 700; padding: 11px 12px; border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
tbody tr:hover { background: #fbfbfd; }
tbody tr.clickable { cursor: pointer; }
.table-empty { padding: 40px 20px; text-align: center; color: var(--color-text-muted); }
.name-cell { display: flex; align-items: center; gap: 10px; }
.name-cell .who .full-name { font-weight: 700; color: var(--color-black); }
.name-cell .who .sub-id { font-size: 11.5px; color: var(--color-text-muted); }
.origin-cell { display: flex; align-items: center; gap: 7px; }
.origin-cell .origin-ic { font-size: 15px; }
.row-actions { display: flex; gap: 4px; }
.row-actions button {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: none;
  display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--color-text-muted);
}
.row-actions button:hover { background: #f1f2f6; color: var(--color-text); }

/* Acciones de fila con texto (no iconos): usadas en "Calidad de datos".
   A diferencia de .row-actions, los botones conservan su ancho natural y
   la fila se reacomoda en pantallas angostas en vez de superponerse. */
.acciones-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.acciones-fila > * { flex: 0 0 auto; }
.acciones-fila select {
  min-width: 190px; max-width: 260px; height: 32px; padding: 0 8px;
  border: 1px solid var(--color-border); border-radius: 8px; font-size: 12.5px; background: #fff;
}
.acciones-fila .btn { white-space: nowrap; }
.celda-comparacion { display: grid; gap: 2px; min-width: 190px; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 4px; font-size: 12.5px; color: var(--color-text-muted); }
.pagination .pages { display: flex; gap: 6px; }
.pagination .pages button {
  min-width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--color-border);
  background: var(--color-surface); font-size: 12.5px; font-weight: 700; color: var(--color-text);
}
.pagination .pages button.active { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-black); }
.pagination .pages button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .02em;
}
.badge-oro { background: var(--oro-bg); color: var(--oro); }
.badge-plata { background: var(--plata-bg); color: var(--plata); }
.badge-bronce { background: var(--bronce-bg); color: var(--bronce); }
.badge-cobre { background: var(--cobre-bg); color: var(--cobre); }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); }
.badge-muted { background: #f1f2f6; color: var(--color-text-muted); }
.badge-prioridad-alta { background: var(--prioridad-alta-bg); color: var(--prioridad-alta); }
.badge-prioridad-normal { background: var(--prioridad-normal-bg); color: var(--prioridad-normal); }
.badge-prioridad-baja { background: var(--prioridad-baja-bg); color: var(--prioridad-baja); }

/* ---------- Filtros ---------- */
.filters-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 14px;
}
.filters-bar .form-group { margin-bottom: 0; min-width: 150px; flex: 1; }
.filters-bar .form-group.small { min-width: 110px; flex: 0 0 auto; }
.filters-bar .contact-month-filter { min-width: 165px; flex: 0 0 165px; }
.filters-bar .contact-month-filter label { display:block; margin-bottom:4px; font-size:11px; color:var(--color-text-muted); }
.search-input-wrap { position: relative; flex: 2; min-width: 220px; }
.search-input-wrap input { padding-left: 38px; }
.search-input-wrap .icon-left { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9aa0ab; line-height: 1; }

/* ---------- Kanban ---------- */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban-column {
  background: #f0f1f5; border-radius: var(--radius-md); width: 258px; flex-shrink: 0;
  display: flex; flex-direction: column; max-height: calc(100vh - 250px);
}
.kanban-column-header {
  padding: 12px 14px 8px; border-bottom: 1px solid #e2e3ea;
}
.kanban-column-header .kch-top { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.kanban-column-header .kch-sub { font-size: 11px; color: var(--color-text-muted); margin-top: 3px; }
.kanban-column-header .count {
  background: rgba(0,0,0,0.08); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700;
}
.kanban-cards { padding: 10px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
  background: var(--color-surface); border-radius: var(--radius-sm); padding: 12px;
  box-shadow: var(--shadow-sm); cursor: grab; border: 1px solid var(--color-border);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.4; }
.kanban-card .kc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.kanban-card .kc-name { font-weight: 700; font-size: 13px; }
.kanban-card .kc-meta { font-size: 11.5px; color: var(--color-text-muted); margin-bottom: 2px; }
.kanban-card .kc-motivo { margin-top: 6px; font-size: 11px; color: var(--color-danger); font-weight: 700; }
.kanban-column.dragover { outline: 2px dashed var(--color-primary-dark); outline-offset: -4px; }
.kanban-column[data-etapa="perdido"] .kanban-card { border-left: 4px solid var(--color-danger); }
.kanban-column[data-etapa="ganado"] .kanban-card { border-left: 4px solid var(--color-success); }
.crm-summary-bottom { display: flex; gap: 0; overflow-x: auto; margin-top: 18px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.crm-summary-bottom .cs-item { padding: 12px 18px; border-right: 1px solid var(--color-border); min-width: 100px; flex-shrink: 0; }
.crm-summary-bottom .cs-item:last-child { border-right: none; background: var(--color-black); color: #fff; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.crm-summary-bottom .cs-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; opacity: .75; margin-bottom: 3px; }
.crm-summary-bottom .cs-value { font-weight: 800; font-size: 14px; }

.crm-side-summary .cs-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--color-border); font-size: 12.5px; }
.crm-side-summary .cs-row:last-of-type { border-bottom: none; }
.crm-side-summary .cs-row .cs-val { font-weight: 800; color: var(--color-black); }

/* ---------- Stepper (modal cambio de etapa) ---------- */
.stage-stepper { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 4px 0 10px; }
.stage-stepper .ss-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 86px; padding: 8px 6px;
  border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; flex-shrink: 0;
}
.stage-stepper .ss-step .ss-dot {
  width: 30px; height: 30px; border-radius: 50%; background: #eef0f5; color: var(--color-text-muted);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800;
}
.stage-stepper .ss-step .ss-label { font-size: 10.5px; font-weight: 700; text-align: center; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .02em; }
.stage-stepper .ss-step.done .ss-dot { background: var(--color-success-bg); color: var(--color-success); }
.stage-stepper .ss-step.selected { background: var(--color-primary-light); }
.stage-stepper .ss-step.selected .ss-dot { background: var(--color-primary); color: var(--color-black); }
.stage-stepper .ss-step.selected .ss-label { color: var(--color-black); }
.stage-stepper .ss-arrow { color: var(--color-border); font-size: 15px; padding: 0 2px; flex-shrink: 0; }
.char-counter { text-align: right; font-size: 11px; color: var(--color-text-muted); margin-top: 3px; }
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider {
  position: absolute; cursor: pointer; inset: 0; background: #d1d5db; transition: .15s; border-radius: 999px;
}
.toggle-switch .slider::before {
  content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff;
  transition: .15s; border-radius: 50%;
}
.toggle-switch input:checked + .slider { background: var(--color-success); }
.toggle-switch input:checked + .slider::before { transform: translateX(18px); }

/* ---------- Tabs / pills ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 16px; }
.tab-btn {
  background: none; border: none; padding: 10px 14px; font-size: 13px; font-weight: 700;
  color: var(--color-text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn.active { color: var(--color-black); border-bottom-color: var(--color-primary); }
.pill-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--color-border); margin-bottom: 16px; }
.pill-tabs button { background: none; border: none; padding: 4px 0 12px; font-size: 13.5px; font-weight: 700; color: var(--color-text-muted); border-bottom: 3px solid transparent; display: flex; align-items: center; gap: 6px; }
.pill-tabs button.active { color: var(--color-black); border-bottom-color: var(--color-primary); }
.pill-toggle { display: flex; gap: 6px; background: #eef0f5; padding: 3px; border-radius: 999px; width: fit-content; }
.pill-toggle button { border: none; background: none; padding: 7px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); }
.pill-toggle button.active { background: var(--color-surface); color: var(--color-black); box-shadow: var(--shadow-sm); }
.seg-toggle { display: inline-flex; border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; }
.seg-toggle button { border: none; background: var(--color-surface); padding: 9px 15px; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); }
.seg-toggle button + button { border-left: 1px solid var(--color-border); }
.seg-toggle button.active { background: var(--color-primary); color: var(--color-black); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 18, 30, 0.55);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column;
}
.modal.modal-lg { max-width: 780px; }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--color-border); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex-shrink: 0; min-width: 0; }
.modal-footer>.btn{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.crm-five .kanban-card{box-sizing:border-box;max-width:100%}
.crm-five .kanban-card>.btn{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.modal-close { background: none; border: none; font-size: 18px; color: var(--color-text-muted); }

/* ---------- Toasts ---------- */
.toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: var(--color-black); color: #fff; padding: 11px 16px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: 13px; min-width: 220px; max-width: 360px;
  animation: toast-in .18s ease-out;
}
.toast.success { background: #14532d; }
.toast.error { background: #7f1d1d; }
.toast.info { background: var(--color-black); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Widgets tipo dashboard ---------- */
.quick-tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 18px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); font-size: 12.5px; font-weight: 700; color: var(--color-text);
}
.quick-tile:hover { background: var(--color-primary-light); border-color: var(--color-primary); }
.quick-tile .qt-icon { font-size: 22px; }

.today-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.today-item:last-child { border-bottom: none; }
.today-item .ti-time { font-size: 12px; font-weight: 800; color: var(--color-text-muted); width: 62px; flex-shrink: 0; }
.today-item .ti-ic { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--color-primary-light); flex-shrink: 0; }
.today-item .ti-title { font-weight: 700; font-size: 13px; }
.today-item .ti-sub { font-size: 11.5px; color: var(--color-text-muted); }

.attention-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--color-border); }
.attention-item:last-child { border-bottom: none; }
.attention-item .att-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-danger); flex-shrink: 0; }
.attention-item .att-name { font-weight: 700; font-size: 13px; }
.attention-item .att-motivo { font-size: 11.5px; color: var(--color-danger); }

.timeline-row { display: flex; gap: 20px; overflow-x: auto; padding-top: 6px; }
.timeline-item { display: flex; flex-direction: column; gap: 6px; min-width: 160px; padding-left: 14px; border-left: 2px solid var(--color-border); }
.timeline-item .tl-time { font-size: 11px; color: var(--color-text-muted); font-weight: 700; }
.timeline-item .tl-title { font-size: 12.5px; font-weight: 600; }

.mini-calendar { width: 100%; border-collapse: collapse; }
.mini-calendar th { font-size: 10px; color: var(--color-text-muted); font-weight: 700; padding: 4px; text-align: center; }
.mini-calendar td { text-align: center; padding: 2px; }
.mini-calendar .day-cell {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; margin: 0 auto; position: relative; cursor: default; color: var(--color-text);
}
.mini-calendar .day-cell.today { background: var(--color-primary); color: var(--color-black); font-weight: 800; }
.mini-calendar .day-cell.selected { outline: 2px solid var(--color-primary-dark); }
.mini-calendar .day-cell .dd {
  position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%;
}
.calendar-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--color-text-muted); margin-top: 10px; }
.calendar-legend .lg-item { display: flex; align-items: center; gap: 5px; }
.calendar-legend .lg-dot { width: 8px; height: 8px; border-radius: 50%; }

.info-tile-row { display: flex; gap: 10px; flex-wrap: wrap; }
.info-tile { flex: 1; min-width: 150px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.info-tile .it-ic { font-size: 17px; }
.info-tile .it-label { font-size: 10.5px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 700; }
.info-tile .it-value { font-weight: 700; font-size: 13px; }

.kv-list .kv-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--color-border); font-size: 12.5px; }
.kv-list .kv-row:last-child { border-bottom: none; }
.kv-list .kv-label { color: var(--color-text-muted); }
.kv-list .kv-value { font-weight: 700; }

/* ---------- Utilidades ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11px; }
.text-bold { font-weight: 700; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--color-text-muted); }
.empty-state .icon { font-size: 34px; margin-bottom: 10px; }
.divider { height: 1px; background: var(--color-border); margin: 16px 0; }
.link-btn { background: none; border: none; color: var(--color-primary-dark); font-size: 13px; font-weight: 700; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.section-title { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--color-text-muted); margin: 18px 0 10px; }
.section-title:first-child { margin-top: 0; }

.mobile-toggle { display: none; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .mobile-toggle { display: inline-flex; }
  .content { padding: 16px; }
  .auth-side { display: none; }
}

/* CORRECCIÓN DEFINITIVA DEL LOGIN */
.auth-screen {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.auth-side {
  width: auto;
  max-width: none;
  box-sizing: border-box;
}

.auth-main {
  width: auto;
  max-width: none;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.auth-main .auth-card {
  width: 100%;
  max-width: 460px;
  box-sizing: border-box;
}

/* Adaptación para celulares */
@media (max-width: 768px) {
  .auth-screen {
    display: block;
  }

  .auth-side {
    display: none;
  }

  .auth-main {
    width: 100%;
    min-height: 100vh;
    padding: 24px;
  }
}

/* Logo real del login */
.auth-side .auth-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 500px;
  max-width: 80%;
  height: auto;
  margin: 0 auto;
  align-self: center;
}

/* Iconos profesionales del dashboard */
.stat-card .stat-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  color: #a31621;
}

.stat-card .stat-icon .stat-icon-green svg {
  color: #079455;
}

.stat-card .stat-icon .stat-icon-purple svg {
  color: #7f44c7;
} 

/* Distribución de la zona operativa del dashboard */
.dashboard-operation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.dashboard-operation-grid > .card {
  width: 100%;
  height: 100%;
  margin: 0;
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .dashboard-operation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-operation-grid > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .dashboard-operation-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-operation-grid > :last-child {
    grid-column: auto;
  }
}

/* Organización interna de las tarjetas superiores */
.stat-card-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card-data {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

/* Icono grande y circular */
.stat-card .stat-card-main .stat-icon {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Tamaño del SVG dentro del círculo */
.stat-card .stat-card-main .stat-icon svg {
  width: 28px;
  height: 28px;
}

/* Número principal */
.stat-card-data .value {
  font-size: 28px;
  line-height: 1.1;
  margin: 1px 0;
}

/* Porcentaje debajo del número */
.stat-percentage {
  color: var(--color-text-muted);
  font-size: 13px;
}

/* Resumen del progreso mensual */
.progress-summary {
  min-width: 105px;
  padding-right: 24px;
  border-right: 1px solid var(--color-border);
}

.progress-summary .progress-ring-num {
  line-height: 1;
  margin-bottom: 8px;
}

.progress-summary-label {
  color: var(--color-text-muted);
  font-size: 14px;
}

/* Centrar verticalmente el contenido de progreso */
.progress-card {
  display: flex;
  flex-direction: column;
}

.progress-card .progress-ring-wrap {
  flex: 1;
  align-items: center;
}

/* Igualar progreso y pipeline */
.dashboard-summary-grid {
  align-items: stretch;
}

.dashboard-summary-grid > .card {
  height: 100%;
  min-height: 165px;
  margin: 0;
  box-sizing: border-box;
  align-self: stretch;
}

/* Iconos de las etapas del pipeline */
.pipeline-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pipeline-icon svg {
  width: 22px;
  height: 22px;
}

.pipeline-icon-blue {
  color: #287ee7;
  background: #e8f2ff;
}

.pipeline-icon-yellow {
  color: #a31621;
  background: #fff1f2;
}

.pipeline-icon-green {
  color: #079455;
  background: #e5f7ed;
}

.pipeline-icon-purple {
  color: #7f44c7;
  background: #f1e9fb;
}

/* Iconos de los títulos del dashboard */
.dashboard-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.dashboard-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
}

.dashboard-title-icon svg {
  width: 21px;
  height: 21px;
}

/* Mensaje e icono de tendencia del progreso */
.progress-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.progress-trend-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #c81e2b;
  flex-shrink: 0;
}

.progress-trend-icon svg {
  width: 25px;
  height: 25px;
}

/* Iconos SVG de acciones rápidas */
.quick-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-action-icon svg {
  width: 31px;
  height: 31px;
}

.quick-action-icon-yellow {
  color: #c81e2b;
}

.quick-action-icon-green {
  color: #079455;
}

.quick-action-icon-blue {
  color: #287ee7;
}

.quick-action-icon-purple {
  color: #7f44c7;
}

/* Icono del título Acciones rápidas */
.quick-title-icon {
  display: inline-flex;
  color: #f97316;
}

.quick-title-icon svg {
  width: 19px;
  height: 19px;
}

/* Calendario alineado sin generar espacio vacío */
.dashboard-month-row {
  position: relative;
  z-index: 2;
  height: 0;
  margin: 0 !important;
  transform: translateY(7px);
}

/* Ajuste para celulares */
@media (max-width: 640px) {
  .dashboard-month-row {
    height: auto;
    margin-bottom: 16px !important;
    transform: none;
  }
}

/* Logo original del menú lateral */
.sidebar-brand {
  min-height: 70px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.sidebar-logo {
  display: block;
  width: 165px;
  max-width: 100%;
  max-height: 50px;
  height: auto;
  object-fit: contain;
}

/* ========================================================================== 
   DASHBOARD ADMINISTRATIVO
   ========================================================================== */

/* Tarjetas de metas del equipo */
.team-stat-card {
  width: 100%;
  height: 100%;
  margin: 0;
  box-sizing: border-box;
  justify-content: center;
  gap: 30px;
}

.team-stat-card .label {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: #374151;
}

.team-progress-layout {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 0;
}

.team-progress-summary {
  min-width: 75px;
  padding-right: 24px;
  border-right: 1px solid var(--color-border);
}

.team-progress-percent {
  color: var(--color-black);
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
}

.team-progress-label {
  margin-top: 5px;
  color: var(--color-text-muted);
  font-size: 11.5px;
}

.team-progress-details {
  flex: 1;
  min-width: 0;
}

.team-progress-details .progress-bar {
  margin-top: 0;
  margin-bottom: 10px;
}

.team-stat-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.team-stat-header .label {
  margin: 0;
}

.team-stat-header .value {
  margin: 0;
  flex-shrink: 0;
  font-size: 24px;
  line-height: 1;
}

.team-stat-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.team-stat-title .quick-action-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.team-stat-title .quick-action-icon svg {
  width: 35px;
  height: 35px;
}

.team-stat-title .quick-action-icon-yellow {
  background: #fff1f2;
}

.team-stat-title .quick-action-icon-green {
  background: #e5f7ed;
}

.team-stat-title .quick-action-icon-purple {
  background: #f1e9fb;
}

/* Fila principal: Separaciones + comparativa */
.admin-separation-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px;
  align-items: stretch;
}

.admin-separation-row > .card {
  width: 100%;
  height: 300px;
  min-height: 300px;
  margin: 0;
  box-sizing: border-box;
}

/* Segunda fila: Ganados, Contactos y Clientes Oro */
.admin-secondary-kpi-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 200px;
  align-items: stretch;
}

.admin-secondary-kpi-row > .team-stat-card {
  min-height: 200px;
}

/* Comparativa por vendedora */
.separation-team-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.separation-team-card h3 {
  margin: 0 0 16px;
  font-size: 16px;
}

.separation-table-wrap {
  flex: 1;
  overflow: auto;
}

.separation-table {
  width: 100%;
  table-layout: fixed;
}

.separation-table th,
.separation-table td {
  padding: 10px 12px;
}

.separation-table th:first-child {
  width: 32%;
}

.separation-table th:nth-child(2) {
  width: 48%;
}

.separation-table th:last-child {
  width: 20%;
  text-align: center;
}

.separation-table-value {
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

/* Barra de avance por vendedor */
.seller-progress {
  width: 100%;
  min-width: 130px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.seller-progress-value {
  min-width: 42px;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
}

.seller-progress-bar {
  width: 100%;
  height: 9px;
  overflow: hidden;
  background: #e9edf3;
  border-radius: 999px;
}

.seller-progress-fill {
  height: 100%;
  background: #c81e2b;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.seller-progress-fill.complete {
  background: #079455;
}

/* Tabla inferior: avance general de cada integrante del equipo */
.general-team-progress-card {
  width: 100%;
  padding: 22px 24px;
  box-sizing: border-box;
}

/* Tarjetas enlazadas y detalle dinámico del dashboard */
.dashboard-stat-link { cursor:pointer; transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease; }
.dashboard-stat-link:hover,.dashboard-stat-link:focus-visible { transform:translateY(-2px) !important; border-color:#c81e2b; box-shadow:0 10px 24px rgba(15,23,42,.1); outline:none; }
.dashboard-stat-link .team-stat-title .label { text-decoration-thickness:2px; text-underline-offset:4px; }
.dashboard-stat-link:hover .team-stat-title .label { text-decoration:underline; }
.dashboard-back-link { display:inline-flex; margin-bottom:10px; }
.dashboard-detail-card { padding:0; overflow:hidden; }
.dashboard-detail-summary { min-height:54px; padding:14px 18px; display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid var(--border); }
.dashboard-detail-table-wrap { overflow-x:auto; }
.dashboard-detail-table { min-width:1050px; }
.dashboard-detail-table th,.dashboard-detail-table td { padding:13px 14px; vertical-align:middle; }
.dashboard-detail-table tbody tr:hover { background:#fff7f8; }

/* Menú lateral amplio con iconos SVG */
.sidebar-menu {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 10px;
}

.sidebar-menu > .sidebar-nav {
  width: 100%;
  padding: 0 !important;
  overflow: visible;
  box-sizing: border-box;
}

.sidebar-menu .sidebar-link,
.sidebar-account-nav .sidebar-link {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  margin: 0 0 5px;
  gap: 13px;
  border-radius: 9px;
  box-sizing: border-box;
  font-size: 15.5px;
  font-weight: 700;
}

.sidebar-link-label {
  flex: 1;
  line-height: 1.2;
  white-space: nowrap;
}

.sidebar-link .sidebar-svg-icon {
  width: 23px;
  height: 23px;
  min-width: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #c81e2b;
}

.sidebar-link .sidebar-svg-icon svg {
  display: block;
  width: 23px;
  height: 23px;
}

.sidebar-link:hover .sidebar-svg-icon {
  color: #ff8491;
}

.sidebar-link.active .sidebar-svg-icon {
  color: #111827;
}

.sidebar-section-label {
  margin: 22px 14px 9px;
  font-size: 11px;
  letter-spacing: .12em;
}

.sidebar-account-nav {
  width: 100%;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  box-sizing: border-box;
}

/* Acceso global y resumen general por vendedora */
.dashboard-global-link { cursor:pointer; transition:border-color .16s ease,box-shadow .16s ease; }
.dashboard-global-link:hover,.dashboard-global-link:focus-visible { border-color:#c81e2b; box-shadow:0 10px 26px rgba(15,23,42,.09); outline:none; }
.dashboard-global-title { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.dashboard-global-title-action { color:#a31621; font-size:13px; white-space:nowrap; }
.general-seller-card { margin-bottom:16px; padding:0; overflow:hidden; }
.general-seller-heading { display:flex; align-items:center; gap:12px; padding:18px 20px; border-bottom:1px solid var(--border); background:#fff; }
.general-seller-heading h2 { margin:0 0 3px; font-size:19px; }
.general-seller-heading span { color:#64748b; font-size:12px; }
.general-seller-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); }
.general-metric-column { min-height:150px; padding:16px 18px; border-right:1px solid var(--border); }
.general-metric-column:last-child { border-right:0; }
.general-metric-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; font-size:13px; font-weight:800; text-transform:uppercase; }
.general-metric-heading strong { min-width:27px; height:27px; display:grid; place-items:center; border-radius:999px; background:#eef2f7; }
.general-metric-column.gold .general-metric-heading { color:#b77900; }
.general-metric-column.reserved .general-metric-heading { color:#079455; }
.general-metric-column.won .general-metric-heading { color:#7c3aed; }
.general-client-list { margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:7px; }
.general-client-item { display:flex; align-items:baseline; justify-content:space-between; gap:12px; min-width:0; }
.general-client-link { appearance:none; padding:0; border:0; background:none; color:#172033; font:inherit; font-size:13px; text-align:left; cursor:pointer; }
.general-client-link:hover { color:#a31621; text-decoration:underline; }
.general-client-date { color:#64748b; font-size:11px; font-weight:600; white-space:nowrap; }
.dashboard-general-actions { align-self:flex-end; }
.general-empty-list { color:#94a3b8; font-size:13px; font-style:italic; }
@media (max-width:1000px) { .general-seller-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .general-metric-column { border-bottom:1px solid var(--border); } }
@media (max-width:620px) { .general-seller-metrics { grid-template-columns:1fr; } .dashboard-global-title { align-items:flex-start; flex-direction:column; } }

.general-team-progress-card > h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.general-team-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

.general-team-table {
  width: 100%;
  min-width: 920px;
  table-layout: fixed;
}

.general-team-table th,
.general-team-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.general-team-table th:first-child {
  width: 24%;
}

.general-team-table th:nth-child(2),
.general-team-table th:nth-child(3),
.general-team-table th:nth-child(4),
.general-team-table th:nth-child(5) {
  width: 12%;
}

.general-team-table th:last-child {
  width: 28%;
}

.general-seller-progress {
  display: grid;
  grid-template-columns: 52px minmax(140px, 1fr);
}

/* Resumen mensual del monto desembolsado */
.admin-disbursed-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 2px;
  box-sizing: border-box;
}

.admin-disbursed-month {
  color: #111827;
  font-size: 20px;
  font-weight: 900;
  text-transform: capitalize;
}

.admin-disbursed-separator {
  color: #d1d5db;
  font-size: 28px;
}

.admin-disbursed-label {
  color: #4b5563;
  font-size: 19px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.admin-disbursed-total {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-disbursed-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #079455;
}

.admin-disbursed-icon svg {
  width: 32px;
  height: 32px;
}

.admin-disbursed-value {
  color: #111827;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

/* Responsive del dashboard administrativo */
@media (max-width: 1100px) {
  .admin-separation-row {
    grid-template-columns: 1fr;
  }

  .admin-separation-row > .card {
    height: auto;
    min-height: 220px;
  }

  .admin-secondary-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
  }
}

@media (max-width: 640px) {
  .admin-secondary-kpi-row {
    grid-template-columns: 1fr;
  }

  .admin-secondary-kpi-row > .team-stat-card {
    min-height: 180px;
  }

  .separation-table {
    min-width: 560px;
  }

  .admin-disbursed-row {
    gap: 8px;
    text-align: center;
  }
}

/* Ampliar el contenido de la tarjeta principal de Separaciones */
.admin-separation-row > .team-stat-card {
  padding: 28px 32px;
  justify-content: center;
  gap: 38px;
}

/* Título y resultado */
.admin-separation-row > .team-stat-card .team-stat-header {
  align-items: center;
}

.admin-separation-row > .team-stat-card .label {
  font-size: 25px;
  line-height: 1.2;
}

.admin-separation-row > .team-stat-card .value {
  font-size: 31px;
}

/* Círculo e icono de Separaciones */
.admin-separation-row > .team-stat-card .quick-action-icon {
  width: 54px;
  height: 54px;
  min-width: 54px;
}

.admin-separation-row > .team-stat-card .quick-action-icon svg {
  width: 38px;
  height: 38px;
}

/* Fila del porcentaje y la barra */
.admin-separation-row > .team-stat-card .team-progress-layout {
  width: 100%;
  gap: 28px;
}

.admin-separation-row > .team-stat-card .team-progress-summary {
  min-width: 90px;
  padding-right: 28px;
}

.admin-separation-row > .team-stat-card .team-progress-percent {
  font-size: 38px;
}

.admin-separation-row > .team-stat-card .team-progress-label {
  font-size: 13px;
}

/* Barra más alta y visible */
.admin-separation-row > .team-stat-card .progress-bar {
  height: 13px;
  margin-bottom: 12px;
}

.admin-separation-row > .team-stat-card .sub {
  font-size: 14px;
}

/* Alinear las tres tarjetas administrativas inferiores */
.admin-secondary-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 200px;
  align-items: stretch !important;
}

.admin-secondary-kpi-row > .team-stat-card {
  grid-row: 1;
  width: 100%;
  height: 200px !important;
  min-height: 200px !important;
  margin: 0 !important;
  align-self: stretch !important;
  position: relative;
  top: 0;
  transform: none !important;
  box-sizing: border-box;
}

[hidden]{display:none!important}.attendance-grid,.attendance-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}.attendance-day{padding:8px;border-radius:8px;background:#f3f4f6;min-height:70px}.attendance-day>*{display:block}.attendance-day.presente{background:#dcfce7;color:#166534}.attendance-day.ausente{background:#fee2e2;color:#991b1b}.attendance-day.descanso{background:#e5e7eb}.attendance-day.en_curso{background:#fef3c7}.daily-panel{border:2px solid #c81e2b}.crm-five{display:grid;grid-template-columns:repeat(5,minmax(210px,1fr));gap:14px;overflow-x:auto}.workflow-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}@media(max-width:650px){.workflow-form{grid-template-columns:1fr}.attendance-day{padding:3px;font-size:10px}}

.crm-controls{display:flex!important;align-items:end;flex-wrap:wrap;gap:12px}.crm-controls>.form-group{flex:1;min-width:160px;margin:0}.crm-controls>select,.crm-controls>input{flex:1;min-width:150px}.crm-controls input[type=search]{border:1px solid #d8dde6;border-radius:8px;padding:10px;min-height:40px}.crm-five{grid-template-columns:repeat(5,minmax(170px,1fr));padding-bottom:12px}.crm-five>.kanban-column{min-width:0;padding:12px;border:1px solid #e3e6ee;border-radius:12px;background:#f0f2f7;min-height:300px}.crm-five>.kanban-column>h3{font-size:13px;padding:0 0 12px;border-bottom:2px solid #c81e2b}.crm-five .kanban-card{overflow-wrap:anywhere}.crm-five .kanban-card p{font-size:12px;margin:7px 0}.attendance-week{text-align:center;font-weight:600;margin-bottom:8px}

.crm-five>.kanban-column{width:auto!important;box-sizing:border-box}.crm-five .kanban-card{width:auto!important;min-width:0}

.opportunity-search{display:block;width:100%;padding:12px 14px;border:1px solid #cbd5e1;border-radius:9px;font:inherit;margin:10px 0;box-sizing:border-box;min-height:44px}.opportunity-results{display:flex;flex-direction:column;gap:8px;max-height:330px;overflow:auto}.opportunity-result{display:flex;flex-direction:column;align-items:flex-start;gap:5px;width:100%;text-align:left;padding:12px 14px;background:#fff;border:1px solid #dde3ec;border-radius:9px;cursor:pointer;font:inherit;white-space:normal}.opportunity-result:hover,.opportunity-result:focus-visible{border-color:#c81e2b;background:#fffbea;outline:2px solid #c81e2b;outline-offset:-2px}.opportunity-result span,.opportunity-result small{color:#64748b;font-size:12px}.opportunity-selected{padding:12px;margin:12px 0;border:1px solid #c81e2b;border-radius:9px;background:#fffbea}.activity-responsible{display:block;color:#64748b;margin-top:5px}.activity-private-notice{padding:12px;background:#fef9c3;border-radius:8px;margin-bottom:16px}

.opportunity-results{margin-bottom:16px;flex-shrink:0}.activity-contact-result{font:inherit;background:#fff;border:1px solid #dbe1ea}.activity-contact-result:focus-visible{outline:2px solid #c81e2b}

.daily-rule-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;margin-top:16px}.daily-rule-row{display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid #e2e8f0;border-radius:10px;padding:14px;cursor:pointer}.daily-rule-action{display:flex;gap:10px;align-items:center}.daily-rule-row small{display:block;color:#64748b}.daily-rule-row input[role=switch]{appearance:none;width:44px;height:25px;flex:0 0 44px;border:0;border-radius:20px;background:#cbd5e1;position:relative;cursor:pointer}.daily-rule-row input[role=switch]::after{content:"";position:absolute;width:19px;height:19px;border-radius:50%;background:white;top:3px;left:3px;transition:transform .15s}.daily-rule-row input[role=switch]:checked{background:#16a34a}.daily-rule-row input[role=switch]:checked::after{transform:translateX(19px)}.daily-rule-row input:focus-visible{outline:3px solid #c81e2b;outline-offset:3px}.daily-rule-status{font-size:12px;color:#475569}.daily-rule-card{margin-top:20px}

.inventory-table td.inventory-person{min-width:170px;max-width:230px;white-space:normal;overflow-wrap:anywhere}.inventory-person a{font-weight:600;text-decoration:underline}.inventory-table th:nth-child(3),.inventory-table th:nth-child(4){min-width:150px}

.crm-review-status{padding:5px 8px;border-radius:6px;background:#fff0ca;color:#74530b;font-size:12px;font-weight:600}
.odoo-months{display:flex;flex-wrap:wrap;gap:8px}
.crm-cash-badge{background:#dcfce7;color:#166534;padding:5px 8px;border-radius:6px;font-weight:600}
.opportunity-mode-grid{align-items:stretch;grid-auto-rows:1fr}
.opportunity-mode-grid>section.card{display:flex;flex-direction:column;margin:0;height:100%;min-width:0;box-sizing:border-box}
.opportunity-mode-grid>section.card>p{flex:1}
.opportunity-mode-grid>section.card>.btn{margin-top:auto;width:100%}
.inventory-kpi-filter{cursor:pointer;text-align:left;font:inherit;transition:border-color .15s,box-shadow .15s}
.inventory-kpi-filter.active,.inventory-kpi-filter:hover,.inventory-kpi-filter:focus-visible{border-color:#c81e2b;box-shadow:0 0 0 2px #c81e2b33;outline:none}

/* Responsive: keep wide data inside scrollable sections, never the whole page. */
.responsive-scroll-controls { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:8px 0; }
.responsive-scroll-controls[hidden] { display:none; }
.responsive-scroll-controls span { flex:1; min-width:0; font-size:12px; color:var(--color-text-muted); }
.responsive-scroll-controls .btn { min-width:44px; min-height:44px; padding:8px; }
.responsive-scroll-controls button:disabled { opacity:.35; cursor:default; }
.table-wrap, .separation-table-wrap, .dashboard-detail-table-wrap, .attendance-scroll, .crm-five { min-width:0; max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
.attendance-scroll { width:100%; }
.table-wrap:focus-visible, .crm-five:focus-visible, .attendance-scroll:focus-visible { outline:2px solid var(--color-primary-dark); outline-offset:2px; }
.sidebar-backdrop { display:none; }
@media (max-width:1100px) {
  .admin-secondary-kpi-row { grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:auto; }
  .admin-secondary-kpi-row > .team-stat-card { grid-row:auto; height:auto !important; min-height:180px !important; }
  .team-stat-header { flex-wrap:wrap; align-items:center; }
  .team-stat-card .label { font-size:17px; overflow-wrap:anywhere; }
}
@media (max-width:900px) {
  .auth-screen { grid-template-columns:minmax(0,1fr); }
  .sidebar { width:min(280px,85vw); max-width:85vw; left:-100vw; height:100dvh; }
  .sidebar-backdrop.open { display:block; position:fixed; inset:0; z-index:40; border:0; background:rgba(15,18,30,.45); }
  .topbar { padding:10px 14px; gap:8px; }
  .topbar > .flex { flex:1; min-width:0; gap:10px; }
  .topbar-right { flex-shrink:0; gap:6px; }
  .topbar-title { font-size:17px; line-height:1.25; overflow-wrap:anywhere; }
  .main, .content, .card, .grid > *, .page-header > * { min-width:0; box-sizing:border-box; }
  .content { width:100%; }
  .admin-separation-row > .card { min-width:0; }
  .team-stat-header .value { font-size:23px; }
  .table-wrap table { min-width:640px; }
  .table-wrap .inventory-table { min-width:1450px; }
  .table-wrap .general-team-table { min-width:920px; }
  .table-wrap .dashboard-detail-table { min-width:1050px; }
  .general-team-table th { white-space:normal; }
  .separation-table { min-width:560px; }
  .name-cell .who { min-width:140px; }
  .crm-five { grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:minmax(260px,38%); align-items:start; scroll-snap-type:x proximity; }
  .crm-five > .kanban-column { scroll-snap-align:start; }
  .crm-five .kanban-card p { font-size:14px; }
  .tabs, .pill-tabs { max-width:100%; overflow-x:auto; }
  .tabs > *, .pill-tabs > * { flex-shrink:0; }
}
@media (max-width:640px) {
  .content { padding:18px 14px 40px; }
  h1 { font-size:22px; overflow-wrap:anywhere; }
  h2 { font-size:19px; overflow-wrap:anywhere; }
  .topbar .user-chip > div:not(.avatar) { display:none; }
  .topbar .user-chip { gap:0; }
  .topbar .btn { min-width:44px; min-height:44px; padding:8px; }
  .card { padding:16px; }
  .grid-2, .grid-3, .grid-4, .admin-secondary-kpi-row { grid-template-columns:minmax(0,1fr); }
  .grid > .card + .card { margin-top:0; }
  .admin-separation-row { gap:16px; }
  .admin-separation-row > .team-stat-card, .admin-secondary-kpi-row > .team-stat-card { padding:18px; gap:22px; height:auto !important; min-height:170px !important; }
  .team-stat-header, .admin-separation-row > .team-stat-card .team-stat-header { gap:12px; align-items:center; }
  .team-stat-card .label, .admin-separation-row > .team-stat-card .label { font-size:16px; line-height:1.35; }
  .team-stat-header .value, .admin-separation-row > .team-stat-card .value { font-size:24px; }
  .admin-separation-row > .team-stat-card .quick-action-icon { width:38px; height:38px; min-width:38px; }
  .admin-separation-row > .team-stat-card .quick-action-icon svg { width:28px; height:28px; }
  .team-progress-layout, .admin-separation-row > .team-stat-card .team-progress-layout { gap:16px; }
  .team-progress-summary, .admin-separation-row > .team-stat-card .team-progress-summary { min-width:72px; padding-right:16px; }
  .team-progress-percent, .admin-separation-row > .team-stat-card .team-progress-percent { font-size:28px; }
  .team-progress-label, .admin-separation-row > .team-stat-card .team-progress-label { font-size:12px; }
  .team-stat-card .sub { font-size:13px; overflow-wrap:anywhere; }
  .separation-team-card, .general-team-progress-card { padding:16px; }
  .admin-separation-row > .separation-team-card { min-height:0; }
  .admin-disbursed-row { gap:10px; text-align:center; }
  .admin-disbursed-label { font-size:15px; width:100%; }
  .admin-disbursed-month { font-size:17px; }
  .admin-disbursed-separator { display:none; }
  .admin-disbursed-value { font-size:30px; }
  .page-header, .card-header { gap:12px; }
  .card-header { flex-wrap:wrap; }
  .page-actions { width:100%; }
  .btn, .row-actions button, .modal-close { min-height:44px; }
  .row-actions button, .modal-close { min-width:44px; }
  .btn { white-space:normal; max-width:100%; overflow-wrap:anywhere; }
  input, select, textarea { box-sizing:border-box; max-width:100%; min-width:0; font-size:16px; }
  input:not([type=checkbox]):not([type=radio]):not([role=switch]), select { min-height:44px; }
  .filters-bar, .crm-controls { display:grid !important; grid-template-columns:minmax(0,1fr); gap:12px; }
  .filters-bar > *, .filters-bar .form-group, .filters-bar .form-group.small, .filters-bar .contact-month-filter, .crm-controls > .form-group, .crm-controls > select, .crm-controls > input, .search-input-wrap { width:100%; min-width:0; max-width:100%; flex-basis:auto; margin:0; }
  .seg-toggle { max-width:100%; }
  .seg-toggle button { min-height:44px; padding:10px; white-space:normal; }
  .crm-five { grid-auto-columns:88%; gap:12px; padding-bottom:12px; }
  .crm-five > .kanban-column { padding:14px; }
  .crm-five > .kanban-column > h3 { font-size:16px; }
  .attendance-grid, .attendance-week { min-width:595px; grid-template-columns:repeat(7,minmax(0,1fr)); }
  .attendance-day { padding:8px; min-height:84px; font-size:13px; overflow-wrap:anywhere; }
  .attendance-day small { font-size:12px; line-height:1.4; }
  .daily-rule-list { grid-template-columns:minmax(0,1fr); }
  .daily-rule-row { flex-wrap:wrap; gap:12px; }
  .daily-rule-action { margin-left:auto; }
  .modal-overlay { padding:8px; }
  .modal { max-height:calc(100dvh - 16px); }
  .modal-header, .modal-body, .modal-footer { padding:14px; min-width:0; }
  .modal-header { gap:12px; }
  .modal-header h2, .modal-header h3 { min-width:0; overflow-wrap:anywhere; }
  .modal-footer > .btn { flex:1 1 130px; }
  .toast-container { left:12px; right:12px; bottom:12px; }
  .toast { min-width:0; max-width:100%; }
}

/* Contraste de la identidad ZYS en superficies rojas. */
.btn-primary, .sidebar-link.active, .avatar, .pagination .pages button.active,
.stage-stepper .ss-step.selected .ss-dot, .seg-toggle button.active,
.mini-calendar .day-cell.today, .sidebar-link.active .sidebar-svg-icon { color: #fff; }
.auth-brand .logo-mark, .auth-brand .logo-text, .auth-brand .logo-sub,
.sidebar-brand .logo-mark, .sidebar-brand .logo-text, .sidebar-brand .logo-sub { color: #fff; }

/* Revision de inventario ZYS: no implica una operacion comercial. */
.inventory-kpis{grid-template-columns:repeat(auto-fit,minmax(130px,1fr))}
.inventory-dot.review,.inventory-status.revision{background:var(--color-primary-light);color:var(--color-primary-dark)}
.inventory-row.status-revision{background:#fffafb}
.inventory-kpi.review strong{color:var(--color-primary-dark)}
.inventory-status.no_comercializable{background:#e5e7eb;color:#374151}

.inventory-review-contact input[type=search]{width:100%;padding:10px 12px;border:1px solid var(--color-border);border-radius:var(--radius-sm);font:inherit;background:var(--color-surface);color:var(--color-text)}

.dashboard-month-row.dashboard-has-editor {height:auto;transform:none;margin-bottom:12px!important;align-items:center;gap:12px;flex-wrap:wrap;}
.dashboard-design-actions {display:flex;flex-wrap:wrap;gap:8px;margin-right:auto;}
.dashboard-design-help {padding:12px 16px;border:1px solid #fecdd3;border-radius:10px;background:#fff1f2;color:#881337;font-size:13px;line-height:1.5;margin:0 0 14px;}
.dashboard-design-grid {display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px;align-items:stretch;grid-auto-flow:row;}
.dashboard-design-widget {grid-column:span var(--dashboard-span,6);height:var(--dashboard-height,auto);min-width:0;position:relative;display:flex;flex-direction:column;}
.dashboard-design-content {min-width:0;min-height:0;flex:1;overflow:auto;}
.dashboard-design-content>.card {margin:0!important;min-height:120px;height:100%;box-sizing:border-box;max-width:100%;}
.dashboard-design-content>.admin-disbursed-row {margin:0!important;min-height:120px;flex-wrap:wrap;max-width:100%;box-sizing:border-box;}
.dashboard-design-content .table-wrap {overflow:auto;}
.dashboard-design-widget-tools,.dashboard-design-resize {display:none;}
.is-editing>.dashboard-design-widget {border:2px dashed #e11d48;border-radius:12px;background:#fff;min-height:150px;box-sizing:border-box;}
.is-editing .dashboard-design-widget-tools {display:flex;flex-wrap:wrap;align-items:center;gap:5px;padding:6px;background:#fff1f2;border-radius:10px 10px 0 0;flex-shrink:0;}
.dashboard-design-widget-tools label {display:flex;align-items:center;gap:4px;font-size:11px;color:#881337;}
.dashboard-design-widget-tools input {width:65px;min-width:0;padding:4px;font-size:12px;}
.dashboard-design-widget-tools .btn {padding:4px 8px;min-height:30px;}
.dashboard-design-move {flex:1 1 120px;min-width:0;border:0;background:transparent;color:#881337;font-weight:700;text-align:left;padding:6px;cursor:grab;touch-action:none;font-size:12px;}
.dashboard-design-move:active {cursor:grabbing;}
.dashboard-design-move:focus-visible,.dashboard-design-resize:focus-visible {outline:3px solid #2563eb;outline-offset:2px;}
.is-editing .dashboard-design-resize {display:block;position:absolute;right:0;bottom:0;width:28px;height:28px;background:#be123c;color:white;border:0;border-radius:8px 0 8px 0;cursor:nwse-resize;touch-action:none;font-weight:900;font-size:20px;z-index:2;}
.is-editing .dashboard-design-content {padding-bottom:18px;}
.is-editing .is-moving {opacity:.55;}
.is-editing .is-drop-target {outline:4px solid #2563eb;outline-offset:2px;}
@media(max-width:1100px) and (min-width:701px){.dashboard-design-grid:not(.is-editing)>.dashboard-design-widget {grid-column:span max(6,var(--dashboard-span,6));}}
@media(max-width:700px){.dashboard-design-grid {grid-template-columns:minmax(0,1fr);}.dashboard-design-widget {grid-column:1!important;height:auto!important;}.dashboard-design-actions {width:100%;}.dashboard-design-content>.card {height:auto;}.dashboard-design-widget-tools label {font-size:12px;}.dashboard-design-help {font-size:12px;}}

/* Entidades y montos de deuda del contacto */
.contact-debt-group {grid-column:1 / -1;min-width:0;}
.contact-debt-group>label:empty {display:none;}
.contact-debt-editor {min-width:0;border:1px solid var(--border,#e2e8f0);border-radius:10px;padding:12px;margin:0;}
.contact-debt-editor legend {font-weight:700;font-size:13px;padding:0 5px;}
.contact-debt-row {display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) auto;align-items:end;gap:10px;margin:10px 0;}
.contact-debt-row label {display:flex;flex-direction:column;gap:5px;min-width:0;font-size:12px;}
.contact-debt-row input {width:100%;min-width:0;}
.contact-debt-total {font-weight:700;margin:12px 0 0;}
.contact-finance-summary {margin-top:12px;overflow-wrap:anywhere;}
@media(max-width:540px){.contact-debt-row {grid-template-columns:minmax(0,1fr);}.contact-debt-row .btn {justify-self:start;}}

/* Fichas compartidas de clientes y sus operaciones. */
.customer-block{display:block;margin-top:4px}.customer-table{overflow-x:auto;margin-bottom:18px}.customer-table table{min-width:850px}.customer-table td{vertical-align:top}.customer-table td p{margin:0 0 8px}.customer-search-title{font-size:16px;margin:18px 0 10px}

/* Buscador de Clientes: misma entrada con lupa que Contactos. */
.customer-search-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;align-items:end;gap:12px}
.customer-search-filters .customer-search-input{grid-column:1/-1;min-width:0;width:100%}
.customer-search-filters .form-group{min-width:0;margin:0}
.customer-search-filters .form-group label{display:block;margin-bottom:6px}
.customer-search-filters input,.customer-search-filters select{width:100%;min-height:40px}
.customer-search-filters>.btn{min-height:40px;padding:9px 18px}
@media(max-width:640px){.customer-search-filters{grid-template-columns:minmax(0,1fr)}.customer-search-filters>.btn{width:100%}}

.contact-picker .search-input-wrap{min-width:0;width:100%;margin-bottom:8px}.contact-picker .search-input-wrap input{min-height:40px}

.prequalification-notes{max-height:250px;overflow-y:auto;min-height:56px;margin-top:12px}
.prequalification-note{padding:12px 0;border-top:1px solid var(--color-border)}
.prequalification-note:first-child{border-top:0;padding-top:0}
.prequalification-note-meta{display:flex;justify-content:space-between;align-items:baseline;gap:14px;font-size:12px}
.prequalification-note-meta time{color:var(--color-text-muted);white-space:nowrap}
.prequalification-note-text{white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0 0}
.prequalification-add{display:flex;justify-content:flex-end;margin-top:10px}
.prequalification-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;width:100%}
.prequalification-actions .btn{width:100%;white-space:normal;min-height:42px}
@media(max-width:640px){.prequalification-actions{grid-template-columns:1fr}.prequalification-note-meta{flex-wrap:wrap;gap:4px}}

.bank-progress{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;list-style:none;padding:0;margin:0 0 22px}
.bank-step{display:flex;flex-direction:column;justify-content:center;gap:5px;min-height:66px;padding:10px 6px;text-align:center;border:1px solid var(--color-border);border-radius:9px;background:#f4f5f7;color:#586174}
.bank-step strong{font-size:12px}.bank-step small{font-size:10px}
.bank-step.current{background:#fff2ba;border-color:#e6b932;color:#714b00}
.bank-step.complete{background:#dcf7e7;border-color:#69bf8b;color:#166534}
.bank-step.inactive{background:#f2f3f5;color:#8b929c;border-style:dashed}
@media(max-width:640px){.bank-progress{grid-template-columns:repeat(3,minmax(0,1fr))}}

.appraisal-task{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,220px);gap:16px;align-items:center;padding:14px 0;border-top:1px solid var(--color-border)}.appraisal-task .form-group{margin-bottom:0}.appraisal-task .checkbox-row{margin-top:8px}.appraisal-task input:disabled{opacity:.55}@media(max-width:640px){.appraisal-task{grid-template-columns:1fr;gap:8px}}

/* Pipeline ZYS: información principal y SVG */
.crm-five .pipeline-column-heading{display:flex;align-items:center;gap:9px;line-height:1.35;min-height:46px}
.pipeline-svg{display:inline-flex;flex:0 0 auto;width:19px;height:19px;align-items:center;justify-content:center}.pipeline-svg svg{width:100%;height:100%}
.pipeline-stage-icon,.pipeline-client-icon{display:inline-flex;align-items:center;justify-content:center;width:33px;height:33px;flex:0 0 33px;border-radius:10px;background:#fff0f2;color:#c81e2b}
.pipeline-column-title{flex:1;min-width:0;font-size:14px}.pipeline-count{padding:3px 8px;border-radius:20px;background:white;color:#a71021;min-width:24px;text-align:center;font-size:13px}
.crm-five .crm-opportunity-card{padding:16px 14px;border-radius:13px;border:1px solid #e5e8ef;border-top:3px solid #cf182c;box-shadow:0 3px 10px #18243a08;transition:box-shadow .16s,transform .16s;cursor:pointer}
.crm-five .crm-opportunity-card:hover{transform:translateY(-2px);box-shadow:0 6px 18px #18243a12}.crm-five .crm-opportunity-card:focus-visible{outline:3px solid #cf182c;outline-offset:3px}
.pipeline-card-heading{display:flex;align-items:flex-start;gap:9px;margin-bottom:10px}.pipeline-client-name{font-size:15px;line-height:1.45;color:#172235;font-weight:750;overflow-wrap:anywhere}.pipeline-client-icon{width:31px;height:31px;flex-basis:31px;border-radius:50%}
.pipeline-stage-badge{display:inline-flex;align-items:center;gap:5px;border-radius:7px;padding:5px 8px;background:#fff0f2;color:#a71021;font-size:12px;font-weight:650;margin-bottom:14px}.pipeline-stage-badge .pipeline-svg{width:15px;height:15px}
.pipeline-info{display:flex;align-items:flex-start;gap:8px;margin:11px 0;color:#697588}.pipeline-info>div{min-width:0}.pipeline-field-label{display:block;font-size:11px;color:#647086;line-height:1.4;margin-bottom:3px}.pipeline-field-value{display:block;font-size:14px;font-weight:600;color:#26344b;line-height:1.45;overflow-wrap:anywhere}
.pipeline-owner{display:flex;gap:8px;align-items:center;border-top:1px solid #eef0f5;margin-top:14px;padding-top:12px;color:#697588}.pipeline-owner strong{display:block;font-size:13px;color:#26344b;line-height:1.4}.pipeline-import-price,.pipeline-review-hint{display:block;margin-top:10px;font-size:12px;color:#647086}.pipeline-review-button{margin-top:10px}
.crm-five .pipeline-ganado{border-top-color:#169b62}.pipeline-ganado .pipeline-stage-badge{background:#e9f8ef;color:#087443}.pipeline-separacion .pipeline-stage-badge{background:#fff5da;color:#8a5800}
@media(prefers-reduced-motion:reduce){.crm-five .crm-opportunity-card{transition:none}.crm-five .crm-opportunity-card:hover{transform:none}}

@media(max-width:1400px){.crm-five .pipeline-column-heading{display:grid;grid-template-columns:1fr auto;gap:7px;min-height:78px}.pipeline-column-heading .pipeline-stage-icon{grid-row:1;grid-column:1}.pipeline-column-heading .pipeline-count{grid-row:1;grid-column:2}.pipeline-column-heading .pipeline-column-title{grid-row:2;grid-column:1 / -1;font-size:14px}.pipeline-card-heading{flex-direction:column;gap:8px}.pipeline-client-name{width:100%}}

/* Controles y prioridades del CRM */
.crm-five .pipeline-column-heading{display:flex!important;align-items:center;gap:10px;min-height:58px}.pipeline-column-heading .pipeline-stage-icon{width:40px;height:40px;flex:0 0 40px}.pipeline-stage-icon .pipeline-svg{width:25px;height:25px}.pipeline-column-heading .pipeline-column-title{font-size:18px!important;line-height:1.3;flex:1;overflow-wrap:anywhere}.pipeline-column-heading .pipeline-count{flex:0 0 auto;margin-left:6px;padding:5px 9px}
.crm-top-action{display:inline-flex;align-items:center;gap:8px;min-height:42px;padding:10px 15px;font-weight:650;box-shadow:0 2px 6px #17223508}.crm-top-action .pipeline-svg{width:20px;height:20px}
.pipeline-width-tools{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:14px 0;color:#46546b;font-size:13px}.pipeline-width-tools label{display:flex;align-items:center;gap:10px}.pipeline-width-tools input{width:150px;accent-color:#cf182c}.pipeline-width-tools output{min-width:70px}.crm-five{overflow-x:auto!important}
.pipeline-priority{display:flex;align-items:center;gap:4px;flex-wrap:wrap;margin-top:10px}.priority-dot{border:0;background:none;padding:2px;color:#d5dbe4;cursor:pointer;font-size:23px;line-height:1;min-width:27px;min-height:29px}.priority-dot.filled{color:#cf182c}.priority-dot:focus-visible{outline:2px solid #cf182c;border-radius:5px}.priority-caption{font-size:11px;color:#647086;margin-left:4px}
.pipeline-lost-corner{display:flex;justify-content:flex-end;margin:18px 0}.pipeline-lost-button{color:#9c3040;background:#fff7f8;border-color:#efd3d8}

.pipeline-owner{flex-wrap:wrap}.pipeline-owner>div:not(.pipeline-priority){flex:1;min-width:70px}.pipeline-owner .pipeline-priority{margin-top:0;max-width:100px;justify-content:flex-end}.pipeline-owner .priority-caption{width:100%;text-align:right}.crm-controls select{min-height:42px}

/* Ajuste individual: solo cambia la tarjeta, no su columna */
.crm-five .crm-opportunity-card{width:var(--opportunity-card-width,100%)!important;max-width:100%;box-sizing:border-box;align-self:flex-start}
.crm-opportunity-card .pipeline-card-heading{position:relative;padding-right:27px}.card-width-editor{position:absolute;top:0;right:0;font-weight:400;font-size:12px;z-index:2}.card-width-editor[open]{z-index:5}.card-width-editor>summary{list-style:none;cursor:pointer;border:1px solid #e5e8ef;border-radius:6px;background:#fff;color:#647086;width:26px;height:26px;display:flex;align-items:center;justify-content:center;font-size:19px}.card-width-editor>summary::-webkit-details-marker{display:none}.card-width-editor>summary:focus-visible{outline:2px solid #c81e2b}
.card-width-panel{position:absolute;right:0;top:32px;display:flex;flex-wrap:wrap;align-items:center;gap:9px;width:210px;padding:12px;background:#fff;border:1px solid #e1e5ed;border-radius:10px;box-shadow:0 8px 24px #17223526;color:#26344b}.card-width-panel strong{width:100%;font-size:12px}.card-width-panel input{width:140px;accent-color:#c81e2b}.card-width-panel output{font-size:12px}.card-width-panel button{min-height:30px}

@media(max-width:1400px){.crm-five .pipeline-column-heading{gap:6px;min-height:76px}.pipeline-column-heading .pipeline-stage-icon{width:28px;height:28px;flex-basis:28px}.pipeline-stage-icon .pipeline-svg{width:20px;height:20px}.pipeline-column-heading .pipeline-column-title{font-size:14px!important;overflow-wrap:normal;word-break:normal;hyphens:auto}.pipeline-column-heading .pipeline-count{margin-left:0;padding:4px;min-width:20px}}

/* Solo altura por oportunidad; columnas y ancho permanecen automáticos */
.crm-five .crm-opportunity-card{width:100%!important;height:var(--opportunity-card-height,auto);display:flex;flex-direction:column;overflow:visible;flex-shrink:0;max-height:none}
.crm-opportunity-card>.pipeline-card-heading{flex:0 0 auto}.pipeline-card-content{min-height:0;flex:1 1 auto;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;padding-right:3px}.pipeline-card-content:focus-visible{outline:2px solid #c81e2b;outline-offset:1px;border-radius:4px}.card-width-panel output{white-space:nowrap}

.commercial-report-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;align-items:start}.commercial-report-columns>.card{min-width:0}.report-search-grid{display:flex;flex-wrap:wrap;align-items:end;gap:12px}.report-search-grid>.form-group{flex:1;min-width:180px;margin:0}.report-search-grid input[type=search]{width:100%;min-height:40px;border:1px solid #d8dde6;border-radius:8px;padding:10px}.report-search-grid [hidden]{display:none!important}@media(max-width:900px){.commercial-report-columns{grid-template-columns:1fr}}

.commercial-report-columns>.card{margin-top:0!important}.commercial-report-columns table{min-width:560px}

/* Prioridad accesible: alta, media, baja y sin prioridad dentro de cada columna. */
.pipeline-priority .priority-dot{min-width:34px;min-height:38px;padding:3px;border-radius:7px}.pipeline-priority .priority-dot span{font-size:26px;line-height:1}.pipeline-priority{gap:3px}.priority-caption{flex-basis:100%;text-align:right}

/* Semáforo y tres controles alineados junto al responsable. */
.pipeline-owner .pipeline-priority{display:grid;grid-template-columns:repeat(3,26px);gap:2px;flex:0 0 82px;max-width:82px;margin-left:auto;align-items:center;justify-content:end}
.pipeline-priority .priority-dot{min-width:26px;min-height:30px;width:26px;height:30px;padding:2px;display:grid;place-items:center;line-height:1}
.pipeline-priority .priority-dot span{display:block;font-size:21px;line-height:1}
.pipeline-owner .pipeline-priority .priority-caption{grid-column:1/-1;white-space:nowrap;font-size:10px;margin:0;text-align:right;width:100%}
.pipeline-priority[data-priority="1"] .priority-dot.filled{color:#dc2626}
.pipeline-priority[data-priority="2"] .priority-dot.filled{color:#d99a00}
.pipeline-priority[data-priority="3"] .priority-dot.filled{color:#16a34a}
.crm-top-action[hidden]{display:none!important}

/* Tres vistas del pipeline. Las columnas crecen con todas sus oportunidades. */
.crm-five.crm-pipeline-board{height:auto!important;max-height:none!important;align-items:stretch;padding-bottom:14px}
.crm-five.crm-pipeline-board>.kanban-column{height:auto!important;max-height:none!important;min-height:260px;overflow:visible;align-self:stretch;gap:10px}
.crm-pipeline-board>.kanban-column>.crm-opportunity-card{margin:0;flex-shrink:0}
.crm-pipeline-board>.kanban-column>.pipeline-column-heading{flex-shrink:0;margin:0 0 4px}
.pipeline-layout-switch{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.pipeline-layout-switch .btn{display:inline-flex;align-items:center;gap:7px;min-height:40px}
.pipeline-layout-icon,.pipeline-layout-icon svg{width:19px;height:19px;display:inline-block}
.crm-five .pipeline-compact-card{height:auto!important;min-height:0!important;max-height:none!important;padding:12px;cursor:pointer;border-radius:10px}
.pipeline-compact-name{display:block;font-size:14px;line-height:1.45;color:#172235;overflow-wrap:anywhere}
.pipeline-compact-card .pipeline-owner{margin-top:9px;padding-top:9px}.pipeline-compact-card .pipeline-owner strong{font-size:12px}
.pipeline-list-stage{margin:0 0 18px;padding:16px;background:#fff;border:1px solid #e3e6ee;border-radius:12px}
.pipeline-list-stage>.pipeline-column-heading{display:flex;align-items:center;gap:9px;margin:0 0 12px;padding-bottom:10px;border-bottom:2px solid #cf182c;font-size:16px}
.pipeline-list-stage .pipeline-column-title{flex:1}.pipeline-list-stage .pipeline-stage-icon{width:32px;height:32px;display:grid;place-items:center;background:#fff0f2;border-radius:8px;color:#cf182c}
.pipeline-list-stage .pipeline-stage-icon .pipeline-svg{width:22px;height:22px}.pipeline-list-stage .pipeline-count{background:#f6f7fa;border-radius:12px;padding:3px 9px;font-size:12px}
.pipeline-list-table{width:100%;table-layout:fixed;min-width:820px}.pipeline-list-table th:nth-child(1){width:27%}.pipeline-list-table th:nth-child(2){width:24%}.pipeline-list-table th:nth-child(3){width:14%}.pipeline-list-table th:nth-child(4){width:22%}.pipeline-list-table th:nth-child(5){width:130px}
.pipeline-list-table th{white-space:normal;line-height:1.45;overflow-wrap:normal}.pipeline-list-table td{vertical-align:middle;overflow-wrap:anywhere}.pipeline-list-client{border:0;padding:4px 0;background:none;color:#172235;text-align:left;font-weight:700;cursor:pointer;line-height:1.5}
.pipeline-list-row{cursor:pointer}.pipeline-list-row:hover{background:#fff8f9}.pipeline-list-row:focus-visible{outline:2px solid #cf182c;outline-offset:-2px}.pipeline-list-client:focus-visible{outline:2px solid #cf182c}
.pipeline-list-substage{display:block;color:#647086;margin-top:4px}.pipeline-list-table .pipeline-priority{display:grid;grid-template-columns:repeat(3,26px);gap:2px;margin:0;justify-content:start;width:82px}.pipeline-list-table .priority-caption{grid-column:1/-1;width:100%;white-space:nowrap;text-align:left;margin:0;font-size:10px}
.pipeline-empty{margin:8px 0}

.project-extra-units{margin:18px 0;padding:16px;border:1px solid #e3e6ee;border-radius:10px;background:#fafbfe}.project-extra-units h3{margin:0 0 8px}.project-extra-group{padding:11px 0;border-top:1px solid #e6e9ef}.project-extra-toggle{display:flex;gap:9px;align-items:center;font-weight:650;cursor:pointer}.project-extra-toggle input{width:18px;height:18px;accent-color:#cf182c}.project-extra-fields{margin-top:12px}.project-extra-fields .form-group{margin-bottom:8px}.project-extra-summary{font-size:12px;color:#647086;margin:10px 0 0}

/* Actividades: búsqueda, resumen personal y calendarios del equipo. */
.activity-search h3{margin:0 0 16px}.activity-search-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1.4fr 1fr 1fr auto;gap:12px;align-items:end}.activity-search-grid .form-group{margin:0;min-width:0}.activity-search-grid input,.activity-search-grid select{width:100%}
.activity-stats{display:flex;flex-wrap:wrap;gap:14px;margin-bottom:20px}.activity-stat{flex:none;max-width:100%;box-sizing:border-box;border-top:3px solid #e4a400}.activity-stat.completada{border-top-color:#16a34a}.activity-stat.vencida{border-top-color:#dc2626}.activity-stat.cancelada{border-top-color:#64748b}.activity-stat-size{font-size:12px;margin-top:8px}.activity-stat-size summary{cursor:pointer;color:#64748b}.activity-stat-size input{width:100%;min-height:20px}.activity-stat-size .form-group{margin:6px 0}.activity-note-preview{white-space:pre-wrap;max-width:430px;overflow-wrap:anywhere;color:#64748b;margin:4px 0}.activity-status{border-radius:20px;padding:5px 9px;background:#fff3cd;white-space:nowrap}.activity-status.completada{background:#dcfce7;color:#166534}.activity-status.vencida{background:#fee2e2;color:#991b1b}.activity-status.cancelada{background:#e2e8f0;color:#475569}
.activity-team-calendar h2{font-size:18px;margin:0 0 18px}.activity-calendar-week,.activity-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}.activity-calendar-week{text-align:center;margin-bottom:8px;color:#64748b}.activity-calendar-day{border:1px solid #e2e8f0;border-radius:9px;min-height:112px;padding:9px;background:#fafbfe;min-width:0}.activity-calendar-day.today{border-color:#d71930;background:#fff6f7}.activity-calendar-event{display:block;width:100%;text-align:left;border:0;border-left:3px solid #e4a400;border-radius:5px;background:#fff4ce;padding:7px;margin-top:7px;cursor:pointer;font-size:12px;overflow-wrap:anywhere}.activity-calendar-event small{display:block;margin-top:4px}.activity-calendar-event.completada{background:#dcfce7;border-color:#16a34a}.activity-calendar-event.vencida{background:#fee2e2;border-color:#dc2626}.activity-calendar-event.cancelada{background:#e2e8f0;border-color:#64748b}.activity-daily-notice{padding:14px;border-radius:8px;background:#fff4ce;margin:12px 0}.activity-contact-results{display:flex;flex-direction:column;gap:5px}.modal-body [hidden]{display:none!important}
@media(max-width:1200px){.activity-search-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:700px){.activity-search-grid{grid-template-columns:1fr 1fr}.activity-calendar-scroll{overflow-x:auto}.activity-calendar-week,.activity-calendar-grid{min-width:770px}.activity-stats>.activity-stat{width:100%!important}.activity-search-grid>.form-group:first-child{grid-column:1/-1}}
.activity-stats>.card{margin:0!important;min-width:160px}.activity-search-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.activity-search-grid .btn{min-height:40px}.activity-search-grid input{min-height:40px}@media(max-width:700px){.activity-search-grid{grid-template-columns:1fr 1fr}}

/* Búsqueda compacta y área de distribución libre de Actividades. */
.activity-search.activity-compact-search{padding:14px}.activity-compact-search h3{margin-bottom:10px}.activity-compact-search .activity-search-grid{display:grid;grid-template-columns:minmax(150px,1.6fr) minmax(100px,1fr) minmax(105px,1fr) minmax(120px,1.15fr) 135px 135px auto;gap:9px;align-items:end}.activity-compact-search label{font-size:11px;margin-bottom:5px}.activity-compact-search input,.activity-compact-search select{font-size:12px;min-height:34px;height:34px;padding:6px 8px}.activity-compact-search .btn{min-height:34px;height:34px;padding:6px 12px;display:flex;gap:6px;align-items:center;justify-content:center;white-space:nowrap}.activity-compact-search .btn svg{width:16px;height:16px}.activity-compact-search.calendar-search .activity-search-grid{grid-template-columns:minmax(160px,1.5fr) 160px 160px auto;justify-content:end}.activity-compact-search [hidden]{display:none!important}
.activity-layout-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#64748b;margin:0 0 10px}.activity-workspace{position:relative;min-height:460px;margin-bottom:20px}.activity-workspace>.activity-layout-panel{position:absolute!important;margin:0!important;min-width:0!important;box-sizing:border-box;padding:0;border:1px solid #e1e5ed;border-radius:10px;overflow:hidden;display:flex;flex-direction:column;transition:box-shadow .15s}.activity-layout-panel.selected{outline:2px solid #cf182c;outline-offset:1px;z-index:2}.activity-layout-panel.moving{z-index:3;box-shadow:0 8px 25px #16213d22}.activity-panel-header{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:40px;padding:10px 13px;cursor:grab;touch-action:none;user-select:none}.activity-panel-header h3{font-size:12px;margin:0;color:#55637a}.activity-panel-move{border:0;background:transparent;color:#7f8ba1;cursor:grab;padding:3px;display:flex;touch-action:none}.activity-panel-move svg{width:17px;height:17px}.activity-panel-content{overflow:auto;flex:1;min-height:0;padding:0 14px 18px}.activity-panel-content .value{font-size:28px;font-weight:750;color:#17243b}.activity-panel-resize{position:absolute;bottom:1px;right:1px;width:25px;height:25px;padding:3px;border:0;border-radius:5px;background:#f5f6fa;color:#7f8ba1;cursor:nwse-resize;touch-action:none}.activity-panel-resize svg{width:19px;height:19px}.activity-layout-stat{border-top:3px solid #e4a400!important}.activity-layout-stat.completada{border-top-color:#16a34a!important}.activity-layout-stat.vencida{border-top-color:#dc2626!important}.activity-layout-stat.cancelada{border-top-color:#64748b!important}.activity-layout-table .activity-panel-header h3{color:#17243b;font-size:14px}.activity-layout-table .table-wrap{max-height:100%;overflow:auto}.activity-calendar-nav{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin-bottom:14px}.activity-calendar-nav .form-group{margin:0}.activity-calendar-nav input{height:34px;min-height:34px}.activity-event-owner{font-weight:700}.activity-calendar-day.outside-period{opacity:.4;background:#f1f3f8}
@media(max-width:1100px){.activity-compact-search{overflow-x:auto}.activity-compact-search .activity-search-grid{min-width:950px}.activity-compact-search.calendar-search .activity-search-grid{min-width:650px}}@media(max-width:700px){.activity-compact-search .activity-search-grid>.form-group:first-child{grid-column:auto}.activity-layout-toolbar{align-items:start}.activity-layout-toolbar small{max-width:60%}}

/* Personalizar Actividades comparte el editor y cuadrícula de Inicio. */
.activity-grid-actions{display:flex;justify-content:flex-end;margin:0 0 12px}.activity-grid-actions .dashboard-design-actions{margin-right:0}.activity-design-grid{grid-auto-flow:row dense}.activity-grid-card{padding:14px;overflow:auto}.activity-grid-card h3{font-size:12px;color:#64748b;margin:0 0 12px}.activity-grid-card .value{font-size:28px;font-weight:750;color:#17243b}.activity-grid-card.pendiente{border-top:3px solid #e4a400}.activity-grid-card.completada{border-top:3px solid #16a34a}.activity-grid-card.vencida{border-top:3px solid #dc2626}.activity-grid-card.cancelada{border-top:3px solid #64748b}.activity-grid-card.activity-grid-table h3{font-size:14px;color:#17243b}.activity-design-grid .dashboard-design-widget-tools input{box-sizing:border-box}.activity-design-grid .dashboard-design-content{overflow:auto}.activity-design-grid.is-editing .activity-grid-card{border-radius:0 0 10px 10px}.activity-design-grid .dashboard-design-widget-tools .btn{min-height:22px;padding:2px 5px;font-size:11px}

/* Resumen interactivo por estado y controles mensuales de calendario. */
.activity-state-action{cursor:pointer}.activity-state-action:hover{background:#fffafb}.activity-state-action.state-selected{box-shadow:inset 0 0 0 2px #cc1830}.activity-state-action:focus-visible{outline:2px solid #cc1830;outline-offset:-3px}.activity-state-preview{display:grid;gap:3px;padding:10px 0;border-top:1px solid #e9edf3;margin-top:8px;font-size:12px;overflow-wrap:anywhere}.activity-state-preview strong{color:#17243b}.activity-state-preview span,.activity-state-preview small{color:#64748b}.activity-daily-summary{margin-top:18px!important;padding:14px}.activity-daily-summary h3{font-size:14px;margin:0 0 10px}.activity-compact-search.calendar-search .activity-search-grid{grid-template-columns:minmax(150px,1.4fr) 160px auto auto auto auto;justify-content:stretch}.activity-compact-search.calendar-search input[type=month]{width:100%}.activity-grid-table>.activity-panel-content{overflow:auto}.activity-grid-table .btn{margin-bottom:8px}@media(max-width:1100px){.activity-compact-search.calendar-search .activity-search-grid{min-width:850px}}
