/* Paleta: azul escuro, cinza e preto */
:root {
  --bg: #eceef1; --card: #fff; --ink: #111418; --muted: #5f6670; --line: #d5d9de;
  --brand: #003f96; --brand-dark: #002f70; --btn: #003f96; --btn-hover: #002f70; --ok: #15803d; --err: #b91c1c; --warn: #b45309;
  --okbg: #dcfce7; --errbg: #fee2e2; --warnbg: #fef3c7; --nav: 232px;
  --side-bg: #111418; --side-ink: #c9ced4; --side-muted: #8a929b; --side-hover: #23282e; --side-line: #2a2f35; --side-on: #003f96;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0d10; --card: #16191d; --ink: #e6e8eb; --muted: #9aa1a9; --line: #2b3036; --brand: #8fb3ea; --brand-dark: #b7cff2; --btn: #0a4bb0; --btn-hover: #083d8f;
    --okbg: #14532d; --errbg: #7f1d1d; --warnbg: #78350f; --ok: #86efac; --err: #fca5a5; --warn: #fcd34d;
    --side-bg: #050607; --side-hover: #1c2025; --side-line: #22262b; --side-on: #0a4bb0; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; } h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
small, .muted { color: var(--muted); } .right { text-align: right; } .nowrap { white-space: nowrap; }

.topbar { display: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--nav); background: var(--side-bg); color: var(--side-ink); border-right: 1px solid var(--side-line); padding: 1rem .75rem; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sidebar a, .sidebar button.link { color: var(--side-ink); }
.sidebar small { color: var(--side-muted); }
.sidebar strong, .sidebar .brand { color: #fff; }
.sidebar > a { padding: .5rem .75rem; border-radius: 8px; }
.sidebar > a:hover { background: var(--side-hover); text-decoration: none; }
.sidebar > a.on { background: var(--side-on); color: #fff; box-shadow: inset 3px 0 0 #fff; }
.sidebar a:focus-visible, .sidebar button:focus-visible { outline-color: #fff; }
.nav-sep { margin: 1rem .75rem .25rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--side-muted); }
.nav-user { margin-top: auto; border-top: 1px solid var(--side-line); padding: .75rem; font-size: .9rem; display: grid; gap: .35rem; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-weight: 700; }
.brand-logo { max-height: 32px; max-width: 120px; }
/* Marca do sistema (alugar.tech) */
.brand .mark { height: 26px; width: auto; } .brand .word { height: 22px; width: auto; }
.sidebar > .side-brand { display: grid; gap: .35rem; padding: .25rem .75rem 1rem; margin-bottom: .5rem; border-bottom: 1px solid var(--side-line); }
.sidebar > .side-brand:hover { background: none; text-decoration: none; }
.side-brand .lockup { display: flex; align-items: center; gap: .6rem; }
.side-brand .mark { height: 36px; width: auto; } .side-brand .word { height: 28px; width: auto; }
.side-brand small { font-size: .78rem; line-height: 1.3; }
.login-brand { display: grid; justify-items: center; gap: .9rem; margin: .5rem 0 1rem; }
.login-brand .mark { height: 72px; width: auto; } .login-brand .word { height: 52px; width: auto; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main { padding: 1.25rem; max-width: 1200px; }
main.with-nav { margin-left: var(--nav); }
main.bare { margin: 0 auto; max-width: 420px; padding-top: 12vh; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; margin: 0 0 1rem; }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; }
.kpi .v { font-size: 1.45rem; font-weight: 700; } .kpi .l { color: var(--muted); font-size: .85rem; }
.kpi.bad .v { color: var(--err); } .kpi.good .v { color: var(--ok); }
a.kpi { color: inherit; text-decoration: none; display: block; } a.kpi:hover { border-color: var(--brand); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
tfoot td { font-weight: 700; background: var(--bg); }
.table-wrap { overflow-x: auto; }
tr.overdue td { background: color-mix(in srgb, var(--errbg) 35%, transparent); }

.btn, button.btn { display: inline-block; background: var(--btn); color: #fff; border: 0; border-radius: 8px; padding: .5rem .9rem; font: inherit; cursor: pointer; }
.btn:hover { background: var(--btn-hover); text-decoration: none; }
.btn.sec { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.sec:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.btn.sm { padding: .25rem .55rem; font-size: .85rem; }
.btn.danger { background: #b91c1c; color: #fff; }
.btn.danger:hover { background: #991b1b; }
button.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; text-align: left; }
button.link.danger { color: var(--err); }

label { display: grid; align-content: start; gap: .25rem; font-size: .88rem; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { min-height: 90px; resize: vertical; }
textarea.big { min-height: 420px; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
input[type=checkbox], input[type=radio] { width: auto; }
label.check { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-size: .95rem; }
.form-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-top: .75rem; }
.inline-form label { flex: 1 1 200px; }
.renew-box .actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.renew-box .inline-form { margin-top: 0; flex-wrap: nowrap; } .renew-box .inline-form label { flex: 0 1 190px; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: 1rem; }
.filters label { flex: 0 1 180px; }
form.row-form { display: inline-flex; gap: .3rem; align-items: center; }
form.row-form input { width: 110px; padding: .25rem .4rem; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .8rem; margin: 0; }
legend { padding: 0 .4rem; color: var(--muted); font-size: .85rem; }
.hidden { display: none !important; }
.perm-list { display: grid; gap: .4rem; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--line); color: var(--ink); }
.badge.ok { background: var(--okbg); color: var(--ok); } .badge.err { background: var(--errbg); color: var(--err); } .badge.warn { background: var(--warnbg); color: var(--warn); }
.alert { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.alert.ok { background: var(--okbg); color: var(--ok); } .alert.err { background: var(--errbg); color: var(--err); } .alert.warn { background: var(--warnbg); color: var(--warn); }
.alert ul { margin: 0; padding-left: 1.1rem; }
dl.info { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
dl.info dt { color: var(--muted); } dl.info dd { margin: 0; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
.thumb { margin: 0; } .thumb img, .pdfbox { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.pdfbox { display: grid; place-items: center; background: var(--bg); font-weight: 700; color: var(--muted); }
.thumb figcaption { display: grid; font-size: .8rem; margin-top: .25rem; word-break: break-word; }
pre.doc { white-space: pre-wrap; font: inherit; }
code { background: var(--bg); padding: .05rem .3rem; border-radius: 4px; }

@media (max-width: 860px) {
  .topbar { display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 5; background: var(--side-bg); border-bottom: 1px solid var(--side-line); padding: .6rem 1rem; }
  .topbar .brand, .burger { color: #fff; }
  .burger { font-size: 1.4rem; cursor: pointer; line-height: 1; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; z-index: 10; box-shadow: 0 0 30px rgba(0,0,0,.3); }
  .navtoggle:checked ~ .sidebar { transform: none; }
  main.with-nav { margin-left: 0; padding: 1rem; }
  th, td { padding: .45rem .4rem; }
  dl.info { grid-template-columns: 1fr; }
}
@media print { .sidebar, .topbar, .actions, .filters { display: none !important; } main.with-nav { margin: 0; } }

/* utilitários (a CSP do site não permite style="" inline) */
.narrow { max-width: 480px; } .mt { margin-top: 1rem; } .w-sm { max-width: 140px; } .w-md { max-width: 260px; }
