/* ============================================================
   FINANCEAI — schedule.css
   Agenda, Perfil, Evolução Patrimonial
   ============================================================ */

/* ---- NAV ADDITIONS ---- */
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   AGENDA / SCHEDULE
   ============================================================ */
.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.schedule-view-toggle {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.sched-view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
}
.sched-view-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.sched-view-btn.active { background: var(--accent); color: #0c1a0c; font-weight: 600; }

/* ---- Summary strip ---- */
.sched-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.sched-strip-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color var(--transition);
}
.sched-strip-item:hover { border-color: var(--border-strong); }

.sched-strip-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sched-strip-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.sched-strip-val   { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }

/* ---- Filters row ---- */
.sched-filter-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ---- Task list ---- */
.task-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.task-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: default;
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--bg-hover); border-radius: 8px; }
.task-item.done { opacity: 0.5; }
.task-item.overdue { border-left: 3px solid var(--danger); padding-left: 9px; }

/* Checkbox */
.task-check {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  margin-top: 2px;
}
.task-check:hover { border-color: var(--accent); }
.task-check.checked { background: var(--accent); border-color: var(--accent); }
.task-check.checked::after { content: '✓'; color: #0c1a0c; font-size: 11px; font-weight: 700; }

.task-body { min-width: 0; }
.task-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-title { font-size: 0.875rem; font-weight: 500; }
.task-item.done .task-title { text-decoration: line-through; }

.task-type-badge {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 20px;
  white-space: nowrap;
}
.task-type-bill     { background: rgba(248,113,113,0.12); color: #f87171; }
.task-type-income   { background: rgba(74,222,128,0.12);  color: #4ade80; }
.task-type-reminder { background: rgba(251,191,36,0.12);  color: #fbbf24; }
.task-type-goal     { background: rgba(129,140,248,0.12); color: #818cf8; }

.task-priority-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.priority-high   { background: var(--danger); }
.priority-medium { background: var(--warning); }
.priority-low    { background: var(--accent); }

.task-meta { font-size: 0.73rem; color: var(--text-muted); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.task-meta-item { display: flex; align-items: center; gap: 4px; }

.task-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.task-value { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; }
.task-value.bill   { color: var(--danger); }
.task-value.income { color: var(--accent); }

.task-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
.task-item:hover .task-actions { opacity: 1; }

/* ---- Days until badge ---- */
.days-badge {
  font-size: 0.68rem; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  white-space: nowrap;
}
.days-badge.today    { background: rgba(129,140,248,0.15); color: #818cf8; }
.days-badge.soon     { background: rgba(251,191,36,0.15);  color: #fbbf24; }
.days-badge.overdue  { background: rgba(248,113,113,0.15); color: #f87171; }
.days-badge.upcoming { background: var(--bg-hover); color: var(--text-muted); }

/* ---- Calendar view ---- */
.sched-calendar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.cal-nav-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }

.cal-nav-btn {
  width: 32px; height: 32px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); background: var(--bg-elevated);
  border: 1px solid var(--border); cursor: pointer;
  transition: all var(--transition);
}
.cal-nav-btn:hover { border-color: var(--accent-mid); color: var(--accent); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-weekday {
  text-align: center; padding: 10px 0;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.cal-day {
  min-height: 72px;
  padding: 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day:hover { background: var(--bg-hover); }
.cal-day.other-month { opacity: 0.35; }
.cal-day.today-day .cal-day-num {
  background: var(--accent); color: #0c1a0c;
  border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.cal-day-num { font-size: 0.78rem; font-weight: 500; margin-bottom: 4px; }

.cal-dot-wrap { display: flex; flex-wrap: wrap; gap: 2px; }
.cal-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   PROFILE
   ============================================================ */
.profile-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}

.profile-left { display: flex; flex-direction: column; gap: 16px; }

/* ---- Profile card ---- */
.profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(135deg, var(--accent-dim), transparent);
}

.profile-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
}

.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent-mid);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}

.profile-avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.3;
  animation: pulseRing 2.5s ease infinite;
}

@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50%       { transform: scale(1.05); opacity: 0.1; }
}

.profile-name {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.profile-email { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }

.profile-whatsapp {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.profile-since {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ---- Stats card ---- */
.profile-stats-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.profile-stat-row:last-child { border-bottom: none; padding-bottom: 0; }
.profile-stat-label { color: var(--text-muted); }
.profile-stat-val   { font-weight: 600; font-family: var(--font-display); }

/* ---- Right column ---- */
.profile-right { display: flex; flex-direction: column; }

.btn-sm { padding: 6px 14px !important; font-size: 0.78rem !important; }

/* ---- Wealth chart ---- */
.wealth-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.wealth-stat {
  text-align: center;
}
.wealth-stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.wealth-stat-val   { font-family: var(--font-display); font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.wealth-stat-val.positive { color: var(--accent); }
.wealth-stat-val.negative { color: var(--danger); }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .profile-layout { grid-template-columns: 260px 1fr; }
  .sched-summary-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .profile-layout { grid-template-columns: 1fr; }
  .sched-summary-strip { grid-template-columns: repeat(2, 1fr); }
  .wealth-summary { grid-template-columns: repeat(2, 1fr); }
  .schedule-header { flex-direction: column; align-items: stretch; }
}
