:root {
  --bg: #f9fafb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #111827;
  --border: #e5e7eb;
}

* {
  font-family: Inter, system-ui, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  background: var(--primary);
  color: white;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.logo {
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 32px;
}

.sidebar nav a {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  color: #9ca3af;
  text-decoration: none;
  cursor: pointer;
}

.sidebar nav a.active,
.sidebar nav a:hover {
  background: #1f2933;
  color: white;
}

.sidebar-footer {
  margin-top: auto;
}

/* MAIN */
.main-content {
  flex: 1;
  padding: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  background: var(--panel);
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
  gap: 20px;
}

.panel {
  background: var(--panel);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.panel h6 {
  margin-bottom: 12px;
  font-weight: 600;
}

.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.task-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}

.task-list.muted li {
  color: var(--muted);
}

.task-list.personal li {
  color: #065f46;
}

/* CHAT */
.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 320px;
  height: 420px;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  z-index: 999;
  transition: all 0.25s ease;
}

/* HEADER */
.chat-header {
  padding: 14px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

/* BOTÓN MINIMIZAR */
.chat-toggle {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* BODY */
.chat-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  font-size: 14px;
}

/* INPUT */
.chat-input {
  display: flex;
  border-top: 1px solid var(--border);
}

.chat-input input {
  flex: 1;
  border: none;
  padding: 12px;
  outline: none;
  font-size: 14px;
}

.chat-input button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 16px;
  cursor: pointer;
}

/* ESTADO MINIMIZADO*/

.chat-widget.minimized {
  height: 52px;
  width: 220px;
  border-radius: 999px;
  overflow: hidden;
}

.chat-widget.minimized .chat-body,
.chat-widget.minimized .chat-input {
  display: none;
}

.chat-widget.minimized .chat-header {
  justify-content: center;
  border-bottom: none;
}

/*MOBILE */

@media (max-width: 768px) {
  .chat-widget {
    width: 92%;
    right: 4%;
    bottom: 16px;
  }

  .chat-widget.minimized {
    width: 70%;
  }
}
/* MOBILE */
@media(max-width:768px){
  .sidebar {
    display: none;
  }
  .main-content {
    padding: 16px;
  }
  .chat-widget {
    width: 92%;
    right: 4%;
  }
}

.clients-section h5 {
  font-weight: 600;
}

/* SECCIÓN CLIENTES */

.client-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.client-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.client-card h6 {
  font-weight: 600;
  margin-bottom: 6px;
}

.client-card p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}

.status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-block;
}

.status.active {
  background: #dcfce7;
  color: #166534;
}

.status.paused {
  background: #fef3c7;
  color: #92400e;
}

/* CHAT MENSAJES */

.chat-msg {
  white-space: pre-line;
  line-height: 1.6;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
}

/* MENSAJE BOT */

.chat-msg.bot {
  color: var(--text);
  background: #f9fafb;
  border: 1px solid var(--border);
}

/* MENSAJE USUARIO */

.chat-msg.user {
  color: var(--muted);
  text-align: right;
  background: #eef2ff;
  margin-left: 40px;
}

/* TÍTULOS DE DÍA (líneas sin viñeta ni reloj) */
.chat-msg.bot {
  font-size: 14px;
}

/* Detectamos líneas que NO empiezan con • ni 🕒 */
.chat-msg.bot
  :not(:has(•))
  :not(:has(🕒)) {
  font-weight: 600;
}

/* TAREAS */
.chat-msg.bot:has(•) {
  padding-left: 18px;
}

/* CADA TAREA */
.chat-msg.bot {
  letter-spacing: 0.1px;
}

/* TOTAL DEL DÍA */
.chat-msg.bot:has(🕒) {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

/* RESUMEN FINAL */
.chat-msg.bot:last-child {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--muted);
}

