/* ProspectAI — Estilos globales */
:root {
  --bg:     #F4F6FA;
  --bg2:    #FFFFFF;
  --card:   #FFFFFF;
  --border: #E2E8F0;
  --b2:     #CBD5E1;
  --cyan:   #0099CC;
  --green:  #059669;
  --amber:  #D97706;
  --red:    #DC2626;
  --purple: #7C3AED;
  --text:   #1E293B;
  --soft:   #475569;
  --muted:  #94A3B8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: 'DM Sans', system-ui, sans-serif; background: var(--bg); color: var(--text);
       min-height: 100vh; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--border); }
::-webkit-scrollbar-thumb { background: var(--b2); border-radius: 3px; }

/* Inputs */
.inp {
  width: 100%; background: var(--bg2); border: 1px solid var(--b2);
  border-radius: 8px; padding: 10px 13px; color: var(--text);
  font-size: 13px; font-family: inherit; outline: none;
  transition: border-color .15s;
}
.inp:focus { border-color: var(--cyan); }
.inp::placeholder { color: var(--muted); }

select.inp { cursor: pointer; }
select.inp option { background: #FFFFFF; color: var(--text); }
textarea.inp { resize: vertical; line-height: 1.6; }

.label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.1px; margin-bottom: 6px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 8px; padding: 10px 20px;
  font-size: 13px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary  { background: var(--cyan);   color: #fff; }
.btn-green    { background: var(--green);  color: #fff; }
.btn-amber    { background: var(--amber);  color: #fff; }
.btn-red      { background: var(--red);    color: #fff; }
.btn-purple   { background: var(--purple); color: #fff; }
.btn-ghost    { background: transparent; border: 1px solid var(--b2); color: var(--soft); }
.btn-sm       { padding: 6px 14px; font-size: 12px; }
.w-full       { width: 100%; }

/* Alerts / Errors */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
  font-size: 13px; line-height: 1.5;
}
.alert-icon { font-size: 16px; flex-shrink: 0; line-height: 1.6; }
.alert-body { flex: 1; }
.alert-title { font-weight: 700; display: block; margin-bottom: 2px; }
.alert-error   { background: #FEF2F2; border: 1px solid #FECACA; color: #DC2626; }
.alert-success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #15803D; }
.alert-warn    { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.alert-info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1D4ED8; }

/* Cards */
.card-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Tags/Badges */
.badge {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 2px 10px;
  font-size: 11px; font-weight: 700;
}

/* Layout: sidebar + main */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
}
.main-content {
  margin-left: 220px; flex: 1; min-height: 100vh;
  padding: 28px 32px 60px;
  max-width: calc(1280px + 220px);
}

/* Nav links */
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px; margin-bottom: 2px;
  color: var(--soft); font-size: 13px; font-weight: 500;
  text-decoration: none; transition: all .15s;
  border-left: 3px solid transparent;
}
.nav-link:hover    { background: var(--bg); color: var(--text); }
.nav-link.active   { font-weight: 700; border-left-color: var(--cyan); }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }

/* Table */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg); border-bottom: 1px solid var(--border); }
th { padding: 10px 14px; text-align: left; font-size: 11px; color: var(--muted);
     font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; cursor: pointer; }
tbody tr:hover { background: var(--bg); }
td { padding: 11px 14px; font-size: 13px; }

/* Progress bar */
.progress-wrap { background: var(--b2); border-radius: 999px; height: 5px; }
.progress-bar  { border-radius: 999px; height: 100%; transition: width .4s ease; }

/* Stream output */
.stream-box {
  background: var(--bg2); border-radius: 10px; padding: 18px;
  font-size: 13px; line-height: 1.85; white-space: pre-wrap;
  max-height: 480px; overflow-y: auto; margin-top: 14px;
}

/* Modal overlay */
.modal-overlay,
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; width: 100%; max-width: 620px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  font-size: 16px; font-weight: 800;
}
.modal-body { padding: 24px; }
.modal-close { background: none; border: none; color: var(--soft); font-size: 22px; cursor: pointer; }

/* Animations */
@keyframes fadeUp  { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
@keyframes spin    { to{transform:rotate(360deg)} }
@keyframes pulse   { 0%,100%{opacity:1} 50%{opacity:.3} }
@keyframes blink   { 0%,100%{opacity:1} 50%{opacity:0} }

.fade-up { animation: fadeUp .3s ease both; }
.spin    { animation: spin 1s linear infinite; display: inline-block; }
.pulse   { animation: pulse 2s infinite; }
.blink   { animation: blink 1s step-end infinite; }

/* Stage colors */
.stage-Prospecto    { background: #3A4D6118; color: #3A4D61; border-color: #3A4D6133; }
.stage-Calificado   { background: #60A5FA18; color: #60A5FA; border-color: #60A5FA33; }
.stage-Demo         { background: #9B6DFF18; color: #9B6DFF; border-color: #9B6DFF33; }
.stage-Propuesta    { background: #FFB02018; color: #FFB020; border-color: #FFB02033; }
.stage-Negociacion  { background: #00E09018; color: #00E090; border-color: #00E09033; }
.stage-Cerrado      { background: #10B98118; color: #10B981; border-color: #10B98133; }
.stage-Perdido      { background: #FF456018; color: #FF4560; border-color: #FF456033; }

/* Score ring */
.score-ring {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; border-width: 2px; border-style: solid;
  flex-shrink: 0;
}
.score-hot  { color: #00E090; border-color: #00E090; }
.score-warm { color: #FFB020; border-color: #FFB020; }
.score-cold { color: #FF4560; border-color: #FF4560; }
