/* css/style.css */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #FAF8F4;
  --bg-tertiary: #F1ECE2;
  --text-primary: #1F1B16;
  --text-secondary: #8A8275;
  --text-tertiary: #A39A89;
  --border: #E8E2D6;
  --border-strong: #D8D1C3;
  --accent: #C2542D;
  --accent-strong: #A03D1C;
  --accent-bg: #FBEFE7;
  --success: #3E5733;
  --success-bg: #EAF0E4;
  --warning: #8A5A12;
  --warning-bg: #FBEFD9;
  --info: #1F4E80;
  --info-bg: #E6EEF8;
  --danger: #8A2A1F;
  --danger-bg: #FBE7E3;
  --radius-md: 9px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(31, 27, 22, 0.07);
  --shadow-md: 0 4px 14px rgba(31, 27, 22, 0.09);
  --shadow-lg: 0 20px 50px rgba(31, 27, 22, 0.30);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--info);
  text-decoration: none;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -16px); }
}

/* ───── Layout geral ───── */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 208px;
  min-width: 208px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 0;
}

.sidebar-logo {
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.sidebar-logo .mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo .mark i {
  color: #fff;
  font-size: 14px;
}

.sidebar-logo span {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link i {
  font-size: 16px;
}

.sidebar-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-link.active {
  color: var(--text-primary);
  border-left-color: var(--accent);
  background: var(--bg-secondary);
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-footer button {
  font-size: 11px;
  padding: 5px 9px;
}

.main-content {
  flex: 1;
  padding: 30px 38px;
  max-width: 1000px;
  animation: fadeUp 0.35s ease backwards;
}

/* ───── Topo de página ───── */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.page-header h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* ───── Botões ───── */

button, .btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

button:hover, .btn:hover {
  background: var(--bg-secondary);
  border-color: var(--text-tertiary);
}

button:active, .btn:active {
  transform: scale(0.97);
}

button.primary {
  background: var(--text-primary);
  color: var(--bg-secondary);
  border-color: var(--text-primary);
}

button.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

button.full {
  width: 100%;
  justify-content: center;
}

button.danger-outline {
  border-color: var(--danger);
  color: var(--danger);
}

button.danger-outline:hover {
  background: var(--danger-bg);
}

/* ───── Inputs ───── */

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  font-family: var(--font-sans);
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

textarea {
  resize: vertical;
  min-height: 70px;
}

label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.campo {
  margin-bottom: 14px;
}

/* ───── Cards ───── */

.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 17px 19px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.3s ease backwards;
}

.card + .card {
  margin-top: 11px;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.card-list .card:nth-child(1) { animation-delay: 0.02s; }
.card-list .card:nth-child(2) { animation-delay: 0.06s; }
.card-list .card:nth-child(3) { animation-delay: 0.1s; }
.card-list .card:nth-child(4) { animation-delay: 0.14s; }
.card-list .card:nth-child(5) { animation-delay: 0.18s; }

/* ───── Métricas ───── */

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.metric-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 15px 17px;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.metric-value {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ───── Badges ───── */

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge-ativo, .badge-concluido { background: var(--success-bg); color: var(--success); }
.badge-planejamento, .badge-pendente { background: var(--warning-bg); color: var(--warning); }
.badge-em_andamento { background: var(--info-bg); color: var(--info); }
.badge-arquivado, .badge-neutro { background: var(--bg-tertiary); color: var(--text-secondary); }

/* ───── Notas fixas ───── */

.notas-fixas {
  background: linear-gradient(135deg, var(--accent-bg), var(--bg-secondary));
  border: 1px solid #F0DCC8;
  border-radius: var(--radius-lg);
  padding: 14px 17px;
  margin-bottom: 22px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.notas-fixas .titulo {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
  margin-bottom: 4px;
}

.notas-fixas .texto {
  font-size: 13px;
  color: #5A4636;
  line-height: 1.55;
}

.notas-fixas textarea {
  background: transparent;
  border: 1.5px solid var(--accent);
}

/* ───── Tabs ───── */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.tab {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 4px;
  margin-right: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--text-primary);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

.subview {
  display: none;
}

.subview.active {
  display: block;
  animation: fadeUp 0.25s ease;
}

/* ───── Tema / Assunto ───── */

.tema-card .tema-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
}

.tema-titulo {
  display: flex;
  align-items: center;
  gap: 9px;
}

.tema-titulo p {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.tema-descricao {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: -2px 0 10px;
}

.tema-descricao-toggle {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.tema-descricao-toggle:hover {
  text-decoration: underline;
}

.tema-actions i {
  font-size: 16px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s;
}

.tema-actions i:hover {
  color: var(--danger);
}

.assunto-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--bg-tertiary);
  transition: background 0.15s;
  border-radius: 8px;
}

.assunto-row:hover {
  background: var(--bg-secondary);
  margin: 0 -8px;
  padding: 10px 8px;
}

.assunto-row .conteudo {
  flex: 1;
}

.assunto-row .texto {
  font-size: 13px;
  font-weight: 500;
}

.assunto-row .observacao {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.45;
}

.assunto-row input[type="checkbox"] {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--success);
  cursor: pointer;
}

.assunto-row.concluido {
  opacity: 0.55;
}

.assunto-row.concluido .texto {
  text-decoration: line-through;
}

.concluidos-toggle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  padding: 9px 0 0;
  cursor: pointer;
  border-top: 1px solid var(--bg-tertiary);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
}

.concluidos-toggle:hover {
  color: var(--text-secondary);
}

.concluidos-toggle i {
  transition: transform 0.25s;
  font-size: 13px;
}

.concluidos-toggle.aberto i {
  transform: rotate(180deg);
}

.concluidos-lista {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.concluidos-lista.aberto {
  max-height: 600px;
}

/* ───── Lista de clientes ───── */

.cliente-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.cliente-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.cliente-row .nome {
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.cliente-row .meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.cliente-row .indicadores {
  display: flex;
  gap: 9px;
  align-items: center;
}

/* ───── Configurações: linha com toggle ───── */

.config-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.config-row .titulo {
  font-size: 14px;
  font-weight: 600;
}

.config-row .descricao {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.config-row input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ───── Login ───── */

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.login-blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  filter: blur(2px);
  z-index: 0;
}

.login-blob-1 {
  width: 380px;
  height: 380px;
  background: var(--accent);
  top: -130px;
  left: -110px;
  animation: float 8s ease-in-out infinite;
}

.login-blob-2 {
  width: 300px;
  height: 300px;
  background: var(--success);
  bottom: -110px;
  right: -90px;
  animation: float 9s ease-in-out infinite reverse;
}

.login-card {
  position: relative;
  z-index: 2;
  background: var(--bg-secondary);
  border-radius: 18px;
  padding: 38px 34px;
  width: 320px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: 0.1s;
}

.login-logo {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  animation-delay: 0.35s;
}

.login-logo i {
  color: #fff;
  font-size: 24px;
}

.login-card h1 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}

.login-card .subtitulo {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: 22px;
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--text-tertiary);
  transition: color 0.15s;
  pointer-events: none;
}

.login-input-wrap input {
  padding-left: 36px;
}

.login-input-wrap input:focus + i {
  color: var(--accent);
}

.login-erro {
  font-size: 12px;
  color: var(--danger);
  background: var(--danger-bg);
  padding: 9px 11px;
  border-radius: var(--radius-md);
  margin-bottom: 13px;
  display: none;
  animation: fadeUp 0.2s ease;
}

/* ───── Estado vazio / carregando ───── */

.estado-vazio {
  text-align: center;
  padding: 44px 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ───── Estratégia: texto simples e blocos estruturados ───── */

.card-text-simples {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
}

.estrategia-passos {
  display: flex;
  flex-direction: column;
}

.estrategia-passo-row {
  display: flex;
  gap: 11px;
  padding: 9px 0;
  border-top: 1px solid var(--bg-tertiary);
}

.estrategia-passo-row:first-child {
  border-top: none;
}

.estrategia-passo-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.estrategia-passo-texto {
  font-size: 13.5px;
  line-height: 1.5;
  font-weight: 500;
}

.estrategia-passo-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-bg);
  padding: 1px 7px;
  border-radius: 6px;
  margin-left: 6px;
  white-space: nowrap;
}

.estrategia-condicao {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  background: var(--accent-bg);
  border-radius: 9px;
  padding: 10px 12px;
  margin-top: 12px;
}

.estrategia-condicao i {
  color: var(--accent);
  font-size: 15px;
  margin-top: 1px;
}

.estrategia-condicao-texto {
  font-size: 12.5px;
  color: #5A4636;
  line-height: 1.5;
}

/* ───── Toggle de modo (texto / estruturado) ───── */

.modo-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.modo-toggle-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: 0.15s;
}

.modo-toggle-btn.active {
  background: var(--text-primary);
  color: var(--bg-secondary);
}

/* ───── Edição de blocos de estratégia ───── */

.bloco-edicao-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  margin-bottom: 9px;
}

.bloco-edicao-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.bloco-edicao-acoes {
  display: flex;
  gap: 9px;
}

.bloco-edicao-acoes i {
  font-size: 14px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s;
}

.bloco-edicao-acoes i:hover {
  color: var(--accent);
}

/* ───── Modal de confirmação ───── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 27, 22, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.aberto {
  display: flex;
  animation: fadeUp 0.2s ease;
}

.modal-box {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  width: 380px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-box h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 9px;
  letter-spacing: -0.01em;
}

.modal-box p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 17px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
