/* ===== styles.css — Base global: variables, reset, botones, campos, toasts, pantallas y modo noche ===== */

/* ============================================================
   TASKFLOW · ESTILOS
   Sistema de gestión de tareas (Asana / Monday / ClickUp style)
   ============================================================ */

:root {
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --navy-700: #334155;
  --navy-500: #64748b;
  --paper: #f7f8fb;
  --paper-card: #ffffff;
  --border: #e5e7eb;

  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;

  --green: #10b981;
  --green-bg: #ecfdf5;
  --yellow: #f59e0b;
  --yellow-bg: #fffbeb;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --blue: #0ea5e9;
  --blue-bg: #f0f9ff;
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.25);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color: var(--navy-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
}

/* ============================================================
   BOTONES / CAMPOS GENERALES
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:active { transform: scale(0.96); }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45); }

.btn-secondary {
  background: var(--paper);
  color: var(--navy-700);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #eef0f3; }

.btn-ghost {
  background: var(--primary-light);
  color: var(--primary);
}
.btn-ghost:hover { background: #e0e3ff; }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
}
.btn-danger:hover { background: #fde2e2; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  flex: 1;
}
.field span {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-700);
}
.field input, .field select, .field textarea {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
  color: var(--navy-900);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.field-row { display: flex; gap: 14px; }
.field-row .field { min-width: 0; }

.form-error {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  font-weight: 600;
}
.form-success {
  color: var(--green);
  font-size: 13px;
  min-height: 18px;
  font-weight: 600;
}


/* ============================================================
   TOASTS
   ============================================================ */

.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: var(--navy-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
  animation: toast-in 300ms cubic-bezier(0.16, 1, 0.3, 1), toast-out 300ms ease 2.5s forwards;
}
.toast.success::before { content: '✓'; color: var(--green); }
.toast.error::before { content: '✕'; color: var(--red); }
.toast.info::before { content: 'i'; color: var(--blue); }

@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }

/* ============================================================
   PANTALLAS (AUTH / APP) — control de visibilidad en un solo archivo
   ============================================================ */
.screen { display: none; }
/* Mayor especificidad para ganarle a .auth-body/.app-body (que definen display en otro archivo) */
.screen:not(.active) { display: none; }
#authScreen.active { display: flex; }
#appScreen.active { display: block; }


/* ============================================================
   MODO NOCHE (día / noche a gusto del usuario)
   ============================================================ */
[data-theme="dark"] {
  --paper: #0f172a;
  --paper-card: #1e293b;
  --border: #334155;
  --navy-900: #f1f5f9;
  --navy-700: #cbd5e1;
  --navy-500: #94a3b8;
  --primary-light: #312e81;
}

/* Superficies que en claro eran blancas/grises */
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .search-box,
[data-theme="dark"] .view-toggle,
[data-theme="dark"] .column-count,
[data-theme="dark"] .task-card,
[data-theme="dark"] .task-table tbody tr,
[data-theme="dark"] .team-card,
[data-theme="dark"] .modal,
[data-theme="dark"] .chat-channels,
[data-theme="dark"] .chat-main,
[data-theme="dark"] .admin-pw-input,
[data-theme="dark"] .subtask-add-row input,
[data-theme="dark"] .comment-add-row input,
[data-theme="dark"] #chatInput { background: var(--paper-card); color: var(--navy-900); }

[data-theme="dark"] .board-column { background: #172033; }
[data-theme="dark"] .progress-bar,
[data-theme="dark"] .due-done,
[data-theme="dark"] .status-pendiente,
[data-theme="dark"] .chat-att-file:hover { background: #334155; }

/* Elementos que deben SEGUIR oscuros aunque el texto se aclare */
[data-theme="dark"] .sidebar { background: #0b1120; }
[data-theme="dark"] .toast { background: #020617; }
[data-theme="dark"] .call-modal { background: #0b1120; }
[data-theme="dark"] .due-overdue { background: #0b1120; color: #fff; }
[data-theme="dark"] .mini-avatar { box-shadow: 0 0 0 2px #1e293b; }
[data-theme="dark"] .theme-toggle { background: #334155; color: #facc15; }

/* Banner de cumpleaños en oscuro */
[data-theme="dark"] .birthday-banner {
  background: linear-gradient(90deg, #3b1d2e, #232a4d);
  border-color: #4b2a5a;
}

