*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Paleta oficial Grupo Gestor (globo verde-teal -> azul), a mesma do site gestorcerto.com.br */
:root {
  --azul: #1D4ED8; --azul2: #0B2A6B; --teal: #14B8A6; --teal2: #0F9488; --verde: #0F9488;
  --cinza1: #F6F9FC; --cinza2: #E2E8F0; --cinza3: #94A3B8;
  --texto: #0F172A; --danger: #dc2626;
  --grad: linear-gradient(135deg, #2DD4BF 0%, #14B8A6 35%, #2563EB 100%);
  --grad-escuro: linear-gradient(150deg, #0B2A6B 0%, #0E3A7A 45%, #0F766E 120%);
}
body { font-family: Inter, Segoe UI, Arial, sans-serif; background: var(--cinza1); color: var(--texto);
       min-height: 100vh; display: flex; flex-direction: column; }

header { background: #fff; padding: 10px 24px; display: flex; align-items: center; gap: 16px;
         box-shadow: 0 1px 3px rgba(15,23,42,.06); flex-wrap: wrap; position: relative;
         border-bottom: 1px solid var(--cinza2); }
header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: var(--grad); }
header .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
header .brand img { height: 56px; width: auto; display: block; }
header .brand .sub { border-left: 2px solid var(--cinza2); padding-left: 14px; color: #334155;
                     font-size: 13px; font-weight: 600; line-height: 1.3; }
header nav { margin-left: auto; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
header nav a, header nav .link { color: var(--azul2); text-decoration: none; font-size: 14px; font-weight: 600; }
header nav a:hover, header nav .link:hover { color: var(--teal2); }
header nav .quem { color: #64748B; font-size: 12px; max-width: 260px; overflow: hidden;
                   text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { header .brand img { height: 44px; } header .brand .sub { display: none; } }
form.inline { display: inline; }
button.link { background: none; border: none; cursor: pointer; font: inherit; }

main { flex: 1; max-width: 680px; width: 100%; margin: 36px auto; padding: 0 16px 40px; }
main.largo { max-width: 1080px; }

.card { background: #fff; border-radius: 14px; box-shadow: 0 2px 16px rgba(0,0,0,.08); padding: 32px; margin-bottom: 24px; }
.card h2 { font-size: 20px; color: var(--azul); margin-bottom: 6px; }
.card h3 { font-size: 16px; color: var(--azul); margin: 8px 0 12px; }
.card .subtitle { color: var(--cinza3); font-size: 14px; margin-bottom: 24px; }

.form-group { margin-bottom: 20px; }
label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 6px; }
label .req { color: var(--danger); margin-left: 2px; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--texto); font-size: 14px; }
.opc { color: #94a3b8; font-weight: 400; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--cinza2); border-radius: 8px; font-size: 14px;
  color: var(--texto); background: #fff; transition: border-color .15s; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(26,86,165,.12); }
textarea { resize: vertical; min-height: 80px; }
.linha { display: flex; gap: 16px; flex-wrap: wrap; }
.linha > * { flex: 1; min-width: 200px; }

.upload-area { border: 2px dashed var(--cinza2); border-radius: 10px; padding: 28px 20px; text-align: center;
               cursor: pointer; transition: border-color .2s, background .2s; position: relative; }
.upload-area:hover, .upload-area.drag { border-color: var(--azul); background: #eff6ff; }
.upload-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-area .icon { font-size: 36px; margin-bottom: 8px; }
.upload-area p  { font-size: 14px; color: #64748b; }
.upload-area em { font-size: 12px; color: var(--cinza3); font-style: normal; }
#file-list { margin-top: 12px; font-size: 13px; color: #475569; text-align: left; }
#file-list li { padding: 4px 0; list-style: none; }
#file-list li::before { content: "📎 "; }

.btn, .btn-enviar { display: inline-block; padding: 10px 18px; background: var(--grad); color: #fff; font-size: 14px;
       font-weight: 700; border: none; border-radius: 10px; cursor: pointer; text-decoration: none;
       transition: background .2s, transform .1s; }
.btn:hover, .btn-enviar:hover { background: var(--grad-escuro); }
.btn-enviar { width: 100%; padding: 13px; font-size: 15px; margin-top: 8px; }
.btn:disabled, .btn-enviar:disabled { background: var(--cinza3); cursor: not-allowed; }
.btn.sec { background: #fff; color: var(--azul); border: 1px solid #bfdbfe; }
.btn.sec:hover { background: #eff6ff; }
.btn.peq { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.perigo { background: #fff; color: var(--danger); border: 1px solid #fecaca; }

.alerts { margin-bottom: 18px; }
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 8px; word-break: break-word; }
.alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.info-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 16px 20px;
            font-size: 13px; color: #1e3a5f; margin-bottom: 24px; line-height: 1.5; }
.info-box strong { color: var(--azul); }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { background: var(--azul2); color: #fff; padding: 9px 12px; text-align: left; font-weight: 600; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--cinza2); vertical-align: top; }
table.t tr:hover td { background: var(--cinza1); }
.tabela-wrap { overflow-x: auto; }
.badge { display: inline-block; background: #eff6ff; color: var(--azul); border: 1px solid #bfdbfe;
         border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.verde { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.badge.amarelo { background: #fefce8; color: #854d0e; border-color: #fde68a; }
.badge.cinza { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.muted { color: #64748b; font-size: 12px; }
.vazio { text-align: center; padding: 40px 20px; color: var(--cinza3); }

.stat-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-card { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 16px 20px; flex: 1;
             min-width: 140px; text-align: center; text-decoration: none; }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--azul); }
.stat-card .lbl { font-size: 12px; color: #64748b; margin-top: 4px; }
.filtros { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; align-items: flex-end; }
.filtros select { width: auto; min-width: 180px; }
.qr svg { width: 200px; height: 200px; background: #fff; }
.codigos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: Consolas, monospace;
           font-size: 16px; background: #f8fafc; padding: 16px; border-radius: 8px; margin: 16px 0; }
.termo { max-height: 340px; overflow-y: auto; border: 1px solid var(--cinza2); border-radius: 8px; padding: 16px;
         font-size: 13px; line-height: 1.6; margin-bottom: 18px; }
.termo h4 { margin: 12px 0 4px; color: var(--azul); }
.texto p, .texto li { font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.texto ul { padding-left: 20px; }
.texto h3 { margin-top: 18px; }

/* contador no menu */
header nav .cont { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: var(--teal);
                   color: #fff; font-size: 11px; text-align: center; }

/* documento: pré-visualização + de -> para */
.doc-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .doc-grid { grid-template-columns: 1fr; } }
.doc-previa { padding: 8px; }
.doc-previa iframe { width: 100%; height: 78vh; border: 0; border-radius: 10px; background: #f1f5f9; }
.doc-previa img { max-width: 100%; display: block; margin: auto; border-radius: 10px; }
.depara { border: 1px solid var(--cinza2); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; position: relative; }
.depara .lbl { position: absolute; top: -9px; left: 12px; background: #fff; padding: 0 6px; font-size: 11px;
               font-weight: 800; letter-spacing: 1px; color: var(--teal2); }
.depara .de { font-size: 14px; line-height: 1.5; }
.depara .para { padding-top: 4px; }
.escolhida { font-size: 13px; color: var(--azul2); background: #EAF2FE; border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }

/* árvore de pastas */
.arvore { border: 1px solid var(--cinza2); border-radius: 10px; padding: 8px 10px; max-height: 300px; overflow: auto;
          background: #fff; margin-bottom: 14px; }
.arvore ul { list-style: none; padding-left: 16px; }
.arvore > ul { padding-left: 0; }
.arvore li { padding: 2px 0; font-size: 13px; }
.arvore button { background: none; border: none; cursor: pointer; font: inherit; color: var(--texto); }
.arvore .abre { width: 18px; color: var(--cinza3); }
.arvore .nome { padding: 2px 6px; border-radius: 6px; }
.arvore .nome:hover { background: #EAF2FE; }
.arvore .nome.sel { background: var(--teal); color: #fff; }
.trilha { font-size: 14px; margin-bottom: 14px; }

footer { text-align: center; padding: 18px; font-size: 12px; color: rgba(255,255,255,.75); background: var(--grad-escuro); }
footer a { color: #fff; }
