/* Padrão visual W3Vision (mesmo das telas de administração: menu lateral escuro, cartões brancos com barra colorida). */
:root {
  --side: #1E2A3A; --side-active: #2C3D52; --side-text: #C9D3E0;
  --bg: #F4F6F9; --surface: #FFFFFF; --fg: #212529; --muted: #6B7280; --line: #EEF0F3; --line-strong: #D5DAE1;
  --primary: #0D6EFD; --primary-dark: #0B5ED7; --primary-soft: #E7F0FF;
  --green: #16A34A; --green-soft: #DCFCE7; --amber: #F59E0B; --amber-soft: #FEF3C7; --amber-text: #92600A;
  --red: #DC2626; --red-soft: #FEE2E2; --gray: #6B7280; --blue: #2563EB;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.5; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 600; line-height: 1.2; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; line-height: 1.35; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* estrutura geral */
.app { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 20px 16px; display: flex; flex-direction: column; gap: 22px; }
.brand { color: #fff; font-size: 18px; font-weight: 700; line-height: 1.2; padding: 0 6px; }
.brand small { display: block; font-size: 12px; font-weight: 400; color: #8FA0B5; margin-top: 8px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { color: var(--side-text); padding: 9px 14px; border-radius: 8px; font-size: 15px; text-decoration: none; }
.nav a:hover { background: rgba(255, 255, 255, .06); }
.nav a.on { background: var(--side-active); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { background: var(--surface); border-bottom: 1px solid var(--line-strong); padding: 12px 24px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; min-height: 56px; }
.top .title { font-size: 15px; color: var(--muted); }
.top-r { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 14px; color: var(--muted); }
.content { padding: 24px; display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 1280px; }
.pagehead { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; justify-content: space-between; }
.pagehead .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.clientsel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.clientsel select { width: auto; max-width: 100%; }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 16px 14px; border-top: 4px solid var(--gray); min-width: 0; }
.kpi.k-green { border-top-color: var(--green); } .kpi.k-blue { border-top-color: var(--blue); }
.kpi.k-amber { border-top-color: var(--amber); } .kpi.k-gray { border-top-color: var(--gray); }
.kpi .lbl { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi .val { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 4px; overflow-wrap: anywhere; }
.kpi .val.txt { font-size: 18px; line-height: 1.3; padding: 6px 0 2px; }
.kpi .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.kpi.k-amber .val { color: var(--amber-text); }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; background: var(--green); border-radius: 4px; }

/* painéis */
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1060px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.panel-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: space-between; align-items: baseline; }
.panel-h h2 { font-size: 16px; }
.panel-b { padding: 6px 18px 12px; }
.panel-b.pad { padding: 16px 18px; }
.empty { padding: 16px 0; color: var(--muted); }

/* pendências */
.pend { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pend:last-child { border-bottom: 0; }
.pend-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: flex-start; justify-content: space-between; }
.pend-h h3 { display: flex; gap: 10px; align-items: baseline; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); flex: none; display: inline-block; }
.dot.d-respondida { background: var(--blue); } .dot.d-concluida { background: var(--green); }
.meta { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; width: fit-content; white-space: nowrap; }
.p-pendente { background: var(--line); color: var(--muted); }
.p-andamento, .p-respondida { background: var(--primary-soft); color: var(--primary-dark); }
.p-aguardando, .p-aberta { background: var(--amber-soft); color: var(--amber-text); }
.p-concluida { background: var(--green-soft); color: #15803D; }
.p-opcional { border: 1px dashed var(--line-strong); color: var(--muted); }
.sec-title { padding: 14px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.answer { background: var(--primary-soft); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.answer small { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.tag { font-size: 12px; color: var(--muted); }

/* etapas */
.timeline { display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 22px 1fr; gap: 0 12px; }
.rail { display: flex; flex-direction: column; align-items: center; }
.rdot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); margin-top: 3px; flex: none; }
.step.s-concluida .rdot { background: var(--green); border-color: var(--green); }
.step.s-andamento .rdot { background: var(--blue); border-color: var(--blue); }
.step.s-aguardando .rdot { background: var(--amber); border-color: var(--amber); }
.step.s-opcional .rdot { border-style: dashed; }
.rline { flex: 1; width: 2px; background: var(--line); margin: 4px 0; }
.step:last-child .rline { display: none; }
.step-body { padding-bottom: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.step-body h3 { font-size: 14px; }
.step-body p { font-size: 13px; }
.updates { display: flex; flex-direction: column; }
.upd { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.upd:last-child { border-bottom: 0; }
.upd time { font-size: 12px; color: var(--muted); padding-top: 2px; }
@media (max-width: 520px) { .upd { grid-template-columns: 1fr; gap: 2px; } }

/* formulários e botões */
form, .row { display: flex; flex-direction: column; gap: 10px; }
form.inline { display: inline; }
label { font-size: 13px; font-weight: 600; color: #374151; }
.opts { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.opts label, label.chk { display: flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 400; font-size: 15px; color: var(--fg); }
input[type="radio"], input[type="checkbox"] { accent-color: var(--primary); }
textarea, select, input[type="text"], input[type="email"], input[type="password"] {
  font: inherit; color: var(--fg); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0;
}
textarea { min-height: 72px; resize: vertical; }
button, a.btn { font: 600 14px var(--font); cursor: pointer; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--primary); background: var(--primary); color: #fff; width: fit-content; text-decoration: none; display: inline-block; }
button:hover, a.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; }
button.ghost, a.btn.ghost { background: #fff; color: var(--primary); border-color: var(--line-strong); }
button.ghost:hover, a.btn.ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
button.danger { color: var(--red); }
button.linklike { background: none; border: 1px solid var(--line-strong); color: var(--fg); padding: 5px 12px; font-weight: 500; font-size: 14px; }
button.linklike:hover { background: var(--bg); border-color: var(--gray); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.note { background: var(--amber-soft); border-left: 4px solid var(--amber); padding: 12px 16px; border-radius: 0 8px 8px 0; overflow-wrap: anywhere; }
.note.pw { font-family: var(--mono); font-size: 15px; }
.err-box { background: var(--red-soft); border-left: 4px solid var(--red); padding: 12px 16px; border-radius: 0 8px 8px 0; }
.err { color: var(--red); font-size: 14px; }
.admin { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.grid .full { grid-column: 1 / -1; }
.grid > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 700px; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.acoes form.inline { display: inline-block; margin: 0 6px 6px 0; }
td.acoes button { padding: 5px 10px; font-size: 13px; }

/* logo w3.projetos */
.logo { display: inline-flex; align-items: center; gap: 0; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-size: 28px; color: #fff; text-decoration: none; }
.logo b { color: #2FD999; font-weight: 800; }
.logo i { width: 11px; height: 11px; border-radius: 50%; background: #2FD999; box-shadow: 0 0 0 5px rgba(47, 217, 153, .2); margin: 0 9px 0 8px; flex: none; }
.logo span { color: #fff; }
.side .logo { font-size: 21px; }
.side .logo i { width: 8px; height: 8px; box-shadow: 0 0 0 4px rgba(47, 217, 153, .2); margin: 0 7px 0 6px; }
a.logo:hover { text-decoration: none; }

/* login e instalação (mesmo padrão escuro do w3form) */
body.auth-body { background: #161B2C; background-image: radial-gradient(ellipse at 50% -10%, #1E2742 0%, #161B2C 60%); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; color: #fff; }
.auth { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.auth .box { background: #1E2438; border: 1px solid #2A3250; border-radius: 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); padding: 32px 28px 28px; display: flex; flex-direction: column; gap: 12px; }
.auth .box .head { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; margin-bottom: 6px; }
.auth h1 { font-size: 21px; font-weight: 700; color: #fff; }
.auth .muted, .auth .sub { color: #8B93B0; font-size: 14px; }
.auth label { color: #C7CDE0; }
.auth input[type="text"], .auth input[type="email"], .auth input[type="password"] { background: #161B2C; border: 1px solid #2A3250; color: #fff; border-radius: 10px; padding: 10px 12px; }
.auth input:focus-visible { outline: 2px solid #2FD999; outline-offset: 1px; }
.auth button { background: #2FD999; border-color: #2FD999; color: #0E1424; border-radius: 10px; padding: 11px 14px; width: 100%; font-weight: 700; }
.auth button:hover { background: #27C088; border-color: #27C088; }
.auth .err { color: #F87171; }
.auth .note { background: rgba(245, 158, 11, .12); color: #FCD9A0; border-left-color: #F59E0B; }
.auth .note a, .auth a { color: #2FD999; }
.auth .tags button { width: auto; }
.auth a.btn.ghost { background: transparent; color: #C7CDE0; border-color: #2A3250; }
.auth label.chk { color: #C7CDE0; }
.auth .foot { color: #8B93B0; font-size: 13px; text-align: center; }

/* telas estreitas: menu vira faixa no topo */
@media (max-width: 800px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav a { padding: 6px 12px; font-size: 14px; }
  .top { padding: 10px 16px; }
  .content { padding: 16px; }
}

#app { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 520px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi { padding: 12px; } .kpi .val { font-size: 24px; } .kpi .val.txt { font-size: 15px; } }
