/* =====================================================================
   VISUAL v2 (carregado depois do app.css): logo "tmj." do site, fonte
   Archivo nos títulos, padrão de fundo com desenhos de marketing e
   movimento. Uma cor de destaque só.
   Raios: 16px em blocos, 10px em botões e campos, círculo só em avatar.
   ===================================================================== */
:root {
  --radius: 16px;
  --display: "Archivo", "Inter", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 1px 2px #1a12080a, 0 8px 24px -12px #1a120826;
}
@media (prefers-color-scheme: dark) {
  :root { --shadow: 0 1px 2px #00000040, 0 10px 28px -14px #000000a0; }
}

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: baseline; gap: 9px; }
.logo-word { font-family: "Inter", var(--font); font-weight: 900; font-size: 34px; line-height: 1; letter-spacing: -0.06em; color: #fff; }
.logo-dot { color: var(--accent); display: inline-block; transform-origin: 50% 90%; }
.logo-tag { font-family: var(--display); font-stretch: 118%; font-weight: 700; font-size: 11px; letter-spacing: 0.14em; color: var(--side-ink); }
.logo.big .logo-word { font-size: 52px; color: var(--ink); }
.logo.big .logo-tag { color: var(--muted); font-size: 12px; }
.brand:hover .logo-dot, .auth .logo-dot { animation: dot-bounce 0.9s var(--ease) both; }
@keyframes dot-bounce {
  0% { transform: translateY(-22px) scale(0.6); opacity: 0; }
  55% { transform: translateY(0) scale(1.25, 0.8); opacity: 1; }
  75% { transform: translateY(-5px) scale(0.95, 1.05); }
  100% { transform: none; opacity: 1; }
}

/* ---------- padrão de fundo ---------- */
.side, .hero, .auth-art { isolation: isolate; overflow: hidden; }
.hero, .auth-art { position: relative; }
.side::before, .hero::before, .auth-art::before {
  content: ""; position: absolute; inset: -240px; z-index: -1; pointer-events: none;
  background: currentColor;
  -webkit-mask: url(/pattern.svg) 0 0 / 240px 240px repeat;
  mask: url(/pattern.svg) 0 0 / 240px 240px repeat;
  animation: drift 60s linear infinite;
}
@keyframes drift { to { transform: translate3d(240px, 240px, 0); } }
.side::before { color: #ffffff; opacity: 0.055; }

/* ---------- menu lateral ---------- */
.side { gap: 30px; padding-top: 26px; }
.brand { padding: 0 12px; }
.side-link { position: relative; padding: 11px 14px; border-radius: 10px; transition: background 0.2s, color 0.2s, transform 0.25s var(--ease); }
.side-link:hover { transform: translateX(3px); }
.side-link::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--accent); transform: scaleY(0); transition: transform 0.3s var(--ease);
}
.side-link.on { background: #ffffff14; }
.side-link.on::before { transform: scaleY(1); }
.side-link .ic { transition: transform 0.3s var(--ease); }
.side-link:hover .ic { transform: scale(1.12) rotate(-4deg); }

/* ---------- títulos ---------- */
.page-head h1, .hero-hello, .auth-card h1, .dialog-head h2 { font-family: var(--display); font-stretch: 108%; font-weight: 800; letter-spacing: -0.03em; }
.page-head h1 { font-size: 32px; }
.card-title { font-family: var(--display); font-stretch: 106%; font-weight: 700; font-size: 17px; }
.stat-value, .big, .hero-number strong, .charge-value, .plan-price { font-family: var(--display); }

/* ---------- entrada das telas ---------- */
.view.enter > * { animation: rise 0.55s var(--ease) both; }
.view.enter > :nth-child(2) { animation-delay: 0.05s; }
.view.enter > :nth-child(3) { animation-delay: 0.1s; }
.view.enter > :nth-child(4) { animation-delay: 0.15s; }
.view.enter > :nth-child(n + 5) { animation-delay: 0.2s; }
.view.enter .stats > *, .view.enter .cols > *, .view.enter .board > *, .view.enter .ctable > * { animation: rise 0.6s var(--ease) both; }
.view.enter .stats > :nth-child(1), .view.enter .board > :nth-child(1), .view.enter .ctable > :nth-child(2) { animation-delay: 0.12s; }
.view.enter .stats > :nth-child(2), .view.enter .board > :nth-child(2), .view.enter .ctable > :nth-child(3), .view.enter .cols > :nth-child(1) { animation-delay: 0.18s; }
.view.enter .stats > :nth-child(3), .view.enter .board > :nth-child(3), .view.enter .ctable > :nth-child(4), .view.enter .cols > :nth-child(2) { animation-delay: 0.24s; }
.view.enter .stats > :nth-child(4), .view.enter .board > :nth-child(4), .view.enter .ctable > :nth-child(5) { animation-delay: 0.3s; }
.view.enter .board > :nth-child(n + 5), .view.enter .ctable > :nth-child(n + 6) { animation-delay: 0.36s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- faixa de boas-vindas ---------- */
.hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 30px 34px; border-radius: 22px;
  background: var(--accent); color: #17100b;
  box-shadow: 0 18px 40px -22px #ff6b2bcc;
}
.hero::before { color: #17100b; opacity: 0.1; }
.hero-date { font-weight: 600; font-size: 14px; opacity: 0.78; }
.hero-hello { font-size: clamp(30px, 4.2vw, 50px); line-height: 1.05; margin-top: 6px; font-stretch: 112%; }
.hero-sum { margin-top: 10px; font-weight: 600; font-size: 16px; }
.hero-number {
  display: flex; flex-direction: column; gap: 2px; text-align: right;
  background: #17100b; color: #fff; padding: 16px 22px; border-radius: 16px; min-width: 230px;
  transition: transform 0.3s var(--ease);
}
.hero-number:hover { transform: translateY(-3px) rotate(-1deg); }
.hero-number span { font-size: 13px; font-weight: 600; color: #cfcdc6; }
.hero-number strong { font-size: 34px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; color: var(--accent); font-variant-numeric: tabular-nums; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- cartões e números ---------- */
.card, .stat, .ctable, .cal, .agenda-day, .column { box-shadow: var(--shadow); }
.stat { position: relative; overflow: hidden; padding: 18px 20px 20px; transition: transform 0.3s var(--ease), border-color 0.2s; }
.stat::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease); }
a.stat:hover { transform: translateY(-3px); }
a.stat:hover::after { transform: scaleX(1); }
.stat-value { font-size: 30px; font-weight: 800; }
.bar-track { height: 10px; border-radius: 5px; }
.bar-fill { width: var(--w, 0%); border-radius: 5px; transform-origin: left; animation: grow 0.9s var(--ease) 0.25s both; }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- linhas e listas ---------- */
.line-main, .post-title { transition: transform 0.25s var(--ease), color 0.2s; }
.line:hover .line-main, .post-row:hover .post-title { transform: translateX(4px); }
.line .dot.danger { position: relative; }
.line .dot.danger::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--danger); opacity: 0; animation: ping 2.4s ease-out infinite; }
@keyframes ping { 0% { transform: scale(0.5); opacity: 0.7; } 70%, 100% { transform: scale(1.5); opacity: 0; } }
input[type=checkbox] { transition: transform 0.2s var(--ease); }
input[type=checkbox]:active { transform: scale(0.85); }

/* ---------- botões ---------- */
.btn { transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn.primary { box-shadow: 0 8px 18px -10px #ff6b2bd0; }
.btn.primary:hover { box-shadow: 0 12px 22px -10px #ff6b2bf0; }
.icon-btn { transition: background 0.2s, transform 0.2s var(--ease); }
.icon-btn:hover { transform: scale(1.08); }

/* ---------- clientes ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: -0.02em;
  transition: transform 0.3s var(--ease);
}
.avatar.big { width: 64px; height: 64px; font-size: 24px; }
.avatar.has-logo { background: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px #0000001a; }
.avatar.has-logo img { width: 100%; height: 100%; object-fit: contain; padding: 12%; display: block; }
.avatar.has-logo.logo-full { box-shadow: none; }
.avatar.has-logo.logo-full img { object-fit: cover; padding: 0; }
.c-name { flex-direction: row; align-items: center; gap: 12px; }
.c-name-text { display: flex; flex-direction: column; min-width: 0; }
a.crow { transition: background 0.2s; }
a.crow:hover .avatar { transform: scale(1.1) rotate(-6deg); }
.client-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.palette { display: inline-flex; margin-top: 10px; border-radius: 6px; overflow: hidden; width: fit-content; }
.palette span { width: 26px; height: 14px; transition: width 0.3s var(--ease); }
.palette:hover span { width: 34px; }

/* ---------- prospecção e calendário ---------- */
.lead { transition: transform 0.3s var(--ease), border-color 0.2s, box-shadow 0.3s; }
.lead:hover { transform: translateY(-3px) rotate(-0.6deg); box-shadow: var(--shadow); }
.lead.dragging { transform: rotate(3deg) scale(1.03); }
.column-head h2 { font-family: var(--display); font-stretch: 106%; }
.column { border-top: 3px solid var(--accent); }
.column.lost { border-top-color: var(--line-strong); }
.cal-post { transition: background 0.2s, transform 0.2s var(--ease); }
.cal-post:hover { transform: translateX(2px); }
.cal-cell.today { background: var(--accent-soft); }
.month-nav strong { font-family: var(--display); font-stretch: 108%; font-size: 18px; }

/* ---------- janelas ---------- */
.dialog { border-radius: 18px; animation: pop 0.32s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.toast { border-radius: 12px; animation: pop 0.3s var(--ease); }

/* ---------- carregando ---------- */
.skeleton .sk { border-radius: var(--radius); background: linear-gradient(100deg, var(--line) 30%, var(--surface-2) 50%, var(--line) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.sk-title { height: 38px; width: 260px; }
.sk-band { height: 130px; }
.sk-card { height: 180px; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------- entrada (login) ---------- */
.auth { position: relative; background: var(--side); overflow: hidden; }
.auth-art { position: absolute; inset: 0; color: #fff; }
.auth-art::before { opacity: 0.07; }
.auth-art::after { content: ""; position: absolute; width: 520px; height: 520px; right: -140px; bottom: -180px; border-radius: 50%; background: var(--accent); }
.auth-card { position: relative; border-radius: 22px; padding: 34px 30px; box-shadow: 0 30px 80px -30px #000000c0; animation: pop 0.5s var(--ease); }
.auth-card h1 { font-size: 28px; }

/* ---------- celular ---------- */
.tab { position: relative; transition: color 0.2s; }
.tab .ic { transition: transform 0.3s var(--ease); }
.tab.on .ic { transform: translateY(-2px) scale(1.1); }
.tab.on::after { content: ""; position: absolute; top: 0; left: 50%; width: 22px; height: 3px; margin-left: -11px; border-radius: 0 0 3px 3px; background: var(--accent); animation: grow 0.3s var(--ease); }

@media (max-width: 860px) {
  .page-head h1 { font-size: 26px; }
  .hero { padding: 22px 20px; border-radius: 18px; align-items: stretch; }
  .hero-number { text-align: left; width: 100%; min-width: 0; }
  .hero-number strong { font-size: 30px; }
  .stats.three { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .stats.three .stat { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 12px; }
  .stats.three .stat-sub { grid-column: 1 / -1; }
  .stat-value { font-size: 24px; }
  .avatar.big { width: 52px; height: 52px; font-size: 20px; }
  .c-name { grid-column: 1 / -1; }
  .side-link:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .side::before, .hero::before, .auth-art::before { animation: none !important; }
}
