/* Tokens tomados de resources/css/app.css de la app C-nect Land */
:root {
  --font-display: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;
  --brand-50: #f2f6fa; --brand-100: #d9e6f2; --brand-200: #b3cce4; --brand-300: #85accd;
  --brand-400: #5c8cb3; --brand-500: #336699; --brand-600: #2a547e; --brand-700: #214264;
  --marino-800: #000066;
  --success: #2e7d5b; --success-soft: #e2f0ea;
  --warning: #c8871e; --warning-soft: #f8efdc;
  --danger: #ab192d; --danger-soft: #f7e3e6;
  --info: #2e7bb5; --info-soft: #e0edf7;
  --surface-base: #f5f7fb; --surface-card: #fff; --surface-border: #e4e8f0; --surface-muted: #f0f2f8;
  --text-primary: #0f1b2d; --text-secondary: #4d5e75; --text-tertiary: #8896aa;
  --radius-card: 1rem; --radius-input: .625rem;
  --shadow-card: 0 1px 2px rgb(15 27 45 / .03), 0 6px 20px -4px rgb(15 27 45 / .08);
  --shadow-card-hover: 0 2px 6px -2px rgb(15 27 45 / .06), 0 12px 28px -6px rgb(15 27 45 / .14);
}
*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font-body); color: var(--text-primary); background: var(--surface-base); -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }
button, input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #d1d9e6; border-radius: 9999px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1rem 4rem; }

/* Topbar píldora con degradado de marca */
.topbar { height: 56px; margin: .75rem 0 1.25rem; padding: 0 1.1rem; border-radius: 9999px;
  background: linear-gradient(90deg, #000066 0%, #336699 100%); display: flex; align-items: center; gap: .75rem;
  box-shadow: 0 10px 26px -10px rgb(0 0 68 / .45); color: #fff; }
.logo-ring { width: 32px; height: 32px; border-radius: 9999px; border: 1.5px solid rgba(255,255,255,.3); display: grid; place-items: center; flex-shrink: 0; }
.logo-ring svg { width: 17px; height: 17px; }
.marca { font-family: 'Inter', sans-serif; font-size: 1rem; line-height: 1.2; white-space: nowrap; }
.marca b { font-weight: 700; letter-spacing: -.065em; }
.marca span { color: rgba(255,255,255,.6); font-weight: 400; }
.marca-sub { display: block; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.6); margin-top: 1px; }
.topbar .espacio { flex: 1; }
.topbar .dato { font-size: .75rem; color: #d9e6f2; text-align: right; line-height: 1.3; }
.topbar .dato b { color: #fff; font-weight: 600; }

.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cabecera h1 { font-size: 1.5rem; }
.cabecera p { margin: .2rem 0 0; color: var(--text-secondary); font-size: .875rem; }
.acciones { display: flex; gap: .5rem; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: .375rem; padding: .5rem 1rem; border-radius: 9999px; font-size: .8125rem; font-weight: 500;
  cursor: pointer; border: none; text-decoration: none; white-space: nowrap; transition: all .18s cubic-bezier(.4,0,.2,1); }
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); box-shadow: 0 6px 16px -6px rgb(51 102 153 / .55); }
.btn-secondary { background: var(--surface-muted); color: var(--text-secondary); border: 1px solid var(--surface-border); }
.btn-secondary:hover { background: #e4e8f0; color: var(--text-primary); }
.btn-ok { background: var(--success-soft); color: var(--success); border: 1px solid #c8e2d6; }
.btn-ok:hover { background: #d3e8df; }
.btn-chico { padding: .3rem .7rem; font-size: .75rem; }
.btn svg { width: .95rem; height: .95rem; }

/* Tarjetas de conteo: también filtran por estado */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat { background: var(--surface-card); border: 1px solid #eef1f6; border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: .9rem 1rem; display: flex; gap: .75rem; cursor: pointer; text-align: left; transition: box-shadow .2s, transform .2s, border-color .2s; }
.stat:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.stat.activo { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgb(51 102 153 / .14), var(--shadow-card); }
.stat .linea { width: 3px; border-radius: 9999px; align-self: stretch; flex-shrink: 0; }
.stat .etq { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); }
.stat .num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; line-height: 1.15; }

/* Barra de filtros */
.filtros { background: var(--surface-card); border: 1px solid #eef1f6; border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: .9rem 1rem; margin-bottom: 1rem; display: grid; gap: .7rem; }
.fila { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.fila > .etq { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-tertiary); width: 4.2rem; flex-shrink: 0; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .85rem; border-radius: 9999px; border: 1px solid var(--surface-border);
  background: #fff; color: var(--text-secondary); font-size: .8125rem; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all .15s; }
.chip:hover { border-color: var(--brand-300); color: var(--brand-500); transform: translateY(-1px); box-shadow: 0 3px 8px -2px rgb(15 27 45 / .12); }
.chip.activo { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.chip small { font-size: .6875rem; opacity: .75; }
.input { padding: .5rem .9rem; background: var(--surface-muted); border: 1px solid transparent; border-radius: 9999px; font-size: .875rem;
  color: var(--text-primary); outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.input:focus { background: #fff; border-color: var(--brand-400); box-shadow: 0 0 0 3px rgb(51 102 153 / .14); }
.buscar { flex: 1; min-width: 14rem; }
.select { padding: .45rem 2.2rem .45rem .8rem; background: #fff; border: 1px solid var(--surface-border); border-radius: var(--radius-input); font-size: .8125rem;
  color: var(--text-primary); outline: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238896aa'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: .95rem; }
.select:focus { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgb(51 102 153 / .14); }
.interruptor { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; color: var(--text-secondary); cursor: pointer; user-select: none; }
.interruptor input { accent-color: var(--brand-500); width: 1rem; height: 1rem; }

.aviso { border-radius: var(--radius-card); padding: .75rem 1rem; font-size: .8125rem; margin-bottom: 1rem; border: 1px solid; }
.aviso-warn { background: #fdf8ee; border-color: #ecd9b3; color: #7a5312; }
.aviso-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.aviso code { font-family: var(--font-mono); font-size: .78rem; background: rgba(255,255,255,.7); padding: .05rem .35rem; border-radius: .3rem; }

/* Tarjeta de lead */
.lead { background: var(--surface-card); border: 1px solid #eef1f6; border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  margin-bottom: .75rem; display: grid; grid-template-columns: minmax(0, 1fr) 20rem; overflow: hidden; }
.lead.e-nuevo { border-left: 4px solid var(--info); }
.lead.e-contactado { border-left: 4px solid var(--success); }
.lead.e-sin_respuesta { border-left: 4px solid var(--warning); }
.lead.e-seguimiento { border-left: 4px solid #14a396; }
.lead.e-descartado { border-left: 4px solid #94a3b8; opacity: .78; }
.lead .info { padding: 1rem 1.1rem; min-width: 0; }
.lead .seg { padding: 1rem 1.1rem; background: #fafbfd; border-left: 1px solid var(--surface-border); display: flex; flex-direction: column; gap: .5rem; }
.lead .encab { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.lead h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.lead .fecha { font-size: .75rem; color: var(--text-tertiary); white-space: nowrap; text-align: right; line-height: 1.35; }
.lead .fecha b { display: block; color: var(--text-secondary); font-weight: 500; font-family: var(--font-mono); font-size: .72rem; }
.insignias { display: flex; gap: .35rem; flex-wrap: wrap; margin: .4rem 0 .6rem; }
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .18rem .6rem; border-radius: 9999px; font-size: .6875rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.b-vendedor { background: linear-gradient(135deg, #2a567f, #4a80ad); color: #fff; }
.b-broker { background: linear-gradient(135deg, #29296e, #4d4da6); color: #fff; }
.b-desarrollador { background: linear-gradient(135deg, #0d5c56, #14a396); color: #fff; }
.b-zona { background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-100); }
.b-alerta { background: var(--warning-soft); color: #7a5312; }
.b-gris { background: var(--surface-muted); color: var(--text-secondary); }
.b-ok { background: var(--success-soft); color: var(--success); }
.b-origen { background: #ededf7; color: #333385; font-family: var(--font-mono); font-weight: 500; }
.contacto { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .65rem; }
.contacto .tel { font-family: var(--font-mono); font-size: .9rem; font-weight: 500; color: var(--text-primary); }
.contacto a.correo { font-size: .8125rem; color: var(--brand-500); text-decoration: none; overflow-wrap: anywhere; }
.contacto a.correo:hover { text-decoration: underline; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .5rem; }
.spec { padding: .55rem .7rem; border-radius: .75rem; background: var(--surface-muted); min-width: 0; }
.spec .l { font-size: .6875rem; color: var(--text-tertiary); font-weight: 500; }
.spec .v { font-size: .875rem; font-weight: 600; overflow-wrap: anywhere; }
.spec .v small { display: block; font-weight: 500; font-size: .72rem; color: var(--text-secondary); }
.spec.chico-terreno { background: #fdf8ee; }
.mensaje { margin-top: .6rem; padding: .6rem .8rem; border-left: 3px solid var(--brand-200); background: var(--brand-50); border-radius: 0 .6rem .6rem 0;
  font-size: .84rem; color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; }
.analisis { margin-top: .6rem; padding: .65rem .8rem; background: #ededf7; border: 1px solid #d5d5ea; border-radius: .75rem; }
.analisis .cab { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-bottom: .3rem; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #333385; }
.analisis .cab .badge { text-transform: none; letter-spacing: 0; }
.analisis .cab .cuando { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-tertiary); margin-left: auto; }
.analisis .txt { font-size: .84rem; color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.b-verde { background: var(--success-soft); color: var(--success); }
.b-amarillo { background: var(--warning-soft); color: #7a5312; }
.b-rojo { background: var(--danger-soft); color: var(--danger); }
.seg label { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-tertiary); }
.seg .select { width: 100%; }
.seg textarea { width: 100%; min-height: 5.2rem; resize: vertical; padding: .55rem .7rem; background: #fff; border: 1px solid var(--surface-border);
  border-radius: var(--radius-input); font-size: .84rem; color: var(--text-primary); outline: none; line-height: 1.45; transition: border-color .15s, box-shadow .15s; }
.seg textarea:focus { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgb(51 102 153 / .14); }
.seg .pie { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .72rem; color: var(--text-tertiary); min-height: 1.6rem; }
.seg .guardado { color: var(--success); opacity: 0; transition: opacity .25s; }
.seg .guardado.ver { opacity: 1; }

.vacio { text-align: center; padding: 3rem 1rem; color: var(--text-secondary); background: var(--surface-card); border: 1px dashed var(--surface-border); border-radius: var(--radius-card); }
.vacio h2 { font-size: 1.1rem; margin-bottom: .4rem; color: var(--text-primary); }
.resumen-lista { font-size: .8125rem; color: var(--text-tertiary); margin: 0 0 .6rem .2rem; }
.pie-pagina { margin-top: 1.5rem; font-size: .75rem; color: var(--text-tertiary); line-height: 1.6; }
input[type=file] { display: none; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead { grid-template-columns: minmax(0, 1fr); }
  .lead .seg { border-left: none; border-top: 1px solid var(--surface-border); }
  .fila > .etq { width: 100%; }
  .topbar .dato { display: none; }
}
@media print { .filtros, .acciones, .topbar { display: none; } .lead { break-inside: avoid; box-shadow: none; } }

/* ── Solo en la versión en línea ─────────────────────────────────── */
.topbar .btn-top { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); color: #fff; padding: .35rem .8rem; font-size: .75rem; }
.topbar .btn-top:hover { background: rgba(255,255,255,.24); }
.topbar .quien { font-size: .75rem; color: #fff; font-weight: 600; white-space: nowrap; }
.error-flotante { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--danger); color: #fff; padding: .6rem 1rem;
  border-radius: 9999px; font-size: .8125rem; box-shadow: 0 10px 26px -10px rgb(171 25 45 / .6); z-index: 50; max-width: calc(100vw - 2rem); }
.seg .por { color: var(--text-tertiary); }
[hidden] { display: none !important; }

/* Pantalla de acceso */
.acceso { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(135deg, #000066 0%, #336699 100%); }
.acceso .caja { width: 100%; max-width: 24rem; background: #fff; border-radius: 1.25rem; padding: 1.75rem; box-shadow: 0 24px 60px -20px rgb(0 0 40 / .6); }
.acceso .marca-osc { font-family: 'Inter', sans-serif; font-size: 1.25rem; color: var(--marino-800); }
.acceso .marca-osc b { font-weight: 700; letter-spacing: -.065em; }
.acceso .marca-osc span { color: var(--text-tertiary); }
.acceso h1 { font-size: 1.15rem; margin: 1rem 0 .25rem; }
.acceso p { margin: 0 0 1rem; font-size: .84rem; color: var(--text-secondary); }
.acceso label { display: block; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-tertiary); margin: .75rem 0 .3rem; }
.acceso input { width: 100%; padding: .6rem .75rem; border: 1px solid var(--surface-border); border-radius: var(--radius-input); font-size: .9rem; color: var(--text-primary); outline: none; }
.acceso input:focus { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgb(51 102 153 / .14); }
.acceso .btn { width: 100%; justify-content: center; margin-top: 1.1rem; padding: .65rem 1rem; font-size: .875rem; }
.acceso .msg { margin-top: .8rem; font-size: .8125rem; color: var(--danger); min-height: 1.2rem; }
.acceso .msg.ok { color: var(--success); }
.acceso .alterno { display: block; text-align: center; margin-top: .9rem; font-size: .78rem; color: var(--brand-500); text-decoration: none; }

/* ── Módulo de usuarios ──────────────────────────────────────────── */
.panel { background: var(--surface-card); border: 1px solid #eef1f6; border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.panel h2 { font-size: 1.05rem; margin-bottom: .8rem; }
.panel h2 .cuenta { font-family: var(--font-body); font-size: .8125rem; font-weight: 400; color: var(--text-tertiary); }
.forma-usuario { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; }
.forma-usuario label { display: block; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-tertiary); margin-bottom: .3rem; }
.forma-usuario .ancho { grid-column: 1 / -1; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.forma-usuario .select { width: 100%; }
.campo { width: 100%; padding: .5rem .75rem; background: #fff; border: 1px solid var(--surface-border); border-radius: var(--radius-input); font-size: .875rem; color: var(--text-primary); outline: none; transition: border-color .15s, box-shadow .15s; }
.campo:focus { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgb(51 102 153 / .14); }
.con-boton { display: flex; gap: .4rem; align-items: center; }
.mono { font-family: var(--font-mono); font-size: .84rem; }
.nota { font-size: .75rem; color: var(--text-tertiary); }
.aviso .nota { margin-top: .35rem; color: inherit; opacity: .8; }
.clave-temporal { font-size: .95rem !important; user-select: all; }
.tabla-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th { padding: .6rem .75rem; text-align: left; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); border-bottom: 1px solid var(--surface-border); white-space: nowrap; }
.data-table tbody td { padding: .7rem .75rem; font-size: .84rem; color: var(--text-secondary); border-bottom: 1px solid var(--surface-border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface-muted); }
.data-table tr.inactivo td { opacity: .6; }
.data-table td .badge { margin-left: .35rem; }
.data-table td .badge:first-child { margin-left: 0; }
.data-table .select { min-width: 9.5rem; }
.acciones-fila { white-space: nowrap; text-align: right; }
.acciones-fila .btn { margin-left: .3rem; }
.btn-peligro { background: var(--danger-soft); color: var(--danger); border: 1px solid #f0ccd2; }
.btn-peligro:hover { background: #f2d3d8; }
@media (max-width: 700px) { .forma-usuario { grid-template-columns: minmax(0, 1fr); } }

/* Barra superior en pantallas chicas: sin nombre ni subtítulo para que quepan los botones */
.marca { min-width: 0; }
@media (max-width: 700px) {
  .topbar { padding: 0 .7rem; gap: .4rem; }
  .topbar .quien, .marca-sub { display: none; }
  .acciones-fila { white-space: normal; }
  .acciones-fila .btn { margin: .15rem 0 .15rem .3rem; }
}

/* Tiempos de respuesta */
.resumen-espera { display: flex; gap: .5rem 1.5rem; flex-wrap: wrap; margin: -.25rem 0 1rem .2rem; font-size: .8125rem; color: var(--text-secondary); }
.resumen-espera b { color: var(--text-primary); font-weight: 600; }
.resumen-espera .t-verde { color: var(--success); } .resumen-espera .t-amarillo { color: #96651a; } .resumen-espera .t-rojo { color: var(--danger); }
