/* CRM-Z — visual no padrão do Gerenciador da Ztrix (menu escuro de 220 px, verde-água, fonte Inter), adaptado ao celular. */
@font-face { font-family:'Inter'; font-style:normal; font-weight:400 700; font-display:swap; src:url('/assets/fontes/inter-latin.woff2') format('woff2'); }
*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
:root {
    --teal:#0D9488; --teal-dark:#0B7A6E; --teal-light:#CCFBF1;
    --bg:#F1F5F9; --white:#fff; --border:#E2E8F0;
    --text-main:#1E293B; --text-muted:#64748B; --text-dark:#0F172A; --text-hint:#94A3B8;
    --sidebar-bg:#0F172A; --sidebar-hover:#1E293B; --sidebar-text:#94A3B8;
    --sidebar-active-text:#5EEAD4; --sidebar-active-bg:rgba(13,148,136,.15);
    --sidebar-width:220px;
    --red:#DC2626; --green:#16A34A; --amber:#D97706; --blue:#2563EB; --purple:#7C3AED;
}
html { -webkit-text-size-adjust:100%; }
body { font-family:'Inter',system-ui,sans-serif; font-size:14px; background:var(--bg); color:var(--text-main); display:flex; min-height:100vh; }
a { color:var(--teal-dark); text-decoration:none; }
a:hover { text-decoration:underline; }
h2 { font-size:15px; font-weight:600; color:var(--text-dark); }

/* ── Menu lateral ── */
.sidebar { width:var(--sidebar-width); background:var(--sidebar-bg); display:flex; flex-direction:column; position:fixed; top:0; left:0; bottom:0; z-index:100; overflow-y:auto; transition:transform .2s; }
.sidebar-brand { padding:20px 20px 16px; display:flex; align-items:center; gap:10px; border-bottom:1px solid #1E293B; }
.sidebar-brand-icon { width:34px; height:34px; background:var(--teal); border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; color:#fff; font-weight:700; font-size:18px; }
.sidebar-brand-name { font-size:14px; font-weight:600; color:#fff; line-height:1.2; }
.sidebar-brand-name small { display:block; font-size:10px; font-weight:400; color:#64748B; text-transform:uppercase; letter-spacing:.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:140px; }
.sidebar-nav { flex:1; padding:12px 0; }
.sidebar-section { padding:12px 16px 4px; font-size:10px; font-weight:600; color:#475569; text-transform:uppercase; letter-spacing:.6px; }
.sidebar-item { display:flex; align-items:center; gap:10px; padding:9px 16px; font-size:13px; color:var(--sidebar-text); text-decoration:none; border-left:3px solid transparent; transition:all .15s; }
.sidebar-item:hover { background:var(--sidebar-hover); color:#CBD5E1; text-decoration:none; }
.sidebar-item.ativo { background:var(--sidebar-active-bg); color:var(--sidebar-active-text); border-left-color:var(--teal); }
.sidebar-item svg { flex-shrink:0; opacity:.7; width:16px; height:16px; }
.sidebar-item.ativo svg { opacity:1; }
.sidebar-item .cnt { margin-left:auto; background:var(--red); color:#fff; border-radius:20px; padding:0 7px; font-size:11px; font-weight:600; line-height:18px; }
.sidebar-footer { padding:14px 16px; border-top:1px solid #1E293B; }
.sidebar-user { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.sidebar-avatar { width:32px; height:32px; border-radius:50%; background:var(--teal); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600; color:#fff; flex-shrink:0; }
.sidebar-user-info { flex:1; min-width:0; }
.sidebar-user-name { font-size:12px; font-weight:500; color:#CBD5E1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user-role { font-size:10px; color:#64748B; }
.sidebar-logout { display:flex; align-items:center; gap:8px; padding:7px 10px; font-size:12px; color:#94A3B8; border-radius:6px; width:100%; background:none; border:none; cursor:pointer; font-family:inherit; }
.sidebar-logout:hover { background:#1E293B; color:#CBD5E1; }
.sombra { display:none; position:fixed; inset:0; background:rgba(15,23,42,.5); z-index:90; }

/* ── Área principal ── */
.main { margin-left:var(--sidebar-width); flex:1; display:flex; flex-direction:column; min-height:100vh; min-width:0; }
.topbar { background:var(--white); border-bottom:1px solid var(--border); padding:0 24px; min-height:56px; display:flex; align-items:center; justify-content:space-between; gap:12px; position:sticky; top:0; z-index:50; }
.topbar-title { font-size:15px; font-weight:600; color:var(--text-dark); }
.topbar-sub { font-size:12px; color:var(--text-muted); margin-top:1px; }
.topbar-acoes { display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.menu-btn { display:none; background:none; border:none; cursor:pointer; padding:6px; margin-right:4px; color:var(--text-dark); }
.sino { position:relative; display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:6px; border:1px solid var(--border); background:#fff; color:var(--text-muted); }
.sino .cnt { position:absolute; top:-6px; right:-6px; background:var(--red); color:#fff; border-radius:20px; padding:0 6px; font-size:10px; font-weight:700; line-height:16px; }
.page-content { padding:24px; }
.faixa { padding:10px 24px; font-size:13px; background:#FFFBEB; color:#92400E; border-bottom:1px solid #FDE68A; }
.faixa.vermelha { background:#FEF2F2; color:#991B1B; border-color:#FECACA; }

/* ── Componentes ── */
.card { background:var(--white); border:1px solid var(--border); border-radius:8px; overflow:hidden; margin-bottom:16px; }
.card-header { padding:12px 20px; border-bottom:1px solid var(--border); background:#FAFAFA; display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.card-title { font-size:14px; font-weight:600; color:var(--text-dark); }
.card-body { padding:16px 20px; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:36px; padding:0 16px; border-radius:6px; font-family:inherit; font-size:13px; font-weight:500; cursor:pointer; text-decoration:none; border:1px solid var(--border); background:var(--white); color:var(--text-muted); white-space:nowrap; }
.btn:hover { background:#F8FAFC; text-decoration:none; }
.btn-primary { background:var(--teal); color:#fff; border-color:var(--teal); }
.btn-primary:hover { background:var(--teal-dark); }
.btn-sm { height:28px; padding:0 10px; font-size:12px; }
.btn-danger { background:#FEF2F2; color:var(--red); border-color:#FECACA; }
.btn-danger:hover { background:#FEE2E2; }
.btn-ok { background:#F0FDF4; color:var(--green); border-color:#BBF7D0; }
.btn-ok:hover { background:#DCFCE7; }
.btn-link { background:none; border:none; color:var(--teal-dark); cursor:pointer; font:inherit; font-size:12px; padding:0; }
.btn-link:hover { text-decoration:underline; }
.badge { display:inline-flex; align-items:center; padding:2px 10px; border-radius:20px; font-size:11px; font-weight:500; background:#E2E8F0; color:#475569; white-space:nowrap; }
.badge-verde { background:#F0FDF4; color:var(--green); }
.badge-vermelho { background:#FEF2F2; color:var(--red); }
.badge-ambar { background:#FFFBEB; color:var(--amber); }
.badge-azul { background:#EFF6FF; color:var(--blue); }
.badge-roxo { background:#F5F3FF; color:var(--purple); }
.badge-teal { background:var(--teal-light); color:var(--teal-dark); }
.alert-ok, .alert-erro, .alert-info { padding:10px 16px; border-radius:6px; font-size:13px; margin-bottom:16px; border:1px solid; }
.alert-ok { background:#F0FDF4; color:#15803D; border-color:#BBF7D0; }
.alert-erro { background:#FEF2F2; color:#DC2626; border-color:#FECACA; }
.alert-info { background:#EFF6FF; color:#1D4ED8; border-color:#BFDBFE; }
.tabela-rolagem { overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
thead { background:#F8FAFC; border-bottom:1px solid var(--border); }
th { text-align:left; padding:10px 16px; font-size:11px; font-weight:600; letter-spacing:.5px; text-transform:uppercase; color:var(--text-muted); white-space:nowrap; }
td { padding:11px 16px; color:var(--text-main); border-bottom:1px solid var(--border); font-size:13px; vertical-align:middle; }
tr:last-child td { border-bottom:none; }
tbody tr:hover td { background:#F8FAFC; }
td.num, th.num { text-align:right; white-space:nowrap; }
tr.atrasada td { background:#FEF2F2; }
.empty { text-align:center; padding:32px 16px; color:var(--text-hint); font-size:13px; }
.muted { color:var(--text-muted); }
.pequeno { font-size:12px; }
.vermelho { color:var(--red); }
.verde { color:var(--green); }
.negrito { font-weight:600; }
.field { display:flex; flex-direction:column; gap:5px; min-width:0; }
.field label, .rotulo { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.4px; color:var(--text-muted); }
.field input, .field select, .field textarea, .campo { padding:8px 12px; border:1px solid var(--border); border-radius:6px; font-size:14px; font-family:inherit; color:var(--text-main); background:var(--white); outline:none; max-width:100%; min-width:0; }
.field input, .field select, .campo { height:36px; }
.field textarea { min-height:72px; resize:vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .campo:focus { border-color:var(--teal); box-shadow:0 0 0 3px rgba(13,148,136,.08); }
.field .hint, .hint { font-size:11px; color:var(--text-muted); }
.form-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.form-grid > * { min-width:0; }
.form-grid .col-2 { grid-column:span 2; }
.form-grid .col-3 { grid-column:span 3; }
.form-footer { display:flex; justify-content:flex-end; align-items:center; gap:8px; padding:14px 20px; border-top:1px solid var(--border); background:#FAFAFA; flex-wrap:wrap; }
.linha { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.linha-fim { display:flex; gap:8px; align-items:center; justify-content:flex-end; flex-wrap:wrap; }
.grade-2 { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:16px; align-items:start; }
.grade-meio { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:start; }
.filtros { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.filtros .campo { height:36px; }
.tabs { display:flex; border-bottom:1px solid var(--border); background:#FAFAFA; overflow-x:auto; }
.tab { padding:12px 18px; font-size:13px; font-weight:500; color:var(--text-muted); border-bottom:2px solid transparent; white-space:nowrap; }
.tab:hover { color:var(--teal); text-decoration:none; }
.tab.ativo { color:var(--teal); border-bottom-color:var(--teal); background:#fff; }
.tab .cnt { background:#E2E8F0; color:#475569; border-radius:20px; padding:1px 8px; font-size:11px; font-weight:600; margin-left:5px; }
.tab.ativo .cnt { background:var(--teal); color:#fff; }
.chips { display:flex; gap:6px; flex-wrap:wrap; }
.chips label { cursor:pointer; }
.chips input { position:absolute; opacity:0; pointer-events:none; }
.chips span { display:inline-flex; align-items:center; height:32px; padding:0 12px; border:1px solid var(--border); border-radius:20px; font-size:12px; font-weight:500; color:var(--text-muted); background:#fff; }
.chips input:checked + span { background:var(--teal); border-color:var(--teal); color:#fff; }
.chips input:focus-visible + span { box-shadow:0 0 0 3px rgba(13,148,136,.2); }
.oculto { display:none !important; }

/* ── Cartões de números (KPI) ── */
.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; margin-bottom:16px; }
.kpi { background:#fff; border:1px solid var(--border); border-radius:8px; padding:14px 16px; display:block; color:inherit; }
a.kpi:hover { border-color:var(--teal); text-decoration:none; }
.kpi-rotulo { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.4px; color:var(--text-muted); }
.kpi-valor { font-size:22px; font-weight:700; color:var(--text-dark); margin-top:4px; line-height:1.2; }
.kpi-sub { font-size:12px; color:var(--text-muted); margin-top:2px; }
.kpi.alerta { border-color:#FECACA; background:#FEF2F2; }
.kpi.alerta .kpi-valor { color:var(--red); }
.kpi.destaque { border-color:var(--teal); background:#F0FDFA; }
.barra { height:8px; background:#E2E8F0; border-radius:8px; overflow:hidden; min-width:80px; }
.barra > i { display:block; height:100%; background:var(--teal); border-radius:8px; }
.barra.amarela > i { background:var(--amber); }
.barra.vermelha > i { background:var(--red); }

/* ── Meu dia / listas de tarefas ── */
.tarefa { display:flex; gap:12px; align-items:flex-start; padding:12px 20px; border-bottom:1px solid var(--border); }
.tarefa:last-child { border-bottom:none; }
.tarefa.atrasada { background:#FEF2F2; }
.tarefa-corpo { flex:1; min-width:0; }
.tarefa-titulo { font-weight:600; color:var(--text-dark); }
.tarefa-sub { font-size:12px; color:var(--text-muted); margin-top:2px; overflow-wrap:anywhere; }
.tarefa-acoes { display:flex; gap:6px; flex-shrink:0; flex-wrap:wrap; justify-content:flex-end; }
.hora { font-size:12px; font-weight:600; color:var(--text-dark); min-width:44px; padding-top:2px; }

/* ── Funil (Kanban) ── */
.kanban { display:flex; gap:12px; align-items:flex-start; overflow-x:auto; padding-bottom:12px; }
.coluna { flex:0 0 272px; background:#E9EEF4; border-radius:8px; display:flex; flex-direction:column; max-height:calc(100vh - 170px); }
.coluna-topo { padding:10px 12px 8px; }
.coluna-nome { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--text-dark); display:flex; justify-content:space-between; gap:6px; }
.coluna-total { font-size:12px; color:var(--text-muted); margin-top:2px; }
.coluna-lista { padding:0 8px 8px; overflow-y:auto; flex:1; min-height:60px; }
.coluna.alvo { outline:2px dashed var(--teal); outline-offset:-2px; }
.cartao { display:block; background:#fff; border:1px solid var(--border); border-left:3px solid var(--border); border-radius:6px; padding:10px 12px; margin-bottom:8px; cursor:grab; color:inherit; }
.cartao:hover { border-color:var(--teal); text-decoration:none; }
.cartao.arrastando { opacity:.4; }
.cartao.sem-retorno { border-left-color:var(--red); }
.cartao.parado { border-left-color:var(--amber); }
.cartao.quer { border-left-color:var(--green); background:#F0FDF4; }
.cartao-titulo { font-weight:600; color:var(--text-dark); font-size:13px; overflow-wrap:anywhere; }
.cartao-sub { font-size:12px; color:var(--text-muted); margin-top:2px; }
.cartao-pe { display:flex; justify-content:space-between; align-items:center; gap:6px; margin-top:8px; font-size:12px; flex-wrap:wrap; }
.cartao-mover { display:none; margin-top:8px; }

/* ── Linha do tempo ── */
.tl { position:relative; padding:4px 20px 8px 44px; }
.tl::before { content:''; position:absolute; left:27px; top:8px; bottom:8px; width:2px; background:var(--border); }
.tl-item { position:relative; padding:10px 0; }
.tl-item::before { content:''; position:absolute; left:-22px; top:15px; width:10px; height:10px; border-radius:50%; background:var(--teal); border:2px solid #fff; box-shadow:0 0 0 1px var(--teal); }
.tl-item.sistema::before { background:#CBD5E1; box-shadow:0 0 0 1px #CBD5E1; }
.tl-cab { font-size:12px; color:var(--text-muted); }
.tl-cab b { color:var(--text-dark); font-weight:600; }
.tl-texto { margin-top:3px; white-space:pre-wrap; overflow-wrap:anywhere; }
.tl-item.sistema .tl-texto { color:var(--text-muted); font-size:13px; }

/* ── Conversa (WhatsApp) ── */
.chat { display:flex; flex-direction:column; height:min(62vh,560px); }
.chat-msgs { flex:1; overflow-y:auto; padding:16px; background:#ECE5DD; display:flex; flex-direction:column; gap:6px; }
.msg { max-width:78%; padding:7px 10px 5px; border-radius:8px; font-size:13px; background:#fff; align-self:flex-start; box-shadow:0 1px 1px rgba(0,0,0,.08); overflow-wrap:anywhere; white-space:pre-wrap; }
.msg.saida { background:#D9FDD3; align-self:flex-end; }
.msg-pe { font-size:10px; color:var(--text-muted); text-align:right; margin-top:2px; white-space:normal; }
.msg img { max-width:240px; max-height:240px; border-radius:6px; display:block; margin-bottom:4px; }
.msg audio { max-width:240px; display:block; }
.msg .removido { font-style:italic; color:var(--text-muted); }
.chat-form { display:flex; gap:8px; padding:10px 12px; border-top:1px solid var(--border); background:#FAFAFA; align-items:flex-end; }
.chat-form textarea { flex:1; min-height:38px; max-height:120px; padding:8px 12px; border:1px solid var(--border); border-radius:18px; font:inherit; resize:none; outline:none; }
.caixa-item { display:flex; gap:12px; align-items:center; padding:12px 20px; border-bottom:1px solid var(--border); color:inherit; }
.caixa-item:hover { background:#F8FAFC; text-decoration:none; }
.caixa-item .previa { font-size:12px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.avatar { width:36px; height:36px; border-radius:50%; background:var(--teal-light); color:var(--teal-dark); display:flex; align-items:center; justify-content:center; font-weight:600; font-size:13px; flex-shrink:0; }

/* ── Agenda (calendário) ── */
.semana { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
.dia { background:#fff; border:1px solid var(--border); border-radius:8px; min-height:120px; padding:8px; }
.dia.hoje { border-color:var(--teal); box-shadow:0 0 0 1px var(--teal); }
.dia.fora { background:#F8FAFC; }
.dia-cab { font-size:11px; font-weight:600; text-transform:uppercase; color:var(--text-muted); margin-bottom:6px; display:flex; justify-content:space-between; }
.evento { display:block; font-size:12px; padding:4px 6px; border-radius:4px; background:var(--teal-light); color:var(--teal-dark); margin-bottom:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.evento.atrasado { background:#FEE2E2; color:#991B1B; }
.evento.renovacao { background:#F5F3FF; color:var(--purple); }

/* ── Entrada / páginas sem menu ── */
body.sem-menu { display:block; background:var(--sidebar-bg); }
.entrada { max-width:400px; margin:0 auto; padding:48px 20px; }
.entrada-marca { display:flex; align-items:center; gap:12px; justify-content:center; margin-bottom:24px; color:#fff; font-size:22px; font-weight:700; }
.entrada-marca .sidebar-brand-icon { width:44px; height:44px; font-size:24px; }
.entrada .card { padding:24px; }
.entrada .field { margin-bottom:14px; }
.entrada .btn { width:100%; height:42px; font-size:14px; }
.entrada-pe { text-align:center; margin-top:16px; font-size:12px; color:#64748B; }
.entrada-pe a { color:#94A3B8; }
.publica { max-width:520px; margin:0 auto; padding:40px 20px; }
.publica .card { padding:28px; text-align:center; }
.publica h1 { font-size:20px; color:var(--text-dark); margin-bottom:10px; }
.publica p { color:var(--text-muted); margin-bottom:14px; line-height:1.5; }
.publica .btn { height:46px; padding:0 28px; font-size:15px; }

/* ── Celular ── */
@media (max-width: 900px) {
    .sidebar { transform:translateX(-100%); }
    body.menu-aberto .sidebar { transform:none; }
    body.menu-aberto .sombra { display:block; }
    .main { margin-left:0; }
    .menu-btn { display:inline-flex; }
    .topbar { padding:8px 14px; }
    .page-content { padding:14px; }
    .faixa { padding:10px 14px; }
    .form-grid { grid-template-columns:1fr; }
    .form-grid .col-2, .form-grid .col-3 { grid-column:auto; }
    .grade-2, .grade-meio { grid-template-columns:minmax(0,1fr); }
    .card-header, .card-body { padding-left:14px; padding-right:14px; }
    .tarefa, .caixa-item { padding-left:14px; padding-right:14px; }
    .tarefa { flex-wrap:wrap; }
    .tarefa-acoes { width:100%; justify-content:flex-start; }
    th, td { padding:10px 12px; }
    .coluna { flex-basis:82vw; max-height:none; }
    .cartao { cursor:pointer; }
    .cartao-mover { display:block; }
    .semana { grid-template-columns:1fr; }
    .dia { min-height:0; }
    .dia.fora { display:none; }
    .msg { max-width:88%; }
    .some-celular { display:none !important; }
    .topbar-sub { display:none; }
}
@media print {
    .sidebar, .topbar-acoes, .menu-btn, .form-footer, .btn { display:none !important; }
    .main { margin-left:0; }
    body { background:#fff; }
}
