/* ==========================================================================
   CRM Inmobiliario Web — LUXUS Inmobiliaria
   Identidad visual propia inspirada en amarillo/negro corporativo.
   ========================================================================== */

:root {
  --color-primary: #f6b300;
  --color-primary-dark: #d99b00;
  --color-primary-light: #fff6dc;
  --color-black: #16181d;
  --color-black-soft: #21242c;
  --color-bg: #f6f7fb;
  --color-surface: #ffffff;
  --color-sidebar: #16181d;
  --color-sidebar-hover: #24272f;
  --color-sidebar-active: #f6b300;
  --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: #f6b300, #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:#f5b400; box-shadow:0 0 0 2px rgba(245,180,0,.16); }
.project-summary-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:12px; background:#fff4d2; 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:#fff8df; color:#735500; 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 LUXUS) ---------- */
.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, #ffcb2e 0%, #f6b300 45%, #e8a600 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, #fffdf5 0%, #fef6e0 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: #fff8e6; border: 1px solid #fce9b8; border-radius: var(--radius-sm);
  font-size: 12px; color: #6b5a1e;
}
.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, #ffcb2e, #f6b300);
}
.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: #8a6a00;
}

.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: #d99b00;
}

.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: #d99b00;
  background: #fff4cf;
}

.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: #e5a900;
  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: #e5a900;
}

.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: #fff4cf;
}

.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: #f5b400;
  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:#f5b400; 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:#fffaf0; }

/* 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: #f5b400;
}

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

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

.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:#f5b400; 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:#d99000; 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:#c98200; 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 #eab308}.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 #eab308}.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:#eab308;background:#fffbea;outline:2px solid #facc15;outline-offset:-2px}.opportunity-result span,.opportunity-result small{color:#64748b;font-size:12px}.opportunity-selected{padding:12px;margin:12px 0;border:1px solid #eab308;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 #eab308}

.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 #facc15;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:#eab308;box-shadow:0 0 0 2px #facc1533;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%; }
}
