*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Notion Design System — ver design-tokens.css para referencia completa */

  /* Accent (Notion Blue) */
  --accent: #0075de;
  --accent-hover: #005bab;
  --accent-focus: #097fe8;
  --accent-bg: #f2f9ff;
  --accent-text: #097fe8;
  --accent-light: #62aef0;

  /* Legacy aliases (mantidos para compatibilidade) */
  --amber: var(--accent);
  --amber-dark: var(--accent-hover);
  --amber-light: var(--accent-light);
  --navy: #31302e;
  --offwhite: #ffffff;

  /* Surfaces */
  --bg-deep: #ffffff;
  --bg-surface: #f6f5f4;
  --bg-card: #ffffff;
  --bg-glass: rgba(0, 0, 0, 0.03);
  --border-subtle: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.18);
  --text-primary: rgba(0, 0, 0, 0.95);
  --text-secondary: #615d59;
  --text-muted: #a39e98;

  /* Categories */
  --cat-trabalho: #0075de;
  --cat-consultoria: #2a9d99;
  --cat-grupo-ser: #7c5caa;
  --cat-pessoal: #1aae39;

  /* Priority */
  --pri-alta: #dd5b00;
  --pri-media: #0075de;
  --pri-baixa: #a39e98;

  /* Radius */
  --radius: 12px;
  --radius-sm: 4px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-card: rgba(0,0,0,0.04) 0px 4px 18px, rgba(0,0,0,0.027) 0px 2.025px 7.85px, rgba(0,0,0,0.02) 0px 0.8px 2.93px, rgba(0,0,0,0.01) 0px 0.175px 1.04px;
  --shadow-deep: rgba(0,0,0,0.01) 0px 1px 3px, rgba(0,0,0,0.02) 0px 3px 7px, rgba(0,0,0,0.02) 0px 7px 15px, rgba(0,0,0,0.04) 0px 14px 28px, rgba(0,0,0,0.05) 0px 23px 52px;

  --transition: 0.2s ease;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "lnum", "locl";
}

/* ========== BACKGROUND ========== */
body::before, body::after { display: none; }
.noise { display: none; }

/* ========== LAYOUT — MOBILE FIRST ========== */
.app {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding-bottom: calc(70px + var(--safe-bottom));
}

/* ========== HEADER ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(0.75rem + var(--safe-top)) 1rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-deep);
}

.header-left { display: flex; align-items: baseline; gap: 0.6rem; }

.logo {
  font-family: 'Inter', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.header-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 300;
  display: none;
}

.header-right { display: flex; align-items: center; gap: 0.5rem; }

/* ========== SEARCH BAR ========== */
.search-container {
  position: relative;
  flex: 1;
  max-width: 300px;
  display: none;
}
.search-input {
  width: 100%;
  padding: 0.4rem 0.7rem 0.4rem 2rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 50px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.75rem;
  outline: none;
  transition: var(--transition);
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,117,222,0.15); }
.search-input::placeholder { color: var(--text-muted); }
.search-icon {
  position: absolute;
  left: 0.6rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
  width: 14px; height: 14px;
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  max-height: 350px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  display: none;
}
.search-results.active { display: block; }
.search-result-item {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
}
.search-result-item:hover { background: var(--bg-glass); }
.search-result-item:last-child { border-bottom: none; }
.search-result-type {
  font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--amber); margin-bottom: 0.15rem;
}
.search-result-title { font-size: 0.8rem; color: var(--text-primary); }
.search-result-meta { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.1rem; }
.search-result-preview { font-size: 0.7rem; color: var(--text-secondary); margin-top: 0.15rem; }

.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  padding: 0;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.btn-add:hover { background: var(--accent-hover); }
.btn-add:active { transform: scale(0.9); }
.btn-add svg { width: 18px; height: 18px; }
.btn-add-text { display: none; }

.view-toggle {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-toggle button {
  padding: 0.4rem 0.75rem;
  background: none; border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.view-toggle button:hover { color: var(--text-secondary); }
.view-toggle button.active { color: var(--accent); background: var(--accent-bg); }

/* ========== STATS BAR (horizontal scroll on mobile) ========== */
.stats-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 16;
  background: var(--bg-deep);
}
.stats-bar::-webkit-scrollbar { display: none; }

.stat-card {
  flex: 0 0 auto;
  min-width: 90px;
  padding: 0.6rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-accent, var(--text-muted));
  opacity: 0.6;
}
.stat-card:hover { border-color: var(--border-hover); }
.stat-card:active { transform: scale(0.96); }
.stat-card.stat-active { border-color: var(--accent); background: var(--accent-bg); }
.stat-card.stat-active::before { opacity: 1; height: 3px; }
.stat-number {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem; font-weight: 700; line-height: 1; margin-bottom: 0.15rem;
  letter-spacing: -0.03em;
}
.stat-label { font-size: 0.65rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat-card.total { --stat-accent: var(--text-primary); }
.stat-card.total .stat-number { color: var(--text-primary); }
.stat-card.pending { --stat-accent: var(--accent); }
.stat-card.pending .stat-number { color: var(--accent); }
.stat-card.done { --stat-accent: #1aae39; }
.stat-card.done .stat-number { color: #1aae39; }
.stat-card.overdue { --stat-accent: var(--pri-alta); }
.stat-card.overdue .stat-number { color: var(--pri-alta); }
.stat-card.meetings { --stat-accent: var(--cat-consultoria); }
.stat-card.meetings .stat-number { color: var(--cat-consultoria); }

/* ========== FILTER CHIPS (horizontal scroll) ========== */
.filter-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 16;
  background: var(--bg-deep);
}
.filter-bar::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  -webkit-user-select: none;
  user-select: none;
}
.chip:hover { border-color: var(--border-hover); }
.chip:active { transform: scale(0.95); }
.chip.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* ========== MAIN CONTENT ========== */
.main { flex: 1; min-height: 0; padding: 0 1rem 0.75rem; overflow-y: auto; }

/* ========== STATUS TABS ========== */
.status-tabs {
  display: flex;
  gap: 0.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 15;
}
.status-tabs::before {
  content: '';
  position: absolute;
  top: -0.75rem; left: -1rem; right: -1rem;
  height: 0.75rem;
  background: var(--bg-deep);
  z-index: -1;
}
.status-tabs::-webkit-scrollbar { display: none; }

.status-tab {
  flex: 1;
  padding: 0.4rem 0.5rem;
  background: none; border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
  text-align: center;
}
.status-tab:hover { color: var(--text-secondary); }
.status-tab.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }

/* ========== TASK LIST ========== */
.task-list { display: flex; flex-direction: column; gap: 0.5rem; padding-bottom: 1rem; }

.task-card {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  position: relative;
  animation: slideUp 0.35s ease backwards;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.task-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cat-color);
  opacity: 0.8;
  border-radius: 3px 0 0 3px;
}

.task-check {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-hover);
  display: flex;
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  margin-top: 2px;
}
.task-check:active { transform: scale(0.85); }
.task-card.completed .task-check { background: #1aae39; border-color: #1aae39; }
.task-card.completed .task-check::after { content: ''; width: 8px; height: 8px; background: white; border-radius: 50%; }

.task-info { flex: 1; min-width: 0; }

.task-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.task-title {
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.35;
  word-break: break-word;
}
.task-card.completed .task-title { text-decoration: line-through; color: var(--text-muted); }

.task-category-badge {
  font-size: 0.6rem;
  padding: 0.12rem 0.5rem;
  border-radius: 50px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.task-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.task-priority { display: flex; align-items: center; gap: 0.25rem; }
.task-priority .dot { width: 5px; height: 5px; border-radius: 50%; }

.task-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.task-date-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.task-date-badge.overdue { color: var(--pri-alta); }

/* ========== MEETING BADGE ========== */
.meeting-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6rem;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.meeting-badge:active { transform: scale(0.92); }
.meeting-badge.zoom { background: rgba(45,140,255,0.15); color: #2d8cff; }
.meeting-badge.meet { background: rgba(52,168,83,0.15); color: #34a853; }
.meeting-badge.teams { background: rgba(98,100,167,0.15); color: #6264a7; }
.meeting-badge.generic { background: var(--bg-glass); color: var(--text-secondary); }

.meeting-icon { width: 10px; height: 10px; }

/* ========== SWIPE ACTIONS (mobile) ========== */
.task-card-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.swipe-action {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pri-alta);
  color: white;
  font-size: 0.7rem;
  font-weight: 500;
  z-index: -1;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ========== TASK ACTIONS ========== */
.task-actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  margin-top: 0.3rem;
}

.task-action-btn {
  width: 28px; height: 28px;
  display: flex;
  align-items: center; justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}
.task-action-btn:hover, .task-action-btn:active {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-glass);
}
.task-action-btn.delete:hover, .task-action-btn.delete:active {
  color: var(--pri-alta);
  border-color: rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.1);
}

/* ========== TODAY VIEW ========== */
/* ========== OVERDUE BANNER ========== */
.overdue-banner {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fadeIn 0.4s ease;
}
.overdue-banner-icon { font-size: 1rem; }
.overdue-banner-text { font-size: 0.75rem; color: var(--pri-alta); font-weight: 500; }

.today-view { display: none; animation: fadeIn 0.4s ease; }
.today-view.active { display: block; }

.today-header {
  padding: 0.5rem 0 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.today-count {
  background: var(--amber);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
}
.today-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.today-empty p { font-size: 0.85rem; margin-top: 0.5rem; }

/* ========== CALENDAR VIEW ========== */
.calendar-view { display: none; animation: fadeIn 0.4s ease; }
.calendar-view.active { display: block; }
.tasks-view.hidden { display: none; }

.calendar-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
}

.calendar-day {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.calendar-day.today {
  border-color: rgba(0,117,222,0.2);
  background: rgba(0,117,222,0.04);
  box-shadow: 0 0 20px rgba(0,117,222,0.05);
}
.calendar-day.empty-day { opacity: 0.5; }
.calendar-day.no-date-column {
  border-style: dashed;
  opacity: 0.8;
}
.calendar-day.no-date-column .calendar-day-header {
  background: rgba(0,117,222,0.06);
}

.calendar-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
}
.calendar-day-name {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 500;
}
.calendar-day-number {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1;
}
.calendar-day.today .calendar-day-name { color: var(--amber); }
.calendar-day.today .calendar-day-number { color: var(--amber); }

.calendar-day-tasks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calendar-task-count {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.4rem;
  text-align: center;
}

.calendar-task {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: 0.72rem;
  border-left: 3px solid var(--cat-color);
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.3;
}
.calendar-task:active { transform: scale(0.97); background: var(--bg-glass); }
.calendar-habit { border-left-style: dashed; opacity: 0.7; }
.calendar-habit.habit-done { opacity: 0.4; text-decoration: line-through; }

.calendar-task-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.calendar-task-title {
  font-weight: 400;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.calendar-task-time {
  font-size: 0.6rem;
  color: var(--cat-color, var(--text-muted));
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  opacity: 0.85;
}
.calendar-task-cat {
  font-size: 0.55rem;
  color: var(--cat-color, var(--text-muted));
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.calendar-task-meeting {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.calendar-task-meeting .meeting-icon { width: 8px; height: 8px; }

/* ========== TASK DETAIL OVERLAY ========== */
.detail-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 110;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.detail-overlay.active { opacity: 1; pointer-events: all; }

.detail-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem 1.25rem calc(1.5rem + var(--safe-bottom));
  width: 100%;
  max-width: 520px;
  transform: translateY(100%);
  transition: var(--transition);
  box-shadow: var(--shadow-deep);
}
.detail-overlay.active .detail-sheet { transform: translateY(0); }

.detail-handle {
  width: 36px; height: 4px;
  background: var(--border-hover);
  border-radius: 2px;
  margin: 0 auto 1.2rem;
}

.detail-category {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.detail-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.detail-field-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.detail-field-value {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.detail-notes {
  padding: 0.75rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
}

.detail-btn {
  flex: 1;
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.detail-btn svg { width: 16px; height: 16px; }
.detail-btn-edit {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.detail-btn-delete {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--pri-alta);
}
.detail-btn-close {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* ========== BOTTOM NAV (mobile) ========== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0.5rem 0.25rem calc(0.5rem + var(--safe-bottom));
  background: var(--bg-deep);
  border-top: 1px solid var(--border-subtle);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
}

.bottom-nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem 0.55rem;
  background: none; border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.55rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 0;
}
.nav-item.active { color: var(--accent); }
.nav-item:active { transform: scale(0.9); }
.nav-item svg { width: 22px; height: 22px; }
.nav-item { position: relative; }
.nav-badge {
  position: absolute;
  top: 2px; right: 8px;
  background: var(--pri-alta);
  color: white;
  font-size: 0.55rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 50px;
  padding: 0 4px;
}

.nav-fab {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: var(--accent);
  border: none;
  color: white;
  display: flex;
  align-items: center; justify-content: center;
  cursor: pointer;
  margin-top: -20px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,117,222,0.3);
  transition: var(--transition);
}
.nav-fab:hover { background: var(--accent-hover); }
.nav-fab:active { transform: scale(0.9); }
.nav-fab svg { width: 24px; height: 24px; }

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem 1.25rem calc(1.5rem + var(--safe-bottom));
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: var(--transition);
  box-shadow: var(--shadow-deep);
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal-handle {
  width: 36px; height: 4px;
  background: var(--border-hover);
  border-radius: 2px;
  margin: 0 auto 1rem;
}

.modal h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px; /* prevents zoom on iOS */
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,117,222,0.12);
}
.form-group select option { background: var(--bg-surface); }
.form-group textarea { resize: vertical; min-height: 70px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.6rem; }

.modal-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.btn-cancel {
  flex: 1;
  padding: 0.7rem;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-save {
  flex: 2;
  padding: 0.7rem;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-save:hover { background: var(--accent-hover); }

/* ========== SIDEBAR (desktop only) ========== */
.sidebar { display: none; }

/* ========== ANIMATIONS ========== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state p { font-size: 0.85rem; margin-top: 0.5rem; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-glass); border-radius: 2px; }

/* ========== HEATMAP 365 (GitHub-style) ========== */
.heatmap365-container {
  margin: 0.75rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.heatmap365-container::-webkit-scrollbar { height: 4px; }
.heatmap365-container::-webkit-scrollbar-thumb { background: var(--bg-glass); border-radius: 2px; }
.heatmap365-months {
  display: flex;
  gap: 0;
  padding-left: 0;
  margin-bottom: 2px;
  min-width: max-content;
}
.heatmap365-month-label {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-align: left;
}
.heatmap365-grid {
  display: grid;
  grid-template-rows: repeat(7, 11px);
  grid-auto-flow: column;
  grid-auto-columns: 11px;
  gap: 2px;
  min-width: max-content;
}
.heatmap365-cell {
  width: 11px; height: 11px;
  border-radius: 2px;
  background: var(--bg-glass);
  position: relative;
  cursor: default;
}
.heatmap365-cell.h-level-1 { background: rgba(0,117,222,0.15); }
.heatmap365-cell.h-level-2 { background: rgba(0,117,222,0.3); }
.heatmap365-cell.h-level-3 { background: rgba(0,117,222,0.5); }
.heatmap365-cell.h-level-4 { background: rgba(0,117,222,0.75); }
.heatmap365-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.6rem;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  display: none;
}
.heatmap365-cell:hover .heatmap365-tooltip { display: block; }
.heatmap365-legend {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  font-size: 0.55rem;
  color: var(--text-muted);
  justify-content: flex-end;
}
.heatmap365-legend-cell {
  width: 11px; height: 11px; border-radius: 2px;
}

/* ========== SWIPE GESTURES (mobile) ========== */
.task-card-swipe-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}
.swipe-bg {
  position: absolute;
  top: 0; bottom: 0;
  width: 100%;
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  padding: 0 1.2rem;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.swipe-bg-right {
  left: 0;
  background: var(--amber);
  justify-content: flex-start;
}
.swipe-bg-left {
  right: 0;
  background: var(--pri-media);
  justify-content: flex-end;
}
.swipe-bg.visible { opacity: 1; }
.task-card.swiping {
  transition: none !important;
  position: relative;
  z-index: 1;
}
.task-card.swipe-completing {
  transition: transform 0.3s ease, opacity 0.3s ease !important;
  transform: translateX(100%) !important;
  opacity: 0 !important;
}
.task-card.swipe-postponing {
  transition: transform 0.3s ease, opacity 0.3s ease !important;
  transform: translateX(-100%) !important;
  opacity: 0 !important;
}

/* ========== POMODORO TIMER ========== */
.pomodoro-widget {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  right: 1rem;
  z-index: 50;
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: none;
  animation: slideUp 0.35s ease;
}
.pomodoro-widget.active { display: block; }
.pomodoro-phase-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  text-align: center;
  margin-bottom: 0.3rem;
  letter-spacing: 0.03em;
}
.pomodoro-cycle-dots {
  text-align: center;
  margin-bottom: 0.3rem;
  line-height: 1;
}
.pomodoro-task-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.pomodoro-time {
  font-family: 'Inter', sans-serif;
  font-size: 2rem;
  color: var(--text-primary);
  text-align: center;
  line-height: 1;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.pomodoro-controls {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
}
.pomodoro-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
  font-size: 0.8rem;
}
.pomodoro-btn:hover { border-color: var(--border-hover); background: var(--bg-glass); }
.pomodoro-btn.stop { color: var(--pri-alta); }
.pomodoro-accumulated {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  text-align: center;
}
/* Pomodoro tooltip on task cards */
.pomo-start-btn { position: relative; }
.pomo-start-btn::after {
  content: 'Pomodoro: 25 min de foco total nesta tarefa. O tempo é registrado automaticamente.';
  position: absolute; bottom: calc(100% + 8px); right: 0;
  background: var(--bg-surface); border: 1px solid var(--border-hover); border-radius: 8px;
  padding: 0.5rem 0.7rem; font-size: 0.65rem; color: var(--text-secondary);
  white-space: normal; width: 200px; line-height: 1.4;
  opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.pomo-start-btn:hover::after { opacity: 1; }
@media (max-width: 768px) {
  .pomo-start-btn::after { display: none; }
}
.task-pomo-time {
  font-size: 0.6rem;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

/* ========== EISENHOWER MATRIX ========== */
.matrix-view { display: none; animation: fadeIn 0.4s ease; }
.matrix-view.active { display: block; }
.matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.matrix-quadrant {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.75rem;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}
.matrix-quadrant-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--q-accent);
}
.matrix-quadrant-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--q-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.matrix-quadrant-subtitle {
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-left: auto;
}
.matrix-quadrant.q1 { --q-accent: var(--pri-alta); }
.matrix-quadrant.q2 { --q-accent: var(--cat-pessoal); }
.matrix-quadrant.q3 { --q-accent: var(--pri-media); }
.matrix-quadrant.q4 { --q-accent: var(--pri-baixa); }
.matrix-task-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow-y: auto;
  max-height: 200px;
}
.matrix-task-item {
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  background: var(--bg-glass);
  border-left: 3px solid var(--cat-color, var(--text-muted));
  color: var(--text-secondary);
  cursor: grab;
  transition: var(--transition);
  line-height: 1.3;
  -webkit-user-select: none;
  user-select: none;
}
.matrix-task-item:active { cursor: grabbing; }
.matrix-task-item.dragging { opacity: 0.4; transform: scale(0.95); }
.matrix-task-item:hover { background: var(--bg-glass); }
.matrix-task-item .matrix-task-badge {
  display: inline-block;
  font-size: 0.5rem;
  padding: 0.08rem 0.35rem;
  border-radius: 50px;
  background: rgba(0,117,222,0.1);
  color: var(--amber);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-left: 0.3rem;
  vertical-align: middle;
}
.matrix-task-meta {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.matrix-empty {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem 0;
  opacity: 0.6;
}
.matrix-quadrant.drag-over {
  border-color: var(--amber);
  background: rgba(0,117,222,0.05);
  box-shadow: 0 0 16px rgba(0,117,222,0.08);
}
.matrix-subtitle-info {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.matrix-subtitle-info svg { width: 14px; height: 14px; opacity: 0.5; }
.matrix-quadrant-count {
  font-size: 0.6rem;
  color: var(--q-accent);
  opacity: 0.7;
  margin-left: 0.3rem;
}
@media (max-width: 480px) {
  .matrix-grid { grid-template-columns: 1fr; }
  .matrix-quadrant { min-height: 80px; }
}

/* ================================================================
   TABLET (768px+)
   ================================================================ */
@media (min-width: 768px) {
  .calendar-scroll { flex-direction: row; flex-wrap: wrap; }
  .calendar-day { flex: 0 0 calc(33.333% - 0.4rem); }
  .stats-bar { justify-content: center; }
  .stat-card { min-width: 110px; }
  .detail-sheet { border-radius: calc(var(--radius) + 4px); max-height: 80vh; }
  .detail-overlay { align-items: center; }
  .search-container { display: block; max-width: 220px; }
}

/* ================================================================
   DESKTOP (1024px+)
   ================================================================ */
@media (min-width: 1024px) {
  .app {
    display: grid;
    grid-template-areas:
      "header header"
      "gamif  gamif"
      "sidebar main";
    grid-template-columns: 260px 1fr;
    grid-template-rows: auto auto 1fr;
    padding-bottom: 0;
  }

  .header {
    grid-area: header;
    padding: 1.25rem 2rem;
  }
  .header-date { display: inline; }
  .search-container { display: block; }

  .btn-add {
    width: auto; height: auto;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    gap: 0.5rem;
  }
  .btn-add-text { display: inline; font-size: 0.82rem; font-weight: 600; }
  .btn-add:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(0,117,222,0.18); }

  /* Hide mobile-only bars on desktop */
  .stats-bar { display: none; }
  #scopeToggleMobile { display: none; }
  .gamification-bar { grid-area: gamif; }
  .filter-bar { display: none; }

  /* Sidebar visible on desktop */
  .sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 1.25rem;
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
  }

  .sidebar .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .sidebar .stat-card { min-width: auto; }

  .sidebar-section h3 {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    font-weight: 500;
  }

  .category-list, .priority-filters {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
  }
  .category-item:hover { background: var(--bg-glass); border-color: var(--border-subtle); }
  .category-item.active { background: var(--bg-glass); border-color: var(--border-hover); }

  .category-item-left { display: flex; align-items: center; gap: 0.5rem; }
  .category-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
  .category-item span { font-size: 0.82rem; color: var(--text-secondary); }
  .category-item.active span { color: var(--text-primary); }
  .category-count {
    font-size: 0.7rem; color: var(--text-muted);
    background: var(--bg-glass);
    padding: 0.1rem 0.45rem;
    border-radius: 50px;
    font-weight: 500;
  }

  .priority-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.82rem;
    color: var(--text-secondary);
    border: 1px solid transparent;
  }
  .priority-item:hover { background: var(--bg-glass); border-color: var(--border-subtle); }
  .priority-item.active { background: var(--bg-glass); border-color: var(--border-hover); color: var(--text-primary); }
  .priority-badge { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

  /* Bottom nav hidden on desktop */
  .bottom-nav { display: none; }

  .main { grid-area: main; padding: 1.5rem 2rem; min-height: 0; }

  /* Modal centered on desktop */
  .modal-overlay { align-items: center; }
  .modal {
    border-radius: calc(var(--radius) + 4px);
    max-height: 80vh;
    padding: 2rem;
  }

  /* Task hover effects */
  .task-card { cursor: pointer; }
  .task-card:hover { border-color: var(--border-hover); transform: translateX(2px); }
  .task-card:hover::before { opacity: 1; width: 4px; }

  /* Calendar grid on desktop */
  .calendar-scroll { flex-direction: row; flex-wrap: nowrap; }
  .calendar-day { flex: 1; min-height: 180px; }

  .task-actions { opacity: 0; transition: var(--transition); }
  .task-card:hover .task-actions { opacity: 1; }
}

/* ================================================================
   LARGE DESKTOP (1280px+)
   ================================================================ */
@media (min-width: 1280px) {
  .app { grid-template-columns: 280px 1fr; }
  .header { padding: 1.5rem 2.5rem; }
  .logo { font-size: 1.8rem; }
  .main { padding: 2rem 2.5rem; }
  .sidebar { padding: 2rem 1.5rem; gap: 2rem; }
}

/* ========== TIMELINE ========== */
.timeline { position: relative; padding-left: 3rem; margin: 1rem 0; }
.timeline::before { content: ''; position: absolute; left: 1.2rem; top: 0; bottom: 0; width: 2px; background: var(--border-subtle); }
.timeline-item { position: relative; margin-bottom: 1rem; padding: 0.8rem 1rem; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); border-left: 3px solid var(--cat-color, var(--text-muted)); cursor: pointer; transition: var(--transition); }
.timeline-item:hover { border-color: var(--border-hover); transform: translateX(4px); }
.timeline-item::before { content: ''; position: absolute; left: -2.05rem; top: 1rem; width: 10px; height: 10px; border-radius: 50%; background: var(--cat-color, var(--text-secondary)); border: 2px solid var(--bg-deep); }
.timeline-time { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; position: absolute; left: -4.5rem; top: 0.8rem; width: 3rem; text-align: right; }
.timeline-title { font-weight: 500; color: var(--text-primary); margin-bottom: 0.25rem; }
.timeline-meta { font-size: 0.75rem; color: var(--text-secondary); display: flex; gap: 0.5rem; flex-wrap: wrap; }
.timeline-now { position: relative; margin: 0.5rem 0; padding: 0.25rem 0.5rem; font-size: 0.7rem; color: var(--amber); }
.timeline-now::before { content: ''; position: absolute; left: -2rem; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); transform: translateY(-50%); }
.timeline-now::after { content: ''; position: absolute; left: -1.4rem; top: 50%; width: calc(100% + 1.4rem); height: 1px; background: var(--amber); opacity: 0.3; }
.today-view-toggle { display: flex; gap: 0.3rem; margin-left: auto; }
.today-view-toggle button { padding: 0.25rem 0.6rem; background: var(--bg-glass); border: 1px solid var(--border-subtle); border-radius: 50px; color: var(--text-muted); font-family: inherit; font-size: 0.7rem; cursor: pointer; transition: var(--transition); }
.today-view-toggle button.active { color: var(--text-primary); background: var(--bg-glass); border-color: var(--border-hover); }

/* ========== QUICK STATUS TOGGLE (3 states) ========== */
.task-card.in-progress { border-left-color: var(--pri-media); }
.task-card.in-progress .task-check { background: rgba(245,158,11,0.2); border-color: var(--pri-media); }
.task-card.in-progress .task-check::after { content: '\25B6'; font-size: 0.5rem; color: var(--pri-media); }
.status-indicator { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 1rem; }
.status-indicator.pendente { background: rgba(239,68,68,0.1); color: var(--pri-alta); }
.status-indicator.em_andamento { background: rgba(245,158,11,0.1); color: var(--pri-media); }
.status-indicator.concluida { background: rgba(0,117,222,0.08); color: var(--amber); }

/* ========== BULK ACTIONS ========== */
.bulk-bar { position: fixed; top: auto; bottom: calc(5rem + var(--safe-bottom) + 10px); left: 50%; transform: translateX(-50%) translateY(200%); opacity: 0; pointer-events: none; background: var(--bg-surface); border: 1px solid var(--border-hover); border-radius: 2rem; padding: 0.4rem 0.7rem; display: flex; align-items: center; gap: 0.5rem; z-index: 90; transition: var(--transition); box-shadow: 0 8px 32px rgba(0,0,0,0.4); max-width: 95vw; }
.bulk-bar.active { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.bulk-bar .bulk-count { font-size: 0.75rem; color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.bulk-bar button { background: none; border: 1px solid var(--border-subtle); color: var(--text-primary); padding: 0.35rem 0.6rem; border-radius: 1rem; cursor: pointer; font-size: 0.72rem; transition: var(--transition); font-family: inherit; white-space: nowrap; }
.bulk-bar button:hover { background: var(--bg-glass); border-color: var(--border-hover); }
.bulk-bar button.danger { border-color: rgba(239,68,68,0.3); color: var(--pri-alta); }
.bulk-bar button.danger:hover { background: rgba(239,68,68,0.1); }
/* Bulk select toggle button */
.bulk-toggle-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; padding: 0.35rem 0.7rem; background: var(--bg-glass); border: 1px solid var(--border-subtle); border-radius: 50px; color: var(--text-muted); font-family: inherit; font-size: 0.7rem; cursor: pointer; transition: var(--transition); flex-shrink: 0; white-space: nowrap; }
.bulk-toggle-btn:hover { border-color: var(--border-hover); color: var(--text-secondary); }
.bulk-toggle-btn.active { background: rgba(0,117,222,0.1); border-color: var(--amber); color: var(--amber); }

/* ========== SORT DROPDOWN ========== */
.sort-dropdown { position: relative; flex-shrink: 0; }
.sort-btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.35rem 0.7rem; background: var(--bg-glass); border: 1px solid var(--border-subtle); border-radius: 50px; color: var(--text-muted); font-family: inherit; font-size: 0.7rem; cursor: pointer; transition: var(--transition); white-space: nowrap; }
.sort-btn:hover { border-color: var(--border-hover); color: var(--text-secondary); }
.sort-btn svg { flex-shrink: 0; }
.sort-menu { display: none; position: absolute; top: calc(100% + 0.4rem); right: 0; min-width: 11rem; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 0.75rem; padding: 0.35rem; z-index: 100; box-shadow: 0 8px 32px rgba(0,0,0,0.35); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.sort-menu.open { display: block; animation: fadeSlideDown 0.15s ease; }
@keyframes fadeSlideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.sort-option { padding: 0.5rem 0.65rem; border-radius: 0.5rem; font-size: 0.78rem; color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.sort-option:hover { background: var(--bg-glass); color: var(--text-primary); }
.sort-option.active { background: rgba(0,117,222,0.08); color: var(--amber); font-weight: 500; }
@media (max-width: 480px) { .sort-btn #sortLabel { display: none; } .sort-btn { padding: 0.35rem 0.5rem; } }

/* ========== SCOPE TOGGLE (semana/tudo) ========== */
.scope-toggle { display: flex; gap: 0.2rem; background: var(--bg-deep); border: 1px solid var(--border-subtle); border-radius: 50px; padding: 3px; margin-bottom: 0.5rem; }
.scope-btn { flex: 1; padding: 0.35rem 0.6rem; background: none; border: none; border-radius: 50px; color: var(--text-muted); font-family: inherit; font-size: 0.72rem; font-weight: 500; cursor: pointer; transition: var(--transition); white-space: nowrap; text-align: center; }
.scope-btn:hover { color: var(--text-secondary); }
.scope-btn.active { background: var(--accent); color: #ffffff; }

/* ========== CONFIRM DIALOG (data diferente) ========== */
.confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: var(--transition); }
.confirm-overlay.active { opacity: 1; pointer-events: all; }
.confirm-dialog { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 1.5rem; width: 90%; max-width: 380px; text-align: center; transform: scale(0.9); transition: var(--transition); }
.confirm-overlay.active .confirm-dialog { transform: scale(1); }
.confirm-icon { font-size: 2.2rem; margin-bottom: 0.6rem; }
.confirm-title { font-family: 'Inter', sans-serif; font-size: 1.15rem; color: var(--text-primary); margin-bottom: 0.4rem; }
.confirm-msg { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 1.2rem; }
.confirm-msg strong { color: var(--amber); }
.confirm-actions { display: flex; gap: 0.6rem; }
.confirm-actions button { flex: 1; padding: 0.6rem; border-radius: 0.6rem; font-family: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: var(--transition); border: 1px solid var(--border-subtle); }
.confirm-btn-cancel { background: var(--bg-glass); color: var(--text-secondary); }
.confirm-btn-cancel:hover { border-color: var(--border-hover); }
.confirm-btn-ok { background: var(--accent); color: #ffffff; border-color: var(--accent); }
.confirm-btn-ok:hover { filter: brightness(1.1); }
.task-card.selected { background: rgba(0,117,222,0.06); border-color: rgba(0,117,222,0.2); }
.task-card .bulk-check { display: none; width: 18px; height: 18px; border: 2px solid var(--border-subtle); border-radius: 4px; margin-right: 0.5rem; flex-shrink: 0; cursor: pointer; align-items: center; justify-content: center; }
.bulk-mode .task-card .bulk-check { display: flex; }
.task-card.selected .bulk-check { background: var(--amber); border-color: var(--amber); }
.task-card.selected .bulk-check::after { content: '\2713'; color: white; font-size: 0.7rem; }

/* ========== REVIEW VIEW ========== */
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 1rem 0; }
.review-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 1rem; }
.review-card h3 { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.review-big-number { font-size: 2rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.review-bar { height: 6px; border-radius: 3px; background: var(--bg-glass); margin-top: 0.5rem; overflow: hidden; }
.review-bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.review-category-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border-subtle); }
.review-category-row:last-child { border-bottom: none; }
.review-category-name { flex: 1; font-size: 0.85rem; color: var(--text-primary); }
.review-category-bar { flex: 2; }
.review-category-count { font-size: 0.8rem; color: var(--text-secondary); min-width: 3rem; text-align: right; }
.heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin: 0.5rem 0; }
.heatmap-cell { aspect-ratio: 1; border-radius: 3px; background: var(--bg-glass); position: relative; }
.heatmap-cell.level-1 { background: rgba(0,117,222,0.1); }
.heatmap-cell.level-2 { background: rgba(0,117,222,0.2); }
.heatmap-cell.level-3 { background: rgba(0,117,222,0.4); }
.heatmap-cell.level-4 { background: rgba(0,117,222,0.6); }
.heatmap-label { font-size: 0.6rem; color: var(--text-muted); text-align: center; }
@media (max-width: 768px) { .review-grid { grid-template-columns: 1fr; } }

/* ========== DARK/LIGHT MODE ========== */
/* Light e o padrao — ver :root acima */
/* Dark mode e a alternativa */
.dark-mode {
  --bg-deep: #191918;
  --bg-surface: #222221;
  --bg-card: #2a2a29;
  --bg-glass: rgba(255, 255, 255, 0.05);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.35);
  --shadow-card: rgba(0,0,0,0.2) 0px 4px 18px, rgba(0,0,0,0.15) 0px 2px 8px;
  --shadow-deep: rgba(0,0,0,0.3) 0px 8px 30px, rgba(0,0,0,0.2) 0px 4px 15px;
}
.dark-mode .header { background: rgba(25,25,24,0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.dark-mode .bottom-nav { background: rgba(25,25,24,0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }

.theme-toggle { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; transition: var(--transition); }
.theme-toggle:hover { border-color: var(--border-hover); }

/* ========== GAMIFICATION ========== */
.gamification-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}
.gamification-bar::-webkit-scrollbar { display: none; }

.progress-ring-container { position: relative; flex-shrink: 0; width: 48px; height: 48px; }
.progress-ring { transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 4; }
.progress-ring .ring-bg { stroke: var(--bg-glass); }
.progress-ring .ring-fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.progress-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 600; color: var(--text-primary); }

.streak-badge {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  background: rgba(0,117,222,0.08);
  border: 1px solid rgba(0,117,222,0.15);
  border-radius: 50px;
  font-size: 0.72rem; color: var(--amber);
  white-space: nowrap; flex-shrink: 0;
}
.streak-badge .streak-fire { font-size: 0.85rem; }
.streak-badge .streak-num { font-weight: 700; }

.xp-bar-container { flex: 1; min-width: 80px; }
.xp-bar-label { font-size: 0.6rem; color: var(--text-muted); margin-bottom: 0.2rem; display: flex; justify-content: space-between; }
.xp-bar { height: 6px; border-radius: 3px; background: var(--bg-glass); overflow: hidden; }
.xp-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-light)); transition: width 0.8s ease; }

.level-badge {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.3rem 0.6rem;
  background: rgba(0,117,222,0.08);
  border: 1px solid rgba(0,117,222,0.15);
  border-radius: var(--radius-sm);
  flex-shrink: 0; white-space: nowrap;
}
.level-badge-num { font-family: 'Inter', sans-serif; font-size: 1.1rem; line-height: 1; color: var(--amber); }
.level-badge-title { font-size: 0.55rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

.xp-popup {
  position: fixed; z-index: 200;
  padding: 0.4rem 0.8rem;
  background: rgba(0,117,222,0.9);
  color: white; font-size: 0.8rem; font-weight: 600;
  border-radius: 50px;
  pointer-events: none;
  animation: xpPopAnim 1.5s ease forwards;
}
@keyframes xpPopAnim {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  70% { opacity: 1; transform: translateY(-40px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.8); }
}

/* ========== DRAG & DROP ========== */
.task-card.dragging, .calendar-task.dragging { opacity: 0.5; transform: scale(0.95); }
.task-card.drag-over { border-color: var(--amber); box-shadow: 0 0 12px rgba(0,117,222,0.15); }
.status-tab.drag-over { background: rgba(0,117,222,0.1); color: var(--text-primary); }
.calendar-day.drag-over { border-color: var(--amber); background: rgba(0,117,222,0.05); box-shadow: 0 0 16px rgba(0,117,222,0.08); }

/* ========== WEEK HISTORY ========== */
.history-nav {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem;
}
.history-nav button {
  background: var(--bg-glass); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition); font-size: 0.9rem;
}
.history-nav button:hover { border-color: var(--border-hover); color: var(--text-primary); }
.history-nav-label { font-size: 0.85rem; color: var(--text-primary); flex: 1; text-align: center; }

.week-annotation {
  width: 100%; min-height: 60px; padding: 0.65rem 0.85rem;
  background: var(--bg-glass); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: inherit; font-size: 14px; resize: vertical;
  transition: var(--transition); outline: none; margin-bottom: 0.75rem;
}
.week-annotation:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(0,117,222,0.08); }
.week-annotation::placeholder { color: var(--text-muted); }

.history-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 0.85rem; margin-bottom: 0.5rem;
  cursor: pointer; transition: var(--transition);
}
.history-card:hover { border-color: var(--border-hover); }
.history-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.3rem; }
.history-card-period { font-size: 0.82rem; color: var(--text-primary); font-weight: 500; }
.history-card-rate { font-size: 0.75rem; font-weight: 600; }
.history-card-note { font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.3rem; }

.btn-save-week {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  border: none; border-radius: var(--radius-sm);
  color: white; font-family: inherit; font-size: 0.78rem; font-weight: 500;
  cursor: pointer; transition: var(--transition); margin-bottom: 0.75rem;
}
.btn-save-week:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,117,222,0.18); }

/* ========== HABITS & SUBCATEGORIES ========== */
.subcategory-badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.58rem; padding: 0.1rem 0.45rem;
  background: rgba(26,174,57,0.08); color: var(--cat-pessoal);
  border-radius: 50px; font-weight: 500; white-space: nowrap;
}
.habit-indicator {
  display: inline-flex; align-items: center; gap: 0.15rem;
  font-size: 0.6rem; color: var(--text-secondary);
}
.routine-badge {
  display: inline-flex; align-items: center; gap: 0.15rem;
  font-size: 0.58rem; padding: 0.1rem 0.4rem;
  background: rgba(42,157,153,0.08); color: var(--cat-consultoria);
  border-radius: 50px;
}
.subcategory-chips {
  display: flex; gap: 0.3rem; padding: 0.3rem 0; flex-wrap: wrap;
}
.subcategory-chip {
  padding: 0.25rem 0.6rem; background: var(--bg-glass);
  border: 1px solid var(--border-subtle); border-radius: 50px;
  font-size: 0.68rem; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
}
.subcategory-chip.active { background: rgba(0,117,222,0.08); border-color: rgba(0,117,222,0.2); color: var(--amber); }

.habit-grid {
  display: grid; grid-template-columns: auto repeat(7, 1fr);
  gap: 3px; margin: 0.75rem 0; align-items: center;
}
.habit-grid-label { font-size: 0.6rem; color: var(--text-muted); text-align: right; padding-right: 0.4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; }
.habit-grid-cell {
  aspect-ratio: 1; border-radius: 3px;
  background: var(--bg-glass);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.55rem;
}
.habit-grid-cell.completed { background: rgba(0,117,222,0.25); color: var(--amber); }
.habit-grid-cell.partial { background: rgba(245,158,11,0.2); }
.habit-grid-day-label { font-size: 0.55rem; color: var(--text-muted); text-align: center; }

.form-group.conditional-field { display: none; }
.form-group.conditional-field.visible { display: block; }

/* ========== BEAM EFFECT ========== */
@keyframes beamFall {
  0% { transform: translateY(-100%); opacity: 0; }
  5% { opacity: 0.8; }
  95% { opacity: 0.8; }
  100% { transform: translateY(400%); opacity: 0; }
}

.beam-container {
  display: none;
  pointer-events: none;
}
.beam-container .beam {
  position: absolute;
  top: 0;
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, rgba(0,117,222,0.1), transparent);
  animation: beamFall linear infinite;
}
.beam-container .beam:nth-child(1) { left: 15%; animation-duration: 12s; animation-delay: 0s; }
.beam-container .beam:nth-child(2) { left: 35%; animation-duration: 16s; animation-delay: 3s; }
.beam-container .beam:nth-child(3) { left: 55%; animation-duration: 14s; animation-delay: 6s; }
.beam-container .beam:nth-child(4) { left: 75%; animation-duration: 18s; animation-delay: 1s; }
.beam-container .beam:nth-child(5) { left: 90%; animation-duration: 15s; animation-delay: 8s; }

/* ========== FADE UP ANIMATION ========== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-card { animation: fadeUp 0.5s ease backwards; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }

.calendar-day { animation: fadeUp 0.5s ease backwards; }
.calendar-day:nth-child(1) { animation-delay: 0.05s; }
.calendar-day:nth-child(2) { animation-delay: 0.1s; }
.calendar-day:nth-child(3) { animation-delay: 0.15s; }
.calendar-day:nth-child(4) { animation-delay: 0.2s; }
.calendar-day:nth-child(5) { animation-delay: 0.25s; }
.calendar-day:nth-child(6) { animation-delay: 0.3s; }
.calendar-day:nth-child(7) { animation-delay: 0.35s; }

/* ========== GOLD LINE ON HOVER ========== */
.task-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.task-card:hover::after { opacity: 0.6; }

/* ========== LABEL/BADGE REFINEMENTS ========== */
.task-category-badge {
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.55rem;
}
.stat-label {
  letter-spacing: 0.12em;
}
.detail-field-label {
  letter-spacing: 0.12em;
}

/* ========== ENERGY MAPPING WIDGET ========== */
.energy-section { margin-bottom: 0.75rem; }
.energy-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.4rem; padding: 0 0.1rem; }
.energy-title { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); }
.energy-hint { font-size: 0.6rem; color: var(--text-muted); font-style: italic; }
.energy-logger { display: flex; gap: 0.5rem; }
.energy-period {
  flex: 1; padding: 0.6rem 0.4rem; background: var(--bg-card);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  text-align: center;
}
.energy-period-label {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--text-muted); margin-bottom: 0.4rem; font-weight: 500;
}
.energy-dots { display: flex; justify-content: center; gap: 0.3rem; }
.energy-dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border-hover); background: transparent;
  cursor: pointer; transition: var(--transition); font-size: 0;
}
.energy-dot:hover { border-color: var(--amber); transform: scale(1.15); }
.energy-dot.active { background: var(--amber); border-color: var(--amber); }
.energy-dot.active ~ .energy-dot { background: transparent; border-color: var(--border-hover); }
.energy-period[data-nivel="1"] .energy-dot.active { background: var(--pri-alta); border-color: var(--pri-alta); }
.energy-period[data-nivel="2"] .energy-dot.active { background: hsl(25, 60%, 50%); border-color: hsl(25, 60%, 50%); }
.energy-period[data-nivel="3"] .energy-dot.active { background: var(--pri-media); border-color: var(--pri-media); }
.energy-period[data-nivel="4"] .energy-dot.active { background: hsl(120, 45%, 45%); border-color: hsl(120, 45%, 45%); }
.energy-period[data-nivel="5"] .energy-dot.active { background: hsl(150, 60%, 42%); border-color: hsl(150, 60%, 42%); }
.energy-period.current-period { border-color: rgba(0,117,222,0.2); box-shadow: 0 0 12px rgba(0,117,222,0.05); }
.energy-level-label { font-size: 0.55rem; color: var(--text-muted); margin-top: 0.3rem; min-height: 0.8rem; transition: var(--transition); }
.energy-period[data-nivel="0"] .energy-level-label { font-style: italic; opacity: 0.5; }
.energy-period[data-nivel="1"] .energy-level-label { color: var(--pri-alta); }
.energy-period[data-nivel="2"] .energy-level-label { color: hsl(25, 60%, 50%); }
.energy-period[data-nivel="3"] .energy-level-label { color: var(--pri-media); }
.energy-period[data-nivel="4"] .energy-level-label { color: hsl(120, 45%, 45%); }
.energy-period[data-nivel="5"] .energy-level-label { color: hsl(150, 60%, 42%); }

/* ========== AI COACHING CARD ========== */
.coaching-card {
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-card));
  border: 1px solid rgba(0,117,222,0.15);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  animation: fadeUp 0.5s ease backwards;
  animation-delay: 0.2s;
}
.coaching-header {
  display: flex; align-items: center; gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.coaching-icon { font-size: 1rem; }
.coaching-label {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--amber); font-weight: 500;
}
.coaching-dismiss {
  margin-left: auto; background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 0.8rem;
  padding: 0.2rem; transition: var(--transition);
}
.coaching-dismiss:hover { color: var(--text-primary); }
.coaching-text {
  font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5;
}
.coaching-text strong { color: var(--amber); font-weight: 500; }

/* ========== SUBTASK PROGRESS (task card) ========== */
.subtask-progress {
  display: flex; align-items: center; gap: 0.4rem;
  margin-top: 0.3rem;
}
.subtask-bar {
  flex: 1; height: 3px; background: var(--border-subtle);
  border-radius: 2px; overflow: hidden;
}
.subtask-bar-fill {
  height: 100%; background: var(--amber);
  border-radius: 2px; transition: width 0.4s ease;
}
.subtask-count { font-size: 0.6rem; color: var(--text-muted); }

/* ========== SUBTASK CHECKLIST (detail overlay) ========== */
.detail-subtasks { margin-bottom: 1rem; }
.detail-subtasks-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.5rem;
}
.detail-subtasks-title {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted);
}
.detail-subtask-add {
  background: none; border: none; color: var(--amber);
  font-size: 0.75rem; cursor: pointer; padding: 0.2rem 0.4rem;
  transition: var(--transition);
}
.detail-subtask-add:hover { color: var(--amber-dark); }
.subtask-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0; border-bottom: 1px solid var(--border-subtle);
}
.subtask-item:last-child { border-bottom: none; }
.subtask-check {
  width: 18px; height: 18px; border-radius: 4px;
  border: 2px solid var(--border-hover); display: flex;
  align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.subtask-check.done { background: var(--amber); border-color: var(--amber); }
.subtask-check.done::after { content: '\2713'; color: var(--navy); font-size: 0.6rem; font-weight: 700; }
.subtask-text { font-size: 0.8rem; color: var(--text-secondary); flex: 1; }
.subtask-item.done .subtask-text { text-decoration: line-through; color: var(--text-muted); }
.subtask-delete {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.7rem; opacity: 0; transition: var(--transition);
  padding: 0.2rem;
}
.subtask-item:hover .subtask-delete { opacity: 1; }
.subtask-delete:hover { color: var(--pri-alta); }
.subtask-input {
  width: 100%; padding: 0.4rem 0.5rem; background: var(--bg-glass);
  border: 1px solid var(--border-subtle); border-radius: 6px;
  color: var(--text-primary); font-family: inherit; font-size: 0.8rem;
  outline: none; margin-top: 0.3rem;
}
.subtask-input:focus { border-color: var(--amber); }

/* ========== ATTACHMENTS (detail overlay) ========== */
.detail-attachments { margin-bottom: 1rem; }
.detail-attachments-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.5rem;
}
.detail-attachments-title {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted);
}
.attachment-item {
  display: flex; align-items: flex-start; gap: 0.5rem;
  padding: 0.5rem; background: var(--bg-glass);
  border: 1px solid var(--border-subtle); border-radius: 6px;
  margin-bottom: 0.3rem; cursor: pointer; transition: var(--transition);
}
.attachment-item:hover { border-color: var(--border-hover); }
.attachment-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.1rem; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-title { font-size: 0.75rem; color: var(--text-primary); font-weight: 500; }
.attachment-preview {
  font-size: 0.68rem; color: var(--text-muted); margin-top: 0.1rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.attachment-date { font-size: 0.6rem; color: var(--text-muted); }
.attachment-delete {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 0.7rem; opacity: 0; transition: var(--transition); padding: 0.2rem;
}
.attachment-item:hover .attachment-delete { opacity: 1; }
.attachment-delete:hover { color: var(--pri-alta); }
.attachment-add-btn {
  background: none; border: none; color: var(--amber);
  font-size: 0.75rem; cursor: pointer; padding: 0.2rem 0.4rem;
  transition: var(--transition);
}
.attachment-add-btn:hover { color: var(--amber-dark); }
.attachment-input-area { display: none; margin-top: 0.3rem; }
.attachment-input-area.visible { display: block; }
.attachment-title-input, .attachment-content-input {
  width: 100%; padding: 0.4rem 0.5rem; background: var(--bg-glass);
  border: 1px solid var(--border-subtle); border-radius: 6px;
  color: var(--text-primary); font-family: inherit; font-size: 0.8rem;
  outline: none; margin-bottom: 0.3rem;
}
.attachment-content-input { min-height: 80px; resize: vertical; }
.attachment-save-btn {
  padding: 0.3rem 0.8rem; background: var(--amber); color: #ffffff;
  border: none; border-radius: 50px; font-family: inherit;
  font-size: 0.72rem; font-weight: 600; cursor: pointer;
}
.attachment-save-btn:hover { opacity: 0.9; }
.attachment-type-selector {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.att-type-btn {
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition);
}
.att-type-btn.active {
  border-color: var(--amber);
  background: rgba(0,117,222,0.1);
  color: var(--amber);
}
.att-type-btn:hover { border-color: var(--border-hover); }
.attachment-file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.attachment-file-drop:hover, .attachment-file-drop.dragover {
  border-color: var(--amber);
  background: rgba(0,117,222,0.06);
}
.attachment-file-drop.file-loaded {
  border-color: var(--cat-pessoal);
  border-style: solid;
}
.file-drop-icon { font-size: 1.5rem; }
.file-drop-text { font-size: 0.75rem; color: var(--text-secondary); }
.file-drop-hint { font-size: 0.65rem; color: var(--text-muted); }
.attachment-input-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.3rem;
}
.attachment-cancel-btn {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}
.attachment-cancel-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.week-annotation-preview {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.week-annotation-preview:hover { border-color: var(--border-hover); }
.week-annotation-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}
.week-annotation-preview-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--amber);
  font-weight: 600;
}
.week-annotation-preview-action {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-decoration: underline;
}
.week-annotation-preview-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nav-annotation-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  margin-left: 3px;
  vertical-align: super;
}
.attachment-expanded {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.7); display: flex;
  align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.attachment-expanded-content {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); max-width: 600px; width: 90%;
  max-height: 80vh; overflow-y: auto; padding: 1.5rem;
}
.attachment-expanded-title {
  font-size: 1rem; font-weight: 600; color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.attachment-expanded-text {
  font-size: 0.85rem; color: var(--text-secondary);
  white-space: pre-wrap; line-height: 1.6;
}
.attachment-expanded-close {
  position: absolute; top: 1rem; right: 1rem;
  background: var(--bg-glass); border: 1px solid var(--border-subtle);
  color: var(--text-primary); width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}

/* ========== TIME BLOCKING VIEW ========== */
.timeblock-view { display: none; animation: fadeIn 0.4s ease; }
.timeblock-view.active { display: block; }

.timeblock-day-selector {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem;
}
.timeblock-day-btn {
  padding: 0.4rem 0.8rem; background: var(--bg-glass); border: 1px solid var(--border-subtle);
  border-radius: 50px; color: var(--text-secondary); font-family: inherit;
  font-size: 0.75rem; cursor: pointer; transition: var(--transition);
}
.timeblock-day-btn.active { background: rgba(0,117,222,0.1); border-color: var(--amber); color: var(--text-primary); }

.timeblock-container { display: flex; flex-direction: column; gap: 0.75rem; }

.timeblock-section {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 0.85rem; overflow: hidden;
}

.timeblock-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.6rem; padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
}
.timeblock-period-name {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--text-muted); font-weight: 500;
}
.timeblock-period-icon { font-size: 0.9rem; }
.timeblock-period-hours {
  font-size: 0.6rem; color: var(--text-muted);
  font-family: 'Inter', sans-serif;
}

.timeblock-tasks { display: flex; flex-direction: column; gap: 0.4rem; }

.timeblock-task {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.65rem; background: var(--bg-glass);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  border-left: 3px solid var(--cat-color);
  cursor: pointer; transition: var(--transition);
}
.timeblock-task:hover { border-color: var(--border-hover); }

.timeblock-task-time {
  font-size: 0.7rem; color: var(--amber); font-weight: 500;
  min-width: 40px; font-family: 'Inter', sans-serif;
}
.timeblock-task-title {
  font-size: 0.8rem; flex: 1; color: var(--text-secondary);
}
.timeblock-task-duration {
  font-size: 0.6rem; color: var(--text-muted); white-space: nowrap;
}
.timeblock-task.completed .timeblock-task-title {
  text-decoration: line-through; color: var(--text-muted);
}

.timeblock-empty {
  text-align: center; padding: 1rem; color: var(--text-muted);
  font-size: 0.75rem; font-style: italic;
}

.timeblock-free-slot {
  padding: 0.4rem 0.65rem; border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: 0.7rem; text-align: center; opacity: 0.5;
}

/* ========== KPIs DASHBOARD VIEW ========== */
.kpis-view { display: none; animation: fadeIn 0.4s ease; }
.kpis-view.active { display: block; }

/* ========== METAS 2026 VIEW ========== */
.metas-view { display: none; animation: fadeIn 0.4s ease; }
.metas-view.active { display: block; }

/* ========== FINANÇAS VIEW ========== */
.financas-view { display: none; animation: fadeIn 0.4s ease; }
.financas-view.active { display: block; }

.fin-header { text-align: center; margin-bottom: 1rem; }
.fin-header h2 { font-family: 'Inter', sans-serif; font-size: 1.4rem; color: var(--text-primary); margin-bottom: 0.15rem; }
.fin-header .fin-month { font-size: 0.78rem; color: var(--text-muted); }

.fin-saldo-card { background: linear-gradient(135deg, rgba(0,117,222,0.08), rgba(0,117,222,0.03)); border: 1px solid rgba(0,117,222,0.15); border-radius: var(--radius); padding: 1.2rem; text-align: center; margin-bottom: 1rem; }
.fin-saldo-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.fin-saldo-valor { font-family: 'Inter', sans-serif; font-size: 2rem; font-weight: 700; margin: 0.2rem 0; }
.fin-saldo-valor.positive { color: #2ECC71; }
.fin-saldo-valor.negative { color: var(--pri-alta); }
.fin-saldo-detail { display: flex; justify-content: center; gap: 2rem; margin-top: 0.5rem; }
.fin-saldo-detail span { font-size: 0.78rem; }
.fin-saldo-detail .receita { color: #2ECC71; }
.fin-saldo-detail .despesa { color: var(--pri-alta); }
.fin-disponivel { font-size: 0.72rem; color: var(--amber); margin-top: 0.4rem; }

.fin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1rem; }
@media (max-width: 480px) { .fin-grid { grid-template-columns: 1fr; } }

.fin-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 0.75rem; padding: 0.8rem; }
.fin-card h3 { font-family: 'Inter', sans-serif; font-size: 0.95rem; color: var(--text-primary); margin-bottom: 0.5rem; }

.fin-cat-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; font-size: 0.75rem; }
.fin-cat-bar { flex: 1; height: 6px; background: var(--bg-glass); border-radius: 3px; overflow: hidden; }
.fin-cat-bar-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.fin-cat-val { color: var(--text-secondary); min-width: 70px; text-align: right; font-size: 0.72rem; }
.fin-cat-name { min-width: 80px; color: var(--text-secondary); }

.fin-orc-item { margin-bottom: 0.6rem; }
.fin-orc-header { display: flex; justify-content: space-between; font-size: 0.75rem; margin-bottom: 0.2rem; }
.fin-orc-cat { color: var(--text-secondary); }
.fin-orc-val { font-weight: 600; }
.fin-orc-bar { height: 8px; background: var(--bg-glass); border-radius: 4px; overflow: hidden; }
.fin-orc-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }

.fin-transacoes { margin-bottom: 1rem; }
.fin-transacao { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border-subtle); }
.fin-transacao:last-child { border-bottom: none; }
.fin-transacao-icon { font-size: 1rem; flex-shrink: 0; }
.fin-transacao-info { flex: 1; }
.fin-transacao-desc { font-size: 0.78rem; color: var(--text-primary); }
.fin-transacao-meta { font-size: 0.65rem; color: var(--text-muted); }
.fin-transacao-valor { font-weight: 600; font-size: 0.82rem; }
.fin-transacao-valor.receita { color: #2ECC71; }
.fin-transacao-valor.despesa { color: var(--pri-alta); }

.fin-empty { text-align: center; padding: 2rem 1rem; color: var(--text-muted); font-size: 0.85rem; }
.fin-empty p { margin-top: 0.5rem; font-size: 0.75rem; }

.metas-header { text-align: center; margin-bottom: 1.2rem; }
.metas-header h2 { font-family: 'Inter', sans-serif; font-size: 1.4rem; color: var(--text-primary); margin-bottom: 0.2rem; }
.metas-narrative { font-size: 0.8rem; color: var(--amber); font-style: italic; margin-bottom: 0.6rem; }
.metas-quarter-nav { display: flex; align-items: center; justify-content: center; gap: 0.6rem; margin-bottom: 0.3rem; }
.metas-quarter-nav button { background: var(--bg-glass); border: 1px solid var(--border-subtle); border-radius: 50px; padding: 0.3rem 0.8rem; color: var(--text-muted); font-family: inherit; font-size: 0.72rem; cursor: pointer; transition: var(--transition); }
.metas-quarter-nav button.active { background: var(--amber); color: #ffffff; border-color: var(--amber); }
.metas-quarter-nav button:hover:not(.active) { border-color: var(--border-hover); color: var(--text-secondary); }

.metas-progress-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.metas-pilar-mini { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 0.75rem; padding: 0.6rem; text-align: center; cursor: pointer; transition: var(--transition); }
.metas-pilar-mini:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.metas-pilar-mini .pilar-icon { font-size: 1.3rem; margin-bottom: 0.2rem; }
.metas-pilar-mini .pilar-name { font-size: 0.65rem; color: var(--text-muted); margin-bottom: 0.35rem; display: block; }
.metas-pilar-mini .pilar-pct { font-family: 'Inter', sans-serif; font-size: 1.2rem; font-weight: 700; }
.metas-pilar-mini .pilar-bar { height: 4px; border-radius: 2px; background: var(--bg-glass); margin-top: 0.35rem; overflow: hidden; }
.metas-pilar-mini .pilar-bar-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }

.metas-insights { background: linear-gradient(135deg, rgba(0,117,222,0.06), rgba(0,117,222,0.02)); border: 1px solid rgba(0,117,222,0.15); border-radius: 0.75rem; padding: 0.8rem 1rem; margin-bottom: 1rem; }
.metas-insights h3 { font-family: 'Inter', sans-serif; font-size: 0.95rem; color: var(--amber); margin-bottom: 0.4rem; }
.metas-insight-item { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6; padding: 0.15rem 0; }

.metas-pilar-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.8rem; transition: var(--transition); }
.metas-pilar-card:hover { border-color: var(--border-hover); }
.metas-pilar-card-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.metas-pilar-card-header .pilar-icon { font-size: 1.5rem; }
.metas-pilar-card-header .pilar-title { font-family: 'Inter', sans-serif; font-size: 1.1rem; color: var(--text-primary); flex: 1; }
.metas-pilar-card-header .pilar-pct-big { font-family: 'Inter', sans-serif; font-size: 1.3rem; font-weight: 700; }
.metas-bar-full { height: 6px; border-radius: 3px; background: var(--bg-glass); margin-bottom: 0.8rem; overflow: hidden; }
.metas-bar-full .bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }

.metas-goal { padding: 0.6rem 0; border-bottom: 1px solid var(--border-subtle); }
.metas-goal:last-child { border-bottom: none; }
.metas-goal-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.25rem; }
.metas-goal-desc { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.metas-actions-list { list-style: none; padding: 0; margin: 0; }
.metas-actions-list li { font-size: 0.75rem; color: var(--text-secondary); padding: 0.2rem 0; padding-left: 1.2rem; position: relative; }
.metas-actions-list li::before { content: ''; position: absolute; left: 0; top: 0.55rem; width: 10px; height: 10px; border: 1.5px solid var(--text-muted); border-radius: 3px; }
.metas-actions-list li.done { color: var(--text-muted); text-decoration: line-through; }
.metas-actions-list li.done::before { background: var(--amber); border-color: var(--amber); }

.metas-related { margin-top: 0.5rem; padding: 0.5rem 0.6rem; background: var(--bg-glass); border-radius: 0.5rem; }
.metas-related-title { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.3rem; }
.metas-related-item { font-size: 0.72rem; color: var(--text-secondary); padding: 0.15rem 0; }
.metas-related-item .done-badge { color: var(--amber); font-weight: 600; }
.metas-related-item .pending-badge { color: var(--text-muted); }

.metas-dormant { background: hsla(0,70%,50%,0.08); border: 1px solid hsla(0,70%,50%,0.2); border-radius: 0.75rem; padding: 0.6rem 0.8rem; margin-top: 0.8rem; }
.metas-dormant h4 { font-size: 0.8rem; color: var(--pri-alta); margin-bottom: 0.3rem; }
.metas-dormant p { font-size: 0.75rem; color: var(--text-secondary); }

@media (max-width: 480px) {
  .metas-progress-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ========== METAS AI COACHING ========== */
.metas-ai-section { margin-bottom: 1rem; }
.metas-ai-btn { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; padding: 0.7rem; background: linear-gradient(135deg, rgba(0,117,222,0.1), rgba(0,117,222,0.04)); border: 1px solid rgba(0,117,222,0.2); border-radius: 0.75rem; color: var(--amber); font-family: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.metas-ai-btn:hover { background: linear-gradient(135deg, rgba(0,117,222,0.18), rgba(0,117,222,0.08)); transform: translateY(-1px); }
.metas-ai-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.metas-ai-btn .spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(0,117,222,0.2); border-top-color: var(--amber); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.metas-ai-result { background: linear-gradient(135deg, var(--bg-surface), var(--bg-card)); border: 1px solid rgba(0,117,222,0.18); border-radius: var(--radius); padding: 1rem 1.1rem; margin-top: 0.6rem; animation: fadeUp 0.5s ease; }
.metas-ai-result-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.7rem; }
.metas-ai-result-header span:first-child { font-size: 1.2rem; }
.metas-ai-result-header .ai-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--amber); font-weight: 600; }
.metas-ai-result-header .ai-date { margin-left: auto; font-size: 0.65rem; color: var(--text-muted); }
.metas-ai-body { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.7; }
.metas-ai-body strong { color: var(--amber); }
.metas-ai-body h4 { color: var(--text-primary); font-size: 0.88rem; margin: 0.8rem 0 0.3rem; font-family: 'Inter', sans-serif; }
.metas-ai-body ul { padding-left: 1.2rem; margin: 0.3rem 0; }
.metas-ai-body li { margin-bottom: 0.2rem; }
.metas-ai-body p { margin: 0.4rem 0; }

.metas-ai-key-setup { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 0.75rem; padding: 0.8rem; margin-top: 0.5rem; }
.metas-ai-key-setup label { font-size: 0.75rem; color: var(--text-muted); display: block; margin-bottom: 0.3rem; }
.metas-ai-key-setup input { width: 100%; padding: 0.45rem 0.6rem; background: var(--bg-glass); border: 1px solid var(--border-subtle); border-radius: 0.5rem; color: var(--text-primary); font-family: inherit; font-size: 0.78rem; box-sizing: border-box; }
.metas-ai-key-setup input:focus { outline: none; border-color: var(--amber); }
.metas-ai-key-setup .key-actions { display: flex; gap: 0.4rem; margin-top: 0.4rem; }
.metas-ai-key-setup .key-actions button { padding: 0.35rem 0.7rem; border-radius: 0.5rem; font-family: inherit; font-size: 0.72rem; cursor: pointer; border: 1px solid var(--border-subtle); transition: var(--transition); }
.metas-ai-key-save { background: var(--amber); color: #ffffff; border-color: var(--amber) !important; }
.metas-ai-key-cancel { background: var(--bg-glass); color: var(--text-secondary); }

.kpis-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.kpi-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 0.85rem;
  animation: fadeUp 0.5s ease backwards;
}
.kpi-card.full-width { grid-column: 1 / -1; }
.kpi-card-label {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--text-muted); margin-bottom: 0.4rem; font-weight: 500;
}
.kpi-card-value {
  font-family: 'Inter', sans-serif; font-size: 2rem;
  line-height: 1; color: var(--amber);
}
.kpi-card-subtitle { font-size: 0.7rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* Bar Chart */
.kpi-bar-chart {
  display: flex; align-items: flex-end; gap: 4px;
  height: 100px; padding-top: 0.5rem;
}
.kpi-bar-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.kpi-bar {
  width: 100%; min-height: 4px; border-radius: 3px 3px 0 0;
  background: linear-gradient(to top, var(--amber-dark), var(--amber));
  transition: height 0.6s ease;
}
.kpi-bar-label { font-size: 0.55rem; color: var(--text-muted); }
.kpi-bar-value { font-size: 0.6rem; color: var(--text-secondary); }

/* Donut Chart */
.kpi-donut-container { display: flex; align-items: center; gap: 1rem; }
.kpi-donut { width: 80px; height: 80px; }
.kpi-donut-legend { display: flex; flex-direction: column; gap: 0.3rem; }
.kpi-legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.7rem; color: var(--text-secondary); }
.kpi-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Sparkline */
.kpi-sparkline { width: 100%; height: 40px; margin-top: 0.3rem; }
.kpi-sparkline polyline { fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kpi-sparkline .sparkline-area { fill: url(#sparklineGrad); stroke: none; }

/* ========== PWA INSTALL BANNER ========== */
.pwa-install-banner {
  position: fixed;
  bottom: calc(70px + var(--safe-bottom) + 10px);
  left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-card));
  border: 1px solid rgba(0,117,222,0.2);
  border-radius: 50px;
  padding: 0.5rem 1rem;
  display: flex; align-items: center; gap: 0.5rem;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeUp 0.4s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.pwa-install-text { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; }
.pwa-install-btn {
  background: var(--amber); color: var(--navy); border: none;
  padding: 0.3rem 0.8rem; border-radius: 50px;
  font-family: inherit; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.pwa-install-btn:hover { background: var(--amber-dark); }
.pwa-install-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1rem; padding: 0.2rem; line-height: 1;
}

/* ========== CALENDAR EVENTS ========== */
.calendar-event {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: 0.72rem;
  background: var(--bg-glass);
  border-left: 3px solid var(--event-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.3;
  position: relative;
}
.calendar-event:hover { background: var(--bg-glass); }
.calendar-event.google { --event-color: hsl(142, 52%, 45%); }
.calendar-event.microsoft { --event-color: hsl(215, 70%, 55%); }

.event-badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.5rem; padding: 0.08rem 0.35rem;
  border-radius: 50px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap; vertical-align: middle; margin-left: 0.3rem;
}
.event-badge.google { background: hsla(142,52%,45%,0.15); color: hsl(142,52%,45%); }
.event-badge.microsoft { background: hsla(215,70%,55%,0.15); color: hsl(215,70%,55%); }

.event-time-range {
  font-size: 0.65rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.25rem;
}
.event-meeting-link {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.6rem; padding: 0.12rem 0.4rem;
  border-radius: 50px; text-decoration: none;
  transition: var(--transition); margin-top: 0.2rem;
}
.event-meeting-link.teams { background: hsla(215,70%,55%,0.15); color: hsl(215,70%,55%); }
.event-meeting-link.meet { background: hsla(142,52%,45%,0.15); color: hsl(142,52%,45%); }
.event-meeting-link.zoom { background: hsla(210,80%,55%,0.15); color: hsl(210,80%,55%); }
.event-meeting-link.generic { background: var(--bg-glass); color: var(--text-secondary); }
.event-meeting-link:hover { filter: brightness(1.2); }

/* Today view event card */
.today-event-card {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.75rem 0.85rem; background: var(--bg-card);
  border: 1px solid var(--border-subtle); border-radius: var(--radius);
  position: relative; animation: slideUp 0.35s ease backwards;
  transition: var(--transition); border-left: 3px solid var(--event-color);
}
.today-event-card.google { --event-color: hsl(142, 52%, 45%); }
.today-event-card.microsoft { --event-color: hsl(215, 70%, 55%); }

.today-event-time {
  font-family: 'Inter', sans-serif; font-size: 0.75rem;
  color: var(--amber); font-weight: 500; min-width: 85px;
}
.today-event-info { flex: 1; min-width: 0; }
.today-event-title { font-size: 0.88rem; font-weight: 400; margin-bottom: 0.2rem; }
.today-event-meta { font-size: 0.68rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

/* Time blocking event */
.timeblock-event {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.65rem; background: hsla(215,70%,55%,0.08);
  border: 1px solid hsla(215,70%,55%,0.15); border-radius: var(--radius-sm);
  border-left: 3px solid var(--event-color);
  opacity: 0.9;
}
.timeblock-event.google { --event-color: hsl(142, 52%, 45%); background: hsla(142,52%,45%,0.08); border-color: hsla(142,52%,45%,0.15); }
.timeblock-event.microsoft { --event-color: hsl(215, 70%, 55%); }
.timeblock-event-time { font-size: 0.7rem; color: var(--text-muted); min-width: 85px; }
.timeblock-event-title { font-size: 0.8rem; color: var(--text-secondary); flex: 1; }
.timeblock-event-badge { font-size: 0.5rem; padding: 0.08rem 0.3rem; border-radius: 50px; }

/* Integration status section */
.integrations-status {
  display: flex; gap: 0.4rem; margin-bottom: 0.75rem;
  padding: 0.5rem 0;
}
.integration-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.6rem; border-radius: 50px;
  font-size: 0.65rem; border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.integration-chip.connected { border-color: hsla(142,52%,45%,0.3); color: hsl(142,52%,45%); }
.integration-chip .integration-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
}
.integration-chip.connected .integration-dot { background: hsl(142,52%,45%); }

/* All-day events banner */
.allday-events-banner {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding: 0.5rem 0.65rem; margin-bottom: 0.5rem;
  background: rgba(0,117,222,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.allday-event-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.5rem; border-radius: 50px;
  font-size: 0.65rem; font-weight: 400;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.allday-event-chip.google { border-color: hsla(142,52%,45%,0.3); }
.allday-event-chip.microsoft { border-color: hsla(215,70%,55%,0.3); }

/* ========== HELP SYSTEM ========== */

/* Help tooltip "?" buttons */
.help-tooltip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  border: none;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  line-height: 1;
}
.help-tooltip-btn:hover { transform: scale(1.15); box-shadow: 0 0 12px rgba(0,117,222,0.3); }
.help-tooltip-btn:active { transform: scale(0.95); }

/* Tooltip floating card */
.help-tooltip-card {
  position: fixed;
  z-index: 1000;
  width: 280px;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  color: var(--text-primary);
  font-size: 0.8rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.help-tooltip-card.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.help-tooltip-card::before {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-hover);
  border-top: 1px solid var(--border-hover);
}
.help-tooltip-card.arrow-up::before {
  top: -6px; right: 20px; left: auto;
  transform: rotate(45deg);
}
.help-tooltip-card.arrow-down::before {
  bottom: -6px; right: 20px; left: auto; top: auto;
  transform: rotate(225deg);
}
.help-tooltip-card h4 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--amber);
  margin-bottom: 0.4rem;
}
.help-tooltip-card p { color: var(--text-secondary); margin: 0; }

/* Header help button */
.btn-help-center {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--amber);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
}
.btn-help-center:hover { border-color: var(--amber); background: rgba(0,117,222,0.08); }
.btn-help-center:active { transform: scale(0.92); }

/* ========== HELP CENTER MODAL ========== */
.help-center-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.help-center-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.help-center-modal {
  width: 92%;
  max-width: 600px;
  max-height: 85vh;
  background: var(--bg-deep);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(30px);
  transition: transform 0.3s ease;
}
.help-center-overlay.active .help-center-modal {
  transform: translateY(0);
}
.help-center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.help-center-header h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.help-center-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.help-center-close:hover { color: var(--text-primary); border-color: var(--border-hover); }
.help-center-body {
  overflow-y: auto;
  padding: 1rem 1.5rem 1.5rem;
  flex: 1;
}
.help-center-body::-webkit-scrollbar { width: 4px; }
.help-center-body::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

/* Accordion */
.help-accordion { margin-bottom: 0.5rem; }
.help-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  -webkit-user-select: none;
  user-select: none;
}
.help-accordion-header:hover { border-color: var(--border-hover); }
.help-accordion.open .help-accordion-header { border-color: rgba(0,117,222,0.2); background: rgba(0,117,222,0.05); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.help-accordion-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 0.5rem;
}
.help-accordion-title .help-acc-icon { font-size: 1.1rem; }
.help-accordion-arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}
.help-accordion.open .help-accordion-arrow { transform: rotate(180deg); }
.help-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.help-accordion.open .help-accordion-content {
  max-height: 2000px;
}
.help-accordion-inner {
  padding: 1rem;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.help-accordion-inner h4 {
  color: var(--amber);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  margin: 0.8rem 0 0.3rem;
}
.help-accordion-inner h4:first-child { margin-top: 0; }
.help-accordion-inner code {
  background: var(--bg-glass);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--amber-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.help-accordion-inner ul {
  list-style: none;
  padding: 0;
}
.help-accordion-inner ul li {
  padding: 0.35rem 0;
  padding-left: 1.2rem;
  position: relative;
}
.help-accordion-inner ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.65rem;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0.5;
}
.help-accordion-inner .cmd-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.help-accordion-inner .cmd-row:last-child { border-bottom: none; }
.help-accordion-inner .cmd-name {
  flex-shrink: 0;
  min-width: 90px;
  color: var(--amber-light);
  font-weight: 500;
}
.help-accordion-inner .cmd-desc { color: var(--text-secondary); }
.help-center-footer {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.btn-restart-tour {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  border: none;
  border-radius: 50px;
  color: white;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-restart-tour:hover { transform: scale(1.03); }
.btn-restart-tour:active { transform: scale(0.97); }
.help-footer-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ========== ONBOARDING TOUR ========== */
.onboarding-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.onboarding-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
@keyframes onboardingPulse {
  0%, 100% { border-color: var(--amber); box-shadow: 0 0 0 9999px rgba(0,0,0,0.6), 0 0 20px rgba(0,117,222,0.25); }
  50% { border-color: var(--amber-light); box-shadow: 0 0 0 9999px rgba(0,0,0,0.6), 0 0 35px rgba(0,117,222,0.4); }
}
.onboarding-highlight {
  position: fixed;
  z-index: 301;
  border: 3px solid var(--amber);
  border-radius: var(--radius);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.6), 0 0 30px rgba(0,117,222,0.25);
  pointer-events: none;
  transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1), left 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: onboardingPulse 2s ease-in-out infinite;
}
.onboarding-popup {
  position: fixed;
  z-index: 302;
  width: 320px;
  max-width: 90vw;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--bg-deep);
  border: 1px solid rgba(0,117,222,0.3);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: 0 16px 50px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease 0.15s, transform 0.3s ease 0.15s, top 0.4s ease, left 0.4s ease;
}
.onboarding-backdrop.active .onboarding-popup {
  opacity: 1;
  transform: translateY(0);
}
/* Arrow pointing from popup to highlighted element */
.onboarding-popup::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: var(--bg-deep);
  border: 1px solid rgba(0,117,222,0.3);
  transform: rotate(45deg);
  z-index: -1;
}
.onboarding-popup.arrow-up::before {
  top: -8px; left: 24px;
  border-right: none; border-bottom: none;
}
.onboarding-popup.arrow-down::before {
  bottom: -8px; left: 24px;
  border-left: none; border-top: none;
}
.onboarding-step-indicator {
  display: flex;
  gap: 4px;
  margin-bottom: 0.7rem;
}
.onboarding-step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-hover);
  transition: var(--transition);
}
.onboarding-step-dot.active { background: var(--amber); width: 20px; border-radius: 4px; }
.onboarding-popup h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  color: var(--amber);
  margin-bottom: 0.4rem;
}
.onboarding-popup p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1rem;
}
.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.onboarding-btn-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  transition: var(--transition);
}
.onboarding-btn-skip:hover { color: var(--text-secondary); }
.onboarding-btn-next {
  padding: 0.5rem 1.2rem;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  border: none;
  border-radius: 50px;
  color: white;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.onboarding-btn-next:hover { transform: scale(1.04); }
.onboarding-btn-next:active { transform: scale(0.96); }

/* ========== CONTEXTUAL VIEW HINTS ========== */
.view-hint {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.75rem;
  background: rgba(0,117,222,0.05);
  border: 1px solid rgba(0,117,222,0.1);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  animation: slideDown 0.35s ease;
}
.view-hint-icon {
  font-size: 1rem;
  flex-shrink: 0;
  color: var(--amber);
}
.view-hint-text { flex: 1; }
.view-hint-close {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.view-hint-close:hover { border-color: var(--border-hover); color: var(--text-secondary); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ========== CLEANUP PANEL ========== */
.btn-cleanup {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-glass); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer; transition: var(--transition);
  font-size: 1rem;
}
.btn-cleanup:hover { border-color: var(--amber); color: var(--amber); background: rgba(0,117,222,0.08); }

.cleanup-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.cleanup-overlay.active { opacity: 1; pointer-events: auto; }

.cleanup-modal {
  width: 94%; max-width: 650px; max-height: 85vh;
  background: var(--bg-deep); border: 1px solid var(--border-hover);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateY(30px); transition: transform 0.3s ease;
}
.cleanup-overlay.active .cleanup-modal { transform: translateY(0); }

.cleanup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0;
}
.cleanup-header h2 {
  font-family: 'Inter', sans-serif; font-size: 1.3rem;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.cleanup-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-glass); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.cleanup-close:hover { color: var(--text-primary); border-color: var(--border-hover); }

.cleanup-body { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; }
.cleanup-body::-webkit-scrollbar { width: 4px; }
.cleanup-body::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

.cleanup-status {
  text-align: center; padding: 2rem 1rem; color: var(--text-secondary); font-size: 0.85rem;
}
.cleanup-status .spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 2px solid var(--border-subtle); border-top-color: var(--amber);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cleanup-summary {
  display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.cleanup-summary-card {
  flex: 1; min-width: 120px; padding: 0.6rem 0.8rem;
  background: var(--bg-glass); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); text-align: center;
}
.cleanup-summary-number { font-size: 1.4rem; font-weight: 700; color: var(--amber); }
.cleanup-summary-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.cleanup-group {
  margin-bottom: 1rem; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); overflow: hidden;
}
.cleanup-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.8rem; background: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
}
.cleanup-group-title { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.cleanup-group-badge {
  font-size: 0.6rem; padding: 0.15rem 0.5rem; border-radius: 50px;
  background: hsla(0,70%,55%,0.15); color: var(--pri-alta); font-weight: 600;
}

.cleanup-task {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}
.cleanup-task:last-child { border-bottom: none; }
.cleanup-task:hover { background: var(--bg-glass); }
.cleanup-task input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--amber); cursor: pointer; flex-shrink: 0;
}
.cleanup-task-info { flex: 1; min-width: 0; }
.cleanup-task-title { font-size: 0.8rem; color: var(--text-primary); }
.cleanup-task-meta { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.1rem; }
.cleanup-task-similarity {
  font-size: 0.6rem; padding: 0.1rem 0.4rem; border-radius: 50px;
  background: rgba(0,117,222,0.1); color: var(--amber); font-weight: 600; flex-shrink: 0;
}
.cleanup-task-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
.cleanup-task-btn {
  padding: 0.25rem 0.5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle); background: transparent;
  color: var(--text-secondary); font-size: 0.65rem; cursor: pointer;
  transition: var(--transition);
}
.cleanup-task-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.cleanup-task-btn.delete { color: var(--pri-alta); }
.cleanup-task-btn.delete:hover { background: hsla(0,70%,55%,0.1); border-color: var(--pri-alta); }

.cleanup-actions {
  display: flex; gap: 0.5rem; padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--border-subtle); flex-shrink: 0;
}
.cleanup-btn {
  flex: 1; padding: 0.55rem 1rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.8rem; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.cleanup-btn-delete {
  background: hsla(0,70%,55%,0.15); border: 1px solid hsla(0,70%,55%,0.3);
  color: var(--pri-alta); font-weight: 600;
}
.cleanup-btn-delete:hover { background: hsla(0,70%,55%,0.25); }
.cleanup-btn-delete:disabled { opacity: 0.4; cursor: not-allowed; }
.cleanup-btn-secondary {
  background: var(--bg-glass); border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.cleanup-btn-secondary:hover { border-color: var(--border-hover); color: var(--text-primary); }

/* ========== AUTH SCREEN ========== */
.auth-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-deep);
  padding: 1rem;
}
.auth-screen.hidden { display: none; }
.app.auth-hidden { display: none !important; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-deep);
}
.auth-logo {
  font-family: 'Inter', sans-serif;
  font-size: 1.6rem; font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary); text-align: center;
  margin-bottom: 0.3rem;
}
.auth-subtitle {
  font-size: 0.75rem; color: var(--text-muted);
  text-align: center; margin-bottom: 1.5rem;
}
.auth-form { display: flex; flex-direction: column; gap: 0.75rem; }
.auth-input {
  width: 100%; padding: 0.65rem 0.85rem;
  background: var(--bg-glass); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: inherit; font-size: 0.85rem;
  transition: var(--transition); outline: none;
}
.auth-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,117,222,0.12); }
.auth-input::placeholder { color: var(--text-muted); }
.auth-btn {
  width: 100%; padding: 0.7rem;
  background: var(--accent); border: 1px solid transparent; border-radius: var(--radius-sm);
  color: #ffffff; font-family: inherit; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: var(--transition);
}
.auth-btn:hover { background: var(--accent-hover); }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-toggle {
  font-size: 0.75rem; color: var(--text-secondary);
  text-align: center; margin-top: 1rem;
}
.auth-toggle a {
  color: var(--accent); cursor: pointer; text-decoration: none;
}
.auth-toggle a:hover { text-decoration: underline; }
.auth-error {
  font-size: 0.72rem; color: var(--pri-alta);
  text-align: center; min-height: 1.2rem;
}
.auth-success {
  font-size: 0.72rem; color: var(--cat-pessoal);
  text-align: center; padding: 0.75rem;
  background: rgba(72,187,120,0.1); border-radius: var(--radius-sm);
  line-height: 1.5;
}
.auth-user-info {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.65rem; color: var(--text-muted);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-logout {
  background: none; border: 1px solid var(--border-subtle);
  border-radius: 50%; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer; transition: var(--transition);
  flex-shrink: 0;
}
.btn-logout:hover { border-color: var(--pri-alta); color: var(--pri-alta); }

