:root {
  --blue: #1a3a5c;
  --blue-light: #2a5a8c;
  --blue-dark: #0d1f2d;
  --gold: #c9a84c;
  --gold-light: #e8d4a0;
  --lime: #8bc34a;
  --lime-dark: #6a9e30;
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --black: #1a1a2e;
  --danger: #dc3545;
  --success: #28a745;
  --warning: #ffc107;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
  --transition: 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--black);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, var(--blue-light) 100%);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(201,168,76,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 3rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(26,58,92,0.3);
}

.login-logo .logo-icon svg { width: 36px; height: 36px; fill: var(--white); }

.login-logo h1 {
  color: var(--blue);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-logo h1 span { color: var(--gold); }

.login-logo p { color: var(--gray-600); font-size: 0.85rem; margin-top: 0.25rem; }

.login-card .form-group { margin-bottom: 1.25rem; }
.login-card label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.4rem; }
.login-card input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
  color: var(--black);
}
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,58,92,0.1); }

.btn-login {
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,58,92,0.4); }
.btn-login:active { transform: translateY(0); }

.login-error {
  background: #fff5f5;
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: 1rem;
  display: none;
  border: 1px solid #fed7d7;
}

/* ===== APP LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  background: var(--blue-dark);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo .logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.3px;
}

.sidebar-logo .logo-text span { color: var(--gold); }
.sidebar-logo .logo-sub { font-size: 0.72rem; color: rgba(255,255,255,0.5); margin-top: 2px; }

.sidebar-user {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue-dark);
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { min-width: 0; }
.user-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.72rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.75rem 0; }

.nav-section { padding: 0.5rem 1.5rem 0.25rem; }
.nav-section-title { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.35); font-weight: 600; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: 0;
  text-decoration: none;
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-item.active { background: rgba(201,168,76,0.15); color: var(--gold); border-right: 3px solid var(--gold); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.5);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
  width: 100%;
  padding: 0.5rem 0;
}
.btn-logout:hover { color: var(--danger); }
.btn-logout svg { width: 16px; height: 16px; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--blue-dark); }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

.page-content { padding: 2rem; flex: 1; }

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title svg { width: 18px; height: 18px; color: var(--gold); }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.blue { background: rgba(26,58,92,0.1); color: var(--blue); }
.stat-icon.gold { background: rgba(201,168,76,0.15); color: var(--gold); }
.stat-icon.lime { background: rgba(139,195,74,0.15); color: var(--lime-dark); }
.stat-icon.red { background: rgba(220,53,69,0.1); color: var(--danger); }

.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--blue-dark); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--gray-600); margin-top: 2px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-light); }

.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: #b8973a; }

.btn-lime {
  background: var(--lime);
  color: var(--white);
  font-size: 1rem;
  padding: 0.875rem 2rem;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(139,195,74,0.35);
}
.btn-lime:hover { background: var(--lime-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(139,195,74,0.45); }

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
}
.btn-outline:hover { background: var(--blue); color: var(--white); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #c82333; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-icon { padding: 0.5rem; border-radius: var(--radius-sm); background: var(--gray-100); color: var(--gray-700); border: none; cursor: pointer; transition: var(--transition); }
.btn-icon:hover { background: var(--gray-200); }
.btn-icon svg { width: 16px; height: 16px; }

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--gray-50);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-200);
}
tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
  vertical-align: middle;
}
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-blue { background: rgba(26,58,92,0.1); color: var(--blue); }
.badge-gold { background: rgba(201,168,76,0.15); color: #8a6d1a; }
.badge-lime { background: rgba(139,195,74,0.15); color: #4a7a1a; }
.badge-red { background: rgba(220,53,69,0.1); color: var(--danger); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }

label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.4rem; }
label .required { color: var(--danger); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.875rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--black);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,58,92,0.08);
}

textarea { resize: vertical; min-height: 100px; }
select { cursor: pointer; }

.form-hint { font-size: 0.78rem; color: var(--gray-500); margin-top: 0.3rem; }

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--blue); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-btn svg { width: 16px; height: 16px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: var(--transition);
}

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

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.modal-header h2 { font-size: 1.1rem; color: var(--blue-dark); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--gray-500); padding: 0.25rem; border-radius: 6px; transition: var(--transition); }
.modal-close:hover { background: var(--gray-100); color: var(--black); }
.modal-close svg { width: 20px; height: 20px; }

.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ===== SESSION ZOOM CARD ===== */
.zoom-card {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  border-radius: 16px;
  padding: 2rem;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.zoom-card .session-info { margin-bottom: 1.5rem; }
.zoom-card .session-date { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.zoom-card .session-time { font-size: 0.9rem; opacity: 0.8; }
.zoom-card .session-warning { font-size: 0.78rem; opacity: 0.7; margin-top: 1rem; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  background: var(--gray-200);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  transition: width 0.5s ease;
}

/* ===== CHECKLIST ===== */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.checklist-item:hover { border-color: var(--gray-300); background: var(--gray-50); }
.checklist-item.done { background: #f0fdf4; border-color: #bbf7d0; opacity: 0.8; }
.checklist-item.done .task-title { text-decoration: line-through; color: var(--gray-500); }

.checklist-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--gray-300);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-top: 2px;
}
.checklist-checkbox:hover { border-color: var(--lime); }
.checklist-item.done .checklist-checkbox { background: var(--lime); border-color: var(--lime); }
.checklist-item.done .checklist-checkbox svg { display: block; }
.checklist-checkbox svg { display: none; width: 12px; height: 12px; fill: white; }

.task-title { font-size: 0.875rem; font-weight: 600; margin-bottom: 2px; }
.task-desc { font-size: 0.8rem; color: var(--gray-600); }
.task-meta { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.25rem; }

/* ===== CLIENT LIST ===== */
.client-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.client-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }

.client-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--white);
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}
.client-avatar img { width: 100%; height: 100%; object-fit: cover; }

.client-info { flex: 1; min-width: 0; }
.client-name { font-weight: 700; font-size: 0.95rem; }
.client-email { font-size: 0.8rem; color: var(--gray-500); }

/* ===== AREA BLOCKS ===== */
.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.area-block {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.area-block-header {
  padding: 0.875rem 1rem;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.area-saude .area-block-header { background: rgba(40,167,69,0.08); color: #1a7a3a; }
.area-relacionamento .area-block-header { background: rgba(201,168,76,0.12); color: #7a5a10; }
.area-dinheiro .area-block-header { background: rgba(26,58,92,0.08); color: var(--blue); }

.area-block-body { padding: 1rem; }
.area-field { margin-bottom: 0.875rem; }
.area-field:last-child { margin-bottom: 0; }
.area-field label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-500); margin-bottom: 0.3rem; }

/* ===== DOCUMENT CATEGORIES ===== */
.doc-category {
  margin-bottom: 1.5rem;
}
.doc-category-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  background: var(--white);
  transition: var(--transition);
}
.doc-item:hover { border-color: var(--blue-light); background: var(--gray-50); }

.doc-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(220,53,69,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-icon svg { width: 20px; height: 20px; color: var(--danger); }

.doc-name { font-size: 0.875rem; font-weight: 600; flex: 1; }
.doc-size { font-size: 0.75rem; color: var(--gray-500); }

/* ===== CALENDAR ===== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-500);
  padding: 0.5rem;
}

.cal-day {
  min-height: 80px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
}

.cal-day:hover { border-color: var(--blue); }
.cal-day.today { border-color: var(--gold); background: rgba(201,168,76,0.05); }
.cal-day.past { opacity: 0.5; cursor: default; }
.cal-day.empty { background: transparent; border-color: transparent; cursor: default; }

.cal-day-num { font-size: 0.8rem; font-weight: 700; color: var(--gray-700); }
.cal-day.today .cal-day-num { color: var(--gold); }

.cal-event {
  background: var(--blue);
  color: var(--white);
  font-size: 0.68rem;
  padding: 2px 4px;
  border-radius: 3px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event.available { background: var(--lime-dark); }

/* ===== IA CHAT ===== */
.ia-container {
  display: flex;
  flex-direction: column;
  height: 500px;
}

.ia-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ia-msg {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.6;
}

.ia-msg.bot {
  background: var(--gray-100);
  color: var(--black);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.ia-msg.user {
  background: var(--blue);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ia-input-area {
  padding: 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 0.5rem;
}

.ia-input-area input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: 100px;
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}
.ia-input-area input:focus { border-color: var(--blue); }

.ia-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.ia-send:hover { background: var(--blue-light); }
.ia-send svg { width: 18px; height: 18px; }

/* ===== WELCOME CARD ===== */
.welcome-card {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
  border-radius: 16px;
  padding: 2rem;
  color: var(--white);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.welcome-card::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(201,168,76,0.2) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-card h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 0.25rem; }
.welcome-card p { opacity: 0.8; font-size: 0.9rem; }

/* ===== LEVEL CARDS ===== */
.level-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.level-card-header {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: var(--white);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.level-card-header h4 { font-size: 0.9rem; font-weight: 700; }
.level-card-header .level-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  margin-right: 0.5rem;
}

.level-card-body { padding: 1rem; display: none; }
.level-card-body.open { display: block; }

/* ===== PLAN CARD ===== */
.plan-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 1rem;
}

.plan-card-header {
  background: var(--gray-50);
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plan-week { font-weight: 700; font-size: 0.95rem; color: var(--blue-dark); }

.plan-items { padding: 1rem; }
.plan-item { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.5rem 0; border-bottom: 1px solid var(--gray-100); }
.plan-item:last-child { border-bottom: none; }
.plan-item-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.plan-item-icon svg { width: 14px; height: 14px; }
.plan-item-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--gray-500); }
.plan-item-value { font-size: 0.875rem; margin-top: 2px; }

/* ===== HAMBURGER ===== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--gray-700); border-radius: 2px; transition: var(--transition); }

/* ===== ALERTS ===== */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info { background: rgba(26,58,92,0.08); color: var(--blue); border: 1px solid rgba(26,58,92,0.15); }
.alert-warning { background: rgba(255,193,7,0.1); color: #7a5f00; border: 1px solid rgba(255,193,7,0.3); }
.alert-danger { background: rgba(220,53,69,0.08); color: var(--danger); border: 1px solid rgba(220,53,69,0.2); }
.alert-success { background: rgba(40,167,69,0.08); color: #1a7a3a; border: 1px solid rgba(40,167,69,0.2); }

/* ===== LOADING ===== */
.loading { display: flex; align-items: center; justify-content: center; padding: 3rem; color: var(--gray-500); gap: 0.75rem; font-size: 0.875rem; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--gray-200); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 3rem; color: var(--gray-500); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-size: 0.875rem; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1.25rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  max-width: 320px;
  border-left: 4px solid var(--success);
  animation: slideIn 0.3s ease;
}
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .page-content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.three { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .area-grid { grid-template-columns: 1fr; }
  .calendar-grid { font-size: 0.75rem; }
  .cal-day { min-height: 50px; }
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ===== SEARCH ===== */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.875rem;
}
.search-box svg { width: 16px; height: 16px; color: var(--gray-500); flex-shrink: 0; }
.search-box input { border: none; background: none; outline: none; font-size: 0.875rem; width: 200px; }

/* ===== FILE UPLOAD ===== */
.file-drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.file-drop-zone:hover, .file-drop-zone.drag { border-color: var(--blue); background: rgba(26,58,92,0.03); }
.file-drop-zone svg { width: 36px; height: 36px; color: var(--gray-400); margin-bottom: 0.75rem; }
.file-drop-zone p { font-size: 0.875rem; color: var(--gray-600); }
.file-drop-zone span { color: var(--blue); font-weight: 600; }

/* Photo upload */
.photo-upload-area {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.photo-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview svg { width: 32px; height: 32px; color: var(--gray-400); }

/* ===== SESSION STATUS ===== */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.status-dot.scheduled { background: var(--gold); }
.status-dot.completed { background: var(--success); }
.status-dot.cancelled { background: var(--danger); }
.status-dot.missed { background: var(--gray-400); }

/* ===== REFLEXÃO PÓS-SESSÃO ===== */

/* Recorder */
.recorder-area {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  border-radius: 16px;
  padding: 2rem;
  color: var(--white);
  text-align: center;
  margin-bottom: 1.5rem;
}

.recorder-status {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  margin-bottom: 0.75rem;
}

.recorder-timer {
  font-size: 2.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  font-family: 'Courier New', monospace;
}

.recorder-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 40px;
  margin-bottom: 1.5rem;
}

.wave-bar {
  width: 4px;
  background: rgba(255,255,255,0.5);
  border-radius: 2px;
  transition: height 0.1s ease;
  min-height: 4px;
}

.wave-bar.active {
  background: var(--gold);
  animation: waveAnim 0.5s ease-in-out infinite alternate;
}

@keyframes waveAnim {
  from { height: 4px; }
  to { height: var(--wave-h, 20px); }
}

.recorder-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.btn-record {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-record.idle {
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(220,53,69,0.4);
}

.btn-record.idle:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 8px rgba(220,53,69,0.2);
}

.btn-record.recording {
  background: var(--danger);
  animation: pulse-record 1.2s ease infinite;
}

@keyframes pulse-record {
  0%   { box-shadow: 0 0 0 0 rgba(220,53,69,0.6); }
  70%  { box-shadow: 0 0 0 16px rgba(220,53,69,0); }
  100% { box-shadow: 0 0 0 0 rgba(220,53,69,0); }
}

.btn-record.paused { background: var(--warning); }

.btn-record svg { width: 28px; height: 28px; fill: white; }

.btn-rec-secondary {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-rec-secondary:hover { background: rgba(255,255,255,0.2); }
.btn-rec-secondary svg { width: 18px; height: 18px; fill: currentColor; }

/* Audio player */
.audio-preview {
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.audio-preview audio { flex: 1; height: 36px; }
.audio-preview audio::-webkit-media-controls-panel { background: rgba(255,255,255,0.15); }

/* Guided questions */
.guided-questions { margin-bottom: 1.5rem; }

.question-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: var(--transition);
}

.question-card:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,58,92,0.08);
}

.question-label {
  background: var(--gray-50);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blue-dark);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.question-label .q-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.question-card textarea {
  border: none;
  border-radius: 0;
  resize: vertical;
  min-height: 80px;
  background: var(--white);
}

.question-card textarea:focus { box-shadow: none; border-color: transparent; }

/* Consent */
.consent-box {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.consent-box input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  accent-color: var(--gold);
  cursor: pointer;
  margin-top: 2px;
}

.consent-text {
  font-size: 0.85rem;
  color: var(--gray-700);
  line-height: 1.6;
}

.consent-text strong { color: var(--gold); }

/* Reflection card (history) */
.reflection-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  transition: var(--transition);
}

.reflection-card:hover { border-color: var(--gray-300); box-shadow: var(--shadow); }

.reflection-card-header {
  padding: 0.875rem 1rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.reflection-meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.reflection-type-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.reflection-type-icon.audio { background: rgba(220,53,69,0.1); color: var(--danger); }
.reflection-type-icon.text { background: rgba(26,58,92,0.1); color: var(--blue); }
.reflection-type-icon.both { background: rgba(201,168,76,0.15); color: var(--gold); }
.reflection-type-icon svg { width: 16px; height: 16px; }

.reflection-card-body { padding: 1rem; }

.reflection-answers { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }

.reflection-answer {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  border-left: 3px solid var(--gold);
}

.reflection-answer .r-question {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.reflection-answer .r-answer {
  font-size: 0.875rem;
  color: var(--black);
  line-height: 1.6;
}

.authorized-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(40,167,69,0.1);
  color: var(--success);
  border: 1px solid rgba(40,167,69,0.2);
}

/* Admin reflection panel */
.reflection-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
  margin-top: 0.75rem;
}

.btn-authorize {
  background: rgba(40,167,69,0.08);
  color: var(--success);
  border: 1px solid rgba(40,167,69,0.25);
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-authorize:hover { background: rgba(40,167,69,0.15); }
.btn-authorize.authorized {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

/* Type toggle */
.type-toggle {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.5rem;
}

.type-toggle-btn {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.type-toggle-btn.active {
  background: var(--white);
  color: var(--blue);
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
}

.type-toggle-btn svg { width: 16px; height: 16px; }

/* WhatsApp trigger btn */
.btn-whatsapp {
  background: #25D366;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}
.btn-whatsapp:hover { background: #1ebe5b; }
.btn-whatsapp svg { width: 16px; height: 16px; fill: currentColor; }

/* Copy toast */
.copy-flash {
  animation: copyFlash 0.3s ease;
}
@keyframes copyFlash {
  0%   { background: rgba(139,195,74,0.2); }
  100% { background: transparent; }
}
