/* ============================================================
   Seeker — Painel de Mandados
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #eef1f7;
    --surface: #ffffff;
    --ink: #1e2433;
    --ink-soft: #5b6478;
    --line: #e4e8f0;
    --brand: #4f46e5;
    --brand-d: #4338ca;
    --topbar-1: #1e293b;
    --topbar-2: #0f172a;
    --tz: #e11d48;
    --tz-bg: #fef2f4;
    --ok: #059669;
    --ok-bg: #ecfdf5;
    --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
    --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Topbar ---------- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    padding: 14px 24px;
    background: linear-gradient(120deg, var(--topbar-1), var(--topbar-2));
    color: #fff;
    box-shadow: 0 4px 20px rgba(15,23,42,.25);
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.02em; display: flex; align-items: baseline; gap: 8px; }
.brand-sub { font-weight: 500; font-size: 13px; color: #94a3b8; }
.logo-dot { font-size: 18px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.user-nome { font-weight: 600; font-size: 14px; }
.badge-papel {
    font-size: 11px; font-weight: 700; letter-spacing: .04em;
    padding: 3px 9px; border-radius: 999px;
    background: #334155; color: #cbd5e1;
}
.badge-papel.adm { background: var(--brand); color: #fff; }
.btn-topo {
    text-decoration: none; color: #e2e8f0; font-size: 13px; font-weight: 600;
    padding: 7px 13px; border-radius: 9px; border: 1px solid #ffffff22;
    transition: .15s;
}
.btn-topo:hover { background: #ffffff1a; }
.btn-topo.sair { border-color: #ffffff10; color: #fca5a5; }

/* ---------- Conteúdo ---------- */
.conteudo { max-width: 1200px; margin: 0 auto; padding: 26px 24px 60px; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.card {
    background: var(--surface); border-radius: var(--radius); padding: 20px 22px;
    box-shadow: var(--shadow); border: 1px solid var(--line);
    position: relative; overflow: hidden;
}
.card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--brand);
}
.card.tz::before { background: var(--tz); }
.card.end::before { background: #0ea5e9; }
.card-num { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.card-lbl { margin-top: 6px; color: var(--ink-soft); font-size: 13px; font-weight: 500; }
.card.tz .card-num { color: var(--tz); }

/* ---------- Painel / filtros ---------- */
.painel {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--line);
    padding: 18px; margin-bottom: 20px;
}
.filtros { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.busca {
    flex: 1 1 260px; min-width: 200px;
    padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
    font-size: 14px; font-family: inherit; background: #fafbfe; color: var(--ink);
}
.busca:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px #4f46e522; }
.pills { display: inline-flex; background: #f1f3f9; border-radius: 10px; padding: 3px; gap: 2px; }
.pill {
    border: none; background: transparent; cursor: pointer;
    font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft);
    padding: 7px 13px; border-radius: 8px; transition: .15s;
}
.pill:hover { color: var(--ink); }
.pill.ativo { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(16,24,40,.12); }

/* ---------- Paginação ---------- */
.por-pagina {
    padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
    font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft);
    background: #fafbfe; cursor: pointer;
}
.paginacao {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px;
    border-top: 1px solid var(--line);
}
.info-pag { font-size: 13px; color: var(--ink-soft); }
.pag-ctrls { display: flex; align-items: center; gap: 10px; }
.pag-atual { font-size: 13px; font-weight: 600; color: var(--ink); min-width: 56px; text-align: center; }
.btn-pag {
    font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px;
    border: 1px solid var(--line); border-radius: 9px; background: #fff;
    color: var(--ink); cursor: pointer; transition: .15s;
}
.btn-pag:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn-pag:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Tabela ---------- */
.tabela-wrap { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela thead th {
    text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft);
    border-bottom: 2px solid var(--line);
}
.tabela tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabela tbody tr:hover { background: #f8faff; }
.td-nome { font-weight: 600; }
.td-orgao { color: var(--ink-soft); font-size: 13px; max-width: 280px; }
.td-cpf { white-space: nowrap; }
.td-inserido { white-space: nowrap; }
.ins-data { font-size: 13px; color: var(--ink); }
.ins-ha { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }
.col-end { text-align: center; font-size: 16px; }
.td-acoes { white-space: nowrap; text-align: right; }
.vazio { padding: 40px; text-align: center; color: var(--ink-soft); }

/* ---------- Tags / badges ---------- */
.tag {
    display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em;
    padding: 4px 10px; border-radius: 999px;
}
.tag.ativa { background: var(--tz-bg); color: var(--tz); }
.tag.off { background: #f1f3f9; color: #94a3b8; }
.tag.grande { font-size: 13px; padding: 7px 14px; }

/* ---------- Botões ---------- */
.btn-ver, .btn-pdf, .btn-mini {
    font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    padding: 7px 13px; border-radius: 9px; text-decoration: none; display: inline-block;
    border: 1px solid var(--line); transition: .15s;
}
.btn-ver { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-ver:hover { background: var(--brand-d); }
.btn-pdf { background: #fff; color: var(--ink); margin-left: 6px; }
.btn-pdf:hover { border-color: var(--brand); color: var(--brand); }
.btn-pdf.grande { padding: 12px 20px; font-size: 15px; background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-pdf.grande:hover { background: var(--brand-d); color: #fff; }
.btn-mini { background: #fff; color: var(--ink-soft); margin: 2px; }
.btn-mini:hover { border-color: var(--brand); color: var(--brand); }
.btn-mini.perigo:hover { border-color: var(--tz); color: var(--tz); }

button, .btn-ver { }

/* ---------- Modal ---------- */
.modal {
    position: fixed; inset: 0; background: rgba(15,23,42,.55);
    backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center;
    padding: 20px; z-index: 50;
}
.modal-box {
    background: var(--surface); border-radius: 18px; width: 100%; max-width: 560px;
    max-height: 88vh; overflow-y: auto; padding: 28px; position: relative;
    box-shadow: 0 24px 60px rgba(15,23,42,.35);
}
.modal-fechar {
    position: absolute; right: 16px; top: 12px; background: none; border: none;
    font-size: 28px; line-height: 1; color: var(--ink-soft); cursor: pointer;
}
.modal-box h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.detalhe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 18px 0; }
.det-item { display: flex; flex-direction: column; gap: 3px; }
.det-item:has(.det-v:only-child) { }
.det-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.det-v { font-size: 14px; font-weight: 500; word-break: break-word; }
.det-item:nth-child(6) { grid-column: 1 / -1; } /* endereço ocupa a linha toda */
.modal-rodape { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; text-align: center; }
.sem-pdf { color: var(--ink-soft); font-size: 13px; }

/* ---------- Login ---------- */
.tela-login {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1e293b, #0f172a); padding: 20px;
}
.login-card {
    background: var(--surface); border-radius: 20px; padding: 40px 34px;
    width: 100%; max-width: 380px; box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.login-brand { font-size: 30px; font-weight: 800; letter-spacing: -.03em; text-align: center; }
.login-sub { text-align: center; color: var(--ink-soft); margin: 4px 0 26px; font-size: 14px; }
.login-card label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin: 14px 0 6px; }
.login-card input {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
    font-size: 15px; font-family: inherit; background: #fafbfe;
}
.login-card input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px #4f46e522; }
.login-card button {
    width: 100%; margin-top: 22px; padding: 13px; border: none; border-radius: 10px;
    background: var(--brand); color: #fff; font-size: 15px; font-weight: 700;
    font-family: inherit; cursor: pointer; transition: .15s;
}
.login-card button:hover { background: var(--brand-d); }

/* ---------- Alertas ---------- */
.alerta { padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; margin-bottom: 16px; }
.alerta.erro { background: var(--tz-bg); color: var(--tz); border: 1px solid #fecdd3; }
.alerta.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #a7f3d0; }

/* ---------- Usuários ---------- */
.secao-titulo { margin: 2px 0 14px; font-size: 15px; font-weight: 700; }
.form-usuario { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-usuario input, .form-usuario select {
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
    font-family: inherit; font-size: 14px; background: #fafbfe;
}
.form-usuario input { flex: 1 1 150px; }
.form-usuario button {
    padding: 10px 20px; border: none; border-radius: 9px; background: var(--brand);
    color: #fff; font-weight: 700; font-family: inherit; cursor: pointer;
}
.form-usuario button:hover { background: var(--brand-d); }
.inline { display: inline; }
.voce { color: var(--ink-soft); font-size: 12px; }

/* ---------- Responsivo ---------- */
@media (max-width: 720px) {
    .cards { grid-template-columns: 1fr; }
    .detalhe-grid { grid-template-columns: 1fr; }
    .det-item:nth-child(6) { grid-column: auto; }
    .td-orgao { display: none; }
    .conteudo { padding: 18px 14px 50px; }
}
