:root {
  --brand-bg:        #150A28;
  --brand-panel:     #201038;
  --brand-panel2:    #2B1548;
  --brand-primary:   #C42D86;
  --brand-primary-h: #DB3F97;
  --brand-accent:    #F5A623;
  --brand-purple:    #6A2C8F;
  --brand-success:   #1FAE7E;
  --brand-warning:   #F0A020;
  --brand-danger:    #E5484D;
  --brand-border:    #3A2158;
  --text-primary:    #F3EFE0;
  --text-secondary:  #9C90B5;
  --brand-gradient:  linear-gradient(180deg, #6A2C8F 0%, #B02E8C 35%, #E63A73 65%, #F5A623 100%);
}

* { scrollbar-color: var(--brand-border) var(--brand-bg); }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

html, body { background: var(--brand-bg); overflow-x: hidden; max-width: 100%; }

/* ---------- Tabs ---------- */
.tab-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem;
  font-size: .875rem; font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--brand-accent); border-image: var(--brand-gradient) 1; border-bottom-width: 2px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px);} to { opacity:1; transform:none; } }

/* ---------- Cards ---------- */
.card {
  background: var(--brand-panel);
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  padding: 1.25rem;
}
.card2 { background: var(--brand-panel2); border: 1px solid var(--brand-border); border-radius: 12px; }

.kpi-card {
  background: var(--brand-panel);
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
}
.kpi-value { font-size: 1.65rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem; border-radius: 10px;
  font-size: .875rem; font-weight: 600;
  transition: background .15s, opacity .15s;
  cursor: pointer;
}
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-primary-h); }
.btn-outline { background: transparent; border: 1px solid var(--brand-border); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn-sm { padding: .35rem .7rem; font-size: .78rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Tables ---------- */
.table-clean { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table-clean th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-secondary); font-weight: 700;
  padding: .6rem .75rem; border-bottom: 1px solid var(--brand-border);
  white-space: nowrap;
}
.table-clean td { padding: .65rem .75rem; border-bottom: 1px solid var(--brand-border); color: var(--text-primary); }
.table-clean tbody tr:hover { background: var(--brand-panel2); }
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--brand-border); }

/* ---------- Badges / estado ---------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-verde  { background: rgba(31,174,126,.18); color: #4ADE9C; }
.badge-amar   { background: rgba(240,160,32,.18); color: #F0B84D; }
.badge-rojo   { background: rgba(229,72,77,.18); color: #F07A7A; }
.badge-neutro { background: var(--brand-panel2); color: var(--text-secondary); }

.dot { width: .5rem; height: .5rem; border-radius: 999px; display: inline-block; }
.dot-verde { background: #4ADE9C; }
.dot-amar  { background: #F0B84D; }
.dot-rojo  { background: #F07A7A; }

/* ---------- Inputs ---------- */
.input, select.input, textarea.input {
  width: 100%; background: var(--brand-panel2); border: 1px solid var(--brand-border);
  border-radius: 10px; padding: .55rem .75rem; font-size: .875rem; color: var(--text-primary);
}
.input:focus, select.input:focus, textarea.input:focus { outline: none; border-color: var(--brand-primary); }
.label { font-size: .78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: .3rem; display: block; }

/* ---------- Matriz Eisenhower ---------- */
.eis-cell { border-radius: 12px; border: 1px solid var(--brand-border); padding: .85rem; min-height: 140px; }
.eis-urgente   { background: rgba(229,72,77,.10); }
.eis-importante{ background: rgba(196,45,134,.10); }
.eis-delegar   { background: rgba(240,160,32,.10); }
.eis-eliminar  { background: rgba(156,144,181,.10); }

/* ---------- Calendario ---------- */
.cal-day {
  border: 1px solid var(--brand-border); border-radius: 10px;
  padding: .6rem; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.cal-day:hover { border-color: var(--brand-primary); }
.cal-day.active { background: rgba(196,45,134,.15); border-color: var(--brand-primary); }
.cal-day .num { font-weight: 700; font-size: 1.1rem; }
.cal-day .dow { font-size: .68rem; color: var(--text-secondary); text-transform: uppercase; }

/* ---------- Kanban ---------- */
.kanban-col { background: var(--brand-panel); border: 1px solid var(--brand-border); border-radius: 12px; min-width: 260px; flex: 1; }
.kanban-col-header { padding: .75rem 1rem; border-bottom: 1px solid var(--brand-border); font-weight: 700; font-size: .82rem; }
.kanban-body { padding: .6rem; display: flex; flex-direction: column; gap: .5rem; min-height: 100px; }
.lead-card { background: var(--brand-panel2); border: 1px solid var(--brand-border); border-radius: 10px; padding: .65rem .75rem; cursor: grab; }
.lead-card:active { cursor: grabbing; }
.lead-card.dragging { opacity: .4; }
.kanban-body.drop-hover { background: rgba(196,45,134,.08); border-radius: 8px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 1rem; }
.modal-box { background: var(--brand-panel); border: 1px solid var(--brand-border); border-radius: 16px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--brand-border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--brand-border); display: flex; justify-content: flex-end; gap: .6rem; }

/* ---------- Toast ---------- */
.toast { background: var(--brand-panel); border: 1px solid var(--brand-border); border-left: 3px solid var(--brand-primary); border-radius: 10px; padding: .75rem 1rem; font-size: .85rem; min-width: 240px; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: slideIn .2s ease; }
.toast.success { border-left-color: var(--brand-success); }
.toast.error { border-left-color: var(--brand-danger); }
@keyframes slideIn { from { opacity:0; transform: translateX(20px);} to { opacity:1; transform:none; } }

/* ---------- Upload dropzone ---------- */
.dropzone {
  border: 2px dashed var(--brand-border); border-radius: 14px; padding: 2rem;
  text-align: center; transition: border-color .15s, background .15s; cursor: pointer;
}
.dropzone.hover, .dropzone:hover { border-color: var(--brand-primary); background: rgba(196,45,134,.05); }

/* Utility text colors matching palette (Tailwind arbitrary already covers most, this backs safe-list) */
.text-success { color: #4ADE9C; }
.text-warning { color: #F0B84D; }
.text-danger  { color: #F07A7A; }

/* ---------- Análisis IA ---------- */
.analisis-sede { border-radius: 14px; border: 1px solid var(--brand-border); border-left: 4px solid var(--brand-border); background: var(--brand-panel); padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.analisis-sede.verde    { border-left-color: var(--brand-success); background: rgba(31,174,126,.08); }
.analisis-sede.amarillo { border-left-color: var(--brand-warning); background: rgba(240,160,32,.08); }
.analisis-sede.rojo     { border-left-color: var(--brand-danger); background: rgba(229,72,77,.08); }
.analisis-modelo-badge { background: rgba(196,45,134,.18); color: #E88BC4; }

.analisis-acc-item { border: 1px solid var(--brand-border); border-radius: 10px; overflow: hidden; }
.analisis-acc-header { padding: .75rem 1rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 700; background: var(--brand-panel2); }
.analisis-acc-header:hover { color: var(--brand-accent); }
.analisis-acc-body { padding: 0 1rem; max-height: 0; overflow: hidden; transition: max-height .2s ease, padding .2s ease; }
.analisis-acc-item.open .analisis-acc-body { padding: .75rem 1rem; max-height: 600px; }
