/* =========================================================================
   Riaz Assistant – Estilos globales
   Estética: profesional, clara, azul oscuro corporativo, poca animación.
   ========================================================================= */

:root {
  --azul-900: #0b2545;
  --azul-800: #11315f;
  --azul-700: #15417a;
  --azul-600: #1c5494;
  --azul-500: #2667ac;
  --azul-100: #e8eef7;
  --azul-50: #f3f6fb;
  --gris-900: #1f2733;
  --gris-700: #44505f;
  --gris-500: #7c8794;
  --gris-300: #d6dce3;
  --gris-200: #e7ebef;
  --gris-100: #f2f4f7;
  --blanco: #ffffff;
  --verde: #1d8a52;
  --verde-bg: #e7f6ee;
  --rojo: #c23b3b;
  --rojo-bg: #fcebeb;
  --naranja: #b8742a;
  --naranja-bg: #fbf0e3;
  --amarillo: #9c8018;
  --amarillo-bg: #fbf6df;
  --radio: 10px;
  --radio-sm: 6px;
  --sombra: 0 1px 3px rgba(11, 37, 69, 0.08), 0 1px 2px rgba(11, 37, 69, 0.06);
  --sombra-md: 0 4px 16px rgba(11, 37, 69, 0.10);
  --topbar-h: 64px;
  --sidebar-w: 236px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--gris-100);
  color: var(--gris-900);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; }

/* ---------------------------- Layout general ---------------------------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--azul-900);
  color: #dbe6f5;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand .brand-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(145deg, #2667ac, #0b2545);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 15px;
  flex-shrink: 0;
}

.sidebar-brand .brand-text strong {
  display: block;
  font-size: 15px;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.sidebar-brand .brand-text span {
  display: block;
  font-size: 11px;
  color: #93a8c6;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: var(--radio-sm);
  font-size: 13.5px;
  color: #c3d2e8;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav .nav-item i { width: 18px; text-align: center; font-size: 14px; color: #8fa6c7; }
.sidebar-nav .nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav .nav-item.active { background: var(--azul-600); color: #fff; }
.sidebar-nav .nav-item.active i { color: #fff; }

.sidebar-footer {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--azul-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.sidebar-user .who strong { display: block; font-size: 12.5px; color: #fff; }
.sidebar-user .who span { display: block; font-size: 11px; color: #93a8c6; }
.sidebar-logout {
  margin-top: 10px;
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #dbe6f5;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--radio-sm);
}
.sidebar-logout:hover { background: rgba(255,255,255,0.15); }

.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--blanco);
  border-bottom: 1px solid var(--gris-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--azul-900);
  margin: 0;
}
.topbar .topbar-sub { font-size: 12px; color: var(--gris-500); margin-top: 1px;}
.topbar-right { display: flex; align-items: center; gap: 14px; }

.btn-ask-assistant {
  display: flex; align-items: center; gap: 8px;
  background: var(--azul-900);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--sombra);
}
.btn-ask-assistant:hover { background: var(--azul-700); }
.btn-ask-assistant i { font-size: 13px; }

.content {
  padding: 26px 28px 60px;
  flex: 1;
}

/* ---------------------------- Componentes comunes ---------------------------- */

.card {
  background: var(--blanco);
  border: 1px solid var(--gris-200);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--azul-900);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-sub {
  font-size: 12.5px;
  color: var(--gris-500);
  margin: 0 0 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
.stat-card {
  background: var(--blanco);
  border: 1px solid var(--gris-200);
  border-radius: var(--radio);
  padding: 18px 20px;
  box-shadow: var(--sombra);
}
.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gris-500);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex; align-items: center; justify-content: space-between;
}
.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--azul-900);
  margin-top: 6px;
}
.stat-card.alert .stat-value { color: var(--rojo); }
.stat-card .stat-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--azul-50); color: var(--azul-600); font-size: 13px;
}
.stat-card.alert .stat-icon { background: var(--rojo-bg); color: var(--rojo); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

.badge-pendiente { background: var(--azul-100); color: var(--azul-700); }
.badge-pendiente .badge-dot { background: var(--azul-600); }
.badge-encurso { background: #eef3fb; color: #5a5fd6; }
.badge-encurso .badge-dot { background: #5a5fd6; }
.badge-completada { background: var(--verde-bg); color: var(--verde); }
.badge-completada .badge-dot { background: var(--verde); }
.badge-vencida { background: var(--rojo-bg); color: var(--rojo); }
.badge-vencida .badge-dot { background: var(--rojo); }

.badge-alta { background: var(--rojo-bg); color: var(--rojo); }
.badge-media { background: var(--naranja-bg); color: var(--naranja); }
.badge-baja { background: var(--gris-100); color: var(--gris-700); }

/* Task row / card */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--gris-200);
}
.task-item:last-child { border-bottom: none; }
.task-checkbox {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gris-300);
  flex-shrink: 0;
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  background: var(--blanco);
}
.task-checkbox:hover { border-color: var(--azul-600); }
.task-checkbox.checked { background: var(--verde); border-color: var(--verde); color: #fff; font-size: 11px; }

.task-body { flex: 1; min-width: 0; }
.task-body .task-client {
  font-size: 13.5px; font-weight: 700; color: var(--azul-900);
}
.task-body .task-desc {
  font-size: 13px; color: var(--gris-700); margin-top: 2px; line-height: 1.4;
}
.task-meta {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px;
  font-size: 12px; color: var(--gris-500);
}
.task-meta span i { margin-right: 5px; color: var(--gris-500); }
.task-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.task-actions .badge { flex-shrink: 0; }

.icon-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid var(--gris-200);
  background: var(--blanco);
  display: flex; align-items: center; justify-content: center;
  color: var(--gris-500);
  font-size: 12px;
}
.icon-btn:hover { background: var(--gris-100); color: var(--azul-700); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radio-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
}
.btn-primary { background: var(--azul-900); color: #fff; }
.btn-primary:hover { background: var(--azul-700); }
.btn-secondary { background: var(--blanco); color: var(--azul-900); border-color: var(--gris-300); }
.btn-secondary:hover { background: var(--gris-100); }
.btn-ghost { background: transparent; color: var(--gris-700); }
.btn-ghost:hover { background: var(--gris-100); }
.btn-danger { background: var(--rojo); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Alert block */
.alert-block {
  border: 1px solid #f1c6c6;
  background: #fdf4f4;
  border-radius: var(--radio);
  padding: 4px 0;
}
.alert-block .task-item { border-bottom: 1px solid #f3dcdc; }

/* Grid de dos columnas dashboard */
.dash-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

/* Filtros */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}
.filter-chip {
  padding: 7px 14px;
  border-radius: 20px;
  background: var(--blanco);
  border: 1px solid var(--gris-300);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gris-700);
}
.filter-chip.active { background: var(--azul-900); color: #fff; border-color: var(--azul-900); }
.filter-select, .filter-input {
  padding: 8px 12px;
  border-radius: var(--radio-sm);
  border: 1px solid var(--gris-300);
  font-size: 12.5px;
  background: var(--blanco);
  color: var(--gris-900);
}
.filter-input { min-width: 220px; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gris-500);
  font-weight: 700;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gris-200);
  background: var(--gris-100);
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gris-200);
  color: var(--gris-900);
  vertical-align: middle;
}
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--azul-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(11, 37, 69, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-md);
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
}
.modal-box.wide { max-width: 680px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--gris-200);
}
.modal-head h3 { margin: 0; font-size: 16px; color: var(--azul-900); }
.modal-close { background: none; border: none; font-size: 18px; color: var(--gris-500); }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--gris-200); display: flex; justify-content: flex-end; gap: 10px; }

.detail-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--gris-200); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--gris-500); }
.detail-row .v { color: var(--gris-900); font-weight: 600; text-align: right; }

/* Toast */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--azul-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radio-sm);
  font-size: 13px;
  box-shadow: var(--sombra-md);
  display: flex; align-items: center; gap: 10px;
  min-width: 240px;
  animation: toast-in 0.2s ease;
}
.toast.success { background: var(--verde); }
.toast.error { background: var(--rojo); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, var(--azul-900) 0%, var(--azul-700) 55%, var(--azul-600) 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--blanco);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  padding: 36px 34px 30px;
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand .brand-mark {
  width: 52px; height: 52px; margin: 0 auto 12px;
  border-radius: 12px;
  background: linear-gradient(145deg, #2667ac, #0b2545);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 20px;
}
.login-brand h1 { font-size: 20px; margin: 0; color: var(--azul-900); }
.login-brand p { font-size: 12.5px; color: var(--gris-500); margin: 4px 0 0; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--gris-700); margin-bottom: 6px; }
.login-field input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--gris-300);
  border-radius: var(--radio-sm);
  font-size: 13.5px;
  background: var(--gris-50);
}
.login-field input:focus { outline: none; border-color: var(--azul-600); background: #fff; }
.login-submit {
  width: 100%; background: var(--azul-900); color: #fff;
  border: none; padding: 12px; border-radius: var(--radio-sm);
  font-size: 14px; font-weight: 600; margin-top: 4px;
}
.login-submit:hover { background: var(--azul-700); }
.login-demo {
  margin-top: 18px; background: var(--azul-50); border-radius: var(--radio-sm);
  padding: 12px 14px; font-size: 12px; color: var(--azul-800); line-height: 1.6;
}
.login-error { color: var(--rojo); font-size: 12.5px; margin-top: -4px; margin-bottom: 12px; display: none; }

/* Assistant floating button + panel */
#assistant-fab {
  position: fixed; bottom: 26px; right: 26px; z-index: 150;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--azul-900); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 8px 24px rgba(11,37,69,0.35);
  border: none;
}
#assistant-fab:hover { background: var(--azul-700); }

#assistant-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 400px; max-width: 94vw;
  background: var(--blanco);
  box-shadow: -8px 0 30px rgba(11,37,69,0.18);
  z-index: 180;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
#assistant-panel.open { transform: translateX(0); }
.assistant-head {
  padding: 18px 20px;
  background: var(--azul-900);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}
.assistant-head h3 { margin: 0; font-size: 15px; }
.assistant-head p { margin: 2px 0 0; font-size: 11.5px; color: #a9bddb; }
.assistant-close { background: rgba(255,255,255,0.12); border: none; color: #fff; width: 28px; height: 28px; border-radius: 50%; }

.assistant-messages { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--gris-50); }
.msg { max-width: 85%; padding: 11px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.msg.bot { background: var(--blanco); border: 1px solid var(--gris-200); color: var(--gris-900); align-self: flex-start; border-bottom-left-radius: 2px; }
.msg.user { background: var(--azul-900); color: #fff; align-self: flex-end; border-bottom-right-radius: 2px; }
.msg.system { align-self: center; background: var(--azul-100); color: var(--azul-800); font-size: 12px; border-radius: 20px; padding: 6px 14px; }

.assistant-suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--gris-200); background: var(--blanco); }
.suggestion-chip { font-size: 11.5px; padding: 7px 12px; border-radius: 16px; background: var(--azul-50); color: var(--azul-700); border: 1px solid var(--azul-100); }
.suggestion-chip:hover { background: var(--azul-100); }

.assistant-input-row { display: flex; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--gris-200); }
.assistant-input-row input {
  flex: 1; padding: 11px 14px; border-radius: 20px; border: 1px solid var(--gris-300); font-size: 13px;
}
.assistant-input-row input:focus { outline: none; border-color: var(--azul-600); }
.assistant-input-row button {
  width: 42px; height: 42px; border-radius: 50%; background: var(--azul-900); color: #fff; border: none; font-size: 15px; flex-shrink: 0;
}

.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gris-500);
  display: inline-block; margin: 0 2px; animation: blink 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Info extraída (panel "Información detectada") */
.extraction-card {
  background: var(--azul-50);
  border: 1px solid var(--azul-100);
  border-radius: var(--radio);
  padding: 16px 18px;
  margin-top: 6px;
}
.extraction-card h4 { margin: 0 0 10px; font-size: 13px; color: var(--azul-900); display:flex; align-items:center; gap:7px; }
.extraction-field { margin-bottom: 9px; font-size: 12.5px; }
.extraction-field .lbl { color: var(--gris-500); font-weight: 600; display:block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px;}
.extraction-field .val { color: var(--gris-900); }
.extraction-tasklist { margin: 4px 0 0; padding-left: 18px; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gris-500); }
.empty-state i { font-size: 28px; margin-bottom: 10px; color: var(--gris-300); display:block; }

/* Client cards grid */
.client-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.client-card {
  background: var(--blanco); border: 1px solid var(--gris-200); border-radius: var(--radio);
  padding: 18px; box-shadow: var(--sombra); cursor: pointer; transition: box-shadow .15s ease, transform .15s ease;
}
.client-card:hover { box-shadow: var(--sombra-md); transform: translateY(-1px); }
.client-card .client-avatar {
  width: 40px; height: 40px; border-radius: 10px; background: var(--azul-100); color: var(--azul-700);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; margin-bottom: 12px;
}
.client-card h4 { margin: 0 0 3px; font-size: 14.5px; color: var(--azul-900); }
.client-card .client-type { font-size: 11.5px; color: var(--gris-500); margin-bottom: 10px; }
.client-card .client-stats { display: flex; gap: 14px; font-size: 12px; color: var(--gris-700); }
.client-card .client-stats b { color: var(--azul-900); }

/* Calendar */
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.calendar-nav { display: flex; align-items: center; gap: 10px; }
.calendar-nav h2 { font-size: 16px; color: var(--azul-900); margin: 0; min-width: 190px; text-align:center; }
.view-switch { display: flex; background: var(--gris-100); border-radius: 20px; padding: 3px; }
.view-switch button { border: none; background: transparent; padding: 7px 14px; font-size: 12.5px; font-weight: 600; border-radius: 16px; color: var(--gris-700); }
.view-switch button.active { background: var(--azul-900); color: #fff; }

.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--gris-200); border-radius: var(--radio); overflow: hidden; background: var(--blanco); }
.month-grid .dow { background: var(--gris-100); font-size: 11px; font-weight: 700; color: var(--gris-500); text-transform: uppercase; padding: 8px; text-align: center; border-bottom: 1px solid var(--gris-200); }
.month-cell { min-height: 108px; border-right: 1px solid var(--gris-200); border-bottom: 1px solid var(--gris-200); padding: 6px; position: relative; }
.month-cell:nth-child(7n) { border-right: none; }
.month-cell .cell-date { font-size: 12px; font-weight: 700; color: var(--gris-700); margin-bottom: 4px; }
.month-cell.other-month { background: #fafbfc; }
.month-cell.other-month .cell-date { color: var(--gris-300); }
.month-cell.is-today { background: var(--azul-50); }
.month-cell.is-today .cell-date { color: var(--azul-700); }
.cal-event {
  font-size: 10.5px; padding: 3px 6px; border-radius: 5px; margin-bottom: 3px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600;
  border-left: 3px solid transparent;
}
.cal-event.tipo-reunion { background: #eef3fb; color: #2b3a8f; border-left-color: #2b3a8f; }
.cal-event.tipo-tramite { background: var(--naranja-bg); color: var(--naranja); border-left-color: var(--naranja); }
.cal-event.tipo-seguimiento { background: var(--azul-100); color: var(--azul-700); border-left-color: var(--azul-700); }
.cal-event.tipo-tarea { background: var(--gris-100); color: var(--gris-700); border-left-color: var(--gris-500); }
.cal-event.tipo-recordatorio { background: #f3eefc; color: #6a3fb0; border-left-color: #6a3fb0; }
.cal-event.vencida { background: var(--rojo-bg); color: var(--rojo); border-left-color: var(--rojo); }

.week-grid, .day-grid { background: var(--blanco); border: 1px solid var(--gris-200); border-radius: var(--radio); overflow: hidden; }
.week-head, .day-head { display: grid; border-bottom: 1px solid var(--gris-200); }
.week-head { grid-template-columns: repeat(7, 1fr); }
.day-head { grid-template-columns: 1fr; }
.week-head div, .day-head div { padding: 10px; text-align: center; font-size: 12px; font-weight: 700; color: var(--gris-700); background: var(--gris-100); text-transform: capitalize; }
.week-body { display: grid; grid-template-columns: repeat(7, 1fr); min-height: 420px; }
.week-col { border-right: 1px solid var(--gris-200); padding: 8px; }
.week-col:last-child { border-right: none; }
.day-body { padding: 14px; min-height: 300px; }

/* Legend */
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12px; color: var(--gris-700); }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Call simulator */
.phone-shell {
  max-width: 380px; margin: 0 auto;
  background: var(--azul-900); border-radius: 30px; padding: 20px;
  box-shadow: var(--sombra-md); color: #fff;
}
.phone-screen { background: #0e1b2e; border-radius: 20px; padding: 24px 20px; min-height: 520px; display: flex; flex-direction: column; }
.call-status { text-align: center; margin-bottom: 18px; }
.call-status .call-avatar {
  width: 70px; height: 70px; border-radius: 50%; background: var(--azul-600); margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700;
}
.call-status h3 { margin: 0; font-size: 16px; }
.call-status p { margin: 4px 0 0; font-size: 12px; color: #9fb3d1; }
.call-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(29, 138, 82, 0.2); color: #6fe3a4; font-size: 11.5px; padding: 4px 12px; border-radius: 14px; margin-top: 10px; font-weight: 600; }
.call-transcript { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.call-transcript .msg.bot { background: #16263e; border-color: #223758; color: #e6edf7; }
.call-transcript .msg.user { background: var(--azul-600); }
.call-controls { display: flex; justify-content: center; gap: 16px; margin-top: 16px; }
.call-controls button {
  width: 50px; height: 50px; border-radius: 50%; border: none; font-size: 16px;
}
.call-end { background: var(--rojo); color: #fff; }
.call-mic { background: rgba(255,255,255,0.12); color: #fff; }

.demo-script-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.demo-script-btn {
  text-align: left; background: var(--blanco); border: 1px solid var(--gris-200); border-radius: var(--radio-sm);
  padding: 12px 14px; font-size: 12.5px; color: var(--gris-900);
}
.demo-script-btn:hover { border-color: var(--azul-500); background: var(--azul-50); }
.demo-script-btn b { display:block; color: var(--azul-800); font-size: 12.5px; margin-bottom:3px; }
.demo-script-btn.active-script { border-color: var(--azul-700); background: var(--azul-50); box-shadow: 0 0 0 1px var(--azul-700) inset; }

/* Security schema */
.flow-schema { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 20px 0; }
.flow-node {
  background: var(--blanco); border: 1.5px solid var(--azul-600); color: var(--azul-900);
  padding: 12px 24px; border-radius: var(--radio-sm); font-weight: 700; font-size: 13px; text-align: center;
  box-shadow: var(--sombra);
}
.flow-node.highlight { background: var(--azul-900); color: #fff; border-color: var(--azul-900); }
.flow-arrow { color: var(--gris-400); font-size: 16px; }

/* Email preview */
.email-preview { background: var(--blanco); border: 1px solid var(--gris-200); border-radius: var(--radio); overflow: hidden; }
.email-head { background: var(--gris-100); padding: 14px 20px; border-bottom: 1px solid var(--gris-200); font-size: 12.5px; color: var(--gris-700); }
.email-head b { color: var(--gris-900); }
.email-body { padding: 24px 28px; font-size: 13.5px; line-height: 1.7; color: var(--gris-900); }
.email-body h3 { font-size: 13px; color: var(--azul-800); border-bottom: 1px solid var(--gris-200); padding-bottom: 6px; margin: 20px 0 10px; }
.email-body h3:first-child { margin-top: 0; }
.email-item { padding: 6px 0; }
.email-item b { color: var(--azul-900); }

/* Config */
.config-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.config-card { padding: 20px 22px; }
.config-card h4 { font-size: 13.5px; color: var(--azul-900); margin: 0 0 14px; display:flex; align-items:center; gap:8px;}
.config-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--gris-200); font-size: 13px; }
.config-row:last-child { border-bottom: none; }
.config-row .k { color: var(--gris-500); }
.config-row .v { font-weight: 600; color: var(--gris-900); }
.user-pill { display:inline-flex; align-items:center; gap:7px; background: var(--azul-50); color: var(--azul-700); padding: 6px 12px; border-radius: 16px; font-size: 12px; font-weight:600; margin: 3px 4px 0 0;}

/* Responsive */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .client-grid { grid-template-columns: repeat(2, 1fr); }
  .config-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .client-grid { grid-template-columns: 1fr; }
  #assistant-panel { width: 100vw; }
}

.mobile-menu-btn { display: none; }
@media (max-width: 720px) {
  .mobile-menu-btn { display: flex; }
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
