:root {
  --bg: #121212;
  --surface-1: #1e1e1e;
  --surface-2: #282828;
  --surface-3: #333333;
  --border: rgba(255, 255, 255, 0.12);
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #707070;
  
  --c-valor: #EF9F27;
  --c-valor-txt: #412402;
  --c-nutrir: #9FE1CB;
  --c-nutrir-txt: #04342C;
  --c-educar: #B5D4F4;
  --c-educar-txt: #042C53;
  --c-referir: #F4C0D1;
  --c-referir-txt: #2C2C2A;
}

body {
  margin: 0;
  padding: 20px;
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}

.hidden { display: none !important; }

/* Login */
.login-overlay {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 99;
}
.login-card {
  background: var(--surface-1); padding: 30px; border-radius: 12px;
  border: 0.5px solid var(--border); width: 320px; text-align: center;
}
.login-card input {
  width: 100%; padding: 10px; margin: 15px 0; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface-2); color: #fff; box-sizing: border-box;
}
.login-card button {
  width: 100%; padding: 10px; border-radius: 6px; border: none;
  background: #185FA5; color: white; font-weight: bold; cursor: pointer;
}
.error-msg { color: #E24B4A; font-size: 12px; margin-top: 10px; }

/* Métricas & Leyendas */
.metrics-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 20px;
}
.metric-card {
  background: var(--surface-1); border-radius: 8px; padding: 10px 15px; border: 0.5px solid var(--border);
}
.metric-card .label { font-size: 12px; color: var(--text-secondary); display: block; }
.metric-card .value { font-size: 20px; font-weight: 600; }
.alert-card .value { color: #E24B4A; }

.legend-row { display: flex; gap: 10px; margin-bottom: 20px; }
.badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 10px; display: inline-block;
}
.badge-valor { background: var(--c-valor); color: var(--c-valor-txt); }
.badge-nutrir { background: var(--c-nutrir); color: var(--c-nutrir-txt); }
.badge-educar { background: var(--c-educar); color: var(--c-educar-txt); }
.badge-referir { background: var(--c-referir); color: var(--c-referir-txt); }
.badge-cita { background: #9FE1CB; color: #04342C; }
.badge-cerrado { background: #C0DD97; color: #173404; }

/* Kanban */
.kanban-board {
  display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 14px; overflow-x: auto;
}
.column-header {
  font-size: 13px; font-weight: 600; padding-bottom: 8px; margin-bottom: 12px;
  border-bottom: 2px solid var(--border); display: flex; justify-content: space-between;
}
.cards-container { min-height: 400px; }

/* Cards (~118px) */
.kanban-card {
  background: var(--surface-2); border: 0.5px solid var(--border); border-radius: 8px;
  padding: 10px; margin-bottom: 10px; height: 118px; box-sizing: border-box;
  cursor: pointer; position: relative; user-select: none;
}
.kanban-card.border-VALOR, .kanban-card.border-A_PREMIUM, .kanban-card.border-A_ESTANDAR { border-left: 4px solid #BA7517; }
.kanban-card.border-NUTRIR, .kanban-card.border-B { border-left: 4px solid #0F6E56; }
.kanban-card.border-EDUCAR, .kanban-card.border-C { border-left: 4px solid #185FA5; }
.kanban-card.border-REFERIR, .kanban-card.border-LATAM { border-left: 4px solid #D45B7E; }
.kanban-card.border-gris { border-left: 4px solid #888780; }

.card-amount { font-size: 15px; font-weight: 600; margin: 4px 0 2px; }
.card-title { font-size: 14px; font-weight: 500; }
.card-company { font-size: 12px; color: var(--text-secondary); }
.card-owner { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Alertas */
.alerts-section { margin-top: 25px; display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  background: var(--surface-2); border: 0.5px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; display: flex; align-items: center; gap: 10px;
}
.bell-icon {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; color: white; flex-shrink: 0;
}

/* Panel Lateral Detalle */
.drawer { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; }
.drawer-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.drawer-content {
  position: relative; width: 440px; max-width: 100%; background: var(--surface-1);
  height: 100%; overflow-y: auto; border-left: 0.5px solid var(--border); box-sizing: border-box;
}