/* ==========================================================================
   DESIGN SYSTEM & VARIÁVEIS CSS (MODO CLARO E ESCURO)
   ========================================================================== */
:root {
  /* Cores Principais do App (Baseado no Print) */
  --primary-color: #be185d;
  --primary-hover: #9d174d;
  --primary-light: #fce7f3;
  --accent-color: #a21caf;
  
  /* Modo Claro (Default) */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-strip: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --timeline-line: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);

  /* Categorias (Cores Vibrantes e Coordenadas) */
  --cat-trabalho: #2563eb;
  --cat-trabalho-bg: #dbeafe;
  --cat-estudo: #7c3aed;
  --cat-estudo-bg: #f3e8ff;
  --cat-lazer: #10b981;
  --cat-lazer-bg: #d1fae5;
  --cat-pessoal: #ea580c;
  --cat-pessoal-bg: #ffedd5;
  --cat-igreja: #c026d3;
  --cat-igreja-bg: #fae8ff;
  
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-title: 'Outfit', sans-serif;
}

body.dark-mode {
  --bg-app: #0f172a;
  --bg-card: #1e293b;
  --bg-header: #1e293b;
  --bg-strip: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --timeline-line: #334155;
  --primary-light: rgba(190, 24, 93, 0.2);
  --cat-trabalho-bg: rgba(37, 99, 235, 0.2);
  --cat-estudo-bg: rgba(124, 58, 237, 0.2);
  --cat-lazer-bg: rgba(16, 185, 129, 0.2);
  --cat-pessoal-bg: rgba(234, 88, 12, 0.2);
  --cat-igreja-bg: rgba(192, 38, 211, 0.2);
}

/* Reset Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-main);
  background-color: #090d16;
  color: var(--text-main);
  overflow: hidden;
}

/* Container do App Simulando Tela de Smartphone em Telas Grandes */
.app-container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

/* ==========================================================================
   HEADER SUPERIOR
   ========================================================================== */
.app-header {
  height: 56px;
  background-color: var(--bg-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background-color 0.2s;
  position: relative;
}

.date-selector:active {
  background-color: var(--primary-light);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.icon-btn:active {
  background-color: var(--border-color);
  transform: scale(0.92);
}

.icon-btn-text {
  background: var(--primary-light);
  border: none;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 5px 10px;
  border-radius: 16px;
  cursor: pointer;
}

/* ==========================================================================
   FAIXA DE DIAS DA SEMANA (TOP DAYS STRIP)
   ========================================================================== */
.days-strip-container {
  background-color: var(--bg-strip);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 4px;
  user-select: none;
  z-index: 9;
}

.days-strip {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 6px;
  padding: 0 4px;

  /* Esconder scrollbar */
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.days-strip::-webkit-scrollbar {
  display: none;
}

.day-item {
  flex: 0 0 calc(100% / 6 - 5px);
  min-width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.day-item .day-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: lowercase;
  margin-bottom: 2px;
}

.day-item .day-number {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

/* Dia Selecionado (Destaque idêntico ao print: Borda vinho/púrpura) */
.day-item.active {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}
.day-item.active .day-name {
  color: var(--primary-color);
  font-weight: 700;
}
.day-item.active .day-number {
  color: var(--primary-color);
}

.day-item.is-today .day-number {
  text-decoration: underline;
  text-decoration-color: var(--primary-color);
}

/* ==========================================================================
   ABA DE ANOTAÇÕES RÁPIDAS (💡 LIGHTBULB TAB) E DRAWER
   ========================================================================== */
.quick-notes-tab {
  position: absolute;
  top: 120px;
  right: 0;
  background-color: #f59e0b;
  color: #ffffff;
  padding: 8px 6px 8px 10px;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  box-shadow: -2px 4px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  z-index: 12;
  transition: transform 0.2s;
}

.quick-notes-tab:hover {
  transform: translateX(-4px);
}

.quick-notes-drawer {
  position: absolute;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 360px;
  height: 100%;
  background-color: var(--bg-card);
  box-shadow: -4px 0 20px rgba(0,0,0,0.2);
  z-index: 50;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.quick-notes-drawer.open {
  right: 0;
}

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

.drawer-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.drawer-body {
  padding: 16px;
  flex: 1;
  display: flex;
}

.drawer-body textarea {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  background-color: var(--bg-app);
  color: var(--text-main);
  resize: none;
  outline: none;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL (TIMELINE LINHA DO TEMPO 24 HORAS)
   ========================================================================== */
.main-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-app);
}

.timeline-view {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  position: relative;
  scroll-behavior: smooth;
  touch-action: pan-y;
}

.timeline-grid {
  position: relative;
  min-height: 1470px; /* 24 horas * 60px + 30px de respiro superior */
  padding-top: 30px; /* Mini respiro para o horário 00:00 não ficar cortado */
  padding-bottom: 80px;
}

/* Linha de Hora */
.hour-row {
  height: 60px;
  display: flex;
  position: relative;
  border-bottom: 1px solid var(--timeline-line);
}

.hour-label {
  width: 58px;
  padding-right: 8px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  transform: translateY(-8px);
  user-select: none;
}

.hour-content {
  flex: 1;
  position: relative;
  border-left: 1px solid var(--timeline-line);
}

/* Divisores de 30 minutos clicáveis */
.slot-half {
  height: 30px;
  width: 100%;
  cursor: pointer;
  transition: background-color 0.15s;
}

.slot-half:hover, .slot-half:active {
  background-color: rgba(190, 24, 93, 0.05);
}

/* Linha do Horário Atual */
.current-time-indicator {
  position: absolute;
  left: 58px;
  right: 0;
  height: 2px;
  background-color: var(--primary-color);
  z-index: 8;
  pointer-events: none;
}

.current-time-indicator::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary-color);
}

/* ==========================================================================
   CARDS DE COMPROMISSOS (EVENT CARDS)
   ========================================================================== */
.event-card {
  position: absolute;
  left: 64px;
  right: 12px;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  cursor: pointer;
  overflow: hidden;
  z-index: 5;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-left: 4px solid var(--event-color, var(--primary-color));
  background-color: var(--event-bg, var(--primary-light));
  touch-action: none; /* Permitir drag customizado no mobile */
}

.event-card:active {
  transform: scale(0.98);
}

.event-card.is-dragging {
  z-index: 100 !important;
  opacity: 0.9 !important;
  box-shadow: 0 12px 28px rgba(0,0,0,0.22) !important;
  transform: scale(1.03) !important;
  cursor: grabbing !important;
  transition: none !important;
}

.event-card .event-title {
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-card .event-time-range {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-card .repeat-icon {
  font-size: 0.75rem;
}

/* ==========================================================================
   BOTÃO FLUTUANTE (FAB +) E BOTTOM NAV BAR
   ========================================================================== */
.fab-btn {
  position: absolute;
  bottom: 68px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 20px;
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: transform 0.2s, background-color 0.2s;
}

.fab-btn:active {
  transform: scale(0.9);
  background-color: var(--primary-hover);
}

.bottom-nav {
  height: 60px;
  background-color: var(--bg-header);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  z-index: 20;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  gap: 2px;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
}

.nav-item.active {
  color: var(--primary-color);
  font-weight: 700;
}

.nav-item .nav-pill {
  width: 42px;
  height: 28px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item.active .nav-pill {
  background-color: var(--primary-color);
  color: #ffffff;
}

.nav-item.active .nav-pill svg {
  stroke: #ffffff;
}

/* ==========================================================================
   MODAIS E POP-UPS
   ========================================================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-card);
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

/* MODAL 1: Seleção de Categoria (Idêntico ao Print enviado) */
.modal-category-card {
  padding: 24px 20px 16px;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  transition: background-color 0.15s;
}

.category-item:active {
  background-color: var(--bg-app);
}

.category-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

.modal-actions-right {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.btn-cancel-text {
  background: none;
  border: none;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px 12px;
}

/* PAINEL REPETIÇÃO PERSONALIZADA */
.custom-recurrence-panel {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.days-toggle-container {
  display: flex;
  gap: 4px;
  justify-content: space-between;
  margin-top: 4px;
}

.day-toggle-pill {
  flex: 1;
  padding: 8px 0;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.day-toggle-pill.active {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

.recurrence-scope-options {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.radio-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
}

.radio-pill input[type="radio"] {
  width: auto;
  accent-color: var(--primary-color);
}

/* MODAL FORMULÁRIO DE EVENTO */
.modal-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  background-color: var(--primary-light);
}

.modal-header-badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-group {
  flex: 1;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  background-color: var(--bg-app);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary-color);
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
}

.right-buttons {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary:active {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-app);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-delete {
  background-color: #ef4444;
  color: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

/* BOTÃO DE FECHAR QUADRADO ARREDONDADO PARA MODAIS */
.btn-close-square {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-sm);
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.btn-close-square:hover, .btn-close-square:active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: scale(1.06);
}

/* MODAL DE RESUMO SEMANAL E CABEÇALHOS */
.modal-header-with-close {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 16px;
}

.weekly-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
}

.weekly-day-group {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.weekly-day-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: capitalize;
  margin-bottom: 6px;
}

.weekly-item-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background-color: var(--bg-app);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

/* MODAL LEITURA / DETALHES DO EVENTO */
.view-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.detail-row svg {
  color: var(--primary-color);
  flex-shrink: 0;
}

/* TOAST NOTIFICATION REMOVIDO */

/* MODAL FILTRO DE CATEGORIAS */
.filter-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.filter-options .category-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-options .category-item:hover,
.filter-options .category-item:active {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}

.filter-options .category-item input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.filter-options .category-item .category-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-options .category-item span:last-child {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   TELA DE LOGIN / PRIMEIRO ACESSO
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(190, 24, 93, 0.75));
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background-color: var(--bg-card);
  border-radius: 24px;
  width: 100%;
  max-width: 400px;
  padding: 32px 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-header {
  text-align: center;
}

.login-logo-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.login-header h2 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}

.login-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-login-submit {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-top: 10px;
}

/* ==========================================================================
   MENU LATERAL HAMBÚRGUER (DRAWER ≡)
   ========================================================================== */
.side-menu-drawer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 85%;
  max-width: 360px;
  height: 100%;
  background-color: var(--bg-card);
  box-shadow: 4px 0 20px rgba(0,0,0,0.25);
  z-index: 90;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.side-menu-drawer.open {
  left: 0;
}

.side-menu-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
}

/* CARTÃO DE PERFIL IDÊNTICO À FOTO DE REFERÊNCIA */
.user-profile-card-box {
  background-color: var(--bg-card);
  border: 1px solid rgba(190, 24, 93, 0.25);
  border-radius: 20px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 0; /* Impede estouro do e-mail no menu lateral */
  box-shadow: 0 4px 14px rgba(0,0,0,0.03);
}

.user-profile-card-box:hover {
  border-color: var(--primary-color);
}

.user-profile-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.user-avatar-gradient {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #be185d, #ea580c);
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(190, 24, 93, 0.25);
}

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

.user-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.profile-chevron-icon {
  color: var(--primary-color);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.user-profile-card-box.open .profile-chevron-icon {
  transform: rotate(180deg);
}

.profile-dashed-divider {
  border-top: 1px dashed var(--border-color);
  margin: 12px 0;
  opacity: 0.8;
}

/* TELA INTEIRA DA SEMANA (ESTENDE ATÉ O FINAL DA TELA) */
.weekly-view {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--bg-app);
}

.weekly-view-header h2 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.weekly-view-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.weekly-view .weekly-list {
  max-height: none; /* Preenche a tela inteira sem travar nos 380px */
  overflow-y: visible;
  flex: 1;
  padding-bottom: 30px; /* Garante respiro ao final da rolagem */
}

.side-menu-body {
  padding: 20px 16px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.menu-section h5 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.menu-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 4px 0;
}

/* ESTILOS DE SANFONA (ACCORDION) NO MENU LATERAL */
.menu-accordion-section {
  display: flex;
  flex-direction: column;
}

.accordion-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 6px 0;
  user-select: none;
  transition: color 0.15s;
  width: 100%;
}

.header-label-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.theme-header-icons {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
}

.icon-slash {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.chevron-icon {
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: auto;
  flex-shrink: 0;
}

.accordion-header-row.open .chevron-icon {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.accordion-content {
  margin-top: 8px;
  animation: fadeInAccordion 0.25s ease;
}

@keyframes fadeInAccordion {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-logout-menu {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-logout-menu:active {
  background-color: rgba(239, 68, 68, 0.2);
}

.theme-selector-group, .lang-selector-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-opt-btn, .lang-opt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-btn-svg {
  fill: none;
  stroke: currentColor;
  transition: all 0.2s ease;
}

/* EFEITO DE ÍCONE PREENCHIDO QUANDO SELECIONADO */
.theme-opt-btn.active {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 700;
}

.theme-opt-btn.active .theme-btn-svg {
  fill: currentColor; /* Preenchido quando ativo */
}

.lang-opt-btn.active {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 700;
}

.flag-icon {
  font-size: 1.2rem;
}

/* ==========================================================================
   TELA INÍCIO (DASHBOARD)
   ========================================================================== */
.home-view {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--bg-app);
}

.home-greeting-card {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: #ffffff;
  padding: 20px;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.home-greeting-card h1 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.home-quote {
  font-size: 0.9rem;
  opacity: 0.95;
  font-style: italic;
  line-height: 1.3;
}

/* CARD DO CLIMA */
.weather-card {
  background-color: var(--bg-card);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.weather-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}
.weather-location svg {
  color: var(--primary-color);
}

.weather-badge {
  background-color: #10b981;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.weather-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.weather-temp-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weather-icon {
  font-size: 2.2rem;
}

.weather-temp {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.weather-details-group {
  display: flex;
  gap: 16px;
}

.w-detail {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.w-detail span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.w-detail strong {
  font-size: 0.95rem;
  color: var(--text-main);
}

/* CARD RESUMO DE COMPROMISSOS */
.home-summary-card {
  background-color: var(--bg-card);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}



