:root {
    --bg: #f6f7f4;
    --surface: #ffffff;
    --ink: #22252a;
    --muted: #68707a;
    --line: #dfe3e6;
    --brand: #1f6f62;
    --brand-2: #b9872d;
    --danger: #ad3434;
    --ok: #287c45;
    --warn: #a76912;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { background: #17211f; color: #fff; padding: 24px 18px; }
.brand { font-size: 22px; font-weight: 700; margin-bottom: 28px; }
.nav a { display: block; color: #eef4f1; padding: 10px 12px; border-radius: 6px; margin-bottom: 4px; }
.nav a:hover, .nav .active { background: rgba(255,255,255,.12); text-decoration: none; }
.main { padding: 28px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 22px; }
h1 { margin: 0; font-size: 28px; }
h2 { margin: 24px 0 12px; font-size: 20px; }
.muted { color: var(--muted); }
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.panel { padding: 20px; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 11px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
textarea { min-height: 92px; resize: vertical; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.btn {
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    border-radius: 6px;
    padding: 10px 14px;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-weight: 700;
}
.btn:hover { text-decoration: none; filter: brightness(.96); }
.btn.secondary { color: var(--brand); background: #fff; }
.btn.danger { border-color: var(--danger); background: var(--danger); }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-size: 13px; background: #fafbfa; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 700; background: #e8eceb; }
.badge.aprovado { background: #dff1e6; color: var(--ok); }
.badge.reprovado { background: #f4dfdf; color: var(--danger); }
.badge.negociacao { background: #f6ead7; color: var(--warn); }
.notice { padding: 12px 14px; border-radius: 6px; background: #e7f1ef; border: 1px solid #c9e0dc; margin-bottom: 16px; }
.error { background: #fae8e8; border-color: #efcaca; }
.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login .panel { width: min(420px, 100%); }
.section-lock { opacity: .58; }
.permission-box { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fafbfa; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(16, 22, 24, .72);
    z-index: 20;
}
.modal-backdrop.is-open { display: flex; }
.pdf-modal {
    width: min(1040px, 100%);
    height: min(86vh, 860px);
    background: #fff;
    border-radius: 8px;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0,0,0,.28);
}
.pdf-modal__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}
.pdf-modal__bar strong { font-size: 16px; }
.pdf-modal iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #f3f4f5;
}
@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .grid, .grid-3 { grid-template-columns: 1fr; }
    .main { padding: 18px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .modal-backdrop { padding: 10px; }
    .pdf-modal { height: 92vh; }
}
