@font-face {
    font-family: Inter;
    src: url("./inter.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.5;
    color: #101828;
    background: #f4f6fa;
    --fundo: #f4f6fa;
    --superficie: #fff;
    --superficie-suave: #f9fafb;
    --texto: #101828;
    --texto-secundario: #344054;
    --texto-suave: #667085;
    --borda: #e4e7ec;
    --borda-campo: #8792a4;
    --primario: #4f46e5;
    --primario-escuro: #4338ca;
    --primario-suave: #eef2ff;
    --menu: #282f74;
    --raio-card: 14px;
    --raio-controle: 10px;
    --sombra-card: 0 2px 10px -2px rgb(10 18 38 / 10%);
    --largura: 100rem;
    --recuo: clamp(1rem, 4vw, 4rem);
    --altura-topo: 4.5rem;
    --altura-menu: 3.25rem;
    --altura-menu-mobile: 4.25rem;
    scroll-padding-top: calc(var(--altura-topo) + var(--altura-menu) + 1rem);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
h1, h2, h3, p, dl, dd, form { margin: 0; }
a { color: var(--primario-escuro); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--primario-escuro); outline-offset: 3px; }

.layout-width {
    width: min(var(--largura), calc(100% - var(--recuo) - var(--recuo)));
    margin-inline: auto;
}

.icon {
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.skip-link {
    position: fixed;
    z-index: 30;
    top: .6rem;
    left: var(--recuo);
    padding: .65rem .9rem;
    color: #fff;
    background: var(--menu);
    border-radius: .5rem;
    transform: translateY(calc(-100% - 1rem));
}

.skip-link:focus { transform: none; }

.app-header { position: sticky; top: 0; z-index: 10; }
.topbar { background: var(--superficie); border-bottom: 1px solid var(--borda); }
.topbar-inner {
    min-height: var(--altura-topo);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-context { display: flex; align-items: center; flex-wrap: wrap; gap: 0 .65rem; }

.logo-txt {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    min-height: 2.75rem;
    color: #1d2939;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -.035em;
    text-decoration: none;
    white-space: nowrap;
}

.logo-txt span { color: var(--primario); }

.topbar-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .65rem;
    max-width: min(60%, 21rem);
    min-height: 2.75rem;
    padding: .35rem .55rem;
    border: 0;
    border-radius: var(--raio-controle);
    background: transparent;
    color: var(--texto-secundario);
    text-align: left;
}

.topbar-user:hover, .topbar-inner:has(.conta-popover:popover-open) .topbar-user { background: var(--fundo); }
.topbar-avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--primario-suave);
    color: var(--primario-escuro);
    font-size: .9rem;
    font-weight: 700;
}

.topbar-user-info { display: grid; min-width: 0; font-size: .8125rem; }
.topbar-user-info > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user-info span { color: var(--texto-suave); font-size: .75rem; }
.icon-chevron { width: .9rem; height: .9rem; }

.conta-popover {
    position: fixed;
    inset: calc(var(--altura-topo) - .3rem) max(var(--recuo), calc((100% - var(--largura)) / 2)) auto auto;
    width: min(18rem, calc(100% - var(--recuo) - var(--recuo)));
    margin: 0;
    padding: .4rem;
    border: 1px solid var(--borda);
    border-radius: var(--raio-controle);
    background: var(--superficie);
    color: var(--texto);
    box-shadow: 0 12px 26px -10px rgb(16 24 40 / 25%);
}

.conta-identidade { display: grid; gap: .15rem; padding: .65rem .75rem; border-bottom: 1px solid var(--borda); overflow-wrap: anywhere; }
.conta-identidade span { color: var(--texto-suave); font-size: .8125rem; }
.conta-acao {
    display: flex;
    width: 100%;
    min-height: 2.75rem;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    color: var(--texto-secundario);
    background: transparent;
    border: 0;
    border-radius: .5rem;
    text-align: left;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 600;
}

.conta-acao:hover { background: var(--fundo); }
.conta-sair { color: #b42318; }

.navegacao { background: var(--menu); }
.navegacao-inner { display: flex; align-items: center; gap: .4rem; min-height: var(--altura-menu); }
.navegacao a {
    display: flex;
    min-height: 2.5rem;
    align-items: center;
    gap: .5rem;
    padding: .45rem .85rem;
    border-radius: .5rem;
    color: #fff;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
}

.nav-icon { display: grid; place-items: center; }
.navegacao a:hover { background: rgb(255 255 255 / 10%); }
.navegacao a[aria-current] { background: rgb(255 255 255 / 16%); font-weight: 600; }
.navegacao a:focus-visible { outline-color: #fff; }

.page-content { display: grid; align-content: start; gap: 1rem; padding-block: 1.6rem 2.75rem; min-width: 0; }
.page-title-box { display: grid; gap: .45rem; }
.page-title-row { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .7rem 1.25rem; }
.page-heading { display: grid; gap: .25rem; min-width: 0; }
.page-heading h1 { font-size: 1.4rem; line-height: 1.25; font-weight: 700; letter-spacing: -.025em; overflow-wrap: anywhere; }
.page-subtitle, .text-muted { color: var(--texto-suave); font-size: .875rem; }
.page-actions, .breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.breadcrumb { color: var(--texto-suave); font-size: .8125rem; overflow-wrap: anywhere; }
.breadcrumb a { font-weight: 600; text-underline-offset: .16rem; }
.breadcrumb [aria-current]::before { content: "/"; margin-inline-end: .5rem; }
.page-actions:has(.iptu-search) { width: min(100%, 31rem); }
.iptu-search { width: 100%; }

.card {
    min-width: 0;
    background: var(--superficie);
    border: 1px solid var(--borda);
    border-radius: var(--raio-card);
    box-shadow: var(--sombra-card);
}

.card-header { padding: 1rem 1.2rem; border-bottom: 1px solid #eff1f5; }
.card-body { padding: 1.1rem 1.2rem; }
.card-footer { padding: .75rem 1.2rem; border-top: 1px solid #eff1f5; }
.card-title { color: var(--texto); font-size: 1rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.card-header > p { margin-top: .2rem; }

.btn, .btn-auth-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.5rem;
    padding: .55rem .9rem;
    border: 1px solid transparent;
    border-radius: var(--raio-controle);
    font-size: .875rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.btn-primary { background: var(--primario); color: #fff; }
.btn-primary:hover { background: var(--primario-escuro); }
.btn-light { background: var(--superficie); color: var(--texto-secundario); border-color: var(--borda); }
.btn-light:hover { background: var(--fundo); }
.btn-outline-primary { background: var(--superficie); color: var(--primario-escuro); border-color: #c7d2fe; }
.btn-outline-primary:hover { background: var(--primario-suave); }

.form-inline { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.form-inline .form-field { flex: 1 1 11rem; }
p + .form-inline { margin-top: .8rem; }
.form-field { display: grid; gap: .35rem; min-width: 0; }
.form-stack { display: grid; gap: .95rem; }
.form-stack > .btn { justify-self: start; }
.linha-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.form-label { display: block; color: var(--texto-secundario); font-size: .8125rem; font-weight: 600; }
.form-control, .form-select {
    display: block;
    width: 100%;
    min-height: 2.5rem;
    padding: .5rem .7rem;
    border: 1px solid var(--borda-campo);
    border-radius: var(--raio-controle);
    background: var(--superficie);
    color: var(--texto);
    font-size: .875rem;
}

.form-control::placeholder { color: var(--texto-suave); }
textarea.form-control { min-height: 5rem; resize: vertical; }
[aria-invalid="true"] { border-color: #b42318; }

.alert { border: 1px solid transparent; border-radius: var(--raio-controle); padding: .7rem .85rem; font-size: .875rem; overflow-wrap: anywhere; }
.alert ul { margin: .35rem 0 0; padding-inline-start: 1.3rem; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #86efac; }
.alert-warning { background: #fffbeb; color: #854d0e; border-color: #fde68a; }
.alert-danger { background: #fef3f2; color: #b42318; border-color: #fecdca; }

.table-responsive { min-width: 0; overflow-x: auto; }
.table-responsive:focus-visible { outline-offset: -3px; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { padding: .7rem .95rem; text-align: left; border-bottom: 1px solid #eff1f5; vertical-align: middle; }
.table th:where(:first-child), .table td:where(:first-child) { padding-inline-start: 1.2rem; }
.table th:where(:last-child), .table td:where(:last-child) { padding-inline-end: 1.2rem; }
.table th { background: var(--superficie-suave); color: var(--texto-secundario); font-size: .75rem; font-weight: 650; white-space: nowrap; }
.table td { overflow-wrap: anywhere; }
.table tbody tr:hover { background: var(--superficie-suave); }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table tbody th { background: transparent; font-size: inherit; }
.table td small { display: block; color: var(--texto-suave); }
.table-link { font-weight: 650; text-underline-offset: .18em; }
.table-cell-label { display: none; }
.table .empty-state { display: table-cell; padding-block: 1.65rem; text-align: center; }

.badge {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: .25rem;
    padding: .17rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    line-height: 1.35;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee4e2; color: #b42318; }
.badge-info { background: #e0eaff; color: #1d4ed8; }
.badge-secondary { background: #f2f4f7; color: #475467; }

.empty-state { display: grid; justify-items: center; gap: .4rem; padding: 2rem 1rem; color: var(--texto-suave); text-align: center; }
.empty-state [class*="title"], .empty-state strong { color: var(--texto-secundario); font-weight: 650; }
.empty-state p { max-width: 38ch; }
.dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 1rem 1.3rem; }
.dados dt { color: var(--texto-suave); font-size: .75rem; font-weight: 600; }
.dados dd { margin-top: .18rem; color: var(--texto-secundario); font-size: .875rem; font-weight: 550; overflow-wrap: anywhere; }
.grade-regras { display: grid; grid-template-columns: minmax(16rem, .85fr) minmax(0, 1.15fr); align-items: start; gap: 1rem; }
.grade-regras > * { min-width: 0; }
.regra-item { display: grid; gap: .35rem; overflow-wrap: anywhere; }
.regra-item + .regra-item { border-top: 1px solid var(--borda); }
.regra-resumo { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .75rem; }
.dados .valor-simulado { color: var(--primario-escuro); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .5rem; }
.pagination-status { color: var(--texto-suave); font-size: .8125rem; }
.pagination .btn { min-height: 2.25rem; padding-block: .38rem; }

.auth-page { display: flex; flex-direction: column; background: var(--superficie); }
.auth-topbar { padding: .9rem max(1.25rem, env(safe-area-inset-right)) .9rem max(1.25rem, env(safe-area-inset-left)); }
.auth-main { display: grid; flex: 1; place-items: center; padding: 1.5rem 1.25rem 4rem; }
.auth-card {
    width: min(100%, 31.25rem);
    padding: 2.75rem 3rem 3rem;
    border-radius: .5rem;
    border: 1px solid var(--borda);
    background: var(--superficie);
    box-shadow: 0 2px 8px rgb(16 24 40 / 6%);
}

.auth-title { color: #1d2939; font-size: 1.6rem; font-weight: 650; letter-spacing: -.025em; line-height: 1.25; }
.auth-subtitle { margin-block: .4rem 1.65rem; color: #475467; font-size: .9rem; }
.auth-card .alert + form { margin-top: .75rem; }
.btn-auth-primary { width: 100%; min-height: 3rem; border-radius: .25rem; background: #1a2c63; color: #fff; }
.btn-auth-primary:hover { background: #14224e; }

@media (max-width: 991.98px) {
    :root { --recuo: 1rem; scroll-padding-top: calc(var(--altura-topo) + .75rem); scroll-padding-bottom: calc(var(--altura-menu-mobile) + env(safe-area-inset-bottom) + .75rem); }
    .navegacao {
        position: fixed;
        inset: auto 0 0;
        min-height: var(--altura-menu-mobile);
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--superficie);
        border-top: 1px solid var(--borda);
        box-shadow: 0 -8px 24px -18px rgb(15 23 42 / 28%);
    }
    .navegacao-inner { width: min(100%, 32rem); min-height: var(--altura-menu-mobile); justify-content: center; gap: 0; }
    .navegacao a {
        flex: 1 1 0;
        min-height: var(--altura-menu-mobile);
        flex-direction: column;
        justify-content: center;
        gap: .15rem;
        color: var(--texto-suave);
        font-size: .75rem;
        font-weight: 600;
    }
    .navegacao a[aria-current], .navegacao a:hover { background: transparent; color: var(--primario-escuro); }
    .navegacao a:focus-visible { outline-color: var(--primario-escuro); outline-offset: -4px; }
    .nav-icon { width: 2.9rem; height: 1.75rem; border-radius: .55rem; }
    .nav-icon .icon { width: 1.25rem; height: 1.25rem; }
    .navegacao a[aria-current] .nav-icon, .navegacao a:hover .nav-icon { background: var(--primario-suave); }
    .page-content { padding-block: 1.2rem calc(var(--altura-menu-mobile) + env(safe-area-inset-bottom) + 1.5rem); }
    .table-mobile { display: block; }
    .table-mobile thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .table-mobile tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; padding: .75rem; }
    .table-mobile tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: start;
        gap: .75rem;
        padding: .75rem;
        border: 1px solid var(--borda);
        border-radius: var(--raio-controle);
        background: var(--superficie);
    }
    .table-mobile tbody th, .table-mobile tbody td {
        display: block;
        min-width: 0;
        padding: 0;
        border: 0;
        color: var(--texto-secundario);
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .table-mobile tbody th { color: var(--texto); }
    .table-cell-label { display: block; margin-bottom: .12rem; color: var(--texto-suave); font-size: .75rem; font-weight: 600; }
    .table-cell-value time { white-space: nowrap; }
    .table-mobile .badge { flex-wrap: wrap; justify-content: start; }
    .table-mobile .table-empty { grid-column: 1 / -1; grid-template-columns: 1fr; border: 0; padding: 0; }
    .table-mobile .table-empty td { display: block; padding-block: .9rem; }
    .auth-main { place-items: start center; padding-top: clamp(2rem, 7dvh, 5rem); }
    .auth-card { max-width: 42.5rem; padding: 0; border: 0; box-shadow: none; }
}

@media (max-width: 640px) {
    .topbar-user-info { display: none; }
    .topbar-user { max-width: none; gap: .35rem; }
    .card-header, .card-body, .card-footer { padding-inline: .85rem; }
    .grade-regras { grid-template-columns: minmax(0, 1fr); }
    .table-mobile tbody { grid-template-columns: minmax(0, 1fr); }
    .form-control, .form-select { min-height: 2.75rem; font-size: 1rem; }
    .btn { min-height: 2.75rem; }
    .pagination .btn { min-height: 2.75rem; }
    .form-inline .form-field { flex-basis: 100%; }
    .form-inline > .btn { flex: 1 1 auto; }
    .iptu-search .form-field { flex: 1 1 0; }
    .iptu-search > .btn { flex: 0 0 auto; }
    .dados { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
