﻿/* ========================================================
   PCF - Controle Financeiro Pessoal
   styles.css — Tema escuro completo
   ======================================================== */
:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-sidebar: #0f172a;
  --bg-input: #0f172a;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --purple: #8b5cf6;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,.25);
  --sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==================== AUTH ==================== */
.auth-container {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
.auth-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 40px 36px; width: 100%; max-width: 520px;
  box-shadow: var(--shadow); text-align: center;
}
.auth-card h1 { font-size: 2rem; margin-bottom: 4px; }
.auth-card h2 { font-size: 1rem; color: var(--text-muted); font-weight: 400; margin-bottom: 24px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.auth-tab {
  flex: 1; padding: 10px; border: none; background: transparent;
  color: var(--text-muted); font-size: .9rem; cursor: pointer; transition: .2s;
}
.auth-tab.active { background: var(--accent); color: #fff; }
.auth-form { text-align: left; }
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 10px; color: var(--text-muted); font-size: .82rem;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #3c4043; border: 1px solid #dadce0;
  font-size: .92rem; font-weight: 500; padding: 10px 16px;
  border-radius: 8px; cursor: pointer; transition: background .15s, box-shadow .15s;
  width: 100%;
}
.btn-google:hover:not(:disabled) { background: #f8f9fa; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.btn-google:disabled { opacity: .6; cursor: not-allowed; }

/* ==================== LAYOUT ==================== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: var(--bg-sidebar);
  border-right: 1px solid var(--border); display: flex;
  flex-direction: column; position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 100; overflow-y: auto;
}
.sidebar-header { padding: 20px 16px 12px; border-bottom: 1px solid var(--border); }
.sidebar-header h1 { font-size: 1.4rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.header-logo-icon { width: 22px; height: 22px; flex-shrink: 0; }
.header-logo-icon svg { width: 22px; height: 22px; display: block; }
/* Global Lucide icon defaults inside .btn */
.btn svg.lucide { width: 15px; height: 15px; vertical-align: middle; flex-shrink: 0; }
.btn-link svg.lucide { width: 15px; height: 15px; vertical-align: middle; }
.btn-gear svg.lucide { width: 16px; height: 16px; }
.user-info { display: flex; align-items: center; justify-content: space-between; }
.user-name { font-size: .85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.sidebar-nav { flex: 1; padding: 8px 0; display: flex; flex-direction: column; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  color: var(--text-muted); text-decoration: none; transition: .15s;
  font-size: .9rem; border-left: 3px solid transparent;
}
.nav-link:hover { background: rgba(255,255,255,.05); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--accent); border-left-color: var(--accent); background: rgba(59,130,246,.08); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 18px; height: 18px; display: block; }
.nav-label { white-space: nowrap; }

/* ---- Nav Groups (accordion) ---- */
.nav-group { display: flex; flex-direction: column; }

.nav-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px 4px; background: none; border: none; width: 100%;
  color: var(--text-dim); font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.1px;
  cursor: pointer; font-family: inherit; transition: color .15s; user-select: none;
}
.nav-group-header:hover { color: var(--text-muted); }
.nav-group-title { display: flex; align-items: center; gap: 5px; }
.nav-group-icon { width: 14px; height: 14px; flex-shrink: 0; display: inline-flex; align-items: center; }
.nav-group-icon svg { width: 14px; height: 14px; display: block; }
.nav-group-arrow { width: 14px; height: 14px; opacity: .6; transition: transform .2s; flex-shrink: 0; }
.nav-group-arrow svg { width: 14px; height: 14px; display: block; }
.nav-group.collapsed .nav-group-arrow { transform: rotate(-90deg); }

.nav-group-items { display: flex; flex-direction: column; }
.nav-group.collapsed .nav-group-items { display: none; }
.nav-group .nav-link { padding-left: 30px; font-size: .87rem; }

.nav-sep {
  border: none; border-top: 1px solid var(--border); margin: 6px 16px 4px;
}

.sidebar-toggle {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 1.4rem; padding: 6px 10px;
  border-radius: var(--radius-sm); cursor: pointer;
}

.main-content {
  flex: 1; margin-left: var(--sidebar-w); padding: 24px 28px; min-height: 100vh;
}

/* ==================== PAGE ==================== */
.page {}
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; padding-right: 56px; }
.page-header h2 { font-size: 1.5rem; font-weight: 600; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.contatos-search-wrap { display: flex; align-items: center; gap: 6px; }
.contatos-search-wrap .input-search { padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); color: var(--text); font-size: .92rem; min-width: 200px; outline: none; transition: border-color .2s; }
.contatos-search-wrap .input-search:focus { border-color: var(--primary); }
.subtitle { color: var(--text-muted); margin-bottom: 16px; font-size: .92rem; }
.text-muted { color: var(--text-muted); font-size: .85rem; }

/* ==================== CARDS ==================== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
  background: var(--bg-card); border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px; border-left: 4px solid var(--border);
  box-shadow: var(--shadow);
}
.card-icon { font-size: 1.8rem; }
.card-info { display: flex; flex-direction: column; gap: 2px; }
.card-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.card-value { font-size: 1.2rem; font-weight: 700; }
.card-receita { border-left-color: var(--success); }
.card-receita .card-value { color: var(--success); }
.card-despesa { border-left-color: var(--danger); }
.card-despesa .card-value { color: var(--danger); }
.card-saldo { border-left-color: var(--accent); }
.card-saldo .card-value { color: var(--accent); }
.card-investimento { border-left-color: var(--purple); }
.card-investimento .card-value { color: var(--purple); }

/* ==================== CHARTS ==================== */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 20px; }
.chart-container {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.chart-container h3 { font-size: 1rem; margin-bottom: 12px; color: var(--text-muted); }
.chart-table { margin-top: 12px; }
.chart-table-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.chart-table-row.total { font-weight: 700; border-top: 2px solid var(--border); color: var(--accent); }
.chart-table-row span:first-child { flex: 1; }
.chart-table-row span { min-width: 90px; text-align: right; }

/* ==================== FORM ==================== */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label { font-size: .85rem; color: var(--text-muted); font-weight: 500; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="time"],
input[type="color"], select, textarea {
  background: var(--bg-input); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: .9rem;
  font-family: inherit; outline: none; transition: border-color .2s; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="color"] { height: 42px; padding: 4px; cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
textarea { resize: vertical; }
select { cursor: pointer; }

.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-label {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: .88rem; transition: .2s;
}
.radio-label.selected { border-color: var(--accent); background: rgba(59,130,246,.15); }
.radio-label input[type="radio"] { accent-color: var(--accent); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters select { width: auto; min-width: 160px; }

.input-file {
  background: var(--bg-input); border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 12px; font-size: .85rem; cursor: pointer; color: var(--text-muted); width: 100%;
}
.input-file::-webkit-file-upload-button {
  background: var(--accent); color: #fff; border: none; padding: 6px 14px;
  border-radius: 4px; cursor: pointer; margin-right: 10px; font-size: .82rem;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border: none; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; cursor: pointer; transition: .2s; font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #475569; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--border); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-icon {
  background: none; border: none; cursor: pointer; font-size: 1rem;
  padding: 4px; border-radius: 4px; transition: .2s;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
}
.btn-icon svg { width: 15px; height: 15px; display: block; }
.btn-icon:hover { background: rgba(255,255,255,.1); }
.btn-icon.btn-danger:hover { background: rgba(220,38,38,.2); }
.btn-link {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: .8rem; padding: 4px 8px; transition: .2s;
}
.btn-link:hover { color: var(--danger); }
.btn-gear { font-size: .95rem; opacity: .7; transition: opacity .2s, transform .3s; }
.btn-gear:hover { opacity: 1; transform: rotate(45deg); color: var(--primary) !important; }

/* ==================== ALERTS ==================== */
.alert {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 12px;
}
.alert-error { background: rgba(220,38,38,.15); color: #fca5a5; border: 1px solid rgba(220,38,38,.3); }
.alert-success { background: rgba(22,163,74,.15); color: #86efac; border: 1px solid rgba(22,163,74,.3); }

/* ==================== TABLE ==================== */
.table-container { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; }
.table thead { background: rgba(255,255,255,.04); }
.table th {
  text-align: left; padding: 10px 12px; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted);
  white-space: nowrap; border-bottom: 1px solid var(--border);
  position: relative;
}
/* ---- Redimensionamento de colunas ---- */
.col-resize-handle {
  position: absolute; top: 0; right: 0;
  width: 5px; height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 2;
  border-radius: 0 2px 2px 0;
  transition: background .15s;
}
.col-resize-handle:hover { background: var(--accent); opacity: .55; }
body.col-resizing,
body.col-resizing * { cursor: col-resize !important; user-select: none !important; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .88rem; white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover { background: rgba(255,255,255,.03); }
.table tr.highlight { background: rgba(59,130,246,.15); }

.empty-text { text-align: center; color: var(--text-dim); padding: 24px; font-style: italic; }

.tipo-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
}
.tipo-badge.receita { background: rgba(22,163,74,.15); color: #4ade80; }
.tipo-badge.despesa { background: rgba(220,38,38,.15); color: #f87171; }
.tipo-badge.investimento { background: rgba(139,92,246,.15); color: #a78bfa; }

.badge-admin {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: .76rem; font-weight: 600;
  background: rgba(234,179,8,.18); color: #fbbf24;
}
.badge-padrao {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: .76rem; font-weight: 600;
  background: rgba(255,255,255,.06); color: var(--text-muted);
}
.check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }

.valor { font-weight: 600; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: .82rem; font-weight: 600; background: var(--bg-card);
  border: 1px solid var(--border); color: var(--accent);
}

/* ==================== CHIPS ==================== */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 20px; font-size: .82rem;
  background: var(--bg-input); border: 1px solid var(--border);
  cursor: pointer; transition: .2s; color: var(--text);
}
.chip:hover { border-color: var(--text-muted); }
.chip.selected { border-color: var(--accent); }
.chip-small {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: .78rem; background: rgba(255,255,255,.06); color: var(--text-muted);
}
.chip-emo {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 12px; font-size: .8rem;
}
.chip-del {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 1rem; margin-left: 2px; opacity: .7;
}
.chip-del:hover { opacity: 1; }

/* ==================== SUBCAT ROWS (Config. Categorias) ==================== */
.subcat-list { display: flex; flex-direction: column; gap: 6px; }
.subcat-row { display: flex; align-items: center; gap: 8px; }
.subcat-row .subcat-nome { flex: 1; }
.subcat-row .subcat-tipo { width: 110px; }

/* ==================== CICLO DO DINHEIRO ==================== */
.ciclo-container { max-width: 700px; }
.ciclo-diagram {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 24px; background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.ciclo-node {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 24px; border-radius: var(--radius); min-width: 180px; text-align: center;
}
.ciclo-icon { font-size: 1.6rem; }
.ciclo-label { font-size: .82rem; color: var(--text-muted); }
.ciclo-valor { font-size: 1.1rem; font-weight: 700; }
.ciclo-receita { background: rgba(22,163,74,.12); }
.ciclo-receita .ciclo-valor { color: var(--success); }
.ciclo-despesa { background: rgba(220,38,38,.12); }
.ciclo-despesa .ciclo-valor { color: var(--danger); }
.ciclo-investimento { background: rgba(59,130,246,.12); }
.ciclo-investimento .ciclo-valor { color: var(--accent); }
.ciclo-saldo { background: rgba(139,92,246,.12); }
.ciclo-saldo .ciclo-valor { color: var(--purple); }
.ciclo-middle { display: flex; align-items: center; gap: 16px; }
.ciclo-center { font-size: 1.4rem; color: var(--text-dim); }
.ciclo-obs { font-size: .85rem; color: var(--text-muted); padding: 12px 16px; background: var(--bg-card); border-radius: var(--radius-sm); margin-bottom: 20px; }
.ciclo-percentuais { background: var(--bg-card); border-radius: var(--radius); padding: 20px; }
.ciclo-percentuais h3 { font-size: 1rem; margin-bottom: 14px; }
.percentual-grid { display: flex; flex-direction: column; gap: 14px; }
.percentual-item { display: flex; align-items: center; gap: 12px; }
.percentual-label { font-size: .85rem; min-width: 160px; color: var(--text-muted); }
.percentual-bar { flex: 1; height: 18px; background: rgba(255,255,255,.06); border-radius: 9px; overflow: hidden; }
.percentual-fill { height: 100%; border-radius: 9px; transition: width .4s; }
.percentual-fill.despesa { background: var(--danger); }
.percentual-fill.investimento { background: var(--accent); }
.percentual-fill.saldo { background: var(--success); }

/* ==================== IMC ==================== */
.imc-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.imc-form { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.imc-table-container { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.imc-table-container h3 { margin-bottom: 12px; }
.imc-result-card {
  margin-top: 16px; padding: 16px; border-radius: var(--radius-sm);
  background: var(--bg); border-left: 4px solid; text-align: center;
}
.imc-value { font-size: 1.6rem; font-weight: 700; }
.imc-class { font-size: .95rem; margin-top: 4px; }
.imc-message { font-size: .85rem; color: var(--text-muted); margin-top: 8px; }

/* ==================== EMOÇÕES ==================== */
.emocoes-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.emocoes-form { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.emocao-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-emocao { display: inline-flex; align-items: center; gap: 6px; }
.chip-emocao .chip-icon { font-size: 1.2rem; line-height: 1; }
.emocoes-lista { }
.emocoes-lista h3 { margin-bottom: 14px; }
.emocao-card {
  background: var(--bg-card); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 12px; border-left: 4px solid var(--border);
  box-shadow: var(--shadow);
}
.emocao-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.emocao-data { font-size: .82rem; color: var(--text-muted); }
.emocao-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.emocao-situacao { font-size: .86rem; color: var(--text-muted); margin-bottom: 4px; }
.emocao-descricao { font-size: .86rem; color: var(--text); }

/* ==================== CONFIG EMOÇÕES ==================== */
.emo-config-list { display: flex; flex-direction: column; gap: 16px; }
.emo-config-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); border-left: 4px solid var(--border);
}
.emo-config-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.emo-config-title { display: flex; align-items: center; gap: 8px; }
.emo-color-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.emo-config-sub {
  margin-left: 20px; padding: 10px 14px; margin-bottom: 8px;
  background: rgba(255,255,255,.03); border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
}
.emo-config-sub-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.emo-config-inf-list { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; }

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 28px; width: 100%; max-width: 440px; box-shadow: 0 8px 32px rgba(0,0,0,.4);
  max-height: 90vh; overflow-y: auto;
}
.modal.modal-lg { max-width: 600px; }
.modal h3 { margin-bottom: 18px; font-size: 1.15rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ==================== IMPORT / EXPORT ==================== */
.ie-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ie-section { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.ie-section h3 { margin-bottom: 16px; }
.ie-buttons { display: flex; flex-direction: column; gap: 10px; }
.ie-import-block { margin-bottom: 16px; }
.ie-import-block label { display: block; font-size: .88rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }

/* ==================== SUBCATS ==================== */
.subcats-list { display: flex; flex-wrap: wrap; gap: 4px; }

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr; }
  .ie-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.4); }
  .sidebar-toggle { display: block; }
  .main-content { margin-left: 0; padding: 16px; padding-top: 52px; }
  .form-row { grid-template-columns: 1fr; }
  .imc-layout { grid-template-columns: 1fr; }
  .emocoes-layout { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .ciclo-middle { flex-direction: column; }
  /* Modal responsivo: ocupa toda a largura, igual ao formulário de página */
  .modal-overlay { padding: 8px; align-items: flex-start; padding-top: 60px; }
  .modal { padding: 20px 16px; width: 100%; max-width: 100%; box-sizing: border-box; }
  .modal.modal-lg { max-width: 100%; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; min-width: 100px; }
  /* Landing hero: alinhar ao topo para evitar clipping do card no cadastro */
  .landing-hero { align-items: flex-start; padding: 80px 12px 32px; }
  .landing-hero .auth-container { padding: 0; width: 100%; }
  .auth-card { padding: 24px 18px; width: 100%; max-width: 100%; box-sizing: border-box; }
  /* Roda da Vida: empilhar roda acima do formulário */
  .rv-layout { flex-direction: column; }
  .rv-wheel-area { width: 100%; max-width: 520px; margin-inline: auto; align-items: center; padding-inline: 6px; }
  .rv-form-area { width: 100%; min-width: 0; }
  /* Page header: recuo à esquerda para não colidir com o botão hamburger fixo */
  .page-header { padding-left: 54px; }
  /* Colunas de tabela ocultas no mobile */
  .col-hide-mobile { display: none !important; }
  /* Barra de busca ocupa linha própria no mobile */
  .contatos-search-wrap { flex: 1 1 100%; order: 3; }
  .contatos-search-wrap .input-search { flex: 1; min-width: 0; width: 100%; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  html { font-size: 13px; }
  .landing-hero { padding: 72px 8px 24px; }
  .auth-card { padding: 20px 14px; }
  /* Modal como bottom-sheet em telas muito pequenas */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: var(--radius) var(--radius) 0 0; max-height: 92vh; }
  .modal.modal-lg { max-width: 100%; }
  .modal-actions .btn { flex: 1 1 100%; }
  /* Agenda: formulário em coluna única */
  .form-grid-agenda { grid-template-columns: 1fr; }
  .form-grid-agenda .form-group:first-child { grid-column: auto; }
  /* Botões do relógio: dividem espaço igualmente */
  .agenda-clock-btns { width: 100%; }
  .agenda-clock-btns .btn { flex: 1; min-width: 0; }
  /* Hábitos: reduz indent dos extras para slider não comprimir */
  .hab-item-extras { padding-left: 8px; }
  .hab-int-slider-wrap { min-width: 0; flex: 1; }
  /* Home: relógio menor */
  .home-clock { font-size: 2rem; letter-spacing: 1px; }
  .home-banner { padding: 16px 14px; margin-bottom: 18px; }
  /* Page header: título menor para caber com botão voltar */
  .page-header { padding-right: 46px; margin-bottom: 14px; }
  .page-header h2 { font-size: 1.3rem; }
  /* Roda da Vida: topbar sem padding excessivo */
  .rv-topbar { padding-right: 46px; }
  .rv-wheel-area { padding-inline: 2px; }
  /* Filtros: selects em coluna quando não há espaço */
  .filters { flex-direction: column; align-items: stretch; }
  .filters select { width: 100%; min-width: 0; }
}

/* ==================== FAROL FINANCEIRO ==================== */
.farol-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  border-left: 5px solid;
  margin-bottom: 1.5rem;
}
.farol-icon { font-size: 2rem; }
.farol-msg { font-size: 1.05rem; font-weight: 600; }

/* ==================== AGENDA ==================== */
.form-grid-agenda {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: .75rem;
  align-items: end;
}
.form-group-btn { display: flex; align-items: end; }
.form-group-btn .btn { height: 38px; white-space: nowrap; }

.agenda-alertas {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem;
}
.agenda-top-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(360px, 460px) minmax(150px, 210px);
  justify-content: space-between;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1rem;
}
.agenda-top-left,
.agenda-calendar-panel,
.agenda-top-actions {
  min-width: 0;
}
.agenda-calendar-panel {
  max-width: 460px;
}
.agenda-top-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.agenda-top-actions {
  display: flex;
  justify-content: flex-end;
}
.page-header-agenda {
  align-items: center;
  gap: 14px;
}
.agenda-sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text);
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.agenda-sound-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}
.agenda-sound-toggle span {
  white-space: nowrap;
}
.alerta-item {
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
}
.alerta-atrasado { background: rgba(220,38,38,.15); border-left: 4px solid var(--danger); }
.alerta-hoje { background: rgba(245,158,11,.15); border-left: 4px solid var(--warning); }
.alerta-proximo { background: rgba(59,130,246,.15); border-left: 4px solid var(--accent); }
.agenda-calendar-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: .75rem;
  margin-bottom: .5rem;
  flex-direction: column;
  width: 100%;
  margin-inline: 0;
}
.agenda-calendar-heading {
  flex: 0 0 auto;
}
.agenda-calendar-heading-side {
  padding-inline: .2rem;
}
.agenda-calendar-heading-side h3 {
  margin-bottom: .35rem;
}
.agenda-calendar-subtitle {
  margin: .25rem 0 0;
  color: var(--text-muted);
  font-size: .84rem;
  line-height: 1.25;
}
.agenda-calendar-toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: nowrap;
  justify-content: center;
  width: 100%;
}
.agenda-calendar-nav {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.agenda-calendar-nav .btn {
  min-width: 38px;
  padding-inline: 0;
}
.agenda-calendar-title {
  min-width: 140px;
  text-align: center;
  font-size: .86rem;
  font-weight: 700;
  text-transform: capitalize;
}
.agenda-calendar-board {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
}
.agenda-calendar-weekdays,
.agenda-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .34rem;
}
.agenda-calendar-weekdays {
  margin-bottom: .1rem;
}
.agenda-calendar-weekdays span {
  text-align: center;
  font-size: .66rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.agenda-calendar-weekdays span.is-weekend {
  color: #e9b4b4;
}
.agenda-calendar-cell {
  position: relative;
  min-height: 46px;
  padding: .34rem .3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.agenda-calendar-cell.has-events {
  background: linear-gradient(180deg, rgba(59,130,246,.12), rgba(59,130,246,.04));
  border-color: rgba(59,130,246,.38);
}
.agenda-calendar-cell.is-today {
  box-shadow: inset 0 0 0 1px rgba(245,158,11,.55);
  border-color: rgba(245,158,11,.55);
}
.agenda-calendar-cell.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(59,130,246,.45), 0 14px 28px rgba(15,23,42,.16);
}
.agenda-calendar-cell:not(.agenda-calendar-cell-empty) {
  cursor: pointer;
}
.agenda-calendar-cell:not(.agenda-calendar-cell-empty):hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}
.agenda-calendar-cell-empty {
  border-style: dashed;
  background: transparent;
  cursor: default;
}
.agenda-calendar-day {
  font-size: .74rem;
  font-weight: 700;
  line-height: 1;
}
.agenda-calendar-cell.is-weekend .agenda-calendar-day {
  color: #e9b4b4;
}
.agenda-calendar-count {
  min-width: 18px;
  height: 15px;
  border-radius: 5px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: .56rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(59,130,246,.2);
}
.agenda-calendar-count-empty {
  visibility: hidden;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
}

.emo-icon-label {
  font-size: 1.3rem;
  margin-right: 2px;
}

@media (max-width: 768px) {
  .agenda-top-grid {
    grid-template-columns: 1fr;
  }
  .agenda-top-actions {
    justify-content: stretch;
  }
  .form-grid-agenda { grid-template-columns: 1fr 1fr; }
  .form-grid-agenda .form-group:first-child { grid-column: 1 / -1; }
  .page-header-agenda {
    flex-direction: column;
    align-items: stretch;
    padding-right: 54px;
  }
  .agenda-sound-toggle {
    width: 100%;
    justify-content: center;
  }
  .agenda-sound-toggle span {
    white-space: normal;
    text-align: center;
  }
  .agenda-calendar-header {
    align-items: stretch;
  }
  .agenda-calendar-toolbar {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .55rem;
  }
  .agenda-calendar-nav {
    flex: 1 1 auto;
    justify-content: space-between;
  }
  .agenda-calendar-title {
    min-width: 0;
    flex: 1;
  }
  .agenda-calendar-weekdays,
  .agenda-calendar-grid {
    gap: .28rem;
  }
  .agenda-calendar-cell {
    min-height: 42px;
    padding: .28rem .24rem;
  }
  .agenda-calendar-count {
    min-width: 16px;
    height: 14px;
    padding: 0 3px;
    font-size: .54rem;
  }
  .plano-acao-form {
    grid-template-columns: 1fr;
  }
  .plano-acao-form-span-2 {
    grid-column: auto;
  }
  .plano-acao-form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.plano-acao-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}
.plano-acao-form textarea {
  min-height: 76px;
  resize: vertical;
}
.plano-acao-form-span-2 {
  grid-column: 1 / -1;
}
.plano-acao-checkbox-group {
  display: flex;
  align-items: end;
}
.plano-acao-checkbox {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 38px;
  font-size: .92rem;
  font-weight: 600;
}
.plano-acao-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}
.plano-acao-form-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
}

/* ---- Agenda: Banner Relógio ---- */
.agenda-clock-banner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: linear-gradient(135deg, rgba(29,78,216,.22), rgba(30,41,59,.55));
  border: 1px solid rgba(59,130,246,.22);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-height: 142px;
}
.agenda-clock-main { display: flex; flex-direction: column; gap: 5px; }
.agenda-clock-time {
  font-size: 2.9rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 22px rgba(59,130,246,.4);
}
.agenda-clock-date {
  font-size: .94rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: .2px;
}
.agenda-clock-tz {
  font-size: .8rem;
  color: var(--text-dim);
}
.agenda-clock-btns {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(37,47,88,.45), rgba(26,33,61,.62));
  border: 1px solid rgba(59,130,246,.14);
}
.agenda-clock-btns .btn {
  min-width: 148px;
  min-height: 48px;
  justify-content: center;
}

/* ---- Timer / Cronômetro Modal ---- */
.ag-clock-modal { min-width: 340px; max-width: 420px; text-align: center; }
.ag-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
  font-weight: 600;
}
.ag-timer-display, .ag-crono-display {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 0 20px rgba(59,130,246,.5);
  margin: .8rem 0;
}
.ag-timer-done {
  color: var(--success);
  text-shadow: 0 0 20px rgba(22,163,74,.6);
  animation: ag-pulse 0.6s ease-in-out infinite alternate;
}
@keyframes ag-pulse {
  from { text-shadow: 0 0 10px rgba(22,163,74,.4); }
  to   { text-shadow: 0 0 32px rgba(22,163,74,.9); }
}
.ag-timer-setup { margin-bottom: .8rem; }
.ag-timer-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ag-timer-input-group { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ag-timer-input-group input {
  width: 62px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 4px;
}
.ag-timer-input-label { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.ag-timer-sep { font-size: 2rem; font-weight: 700; color: var(--text-dim); margin-bottom: 14px; }
.ag-modal-actions { display: flex; gap: .75rem; justify-content: center; margin-top: .8rem; }
.ag-timer-status { margin-top: .6rem; font-size: 1.05rem; font-weight: 600; color: var(--success); min-height: 1.4rem; }
.ag-crono-laps {
  margin-top: .8rem;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ag-crono-lap-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: .85rem;
}
.ag-crono-lap-num { color: var(--text-muted); }
.ag-crono-lap-time { font-weight: 600; font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  .agenda-clock-banner { min-height: 0; padding: 16px; }
  .agenda-clock-main { width: 100%; text-align: center; }
  .agenda-clock-time { font-size: 2.2rem; }
  .agenda-clock-btns .btn { min-width: 0; }
  .agenda-sound-toggle {
    border-radius: var(--radius);
    padding: .7rem .85rem;
  }
}

/* ==================== HÁBITOS ==================== */

/* Frase do dia */
.hab-frase-dia {
  display: flex; align-items: flex-start; gap: 14px;
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(139,92,246,.08));
  border: 1px solid rgba(59,130,246,.25); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 20px;
}
#btn-outra-frase { flex-shrink: 0; align-self: center; }
.hab-frase-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.hab-frase-content { flex: 1; }
.hab-frase-label { font-size: .7rem; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.hab-frase-texto { font-size: .95rem; font-style: italic; color: var(--text); line-height: 1.5; text-align: justify; }
.hab-frase-autor { font-size: .82rem; color: var(--accent); margin-top: 6px; }

/* Lista de hábitos check-in */
.hab-list { display: flex; flex-direction: column; gap: 10px; }
.hab-item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg-card); border-radius: var(--radius);
  padding: 14px 16px; border: 1px solid var(--border);
  transition: border-color .2s, background .2s;
}
.hab-item.done { background: rgba(22,163,74,.06); border-color: rgba(22,163,74,.25); }
.hab-check-btn {
  font-size: 1.5rem; background: none; border: none; cursor: pointer;
  padding: 0; line-height: 1; transition: transform .15s; flex-shrink: 0;
}
.hab-check-btn:hover { transform: scale(1.2); }
.hab-item-icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; font-size: 1.3rem;
  flex-shrink: 0;
}
.hab-item-info { flex: 1; min-width: 0; }
.hab-item-nome { font-weight: 600; font-size: .92rem; }
.hab-item-desc { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.hab-item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.hab-item-cat {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: .74rem; background: rgba(255,255,255,.06); color: var(--text-muted);
}
.hab-streak { font-size: .78rem; color: var(--warning); font-weight: 600; }
.hab-item-obs { flex-shrink: 0; }
.hab-obs-input {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: .8rem; color: var(--text); outline: none;
  transition: border-color .2s; width: 180px;
}
.hab-obs-input:focus { border-color: var(--accent); }

/* Extras: momento + intensidade */
.hab-item-extras {
  width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 0 2px 56px;
  border-top: 1px solid var(--border); margin-top: 4px;
}
.hab-extras-off { opacity: .35; pointer-events: none; }
.hab-extras-label {
  font-size: .75rem; color: var(--text-dim); font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; flex-shrink: 0;
}
.hab-momento-sel { width: auto; min-width: 130px; padding: 5px 10px; font-size: .82rem; }
.hab-int-slider-wrap { min-width: 190px; flex: 1; max-width: 260px; }
.hab-int-track-wrap  { position: relative; padding-bottom: 20px; }
.hab-int-slider {
  width: 100%; accent-color: var(--accent); cursor: pointer;
  height: 6px; border-radius: 3px; display: block;
}
.hab-int-slider:disabled { cursor: default; opacity: .5; }
.hab-int-bubble {
  position: absolute; bottom: 0;
  transform: translateX(-50%);
  font-size: .7rem; font-weight: 700;
  color: var(--accent); white-space: nowrap; pointer-events: none;
}

/* Empty state */
.hab-empty {
  background: var(--bg-card); border-radius: var(--radius); padding: 40px;
  text-align: center; color: var(--text-muted); border: 1px dashed var(--border);
}
.hab-empty p { margin-bottom: 4px; }

/* Visão mensal */
.hab-mensal-table th, .hab-mensal-table td { padding: 6px 4px; }
.hab-cell { cursor: pointer; font-size: 1rem; transition: transform .1s; display: inline-block; }
.hab-cell:hover { transform: scale(1.3); }

/* Relatório — cards de hábito */
.hab-relat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 14px; }
.hab-pct-bar {
  height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden;
}
.hab-pct-fill { height: 100%; border-radius: 3px; transition: width .4s; }

/* Config hábitos — seletor de ícone */
.hab-icone-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px; max-height: 130px; overflow-y: auto;
}
.hab-icone-btn {
  background: none; border: 2px solid transparent; border-radius: 6px;
  font-size: 1.3rem; padding: 4px 6px; cursor: pointer; transition: .15s; line-height: 1;
}
.hab-icone-btn:hover { background: rgba(255,255,255,.08); }
.hab-icone-btn.selected { border-color: var(--accent); background: rgba(59,130,246,.15); }

@media (max-width: 768px) {
  .hab-item { flex-wrap: wrap; }
  .hab-item-obs { width: 100%; }
  .hab-obs-input { width: 100%; }
  .hab-relat-cards { grid-template-columns: 1fr; }
  .hab-frase-dia { flex-direction: column; gap: 8px; }
}

/* ==================== THEME TOGGLE SWITCH ==================== */
.sidebar-header-top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.sidebar-header-top h1 { margin-bottom: 0; }

.theme-toggle-wrap {
  display: flex; align-items: center; gap: 5px;
}
.theme-toggle-icon { width: 14px; height: 14px; opacity: .7; display: flex; align-items: center; user-select: none; }
.theme-toggle-icon svg { width: 14px; height: 14px; display: block; }

.theme-switch {
  position: relative; display: inline-block; width: 42px; height: 22px; cursor: pointer;
}
.theme-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.theme-switch-slider {
  position: absolute; inset: 0; background: #2d4a6e;
  border: 1px solid #334155; border-radius: 11px; transition: background .25s, border-color .25s;
}
.theme-switch-slider::before {
  content: ''; position: absolute;
  height: 16px; width: 16px; left: 2px; top: 2px;
  border-radius: 50%; background: #e2e8f0; transition: transform .25s;
}
.theme-switch input:checked + .theme-switch-slider {
  background: #7dd3fc; border-color: #38bdf8;
}
.theme-switch input:checked + .theme-switch-slider::before {
  transform: translateX(20px); background: #fff;
}

/* ==================== DIÁRIO ==================== */
.diario-sugestoes {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 20px; overflow: hidden;
}
.diario-sugestoes-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: rgba(59,130,246,.06);
}
.diario-sugestoes-header small { font-size: .78rem; }
.diario-tabs-bar {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.diario-tab {
  padding: 8px 16px; border: none; background: transparent;
  color: var(--text-muted); font-size: .85rem; cursor: pointer;
  border-bottom: 2px solid transparent; transition: .15s; white-space: nowrap;
}
.diario-tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.diario-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: rgba(59,130,246,.06); }
.diario-tab-content { display: none; list-style: none; margin: 0; padding: 10px 12px; }
.diario-tab-content.active { display: flex; flex-direction: column; gap: 4px; }

/* ==================== GERENCIAR BASES ==================== */
.gb-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.gb-tab {
  padding: 8px 16px; border: none; background: transparent;
  color: var(--text-muted); font-size: .9rem; cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: .15s; font-family: inherit;
}
.gb-tab:hover { background: rgba(255,255,255,.05); color: var(--text); }
.gb-tab.active { background: var(--accent); color: #fff; }
.gb-section { display: flex; flex-direction: column; gap: 12px; }
.gb-section-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.gb-section-header h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 0; }
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); }
.diario-question-item {
  padding: 7px 12px; border-radius: var(--radius-sm); font-size: .88rem;
  color: var(--text-muted); cursor: pointer; transition: .15s;
  border: 1px solid transparent;
}
.diario-question-item:hover {
  background: rgba(59,130,246,.1); color: var(--text);
  border-color: rgba(59,130,246,.3);
}
.diario-header-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.diario-today { margin-bottom: 24px; }
.diario-day-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.diario-day-title h3 { margin: 0; }
.diario-textarea {
  width: 100%; min-height: 120px; padding: 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: .95rem; font-family: inherit; resize: vertical; box-sizing: border-box;
}
.diario-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.diario-today-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.diario-saved-msg { color: var(--success); font-size: .9rem; }
.diario-entry { margin-bottom: 14px; }
.diario-entry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.diario-entry-text { margin: 0; font-size: .92rem; line-height: 1.6; white-space: pre-wrap; color: var(--text-muted); }
.diario-index { display: flex; flex-direction: column; gap: 6px; }
.diario-index-item {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 14px;
  border-radius: 8px; border: 1px solid var(--border); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.diario-index-item:hover { background: var(--bg-hover, rgba(255,255,255,.04)); border-color: var(--primary); }
.diario-index-item.active { border-color: var(--primary); background: rgba(59,130,246,.08); }
.diario-index-date { font-weight: 600; font-size: .9rem; }
.diario-index-preview { font-size: .83rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-neutral { background: rgba(148,163,184,.2); color: var(--text-muted); font-size: .75rem; padding: 2px 8px; border-radius: 999px; }

@media (max-width: 600px) {
  /* Header: empilha título e controles verticalmente */
  .page-header:has(.diario-header-controls) { flex-direction: column; align-items: flex-start; padding-right: 56px; }
  .diario-header-controls { width: 100%; gap: 8px; }
  #diario-data { flex: 1; min-width: 0; min-height: 44px; font-size: 1rem; padding: 6px 10px; box-sizing: border-box; }
  #btn-diario-hoje { flex-shrink: 0; min-height: 44px; padding: 0 16px; font-size: .95rem; }

  /* Sugestões */
  .diario-sugestoes-header {
    flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px;
  }
  .diario-sugestoes-header small { font-size: .8rem; }
  .diario-tabs-bar {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory; padding-bottom: 2px;
  }
  .diario-tab {
    flex: 0 0 auto; padding: 10px 14px; font-size: .82rem;
    scroll-snap-align: start; min-height: 44px;
  }
  .diario-tab-content.active { gap: 2px; }
  .diario-question-item {
    padding: 10px 12px; font-size: .9rem; min-height: 44px;
    display: flex; align-items: center; line-height: 1.4;
  }

  /* Editor */
  .diario-day-title { flex-wrap: wrap; gap: 6px; }
  .diario-textarea { min-height: 180px; font-size: 1rem; padding: 10px; }
  .diario-today-actions { gap: 8px; }
  .diario-today-actions .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }

  /* Índice de registros */
  .diario-index { gap: 8px; }
  .diario-index-item { padding: 12px 14px; }
  .diario-index-date { font-size: .95rem; }
  .diario-index-preview { font-size: .85rem; white-space: normal; overflow: visible; text-overflow: unset; line-height: 1.4; }
}

/* ==================== RODA DA VIDA ==================== */
.rv-page { padding-bottom: 40px; }

.rv-topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; margin-bottom: 16px; padding-right: 48px;
}
.rv-nav-area { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-nav-area .btn { height: 30px; padding-top: 0; padding-bottom: 0; }
.rv-date-badge {
  padding: 5px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; font-size: .9rem; font-weight: 500; white-space: nowrap;
}
.rv-date-badge.is-saved { border-color: var(--success); color: var(--success); }

.rv-sugg-info {
  background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: .88rem;
  color: var(--text-muted); margin-bottom: 16px;
}

.rv-layout {
  display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap;
}
.rv-wheel-area {
  flex: 0 0 auto; width: clamp(280px, 42%, 500px);
  max-width: 100%; padding-inline: 10px; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.rv-canvas { width: 100%; max-width: 100%; height: auto; display: block; }
.rv-form-area {
  flex: 1 1 320px; display: flex; flex-direction: column; gap: 16px; min-width: 280px;
}

.rv-quad-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.rv-quad-head {
  padding: 4px 0 10px 10px; margin-bottom: 6px;
}
.rv-quad-lbl { font-weight: 600; font-size: .95rem; }

.rv-cat-item { margin-bottom: 14px; }
.rv-cat-item:last-child { margin-bottom: 0; }
.rv-cat-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; gap: 8px;
}
.rv-cat-name { font-size: .88rem; color: var(--text-muted); flex: 1; }
.rv-cat-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.rv-sugg-badge {
  font-size: .78rem; padding: 2px 7px; border-radius: 999px;
  background: rgba(59,130,246,.15); color: #93c5fd; white-space: nowrap; cursor: default;
}
.rv-score-val {
  font-size: 1.15rem; font-weight: 700; min-width: 28px; text-align: right; color: var(--text);
}

.rv-slider-track { margin-bottom: 2px; }
.rv-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px; cursor: pointer; outline: none;
  background: linear-gradient(to right,
    var(--rv-fill, var(--accent)) calc((var(--value, 5) - 1) / 9 * 100%),
    rgba(255,255,255,.12) calc((var(--value, 5) - 1) / 9 * 100%)
  );
}
.rv-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--rv-fill, var(--accent));
  box-shadow: 0 1px 4px rgba(0,0,0,.4); transition: transform .1s;
}
.rv-range::-webkit-slider-thumb:active { transform: scale(1.2); }
.rv-range::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--rv-fill, var(--accent));
  background: #fff; cursor: pointer;
}
.rv-range-labels {
  display: flex; justify-content: space-between; margin-top: 2px;
}
.rv-range-labels small { font-size: .73rem; color: var(--text-dim); }

.rv-btns { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

/* ==================== LANDING PAGE ==================== */
.landing-page { min-height: 100vh; background: var(--bg); overflow-x: hidden; }

/* ---- Header ---- */
.landing-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(15,23,42,.96); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); transition: box-shadow .3s;
}
.landing-header.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,.45); }
.landing-header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.landing-brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  flex-shrink: 0;
}
.landing-brand:hover { text-decoration: none; }
.landing-brand-icon { font-size: 1.6rem; line-height: 1; }
.landing-brand-name { font-size: 1.1rem; font-weight: 700; color: var(--text); display: block; line-height: 1.2; }
.landing-brand-sub { font-size: .65rem; color: var(--text-muted); display: block; white-space: nowrap; }

.landing-nav {
  display: flex; align-items: center; gap: 2px;
}
.landing-nav-link {
  padding: 7px 13px; border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: .88rem; font-weight: 500; text-decoration: none; transition: color .2s, background .2s;
}
.landing-nav-link:hover { color: var(--text); background: rgba(255,255,255,.07); text-decoration: none; }
.landing-nav-link.active { color: var(--accent); background: rgba(59,130,246,.1); text-decoration: none; }

.landing-nav-divider { width: 1px; height: 22px; background: var(--border); margin: 0 8px; }

.landing-nav-contact {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none; transition: color .2s, background .2s;
}
.landing-nav-contact:hover { color: var(--accent); background: rgba(59,130,246,.1); text-decoration: none; }
.landing-nav-contact svg { width: 18px; height: 18px; display: block; }

.landing-nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 6px 8px;
  cursor: pointer; align-items: center; justify-content: center;
}
.landing-nav-toggle svg { width: 20px; height: 20px; display: block; }

/* ---- Sections ---- */
.landing-hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 88px 24px 40px;
}
.landing-hero .auth-container { min-height: auto; }

.landing-section { padding: 80px 24px; }
.landing-container { max-width: 1100px; margin: 0 auto; }

.landing-badge {
  display: inline-block; padding: 4px 14px; border-radius: 20px;
  background: rgba(59,130,246,.13); color: var(--accent); font-size: .75rem;
  font-weight: 600; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 16px;
}
.landing-section-title {
  font-size: 2rem; font-weight: 700; margin-bottom: 12px; color: var(--text);
}
.landing-section-desc {
  font-size: .97rem; color: var(--text-muted); margin-bottom: 48px; max-width: 600px; line-height: 1.65;
}

/* ---- Features ---- */
.landing-features-section { background: var(--bg-card); text-align: center; }
.landing-features-section .landing-section-desc { margin-left: auto; margin-right: auto; }

.landing-features-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; text-align: left;
}
.landing-feature-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 18px; transition: border-color .2s, transform .2s;
}
.landing-feature-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.landing-feature-icon {
  width: 44px; height: 44px; border-radius: 10px; background: rgba(59,130,246,.1);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.landing-feature-icon svg { width: 22px; height: 22px; color: var(--accent); display: block; }
.landing-feature-card h3 { font-size: .97rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.landing-feature-card p { font-size: .83rem; color: var(--text-muted); line-height: 1.55; }

/* ---- About ---- */
.landing-about-section { background: var(--bg); }
.landing-about-inner { display: grid; grid-template-columns: 1fr auto; gap: 60px; align-items: center; }
.landing-about-text { font-size: .95rem; color: var(--text-muted); line-height: 1.75; margin-bottom: 10px; }
.landing-about-text strong { color: var(--text); }
.landing-about-contacts { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.landing-contact-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  color: var(--text-muted); font-size: .88rem; text-decoration: none;
  transition: color .2s, border-color .2s, background .2s;
}
.landing-contact-btn:hover {
  color: var(--accent); border-color: var(--accent);
  background: rgba(59,130,246,.06); text-decoration: none;
}
.landing-contact-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.landing-about-stats { display: flex; flex-direction: column; gap: 20px; }
.landing-stat {
  text-align: center; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 36px;
}
.landing-stat-number { display: block; font-size: 2.2rem; font-weight: 700; color: var(--accent); }
.landing-stat-label { display: block; font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* ---- Footer ---- */
.landing-footer {
  padding: 22px 24px; text-align: center; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: .82rem; background: var(--bg-card);
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.landing-visit-counter {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; color: var(--text-dim);
}
.landing-visit-counter svg { width: 13px; height: 13px; opacity: .7; }

/* ---- Mobile ---- */
@media (max-width: 768px) {
  .landing-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    padding: 8px 12px; flex-direction: column; align-items: flex-start; gap: 2px;
  }
  .landing-nav.open { display: flex; }
  .landing-nav-link { width: 100%; padding: 10px 14px; }
  .landing-nav-divider { display: none; }
  .landing-nav-contact { width: 40px; }
  .landing-nav-toggle { display: flex; }
  .landing-about-inner { grid-template-columns: 1fr; gap: 32px; }
  .landing-about-stats { flex-direction: row; gap: 12px; }
  .landing-stat { flex: 1; padding: 14px 10px; }
  .landing-stat-number { font-size: 1.5rem; }
  .landing-section-title { font-size: 1.5rem; }
  .landing-section { padding: 56px 20px; }
}
.rv-del-btn { color: var(--danger) !important; }

.rv-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #e2e8f0; padding: 10px 20px;
  border-radius: 999px; font-size: .9rem; z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,.4); transition: opacity .4s;
}

/* Config. Roda da Vida */
.rvc-quads { display: flex; flex-direction: column; gap: 20px; }
.rvc-quad-card { padding: 16px; }
.rvc-quad-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  flex-wrap: wrap;
}
.rvc-quad-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.rvc-quad-head strong { flex: 1; font-size: 1rem; }
.rvc-quad-actions { display: flex; gap: 4px; }
.rvc-cat-table { margin-bottom: 10px; }
.rvc-cat-acts { white-space: nowrap; }
.rvc-cor-dot { display: inline-block; width: 16px; height: 16px; border-radius: 3px; vertical-align: middle; }
.rvc-add-cat-wrap { padding: 4px 0; }

/* ==================== LIGHT THEME ==================== */
[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: #f8fafc;
  --bg-input: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
}
[data-theme="light"] .nav-link:hover { background: rgba(0,0,0,.05); }
[data-theme="light"] .nav-link.active { background: rgba(59,130,246,.1); }
[data-theme="light"] .table thead { background: rgba(0,0,0,.03); }
[data-theme="light"] .table tr:hover { background: rgba(0,0,0,.02); }
[data-theme="light"] .btn-icon:hover { background: rgba(0,0,0,.07); }
[data-theme="light"] .btn-icon.btn-danger:hover { background: rgba(220,38,38,.12); }
[data-theme="light"] .btn-secondary { background: #e2e8f0; color: var(--text); }
[data-theme="light"] .btn-secondary:hover { background: #cbd5e1; }
[data-theme="light"] .agenda-clock-time { color: #1e293b; text-shadow: none; }
[data-theme="light"] .ag-timer-display,
[data-theme="light"] .ag-crono-display { color: #1e293b; text-shadow: none; }
[data-theme="light"] .hab-pct-bar { background: rgba(0,0,0,.08); }
[data-theme="light"] .chip-small { background: rgba(0,0,0,.06); color: var(--text-muted); }
[data-theme="light"] .hab-icone-btn:hover { background: rgba(0,0,0,.06); }
[data-theme="light"] .emo-config-sub { background: rgba(0,0,0,.03); }
[data-theme="light"] .sidebar.open { box-shadow: 4px 0 20px rgba(0,0,0,.15); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cbd5e1; }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,.35); }
[data-theme="light"] .ag-crono-lap-row { background: #f1f5f9; }

/* ==================== HOME PAGE ==================== */
.home-page { max-width: 860px; margin: 0 auto; }

.home-banner {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59,130,246,.07) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
  margin-bottom: 28px;
  text-align: center;
  box-shadow: var(--shadow);
}

.home-clock {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 0 0 24px rgba(59,130,246,.35);
}

.home-date {
  font-size: .95rem;
  color: var(--text-muted);
  margin-bottom: 22px;
  text-transform: capitalize;
}

.home-message-wrap {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: left;
}

.home-message-content {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.home-message-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--warning); margin-top: 2px; }
.home-message-icon svg { width: 20px; height: 20px; display: block; }

.home-message-body { flex: 1; }

.home-message-text {
  font-size: .88rem;
  color: var(--text);
  line-height: 1.65;
  font-style: italic;
  text-align: justify;
}

.home-message-cat {
  font-style: normal;
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--warning);
}

.home-message-author {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 5px;
  min-height: 1em;
}

.home-msg-refresh {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  padding: 0;
}
.home-msg-refresh:hover { color: var(--accent); border-color: var(--accent); }
.home-msg-refresh svg { width: 15px; height: 15px; display: block; }

.home-modules-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.home-modules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.home-module-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s, color .18s;
  box-shadow: var(--shadow);
}
.home-module-btn:hover {
  text-decoration: none;
  color: var(--module-color, var(--accent));
  border-color: var(--module-color, var(--accent));
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
}

.home-module-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: center;
  color: var(--module-color, var(--accent));
  transition: background .18s;
}
.home-module-btn:hover .home-module-icon {
  background: color-mix(in srgb, var(--module-color, var(--accent)) 16%, transparent);
}
.home-module-icon svg { width: 22px; height: 22px; display: block; }

.home-module-label {
  font-size: .84rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.25;
}

@media (max-width: 768px) {
  .home-clock { font-size: 2.6rem; letter-spacing: 2px; }
  .home-banner { padding: 24px 18px; }
  .home-modules-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .home-modules-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

[data-theme="light"] .home-banner {
  background: linear-gradient(135deg, #fff 0%, rgba(59,130,246,.05) 100%);
}
[data-theme="light"] .home-message-wrap {
  background: rgba(0,0,0,.02);
  border-color: rgba(0,0,0,.06);
}
[data-theme="light"] .home-module-icon { background: rgba(0,0,0,.05); }
[data-theme="light"] .home-clock { text-shadow: none; }

/* ==================== BOTÃO VOLTAR / HOME ==================== */
.btn-home-back {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 150;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: color .15s, border-color .15s, background .15s;
}
.btn-home-back:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(59,130,246,.07);
}
.btn-home-back svg { width: 16px; height: 16px; flex-shrink: 0; display: block; }

/* =====================================================
   VIRTUDES — Controle de Virtudes
   ===================================================== */

/* ── Date bar ── */
.virtudes-date-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.form-control-inline {
  padding: 5px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .875rem;
}

/* ── Progress bar ── */
.virtudes-progress-wrap { margin-bottom: 20px; }
.virtudes-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.virtudes-progress-pct { font-weight: 600; color: var(--text); }
.virtudes-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.virtudes-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  border-radius: 99px;
  transition: width .4s ease;
}

/* ── Grupos ── */
.virtudes-grupos { display: flex; flex-direction: column; gap: 20px; }
.virtudes-grupo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--catcolor, #64748b);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid color-mix(in srgb, var(--catcolor, #64748b) 25%, transparent);
}
.virtudes-grupo-header svg { width: 16px; height: 16px; }
.virtudes-grupo-count {
  margin-left: auto;
  font-size: .75rem;
  background: color-mix(in srgb, var(--catcolor, #64748b) 15%, transparent);
  color: var(--catcolor, #64748b);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
}

/* ── Grid de botões de virtudes ── */
.virtudes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

/* ── Botão de virtude ── */
.virtude-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .18s ease;
  text-align: center;
  color: var(--text);
  overflow: hidden;
}
.virtude-btn:hover {
  border-color: var(--vcolor, #8b5cf6);
  background: color-mix(in srgb, var(--vcolor, #8b5cf6) 8%, var(--bg-card));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--vcolor, #8b5cf6) 20%, transparent);
}
.virtude-btn.praticada {
  border-color: var(--vcolor, #8b5cf6);
  background: color-mix(in srgb, var(--vcolor, #8b5cf6) 14%, var(--bg-card));
}
.virtude-btn.praticada::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--vcolor, #8b5cf6) 6%, transparent), transparent);
  pointer-events: none;
}
.virtude-icon {
  font-size: 1.6rem;
  line-height: 1;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.15));
}
.virtude-nome {
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}
.virtude-btn.praticada .virtude-nome { color: var(--vcolor, #8b5cf6); }
.virtude-streak {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: .65rem;
  font-weight: 700;
  background: rgba(0,0,0,.35);
  color: #fff;
  padding: 1px 5px;
  border-radius: 99px;
}
.virtude-check {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: .75rem;
  font-weight: 900;
  color: var(--vcolor, #8b5cf6);
}
.virtude-hint {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: normal;
  min-width: 200px;
  max-width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: .75rem;
  color: var(--text-muted);
  box-shadow: var(--shadow);
  z-index: 100;
  text-align: left;
  pointer-events: none;
}
.virtude-btn:hover .virtude-hint,
.virtude-btn:focus .virtude-hint { display: block; }

/* ── Relatório ── */
.vrel-section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: 20px 0 8px;
}
.virtudes-cat-bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.vcat-bar-item { display: flex; align-items: center; gap: 8px; }
.vcat-bar-label { min-width: 130px; font-size: .82rem; font-weight: 600; }
.vcat-bar-track {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.vcat-bar-fill { height: 100%; border-radius: 99px; transition: width .4s ease; }
.vcat-bar-pct { min-width: 36px; text-align: right; font-size: .78rem; color: var(--text-muted); font-weight: 600; }

.mini-bar { display: inline-block; width: 60px; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; vertical-align: middle; margin-right: 4px; }
.mini-bar-fill { height: 100%; border-radius: 99px; }

.top-dias-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.top-dia-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  text-align: center;
  min-width: 100px;
}
.top-dia-data { font-size: .8rem; color: var(--text-muted); }
.top-dia-qtd { font-size: 1rem; font-weight: 700; color: var(--accent); }

/* ── Config ── */
.vconfig-table-wrap { overflow-x: auto; }
.row-inactive { opacity: .5; }
.row-inactive td:first-child::after { content: ' (inativo)'; font-size: .7rem; color: var(--text-muted); }

/* ── Info box ── */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: .83rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.info-box svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .virtudes-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .virtude-btn { padding: 10px 6px; }
  .virtude-icon { font-size: 1.3rem; }
  .virtude-nome { font-size: .72rem; }
  .vcat-bar-label { min-width: 90px; font-size: .75rem; }
}
[data-theme="light"] .virtude-btn { background: #fff; }
[data-theme="light"] .virtude-btn.praticada { background: color-mix(in srgb, var(--vcolor, #8b5cf6) 10%, #fff); }

/* ==================== CARROSSEL DE APRESENTA��O ==================== */
.landing-carousel-section {
  background: var(--bg);
  padding: 64px 0 0;
}
.landing-carousel-header {
  text-align: center;
  padding: 0 24px 32px;
}
.landing-carousel-header .landing-section-desc { margin-bottom: 0; margin-left: auto; margin-right: auto; }

/* ==================== CARROSSEL VANILLA JS ==================== */
.pcf-carousel {
  position: relative;
  overflow: hidden;
  user-select: none;
}
.pcf-carousel-track {
  display: flex;
  transition: transform .5s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.pcf-carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  min-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
}
.pcf-slide-1 { background: linear-gradient(135deg, #0a0f1e 0%, #1a237e 55%, #1a0533 100%); }
.pcf-slide-2 { background: linear-gradient(135deg, #042f2e 0%, #0c4a6e 60%, #0a0f1e 100%); }
.pcf-slide-3 { background: linear-gradient(135deg, #052e16 0%, #064e3b 50%, #0c4a6e 100%); }
.pcf-slide-4 { background: linear-gradient(135deg, #2e1065 0%, #4c1d95 50%, #1e3a5f 100%); }

/* Botões prev/next */
.pcf-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background .2s, transform .15s;
  font-family: inherit;
  padding: 0;
}
.pcf-carousel-btn:hover { background: rgba(0,0,0,.6); transform: translateY(-50%) scale(1.1); }
.pcf-carousel-prev { left: 14px; }
.pcf-carousel-next { right: 14px; }

/* Dots indicadores */
.pcf-carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.pcf-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  padding: 0;
  transition: background .3s, width .3s, border-radius .3s;
}
.pcf-dot.active {
  background: #fff;
  width: 28px;
  border-radius: 5px;
}

.pcf-slide-body {
  text-align: center;
  max-width: 820px;
  width: 100%;
}
.pcf-slide-emoji {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 20px;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.4));
}
.pcf-slide-title {
  font-size: 2rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 14px;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
  line-height: 1.25;
}
.pcf-slide-sub {
  font-size: 1rem;
  color: rgba(226,232,240,.8);
  margin-bottom: 28px;
  line-height: 1.65;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}
.pcf-cta-btn {
  display: inline-block;
  padding: 13px 32px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  font-family: 'Inter', system-ui, sans-serif;
  box-shadow: 0 4px 16px rgba(59,130,246,.4);
}
.pcf-cta-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59,130,246,.5);
}

/* Slide 2 � m�dulos */
.pcf-modules-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
.pcf-module-chip {
  padding: 9px 18px;
  background: rgba(255,255,255,.13);
  color: #f1f5f9;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

/* Slide 3 � relat�rios */
.pcf-reports-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.pcf-report-card {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  padding: 14px 16px;
  color: #f1f5f9;
  font-size: .9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(4px);
  text-align: left;
}
.pcf-report-card span:first-child { font-size: 1.4rem; flex-shrink: 0; }

/* Slide 4 � integra��o */
.pcf-int-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 18px auto;
  max-width: 680px;
}
.pcf-int-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pcf-int-node {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: .9rem;
  color: #f1f5f9;
  font-weight: 500;
}
.pcf-int-center-node {
  background: rgba(59,130,246,.35);
  border: 1px solid rgba(99,179,237,.5);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.pcf-int-line {
  color: rgba(255,255,255,.35);
  font-size: .85rem;
  letter-spacing: -1px;
}
.pcf-int-arrows {
  color: rgba(255,255,255,.45);
  font-size: 1.3rem;
}
.pcf-int-note {
  font-size: .85rem;
  color: rgba(226,232,240,.6);
  margin-top: 10px;
  font-style: italic;
  margin-bottom: 0;
}


/* ==================== BOT�O TEMA NA LANDING HEADER ==================== */
/* �cone sol/lua: visibilidade controlada pelo data-theme */
[data-theme="dark"] #ltg-sun { display: none; }
[data-theme="dark"] #ltg-moon { display: block; }
[data-theme="light"] #ltg-sun { display: block; }
[data-theme="light"] #ltg-moon { display: none; }
/* padr�o sem data-theme (tema escuro inicial) */
#ltg-sun { display: none; }
#ltg-moon { display: block; }

/* ==================== LANDING � TEMA CLARO ==================== */
[data-theme="light"] .landing-header {
  background: rgba(248,250,252,.97);
  border-bottom-color: #e2e8f0;
}
[data-theme="light"] .landing-header .landing-brand-name,
[data-theme="light"] .landing-header .landing-brand-sub { color: #1e293b; }
[data-theme="light"] .landing-header .landing-nav-link { color: #475569; }
[data-theme="light"] .landing-header .landing-nav-link:hover { background: rgba(0,0,0,.05); color: #1e293b; }
[data-theme="light"] .landing-header .landing-nav-link.active { color: #2563eb; background: rgba(37,99,235,.08); }
[data-theme="light"] .landing-header .landing-nav-contact { color: #475569; }
[data-theme="light"] .landing-header .landing-nav-contact:hover { color: #2563eb; background: rgba(37,99,235,.08); }
[data-theme="light"] .landing-header .landing-nav-toggle { border-color: #e2e8f0; color: #1e293b; }
[data-theme="light"] .landing-carousel-section { background: #f1f5f9; }
[data-theme="light"] .landing-footer { background: #fff; border-top-color: #e2e8f0; }

/* ==================== CARROSSEL � RESPONSIVO ==================== */
@media (max-width: 768px) {
  .pcf-carousel-slide { min-height: 360px; padding: 40px 20px; }
  .pcf-slide-title { font-size: 1.45rem; }
  .pcf-slide-sub { font-size: .88rem; margin-bottom: 22px; }
  .pcf-slide-emoji { font-size: 3rem; margin-bottom: 14px; }
  .pcf-reports-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pcf-int-line { display: none; }
  .pcf-int-row { gap: 6px; }
  .landing-carousel-section { padding: 48px 0 0; }
  .pcf-carousel-btn { width: 36px; height: 36px; font-size: 1.5rem; }
  .pcf-carousel-prev { left: 6px; }
  .pcf-carousel-next { right: 6px; }
}
@media (max-width: 480px) {
  .pcf-carousel-slide { min-height: 300px; padding: 32px 14px; }
  .pcf-slide-title { font-size: 1.2rem; }
  .pcf-reports-grid { grid-template-columns: 1fr; }
  .pcf-module-chip { font-size: .82rem; padding: 7px 13px; }
}

