/* ============================================================
   Adevê - design system
   Referência: dashboard claro, pílulas super arredondadas,
   verde-lima #C9FB7C, azul #2938F3, tipografia estilo Lufga.
   ============================================================ */

:root {
  --lime: #C9FB7C;
  --lime-soft: #EAFCD2;
  --blue: #2938F3;
  --blue-soft: #E4E7FE;
  --ink: #0F1117;
  --gray: #596070;
  --gray-2: #8C94A6;
  --purple: #A78BFA;
  --purple-soft: #F1EBFE;
  --orange: #FF9F2E;
  --orange-soft: #FFF0DC;
  --red: #FF6B6B;
  --red-soft: #FFE7E7;
  --slate: #7B8497;

  --bg: #EFF0F3;
  --panel: #F7F8FA;
  --card: #FFFFFF;
  --tile: #FFFFFF;
  --border: #E5E7EC;
  --text: #0F1117;
  --muted: #596070;
  --muted-2: #8C94A6;
  --shadow: 0 2px 10px rgba(15, 17, 23, 0.05);
  --shadow-lg: 0 12px 40px rgba(15, 17, 23, 0.12);
  --stripe: rgba(41, 56, 243, 0.16);

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --font: "Poppins", "Lufga", -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #0B0D12;
  --panel: #12151C;
  --card: #181C25;
  --tile: #1D222D;
  --border: #262C38;
  --text: #F4F5F7;
  --muted: #A6ACBA;
  --muted-2: #737B8C;
  --lime-soft: #2A3520;
  --blue-soft: #1B2040;
  --purple-soft: #292344;
  --orange-soft: #3A2C16;
  --red-soft: #3C2020;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --stripe: rgba(122, 134, 255, 0.2);
}

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

html, body { height: 100%; }

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

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ Estrutura ============ */

.layout {
  display: grid;
  grid-template-columns: 96px 1fr;
  min-height: 100vh;
}

/* ---- Sidebar ---- */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 24px;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 50;
}
.sidebar::-webkit-scrollbar { display: none; }

/* Identidade: logo horizontal "advê", "ad" preto e "vê" verde, sem fundo. */
:root { --logo-verde: #8FD41F; }
[data-theme="dark"] { --logo-verde: #C9FB7C; }
.logo, .logo-marca {
  display: inline-flex;
  align-items: baseline;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.8px;
  line-height: 1;
  font-family: var(--font);
  white-space: nowrap;
}
.logo { margin-bottom: 14px; flex-shrink: 0; padding-top: 10px; }
.logo .ad, .logo-marca .ad { color: var(--text); }
.logo .ve, .logo-marca .ve { color: var(--logo-verde); }
.topbar-marca { font-size: 24px; margin-right: 8px; }
@media (max-width: 1000px) { .topbar-marca { display: none; } }
.wordmark {
  color: var(--logo-verde);
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}

.nav-item {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: none;
  background: var(--tile);
  color: var(--muted);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  position: relative;
  flex-shrink: 0;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { transform: translateY(-2px); color: var(--text); }
.nav-item.ativo { background: var(--lime); color: #0F1117; }
.nav-item svg { width: 21px; height: 21px; }

.nav-tooltip {
  position: fixed;
  transform: translateY(-50%);
  background: var(--ink);
  color: #fff;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  max-width: min(240px, 65vw);
  pointer-events: none;
  z-index: 60;
}

/* ---- Área principal ---- */

.main {
  padding: 20px 28px 40px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.busca {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: 999px;
  padding: 0 22px;
  height: 52px;
  box-shadow: var(--shadow);
}
.busca svg { width: 18px; height: 18px; color: var(--muted-2); flex-shrink: 0; }
.busca input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 14px;
}
.busca input::placeholder { color: var(--muted-2); }

.top-acao {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: none;
  background: var(--card);
  color: var(--text);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  position: relative;
}
.top-acao svg { width: 20px; height: 20px; }
.top-acao .ponto {
  position: absolute;
  top: 13px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--card);
}

.conta-menu { position: relative; flex-shrink: 0; }

.avatar-top {
  border: 0;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 16px;
  box-shadow: var(--shadow);
}

.conta-opcoes {
  position: absolute;
  top: 100%;
  right: 0;
  width: 208px;
  max-width: 65vw;
  padding-top: 8px;
  z-index: 60;
}
.conta-opcoes-card {
  display: grid;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.conta-opcoes strong {
  padding: 8px 10px;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.conta-opcoes a, .conta-opcoes button {
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
}
.conta-opcoes a:hover, .conta-opcoes button:hover { background: var(--bg); }

.tema-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--ink);
  border-radius: 999px;
  padding: 5px;
  height: 52px;
  box-shadow: var(--shadow);
}
[data-theme="dark"] .tema-toggle { background: var(--tile); }
.tema-toggle button {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #8C94A6;
  display: grid;
  place-items: center;
}
.tema-toggle button.ativo { background: #fff; color: #0F1117; }
[data-theme="dark"] .tema-toggle button.ativo { background: var(--lime); }
.tema-toggle svg { width: 18px; height: 18px; }

/* ---- Cabeçalho de página ---- */

.pagina-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.pagina-titulo h1 {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.1;
}
.pagina-titulo p { color: var(--muted-2); margin-top: 4px; font-size: 13.5px; }

/* Abas em pílula */
.tabs {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px;
  gap: 2px;
}
.tabs button {
  border: none;
  background: transparent;
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.tabs button.ativo {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
}

/* ============ Pílulas de estatística (referência) ============ */

.stats-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.stat-label {
  background: var(--card);
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}
.stat-valor {
  background: var(--card);
  border-radius: 999px;
  padding: 6px;
  padding-right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
  margin-top: -6px;
  margin-left: 26px;
}
.stat-fill {
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 600;
  font-size: 15px;
  color: #0F1117;
  min-width: 96px;
  text-align: center;
}
.stat-fill.branco { color: #fff; }
.stat-seta {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: var(--text);
}
.stat-seta svg { width: 16px; height: 16px; }

/* ============ Cards e painéis ============ */

.card {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: var(--shadow);
}

.painel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-head h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.3px; }
.card-head .icone-head {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--panel);
  display: grid;
  place-items: center;
  color: var(--text);
}
.card-head .icone-head svg { width: 18px; height: 18px; }

/* ============ Chips / etiquetas ============ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; }

.chip-outline-purple { border-color: var(--purple); color: var(--purple); }
.chip-outline-red { border-color: var(--red); color: var(--red); }
.chip-outline-orange { border-color: var(--orange); color: var(--orange); }
.chip-outline-blue { border-color: var(--blue); color: var(--blue); }
[data-theme="dark"] .chip-outline-blue { border-color: #7A86FF; color: #7A86FF; }
.chip-outline-gray { border-color: var(--slate); color: var(--slate); }

.chip-lime { background: var(--lime); color: #0F1117; }
.chip-orange { background: var(--orange); color: #fff; }
.chip-red { background: var(--red); color: #fff; }
.chip-blue { background: var(--blue); color: #fff; }
.chip-purple { background: var(--purple); color: #fff; }
.chip-gray { background: var(--slate); color: #fff; }
.chip-soft-lime { background: var(--lime-soft); color: #3E6B0A; }
[data-theme="dark"] .chip-soft-lime { color: var(--lime); }
.chip-soft-blue { background: var(--blue-soft); color: var(--blue); }
[data-theme="dark"] .chip-soft-blue { color: #8B96FF; }
.chip-soft-orange { background: var(--orange-soft); color: #B66A00; }
[data-theme="dark"] .chip-soft-orange { color: var(--orange); }
.chip-soft-red { background: var(--red-soft); color: #C43A3A; }
.chip-soft-purple { background: var(--purple-soft); color: #7C5CD6; }

/* ============ Botões ============ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--ink);
  color: #fff;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
[data-theme="dark"] .btn { background: var(--lime); color: #0F1117; }
.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn svg { width: 16px; height: 16px; }

.btn-lime { background: var(--lime); color: #0F1117; }
[data-theme="dark"] .btn-lime { background: var(--lime); }
.btn-blue { background: var(--blue); color: #fff; }
[data-theme="dark"] .btn-blue { background: var(--blue); color: #fff; }
.btn-ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
[data-theme="dark"] .btn-ghost { background: var(--tile); color: var(--text); }
.btn-sm { padding: 8px 16px; font-size: 12.5px; }
.btn-danger { background: var(--red); color: #fff; }
[data-theme="dark"] .btn-danger { background: var(--red); color: #fff; }

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
[data-theme="dark"] .btn-icon { background: var(--tile); }
.btn-icon:hover { color: var(--text); }
.btn-icon svg { width: 16px; height: 16px; }

/* ============ Formulários ============ */

.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.campo input, .campo select, .campo textarea {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
}
[data-theme="dark"] .campo input, [data-theme="dark"] .campo select, [data-theme="dark"] .campo textarea { background: var(--tile); }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--blue); }
[data-theme="dark"] .campo input:focus, [data-theme="dark"] .campo select:focus, [data-theme="dark"] .campo textarea:focus { border-color: #7A86FF; }
.campo textarea { resize: vertical; min-height: 80px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }

/* ============ Listas em cartão ============ */

.lista { display: flex; flex-direction: column; gap: 10px; }
.lista-item {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease;
}
.lista-item.clicavel { cursor: pointer; }
.lista-item.clicavel:hover { transform: translateY(-1px); }
.painel .lista-item { box-shadow: none; border: 1px solid var(--border); }

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.avatar.sm { width: 34px; height: 34px; border-radius: 12px; font-size: 11px; }

.item-info { flex: 1; min-width: 0; }
.item-info .titulo { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-info .sub { color: var(--muted-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ Barra de progresso (com hachura da referência) ============ */

.progresso {
  height: 12px;
  border-radius: 999px;
  background-image: repeating-linear-gradient(
    115deg,
    var(--stripe) 0 2px,
    transparent 2px 6px
  );
  overflow: hidden;
  position: relative;
}
.progresso > span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--lime);
}
.progresso.azul > span { background: var(--blue); }

/* ============ Tabela de dados ============ */

.tabela { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.tabela th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted-2);
  padding: 4px 16px;
}
.tabela td {
  background: var(--card);
  padding: 13px 16px;
  font-size: 13.5px;
  vertical-align: middle;
}
.tabela tr td:first-child { border-radius: var(--r-lg) 0 0 var(--r-lg); }
.tabela tr td:last-child { border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.tabela tbody tr { box-shadow: var(--shadow); }
.tabela tbody tr.clicavel { cursor: pointer; }
.tabela tbody tr.clicavel:hover td { background: var(--panel); }
.tabela-wrap { overflow-x: auto; }

/* ============ Kanban ============ */

.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.kanban-col { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 14px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 0 4px; }
.kanban-col-head .nome { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.kanban-col-head .qtd { background: var(--card); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; color: var(--muted); box-shadow: var(--shadow); }
.kanban-cards { display: flex; flex-direction: column; gap: 10px; min-height: 30px; }
.kanban-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  cursor: grab;
}
.kanban-card .titulo { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.kanban-card .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.kanban-card.arrastando { opacity: 0.4; }
.kanban-col { transition: background 0.2s ease, box-shadow 0.2s ease; }
.kanban-col.sobre { background: var(--lime-soft); box-shadow: inset 0 0 0 2px var(--lime); }

/* Animação de pouso ao mover um card entre colunas */
@keyframes pousarCard {
  0% { transform: scale(0.86) translateY(-10px); opacity: 0.4; }
  55% { transform: scale(1.04) translateY(2px); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.tarefa-wrap.pousou, .tarefa-card.pousou, .kanban-card.pousou {
  animation: pousarCard 0.42s cubic-bezier(0.22, 0.9, 0.35, 1);
}

/* ============ Modal ============ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 18, 0.5);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--bg);
  border-radius: var(--r-xl);
  padding: 26px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: subir 0.2s ease;
}
.modal.grande { max-width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-head h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.5px; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes subir { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============ Toast ============ */

.toast-area { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: 16px;
  padding: 14px 20px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: subir 0.2s ease;
  max-width: 380px;
}
[data-theme="dark"] .toast { background: var(--lime); color: #0F1117; }
.toast.erro { background: var(--red); color: #fff; }

/* ============ Dashboard específico ============ */

.dash-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

.grade-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .grade-cards { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: span 1; } }

.mini-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.painel .mini-card { box-shadow: none; border: 1px solid var(--border); }
.mini-card .rotulo { font-size: 11.5px; color: var(--muted-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.mini-card .numero { font-size: 26px; font-weight: 600; letter-spacing: -0.5px; margin-top: 2px; }

.destaque-num { font-size: 44px; font-weight: 600; letter-spacing: -1.5px; line-height: 1; }
.destaque-num small { font-size: 20px; color: var(--muted-2); font-weight: 500; }

/* Gráficos SVG */
.graf-barras { width: 100%; height: auto; display: block; }
.legenda { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.legenda i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ============ Calendário ============ */

.cal-grade { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dia-nome { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; padding: 6px 0; }
.cal-dia {
  min-height: 84px;
  background: var(--card);
  border-radius: 14px;
  padding: 8px;
  font-size: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cal-dia.fora { opacity: 0.35; }
.cal-dia .num { font-weight: 600; font-size: 12.5px; margin-bottom: 4px; }
.cal-dia.hoje { outline: 2px solid var(--blue); outline-offset: -2px; }
.cal-dia.hoje .num { color: var(--blue); }
[data-theme="dark"] .cal-dia.hoje { outline-color: #7A86FF; }
.cal-evento {
  border-radius: 7px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 600;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

/* ============ Chat IA ============ */

.chat-area { display: flex; flex-direction: column; height: 560px; }
.chat-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px 2px 16px; }
.msg { max-width: 78%; padding: 12px 18px; border-radius: 20px; font-size: 13.5px; white-space: pre-wrap; }
.msg.usuario { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
[data-theme="dark"] .msg.usuario { background: var(--blue); }
.msg.ia { align-self: flex-start; background: var(--card); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.chat-input { display: flex; gap: 10px; }
.chat-input input { flex: 1; background: var(--card); border: 1.5px solid var(--border); border-radius: 999px; padding: 13px 20px; outline: none; }
[data-theme="dark"] .chat-input input { background: var(--tile); }
.chat-input input:focus { border-color: var(--blue); }

/* ============ Utilidades ============ */

.linha { display: flex; align-items: center; gap: 10px; }
.linha.entre { justify-content: space-between; }
.linha.wrap { flex-wrap: wrap; }
.coluna { display: flex; flex-direction: column; gap: 10px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 14px; } .mt-3 { margin-top: 22px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 14px; } .mb-3 { margin-bottom: 22px; }
.muted { color: var(--muted-2); }
.negrito { font-weight: 600; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; }
.verde { color: #5AA810; } [data-theme="dark"] .verde { color: var(--lime); }
.vermelho { color: var(--red); }
.azul { color: var(--blue); } [data-theme="dark"] .azul { color: #8B96FF; }
.laranja { color: var(--orange); }
.centro { text-align: center; }
.dir { text-align: right; }

.vazio {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted-2);
}
.vazio-icone {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  color: var(--muted-2);
}
.vazio-icone svg { width: 26px; height: 26px; }

.selo-demo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple-soft);
  color: #7C5CD6;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 11.5px;
  font-weight: 600;
}
[data-theme="dark"] .selo-demo { color: var(--purple); }

.grade-ferramentas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ferramenta {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.12s ease, border-color 0.15s ease;
  text-align: left;
}
.ferramenta:hover { transform: translateY(-2px); border-color: var(--lime); }
.ferramenta .icone {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  font-size: 19px;
}
.ferramenta .nome { font-weight: 600; font-size: 14px; }
.ferramenta .desc { color: var(--muted-2); font-size: 12px; margin-top: 3px; line-height: 1.4; }

.resultado-calc {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.resultado-calc .linha-res { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.resultado-calc .linha-res:last-child { border-bottom: none; }
.resultado-calc .linha-res.total { font-weight: 700; font-size: 16px; }

.doc-preview {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  max-height: 480px;
  overflow-y: auto;
}

/* ============ Animações ============ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim { animation: fadeUp 0.5s cubic-bezier(0.22, 0.9, 0.35, 1) both; }

@keyframes barraCresce { from { width: 0; } }
.progresso > span { animation: barraCresce 1s cubic-bezier(0.22, 0.9, 0.35, 1) both; animation-delay: 0.25s; }

@keyframes crescerY { from { transform: scaleY(0); } }
.barra-svg { transform-box: fill-box; transform-origin: bottom; animation: crescerY 0.8s cubic-bezier(0.22, 0.9, 0.35, 1) both; }

@keyframes desenharLinha { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.linha-svg { stroke-dasharray: 1; animation: desenharLinha 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both; }

@keyframes surgirArea { from { opacity: 0; } to { opacity: 1; } }
.area-svg { animation: surgirArea 0.8s ease 1s both; }

@keyframes anelGira {
  from { stroke-dashoffset: var(--circ); }
  to { stroke-dashoffset: var(--alvo); }
}
.anel-svg { animation: anelGira 1.2s cubic-bezier(0.22, 0.9, 0.35, 1) 0.2s both; }

@keyframes fatiaEntra { from { opacity: 0; transform: rotate(-14deg); } to { opacity: 1; transform: rotate(0); } }
.donut-svg { transform-box: view-box; transform-origin: center; animation: fatiaEntra 0.9s cubic-bezier(0.22, 0.9, 0.35, 1) both; }

@keyframes pulsar { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.nav-item.ativo { animation: pulsar 0.35s ease; }

.nav-sep { width: 22px; height: 2px; border-radius: 2px; background: var(--border); margin: 5px 0; flex-shrink: 0; }

/* ============ Formulário de cadastro (seções) ============ */

.form-secao {
  grid-column: span 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.form-secao:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.form-secao svg { width: 15px; height: 15px; }

.segmento {
  grid-column: span 2;
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px;
  gap: 4px;
}
.segmento button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 11px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}
.segmento button svg { width: 16px; height: 16px; }
.segmento button.ativo { background: var(--ink); color: #fff; box-shadow: var(--shadow); }
[data-theme="dark"] .segmento button.ativo { background: var(--lime); color: #0F1117; }

.campo.invalido input { border-color: var(--red); }
.campo .erro-msg { color: var(--red); font-size: 11.5px; font-weight: 500; display: none; }
.campo.invalido .erro-msg { display: block; }
.campo .ok-msg { color: #5AA810; font-size: 11.5px; font-weight: 600; display: none; }
.campo.valido .ok-msg { display: block; }
[data-theme="dark"] .campo .ok-msg { color: var(--lime); }

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; z-index: 2; margin: 0; }
.switch .trilho {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.2s ease;
}
.switch .trilho::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.22s cubic-bezier(0.22, 0.9, 0.35, 1);
}
.switch input:checked + .trilho { background: var(--lime); }
.switch input:checked + .trilho::after { transform: translateX(20px); }

.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* Selos e avatares com ícone */
.selo-demo svg { width: 13px; height: 13px; }
.avatar svg { width: 20px; height: 20px; }
.avatar.sm svg { width: 16px; height: 16px; }
.ferramenta .icone svg { width: 20px; height: 20px; }

/* Grade de gráficos do dashboard */
.grade-graficos { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.grade-graficos-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
@media (max-width: 1100px) {
  .grade-graficos, .grade-graficos-3 { grid-template-columns: 1fr; }
}

.dias-semana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.dia-pilula {
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 10px 4px 8px;
  text-align: center;
  transition: transform 0.15s ease;
}
.dia-pilula:hover { transform: translateY(-2px); }
.dia-pilula.hoje { background: var(--ink); color: #fff; border-color: var(--ink); }
[data-theme="dark"] .dia-pilula.hoje { background: var(--lime); color: #0F1117; border-color: var(--lime); }
.dia-pilula .d-nome { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.6; }
.dia-pilula .d-num { font-size: 16px; font-weight: 600; }
.dia-pilula .d-qtd {
  margin-top: 5px;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 0;
  background: var(--lime);
  color: #0F1117;
}
.dia-pilula .d-qtd.zero { background: transparent; color: var(--muted-2); font-weight: 500; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 70px 1fr; }
  .main { padding: 16px 14px 30px; }
  .pagina-titulo h1 { font-size: 28px; }
  .nav-item, .logo { width: 44px; height: 44px; }
  .stats-row { gap: 10px; }
}

/* ============ Kanban de tarefas (estilo referência) ============ */

.tarefa-card {
  background: var(--card);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.tarefa-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tarefa-card .topo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tarefa-card .topo .quem { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarefa-card .titulo { font-weight: 600; font-size: 14.5px; line-height: 1.4; margin-bottom: 12px; }
.tarefa-card .rodape { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tarefa-card .rodape .pilula {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tarefa-card .rodape .pilula i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.check-circulo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  color: transparent;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.18s ease, transform 0.18s ease;
}
.check-circulo svg { width: 15px; height: 15px; }
.check-circulo:hover { border-color: var(--lime); color: var(--muted-2); transform: scale(1.08); }
.check-circulo.feito { background: var(--lime); border-color: var(--lime); color: #0F1117; }
.tarefa-card.concluida .titulo { text-decoration: line-through; opacity: 0.55; }
.tarefa-card .sub-progresso { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 11.5px; color: var(--muted-2); font-weight: 600; }
.tarefa-card .sub-progresso .progresso { flex: 1; height: 6px; }

/* Painel lateral de tarefa */
.painel-lateral-overlay {
  position: fixed; inset: 0; background: rgba(11, 13, 18, 0.45);
  backdrop-filter: blur(3px); z-index: 100; animation: fadeIn 0.15s ease;
}
.painel-lateral {
  position: fixed; top: 12px; right: 12px; bottom: 12px;
  width: min(480px, calc(100vw - 24px));
  background: var(--bg);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  z-index: 101;
  padding: 24px;
  overflow-y: auto;
  animation: deslizar 0.25s cubic-bezier(0.22, 0.9, 0.35, 1);
}
@keyframes deslizar { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.subtarefa-linha { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 10px 14px; }
.subtarefa-linha .check-circulo { width: 26px; height: 26px; }
.subtarefa-linha .check-circulo svg { width: 12px; height: 12px; }
.subtarefa-linha .texto { flex: 1; font-size: 13px; font-weight: 500; }
.subtarefa-linha.feita .texto { text-decoration: line-through; opacity: 0.55; }
.comentario-bolha { background: var(--card); border-radius: 16px; border-bottom-left-radius: 6px; padding: 10px 14px; font-size: 13px; }

/* ============ Agenda semanal (estilo referência) ============ */

.agenda-grid { display: grid; grid-template-columns: 290px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .agenda-grid { grid-template-columns: 1fr; } .agenda-grid .card:first-child { max-width: 340px; } }

.mini-mes { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mini-mes .nome-dia { font-size: 10px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; padding: 4px 0; }
.mini-mes button {
  border: none; background: transparent; border-radius: 999px;
  width: 32px; height: 32px; margin: 0 auto; font-size: 12.5px; font-weight: 500;
  color: var(--text); display: grid; place-items: center;
  transition: background 0.15s ease;
}
.mini-mes button:hover { background: var(--panel); }
.mini-mes button.fora { color: var(--muted-2); opacity: 0.5; }
.mini-mes button.selecionado { background: var(--ink); color: #fff; font-weight: 700; }
[data-theme="dark"] .mini-mes button.selecionado { background: var(--lime); color: #0F1117; }
.mini-mes button.hoje-marca { outline: 2px solid var(--lime); outline-offset: -2px; }
.mini-mes button.tem-evento { position: relative; }
.mini-mes button.tem-evento::after {
  content: ""; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--orange);
}

.semana-head { display: grid; grid-template-columns: 52px repeat(7, 1fr); gap: 8px; margin-bottom: 10px; }
.semana-head .dia-cab {
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 10px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.semana-head .dia-cab:hover { transform: translateY(-2px); }
.semana-head .dia-cab .num { font-size: 15px; font-weight: 700; color: var(--text); }
.semana-head .dia-cab.selecionado { background: var(--ink); border-color: var(--ink); color: rgba(255,255,255,0.7); }
.semana-head .dia-cab.selecionado .num { color: #fff; }
[data-theme="dark"] .semana-head .dia-cab.selecionado { background: var(--lime); border-color: var(--lime); color: rgba(15,17,23,0.6); }
[data-theme="dark"] .semana-head .dia-cab.selecionado .num { color: #0F1117; }

.semana-corpo { display: grid; grid-template-columns: 52px repeat(7, 1fr); gap: 8px; }
.hora-col { display: flex; flex-direction: column; }
.hora-col span { height: 64px; font-size: 10.5px; color: var(--muted-2); font-weight: 600; text-align: right; padding-right: 6px; }
.dia-col { position: relative; border-radius: 16px; background: var(--panel); border: 1px solid var(--border); overflow: hidden; }
.dia-col .linha-hora { position: absolute; left: 0; right: 0; height: 1px; background: var(--border); opacity: 0.6; }
.evento-bloco {
  position: absolute;
  left: 5px; right: 5px;
  border-radius: 14px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  animation: fadeUp 0.4s ease both;
}
.evento-bloco:hover { transform: scale(1.02); box-shadow: var(--shadow); z-index: 3; }
.evento-bloco .hora-ev { font-weight: 500; opacity: 0.75; font-size: 10.5px; }
.ev-prazo { background: var(--orange-soft); color: #8A5200; }
.ev-audiencia { background: var(--purple-soft); color: #6644C4; }
.ev-reuniao { background: #FDF6C9; color: #7A6A00; }
.ev-tarefa { background: var(--lime-soft); color: #3E6B0A; }
[data-theme="dark"] .ev-reuniao { background: #3A3618; color: #E8DC7A; }
.prazos-dia-strip { display: flex; flex-direction: column; gap: 4px; padding: 5px; }
.prazo-mini {
  border-radius: 10px;
  background: var(--red-soft);
  color: #C43A3A;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}

/* ============ Lista de prazos com bloco de data ============ */

.data-tile {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1.05;
}
.data-tile .dia { font-size: 20px; font-weight: 700; }
.data-tile .mes { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted-2); }
.data-tile.urgente { background: var(--red-soft); border-color: transparent; }
.data-tile.urgente .dia { color: #C43A3A; }
.data-tile.atencao { background: var(--orange-soft); border-color: transparent; }
.data-tile.atencao .dia { color: #B66A00; }
.data-tile.ok { background: var(--lime-soft); border-color: transparent; }
.data-tile.ok .dia { color: #3E6B0A; }

/* ============ Clientes em cards ============ */

.grade-clientes { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.cliente-card {
  background: var(--card);
  border-radius: 26px;
  padding: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cliente-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cliente-card .cab { display: flex; align-items: center; gap: 14px; }
.cliente-card .avatar { width: 54px; height: 54px; border-radius: 50%; font-size: 16px; }
.cliente-card .nome { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.cliente-card .info { font-size: 12.5px; color: var(--muted-2); }
.cliente-card .metricas { display: flex; gap: 8px; }
.cliente-card .metrica {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 12px;
}
.cliente-card .metrica .rot { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted-2); }
.cliente-card .metrica .num { font-size: 16px; font-weight: 600; margin-top: 1px; }
.cliente-card .rodape { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-top: 1px dashed var(--border); padding-top: 12px; }

.toggle-visao { display: inline-flex; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 2px; }
.toggle-visao button { border: none; background: transparent; width: 38px; height: 34px; border-radius: 999px; color: var(--muted-2); display: grid; place-items: center; }
.toggle-visao button svg { width: 16px; height: 16px; }
.toggle-visao button.ativo { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ============ Calculadoras: ícone sem fundo ============ */

.ferramenta .icone.sem-bg {
  background: transparent !important;
  width: auto;
  height: auto;
  margin-bottom: 10px;
  justify-content: flex-start;
  display: flex;
}
.ferramenta .icone.sem-bg svg { width: 26px; height: 26px; }
.icone-head.sem-bg { background: transparent !important; width: auto; height: auto; }
.icone-head.sem-bg svg { width: 26px; height: 26px; }

/* ============ Documento A4 (orçamento / contrato) ============ */

.doc-a4 {
  background: #fff;
  color: #0F1117;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 48px 52px;
  max-width: 760px;
  margin: 0 auto;
  font-size: 13px;
  line-height: 1.65;
}
.doc-a4 .doc-marca {
  display: inline-flex;
  align-items: baseline;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}
.doc-a4 .doc-marca .ad { color: #0F1117; }
.doc-a4 .doc-marca .ve { color: #8FD41F; }
.doc-a4 h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.5px; margin: 6px 0 2px; }
.doc-a4 .doc-meta { color: #596070; font-size: 12px; }
.doc-a4 .doc-secao { margin-top: 22px; }
.doc-a4 .doc-secao .doc-rotulo {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: #8C94A6; margin-bottom: 6px;
}
.doc-a4 table { width: 100%; border-collapse: collapse; }
.doc-a4 table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: #8C94A6; padding: 8px 10px; border-bottom: 1.5px solid #E5E7EC; }
.doc-a4 table td { padding: 10px; border-bottom: 1px solid #EFF0F3; font-size: 13px; }
.doc-a4 table td:last-child, .doc-a4 table th:last-child { text-align: right; }
.doc-a4 .doc-total { display: flex; justify-content: flex-end; gap: 40px; padding: 14px 10px 0; font-size: 13px; }
.doc-a4 .doc-total.grande { font-size: 17px; font-weight: 700; }
.doc-a4 .clausula { margin-top: 14px; }
.doc-a4 .clausula .titulo-cl { font-weight: 700; font-size: 13px; }
.doc-a4 .assinaturas { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; text-align: center; }
.doc-a4 .assinaturas .linha-ass { border-top: 1.5px solid #0F1117; padding-top: 8px; font-size: 12px; }
.doc-a4 .doc-rodape { margin-top: 36px; padding-top: 14px; border-top: 1px solid #E5E7EC; color: #8C94A6; font-size: 11px; display: flex; justify-content: space-between; }

/* Impressão: só o documento/relatório */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .nao-imprimir, .toast-area { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; }
  .doc-a4 { box-shadow: none; border-radius: 0; max-width: none; padding: 24px 8px; }
  .modal-overlay { position: static; background: none; backdrop-filter: none; padding: 0; display: block; }
  .modal { box-shadow: none; max-width: none; max-height: none; overflow: visible; padding: 0; background: #fff; }
  .modal-head, .modal-acoes { display: none !important; }
  .card, .painel { box-shadow: none; border: 1px solid #E5E7EC; break-inside: avoid; }
  .anim, .linha-svg, .area-svg, .donut-svg, .anel-svg, .progresso > span { animation: none !important; }
  .relatorio-so-imprimir { display: block !important; }
}

/* ============ KPI compacto (relatórios) ============ */

.grade-kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi {
  background: var(--card);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.kpi .rot { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted-2); display: flex; align-items: center; gap: 6px; }
.kpi .rot svg { width: 13px; height: 13px; }
.kpi .num { font-size: 21px; font-weight: 600; letter-spacing: -0.5px; margin-top: 3px; }
.kpi .var { font-size: 11px; font-weight: 600; }

/* ============ Kanban fiel à referência: colunas soltas num painel único ============ */

.kanban-solto {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
}
.kanban-solto .kanban-col { background: transparent; border: none; padding: 0 4px; border-radius: 16px; }
.kanban-solto .kanban-col-head { padding: 0 8px; margin-bottom: 14px; }
.kanban-solto .kanban-col-head .nome { font-size: 14px; color: var(--muted); }
.kanban-solto .kanban-col.sobre { background: var(--lime-soft); box-shadow: inset 0 0 0 2px var(--lime); }

.tarefa-card .avatar.sm { border-radius: 50%; }
.tarefa-card .check-circulo { width: 40px; height: 40px; }
.tarefa-card .check-circulo svg { width: 17px; height: 17px; }

/* Anexos no painel da tarefa */
.anexos-grade { display: flex; gap: 10px; flex-wrap: wrap; }
.anexo-tile {
  width: 88px;
  height: 68px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px;
  text-align: center;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.anexo-tile:hover { transform: translateY(-2px); }
.anexo-tile svg { width: 18px; height: 18px; color: var(--muted-2); }
.anexo-tile .nome-anexo { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anexo-tile.add { border-style: dashed; background: transparent; }

/* ============ Card de tarefa estilo pasta: check fora do card, num recorte ============ */

.tarefa-wrap { position: relative; }
.tarefa-wrap.arrastando { opacity: 0.4; }
.tarefa-wrap .tarefa-card:hover { transform: none; box-shadow: var(--shadow); }
.tarefa-wrap:hover { transform: translateY(-3px); transition: transform 0.14s ease; }

.tarefa-card.recorte {
  -webkit-mask: radial-gradient(circle at calc(100% - 27px) 27px, transparent 27px, #000 28px);
  mask: radial-gradient(circle at calc(100% - 27px) 27px, transparent 27px, #000 28px);
}
.tarefa-card.recorte .topo { padding-right: 44px; margin-bottom: 10px; }

.check-flutuante {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  box-shadow: var(--shadow);
  color: transparent;
  display: grid;
  place-items: center;
  z-index: 2;
  transition: background 0.18s ease, transform 0.18s ease;
}
.check-flutuante svg { width: 17px; height: 17px; }
.check-flutuante:hover { color: var(--muted-2); transform: scale(1.1); }
.check-flutuante.feito { background: var(--lime); color: #0F1117; }

/* ============ Pasta de tarefa (estilo referência) ============
   Card único com o canto superior direito escavado em arco côncavo;
   o check mora nesse recorte, com um respiro uniforme ao redor.
   A folha de trás espia por cima para o efeito de pastas empilhadas. */

.pasta-wrap { position: relative; padding-top: 9px; }
.pasta-wrap.arrastando { opacity: 0.4; }
.pasta-wrap:hover { transform: translateY(-3px); transition: transform 0.14s ease; }

.pasta {
  --pbg: var(--card);
  --ptx: var(--text);
  position: relative;
  background: var(--pbg);
  color: var(--ptx);
  border-radius: 18px;
  padding: 13px 16px 16px;
  cursor: pointer;
  filter: drop-shadow(0 2px 8px rgba(15, 17, 23, 0.06));
  -webkit-mask: radial-gradient(circle at calc(100% - 20px) 17px, transparent 27px, #000 28px);
  mask: radial-gradient(circle at calc(100% - 20px) 17px, transparent 27px, #000 28px);
}
[data-theme="dark"] .pasta { filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35)); }

/* Folha de trás espiando por cima (o recorte também a limpa no canto) */
.pasta::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 14px;
  right: 44px;
  height: 22px;
  border-radius: 12px 12px 0 0;
  background: #E2E4E9;
  background: color-mix(in srgb, var(--pbg) 55%, #B8BCC6);
  z-index: 0;
}
[data-theme="dark"] .pasta::before {
  background: #2A303C;
  background: color-mix(in srgb, var(--pbg) 55%, #4A5160);
}
.pasta.colorida::before {
  background: color-mix(in srgb, var(--pbg) 45%, #FFFFFF);
}
[data-theme="dark"] .pasta.colorida::before {
  background: color-mix(in srgb, var(--pbg) 45%, #12151C);
}

.pasta-topo {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
  padding-right: 40px;
  position: relative;
  z-index: 1;
}
.pasta-topo .avatar.sm {
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 10px;
  flex-shrink: 0;
}
.pasta-topo .quem {
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pasta .titulo { font-weight: 600; font-size: 14.5px; line-height: 1.4; margin-bottom: 12px; position: relative; z-index: 1; }
.pasta.concluida .titulo { text-decoration: line-through; opacity: 0.55; }
.pasta .rodape { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; position: relative; z-index: 1; }
.pasta .pilula {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pasta .pilula i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.pasta .sub-progresso { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 11.5px; color: var(--muted-2); font-weight: 600; position: relative; z-index: 1; }
.pasta .sub-progresso .progresso { flex: 1; height: 6px; }

/* Pasta colorida */
.pasta.colorida .pilula { background: rgba(255, 255, 255, 0.92); border-color: transparent; color: #3A3F4A; }
.pasta.colorida .sub-progresso { color: var(--ptx); opacity: 0.85; }
.pasta.colorida .progresso { background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.35) 0 2px, transparent 2px 6px); }
.pasta.colorida .progresso > span { background: rgba(255, 255, 255, 0.95); }
.pasta.colorida .quem { opacity: 0.85; }

/* Check dentro do recorte do canto */
.pasta-wrap .check-flutuante {
  top: 6px;
  right: 0;
  width: 40px;
  height: 40px;
  background: var(--panel);
  border: 1.5px solid var(--border);
  box-shadow: none;
  z-index: 3;
}
.pasta-wrap .check-flutuante:hover {
  background: var(--lime-soft);
  border-color: var(--lime);
  color: #5AA810;
  transform: scale(1.06);
}
.pasta-wrap .check-flutuante.feito {
  background: var(--lime);
  border-color: var(--lime);
  color: #0F1117;
}

/* Seletor de cores da pasta */
.cores-pasta { display: flex; gap: 8px; flex-wrap: wrap; }
.cores-pasta button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.cores-pasta button:hover { transform: scale(1.12); }
.cores-pasta button.sel { border-color: var(--text); }

.pagina-acesso {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.acesso-card { width: min(100%, 440px); }
.acesso-card .logo { margin: 0 0 16px; }
.acesso-card a { color: var(--text); text-decoration: underline; }
.conta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 20px;
  align-items: start;
}
.conta-form { display: grid; gap: 12px; margin: 16px 0; }
.conta-form[hidden], .conta-form label[hidden], .conta-card[hidden] { display: none; }
.conta-form label { display: grid; gap: 5px; }
.conta-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.conta-form button { justify-self: start; }
.conta-form [role="status"]:empty, #acesso-mensagem:empty { display: none; }

.config-abas, .config-acoes, .config-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.config-abas { margin: 16px 0; }
.config-abas a {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
}
.config-abas [aria-current="page"] { background: var(--lime); color: var(--ink); }
.config-perfil { max-width: 720px; margin-top: 16px; }
.config-campos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 14px;
}
.conta-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
}
.config-acoes [hidden] { display: none; }
.config-usuarios { list-style: none; margin: 14px 0 0; }
.config-usuarios li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.config-usuarios p { color: var(--muted); }
.config-usuarios a, .config-links a { text-decoration: underline; }
