
:root {
    --bg: #f3f6fa;
    --bg-soft: #fbfdff;
    --card: #ffffff;
    --card-soft: #f8fbfd;
    --line: #d7e1ec;
    --line-strong: #c4d1de;
    --text: #16324f;
    --text-soft: #667a91;
    --primary: #1459a6;
    --primary-dark: #0d457f;
    --primary-soft: #eaf2fb;
    --success: #18794e;
    --success-soft: #e9f7f0;
    --danger: #c43f3f;
    --danger-soft: #fdf0f0;
    --warning: #b7791f;
    --warning-soft: #fff6e5;
    --info: #3556d8;
    --info-soft: #edf1ff;
    --neutral: #64748b;
    --neutral-soft: #eff3f7;
    --sidebar: #ffffff;
    --sidebar-soft: #f4f8fc;
    --brand-600: #1e63ae;
    --brand-700: #154c89;
    --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.06);
    --shadow: 0 18px 48px rgba(15, 23, 42, 0.10);
    --radius-sm: 14px;
    --radius: 18px;
    --radius-lg: 24px;
    --transition: 0.2s ease;
    --content-max: 1380px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    background: linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.login-body {
    min-height: 100vh;
    padding: 20px;
    display: grid;
    place-items: center;
    background: #eef3f8;
}

.login-card {
    width: min(420px, 100%);
    background: var(--card);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 26px;
    border: 1px solid rgba(15, 23, 42, 0.04);
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 32px;
    line-height: 1.1;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.login-brand img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex: 0 0 auto;
}

.login-brand h1 {
    margin: 0 0 4px;
}

.login-brand .muted {
    margin: 0;
}


.login-footer {
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-soft);
}

.app-shell {
    min-height: 100vh;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(7, 17, 33, 0.42);
    backdrop-filter: blur(2px);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 310px);
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    color: var(--text);
    padding: 18px 16px 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transform: translateX(-100%);
    transition: transform var(--transition);
    z-index: 40;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    box-shadow: 16px 0 36px rgba(15, 23, 42, 0.12);
}

body.sidebar-open .sidebar {
    transform: translateX(0);
}

.sidebar-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-text-only {
    min-height: 58px;
    align-items: center;
}

.brand-text-only .brand-title {
    font-size: 28px;
}

.brand-mark {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
    flex: 0 0 auto;
}

.brand-logo {
    display: block;
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.brand-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.brand-subtitle {
    color: var(--text-soft);
    font-size: 13px;
}

.sidebar-close,
.menu-toggle {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--primary-soft);
    color: var(--primary-dark);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.sidebar-close {
    font-size: 26px;
    line-height: 1;
    box-shadow: none;
}

.user-box {
    background: var(--sidebar-soft);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    display: grid;
    gap: 5px;
}

.user-box strong {
    font-size: 17px;
}

.user-box small {
    color: var(--text-soft);
    font-size: 12px;
    letter-spacing: 0.04em;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 14px;
    color: var(--text);
    background: transparent;
    transition: background var(--transition), transform var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
    border: 1px solid transparent;
}

.nav-logout-form {
    margin: 4px 0 0;
    display: flex;
    justify-content: flex-start;
}

.nav-button {
    width: auto;
    min-width: 150px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    min-height: 42px;
    border-radius: 14px;
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid #f3cccc;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: background var(--transition), transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.nav-button:hover {
    background: #fbe6e6;
    border-color: #e8b6b6;
    transform: translateY(-1px);
}


.nav a:hover,
.nav a.is-active {
    background: var(--primary-soft);
    border-color: rgba(20, 89, 166, 0.12);
    color: var(--primary-dark);
}

.nav a.is-active {
    box-shadow: inset 3px 0 0 var(--primary), 0 10px 24px rgba(20, 89, 166, 0.08);
}

.nav-label {
    font-size: 16px;
    font-weight: 600;
}

.content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: var(--content-max);
    margin: 0 auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid rgba(12, 26, 75, 0.05);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    position: static;
    top: auto;
    z-index: auto;
    backdrop-filter: none;
}

.topbar-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-copy {
    display: grid;
    gap: 2px;
}

.topbar-copy strong {
    font-size: 15px;
}

.topbar-copy span {
    color: var(--text-soft);
    font-size: 13px;
}

.topbar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.topbar-logout-form {
    margin: 0;
}

.topbar-logout-btn {
    min-width: 96px;
}

.topbar-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
}

.topbar-chip-muted {
    background: var(--neutral-soft);
    color: var(--neutral);
}

.topbar--minimal {
    justify-content: flex-start;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    position: static;
    padding: 0;
    border-radius: 0;
}

.topbar--minimal .topbar-main {
    gap: 0;
}


.topbar-card {
    display: grid;
    gap: 16px;
    margin: 0;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid rgba(12, 26, 75, 0.06);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    position: static;
    top: auto;
    z-index: auto;
    backdrop-filter: none;
}

.topbar-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-card__menu {
    flex: 0 0 auto;
    background: var(--primary-soft);
    color: var(--primary-dark);
    box-shadow: none;
}

.topbar-card__title-wrap {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.topbar-card__title {
    margin: 0;
    font-size: 15px;
    line-height: 1.2;
}

.topbar-card__subtitle {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
}

.topbar-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.topbar-card__chip--user {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.topbar-card__logout-form {
    margin: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.topbar-card__logout-btn {
    width: auto;
    min-width: 120px;
    min-height: 44px;
    padding: 10px 22px;
    border-radius: 14px;
}


.mobile-page-tools {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 6px;
}

.mobile-menu-toggle {
    background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}


.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.page-header--compact {
    justify-content: flex-end;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.page-subtitle {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 14px;
}

.page-header .actions,
.page-header > div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    border: 1px solid rgba(12, 26, 75, 0.06);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.card-header h2,
.card > h2 {
    margin: 0;
    font-size: 23px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.card-header p,
.section-head p,
.empty-state p,
.helper-text,
.upload-note {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
}

.cards-grid,
.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.stat-card {
    display: grid;
    gap: 10px;
    min-height: 128px;
    align-content: space-between;
    background:
        radial-gradient(circle at top right, rgba(11, 99, 206, 0.10), transparent 42%),
        var(--card);
}

.stat-label {
    color: var(--text-soft);
    font-size: 14px;
}

.stat-card strong {
    font-size: 42px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.stat-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    color: var(--text-soft);
    font-size: 13px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.filter-grid {
    align-items: end;
}

.single-column {
    grid-template-columns: 1fr;
}

.form-section {
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--card-soft);
    padding: 14px;
    display: grid;
    gap: 14px;
}

.section-head {
    display: grid;
    gap: 6px;
}

.section-head h2,
.section-head h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.section-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

label,
.field-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-soft);
    font-size: 14px;
}

label span:first-child,
.field-label {
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
    outline: none;
    background: #fff;
    color: var(--text);
    min-height: 48px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(11, 99, 206, 0.10);
}

input[readonly] {
    background: #f8fafc;
}

.form-actions,
.filter-actions,
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.form-actions {
    grid-column: 1 / -1;
}

.col-span-2,
.col-span-full {
    grid-column: 1 / -1;
}

.btn {
    border: 0;
    background: #edf2f7;
    color: var(--text);
    border-radius: 14px;
    padding: 12px 16px;
    min-height: 46px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    transition: background var(--transition), transform var(--transition), opacity var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: #fff;
}


.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--line);
}

.btn-small {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-soft);
    color: #0d7c45;
    border-color: rgba(15, 157, 88, 0.12);
}

.alert-error {
    background: var(--danger-soft);
    color: #b03232;
    border-color: rgba(202, 61, 61, 0.12);
}

.alert-warning {
    background: var(--warning-soft);
    color: #996200;
    border-color: rgba(201, 133, 0, 0.12);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table-shell {
    display: grid;
    gap: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    color: var(--text-soft);
    font-size: 12px;
    letter-spacing: 0.02em;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid #edf2f8;
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.table-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    min-height: 32px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--neutral-soft);
    color: var(--neutral);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-success {
    background: var(--success-soft);
    color: #0c7a43;
}

.badge-danger {
    background: var(--danger-soft);
    color: #b03232;
}

.badge-warning {
    background: var(--warning-soft);
    color: #a16a00;
}

.badge-info {
    background: var(--info-soft);
    color: #314bc6;
}

.badge-neutral {
    background: var(--neutral-soft);
    color: #5a6678;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.detail-grid > .card {
    display: grid;
    gap: 14px;
}

.detail-list {
    margin: 0;
    display: grid;
    gap: 10px;
}

.detail-list div {
    display: grid;
    gap: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
}

.detail-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-list dt {
    font-weight: 700;
    color: var(--text-soft);
    font-size: 13px;
}

.detail-list dd {
    margin: 0;
    font-size: 15px;
    word-break: break-word;
}

.log-box {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    background: #fbfdff;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    background: #111827;
    color: #d1f7ff;
    padding: 14px;
    border-radius: 14px;
    overflow: auto;
    font-size: 13px;
}

.muted,
.text-muted {
    color: var(--text-soft);
}

.checkbox-field {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.checkbox-field input {
    width: auto;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--text-soft);
    font-size: 13px;
}

.field-help.is-error {
    color: var(--danger);
}

.field-help.is-success {
    color: var(--success);
}

.summary-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.summary-box {
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--line);
    display: grid;
    gap: 8px;
}

.summary-box strong {
    font-size: 13px;
    color: var(--text-soft);
    font-weight: 700;
}

.summary-box span {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.autocomplete {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
}

.autocomplete-item,
.autocomplete-empty {
    width: 100%;
    padding: 12px 14px;
}

.autocomplete-item {
    border: 0;
    background: #fff;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid #eef2f8;
}

.autocomplete-item:last-child {
    border-bottom: 0;
}

.autocomplete-item:hover {
    background: #f4f7fb;
}

.autocomplete-item strong,
.autocomplete-item span {
    display: block;
}

.autocomplete-item span,
.autocomplete-empty {
    color: var(--text-soft);
    font-size: 13px;
}

.location-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.map-box {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-box-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.map-box-header strong {
    display: block;
    color: var(--text);
    font-size: 15px;
}

.map-box-header small {
    display: block;
    color: var(--text-soft);
    font-size: 13px;
    margin-top: 3px;
}


.google-map-layer-control {
    margin: 10px 10px 0 0;
    position: relative;
    font-family: Arial, sans-serif;
    user-select: none;
}

.google-map-layer-toggle {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: #fff;
    color: #3c4043;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
    cursor: pointer;
}

.google-map-layer-toggle:hover,
.google-map-layer-toggle:focus {
    background: #f8f9fa;
    outline: none;
}

.google-map-layer-icon {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.google-map-layer-menu {
    position: absolute;
    top: 44px;
    right: 0;
    min-width: 190px;
    overflow: hidden;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    z-index: 2;
}

.google-map-layer-option {
    width: 100%;
    display: block;
    padding: 10px 12px;
    border: 0;
    background: #fff;
    color: #1f2937;
    font-size: 13px;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.google-map-layer-option:hover,
.google-map-layer-option:focus,
.google-map-layer-option.is-active {
    background: #e8f0fe;
    outline: none;
}

.google-map-layer-option.is-active {
    font-weight: 700;
}

.map-canvas {
    width: 100%;
    min-height: 300px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #e8eef7;
}

.photo-upload-box {
    border: 1px dashed var(--line-strong);
    border-radius: 18px;
    padding: 16px;
    background: #fbfdff;
}

.photo-current,
.photo-preview {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid #edf2f8;
    border-radius: 16px;
    background: #fff;
    margin-bottom: 12px;
}

.photo-current-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.photo-thumb {
    width: 160px;
    max-width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #e6edf5;
    background: #eef3f8;
}

.photo-view-link {
    display: block;
}

.photo-view {
    width: 100%;
    max-height: 620px;
    object-fit: contain;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #f6f9fc;
}

.detail-grid > .card.card-wide {
    grid-column: 1 / -1;
}

.infracao-attachments-card {
    gap: 14px;
}

.attachment-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.attachment-card {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #f8fafc;
}

.attachment-preview {
    display: block;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #eef3f8;
}

.attachment-image {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #fff;
}

.attachment-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}


.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 14px;
}

.check-inline input {
    width: auto;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}

.upload-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-title {
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
}


.file-trigger {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    cursor: pointer;
}

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

.file-trigger__button {
    min-width: 160px;
}

.form-submit-bar {
    position: sticky;
    bottom: 12px;
    z-index: 15;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(12, 26, 75, 0.07);
    border-radius: 18px;
    background: rgba(255,255,255,0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.form-submit-copy {
    flex: 1 1 220px;
    display: grid;
    gap: 3px;
}

.form-submit-copy strong {
    font-size: 15px;
}

.form-submit-copy span {
    color: var(--text-soft);
    font-size: 13px;
}

.form-submit-card {
    grid-column: 1 / -1;
    position: static;
    margin-top: 0;
}

.form-submit-card__head {
    gap: 6px;
}

.form-submit-card__head h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.form-submit-card__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.form-submit-card__actions .btn {
    width: 100%;
}

@media (min-width: 768px) {
    .form-submit-card__actions {
        grid-template-columns: repeat(2, minmax(0, max-content));
        justify-content: flex-start;
    }

    .form-submit-card__actions .btn {
        width: auto;
    }
}

.empty-state {
    display: grid;
    justify-items: start;
    gap: 10px;
    padding: 6px 0;
}

.empty-state-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--neutral-soft);
    color: var(--neutral);
    font-size: 24px;
    font-weight: 700;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.toolbar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.kpi-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.input-group {
    display: grid;
    gap: 8px;
}

.desktop-only {
    display: none;
}

.mobile-stack {
    display: grid;
    gap: 12px;
}

.responsive-table tbody td[data-label]::before {
    display: none;
}

@media (min-width: 720px) {
    .content {
        padding: 22px;
        gap: 18px;
    }

    .summary-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .section-grid,
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .upload-grid,
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }


    .attachment-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-section {
        padding: 18px;
    }


    .map-canvas {
        min-height: 360px;
    }
}

@media (min-width: 1100px) {
    body {
        background: linear-gradient(180deg, #f6f9fc 0%, #eef3f8 100%);
    }

    .app-shell {
        display: grid;
        grid-template-columns: 280px 1fr;
        align-items: start;
    }

    .sidebar-backdrop,
    .sidebar-close,
    .menu-toggle {
        display: none;
    }

    .sidebar {
        position: sticky;
        top: 0;
        transform: none;
        width: 100%;
        min-height: 100vh;
        border-right: 1px solid var(--line);
        box-shadow: none;
        z-index: 5;
    }

    .content {
        padding: 28px;
        gap: 18px;
    }

    .cards-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .detail-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .detail-grid > .card {
        grid-column: span 6;
    }

    .col-span-2 {
        grid-column: span 2;
    }

    .topbar {
        top: 16px;
    }

    .topbar--minimal,
    .mobile-page-tools {
        display: none;
    }

    .desktop-only {
        display: block;
    }
}

@media (max-width: 719px) {
    .page-header h1 {
        font-size: 32px;
    }

    .filter-actions,
    .form-actions,
    .actions,
    .location-tools,
    .toolbar-group {
        width: 100%;
    }

    .filter-actions > *,
    .form-actions > *,
    .actions > *,
    .location-tools > *,
    .toolbar-group > * {
        flex: 1 1 calc(50% - 6px);
    }

    .photo-current,
    .photo-preview {
        flex-direction: column;
    }

    .photo-thumb {
        width: 100%;
        height: auto;
        max-height: 280px;
    }

    .responsive-table table,
    .responsive-table thead,
    .responsive-table tbody,
    .responsive-table th,
    .responsive-table td,
    .responsive-table tr {
        display: block;
        width: 100%;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody {
        display: grid;
        gap: 12px;
    }

    .responsive-table tr {
        background: var(--card-soft);
        border: 1px solid var(--line);
        border-radius: 18px;
        padding: 10px;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
    }

    .responsive-table td {
        border: 0;
        padding: 8px 4px;
        display: grid;
        gap: 6px;
    }

    .responsive-table tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        color: var(--text-soft);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .responsive-table td.actions {
        padding-top: 10px;
    }

    .responsive-table td.actions .btn,
    .responsive-table td.actions form,
    .responsive-table td.actions a {
        width: 100%;
    }

    .responsive-table td.actions form {
        display: flex;
    }

    .responsive-table td.actions .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 479px) {
    .content {
        padding: 14px;
    }

    .card,
    .login-card,
    .form-section {
        padding: 16px;
    }

    .topbar {
        padding: 10px 12px;
    }

    .topbar-card {
        padding: 16px;
        gap: 14px;
    }

    .topbar-card__title {
        font-size: 14px;
    }

    .topbar-card__subtitle {
        font-size: 12px;
    }

    .topbar-copy strong {
        font-size: 14px;
    }

    .topbar-copy span {
        font-size: 12px;
    }

    .filter-actions > *,
    .form-actions > *,
    .actions > *,
    .location-tools > *,
    .toolbar-group > * {
        flex: 1 1 100%;
    }

    .btn,
    input,
    select,
    textarea {
        min-height: 46px;
    }
}


@media (max-width: 640px) {
    .topbar {
        align-items: stretch;
    }

    .topbar-main,
    .topbar-meta {
        width: 100%;
    }

    .topbar-meta {
        justify-content: space-between;
    }

    .topbar-logout-form {
        flex: 1 1 100%;
    }

    .topbar-logout-btn {
        width: 100%;
    }

    .topbar-card__head,
    .topbar-card__meta {
        width: 100%;
    }

    .topbar-card__meta {
        justify-content: space-between;
    }

    .topbar-card__logout-form {
        width: 100%;
        justify-content: flex-end;
    }
}
/* Ajuste específico da página de visualização de infração: mantém os botões lado a lado e com largura proporcional. */
.page-header .infracao-view-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: auto;
}

.page-header .infracao-view-actions > *,
.page-header .infracao-view-actions .inline-form,
.page-header .infracao-view-actions .btn {
    flex: 0 0 auto;
    width: auto;
}

.page-header .infracao-view-actions .inline-form {
    display: inline-flex;
}

.page-header .infracao-view-actions .btn {
    white-space: nowrap;
}


/* Ajuste específico da página de usuários: evita que o formulário seja esticado
   pela altura da lista de usuários e mantém o botão proporcional. */
.usuarios-grid {
    align-items: start;
}

.usuarios-grid > .card {
    align-content: start;
}

.usuario-form-card {
    align-self: start;
}

.usuario-form-card .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
}

.usuario-form-card .btn-primary {
    width: auto;
    min-width: 190px;
    justify-self: start;
}

.usuarios-list-card {
    min-width: 0;
}

.usuarios-list-card .table-wrap {
    max-height: 640px;
    overflow: auto;
}

@media (min-width: 1100px) {
    .usuarios-grid .usuario-form-card {
        grid-column: span 4;
    }

    .usuarios-grid .usuarios-list-card {
        grid-column: span 8;
    }
}

@media (max-width: 719px) {
    .usuario-form-card .btn-primary {
        width: 100%;
    }
}

/* === DESIGN LOW-CODE CORPORATIVO | 2026 === */
:root {
    --bg: #eef2f7;
    --bg-soft: #f8fafc;
    --card: #ffffff;
    --card-soft: #f8fafc;
    --line: #dbe3ef;
    --line-strong: #cbd5e1;
    --text: #0f172a;
    --text-soft: #64748b;
    --primary: #1d4ed8;
    --primary-dark: #1e3a8a;
    --primary-soft: #eff6ff;
    --success: #047857;
    --success-soft: #ecfdf5;
    --danger: #b91c1c;
    --danger-soft: #fef2f2;
    --warning: #b45309;
    --warning-soft: #fffbeb;
    --info: #2563eb;
    --info-soft: #eff6ff;
    --neutral: #475569;
    --neutral-soft: #f1f5f9;
    --sidebar: #0f172a;
    --sidebar-soft: rgba(255,255,255,0.08);
    --brand-600: #2563eb;
    --brand-700: #1e3a8a;
    --shadow-sm: 0 12px 28px rgba(15, 23, 42, 0.07);
    --shadow: 0 22px 60px rgba(15, 23, 42, 0.13);
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --transition: 0.18s ease;
    --content-max: 1460px;
}

html {
    background: var(--bg);
}

body {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 34rem),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
    letter-spacing: -0.005em;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.68), transparent 70%);
}

.app-shell--corporate {
    min-height: 100vh;
}

.sidebar--corporate {
    background:
        linear-gradient(180deg, rgba(30, 58, 138, 0.42) 0%, rgba(15, 23, 42, 0) 34%),
        #0f172a;
    color: #e5edf8;
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 16px 0 48px rgba(15, 23, 42, 0.18);
}

.sidebar--corporate .sidebar-top {
    border-bottom: 1px solid rgba(226, 232, 240, 0.13);
    padding-bottom: 18px;
}

.brand-corporate {
    align-items: center;
}

.brand-emblem {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ffffff, #dbeafe);
    color: #1e3a8a;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -0.04em;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.24);
    flex: 0 0 auto;
}

.sidebar--corporate .brand-title {
    color: #ffffff;
    font-size: 22px;
    letter-spacing: -0.04em;
}

.sidebar--corporate .brand-subtitle {
    color: #aebdd2;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.sidebar--corporate .sidebar-close,
.sidebar--corporate .menu-toggle {
    background: rgba(255,255,255,0.10);
    color: #ffffff;
    border-color: rgba(255,255,255,0.14);
}

.user-box--corporate {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(226, 232, 240, 0.13);
    border-radius: 18px;
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.user-box--corporate .user-box__label {
    color: #93a4bc;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    font-weight: 900;
}

.user-box--corporate strong {
    color: #ffffff;
    font-size: 16px;
    line-height: 1.25;
}

.user-box--corporate small {
    color: #b6c4d8;
}

.nav--corporate {
    gap: 9px;
}

.nav--corporate a,
.nav-button--corporate {
    min-height: 48px;
    justify-content: flex-start;
    gap: 11px;
    border-radius: 16px;
    border: 1px solid transparent;
}

.nav--corporate a {
    color: #d7e1ef;
    background: rgba(255,255,255,0.035);
}

.nav--corporate a:hover,
.nav--corporate a.is-active {
    color: #ffffff;
    background: rgba(37, 99, 235, 0.24);
    border-color: rgba(147, 197, 253, 0.22);
    transform: translateX(2px);
}

.nav--corporate a.is-active {
    box-shadow: inset 3px 0 0 #60a5fa, 0 14px 30px rgba(15, 23, 42, 0.18);
}

.nav-icon {
    width: 26px;
    height: 26px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    background: rgba(255,255,255,0.10);
    color: currentColor;
    font-weight: 900;
    line-height: 1;
    flex: 0 0 auto;
}

.nav--corporate .nav-label {
    font-size: 14px;
    font-weight: 800;
}

.nav-button--corporate {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    color: #fecaca;
    background: rgba(185, 28, 28, 0.12);
    border-color: rgba(254, 202, 202, 0.15);
}

.nav-button--corporate:hover {
    background: rgba(185, 28, 28, 0.20);
    border-color: rgba(254, 202, 202, 0.26);
}

.content--corporate {
    padding: 18px;
    gap: 18px;
}

.corp-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 24px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(203, 213, 225, 0.75);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(14px);
}

.corp-topbar__left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.corp-topbar__menu {
    flex: 0 0 auto;
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.18);
}

.corp-topbar__copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.corp-kicker {
    color: var(--primary);
    font-size: 11px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 900;
}

.corp-topbar h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(22px, 2.4vw, 34px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.corp-topbar p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.35;
}

.corp-topbar__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.card,
.login-card,
.form-section,
.table-wrap,
.attachment-card,
.map-box {
    border: 1px solid rgba(203, 213, 225, 0.82);
    box-shadow: var(--shadow-sm);
}

.card,
.login-card {
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(10px);
}

.card {
    border-radius: 22px;
    padding: 20px;
}

.card-header {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.card-header h2,
.card > h2 {
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.page-header h1 {
    font-size: clamp(24px, 3vw, 34px);
}

.form-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 22px;
}

.form-section::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #2563eb, #0f766e);
}

.section-head h2,
.section-head h3 {
    font-weight: 900;
    color: var(--text);
}

.section-head p,
.card-header p,
.helper-text,
.upload-note,
.field-help,
.page-subtitle {
    color: var(--text-soft);
}

label span:first-child,
.field-label {
    color: #1e293b;
    font-size: 13px;
    text-transform: none;
    letter-spacing: -0.01em;
}

input,
select,
textarea {
    border-radius: 14px;
    border-color: #cbd5e1;
    background: #ffffff;
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

input:hover,
select:hover,
textarea:hover {
    border-color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
}

input[readonly] {
    background: #f1f5f9;
    color: #475569;
}

.btn {
    border-radius: 14px;
    font-weight: 850;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
    box-shadow: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: none;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-success {
    background: #059669;
}

.btn-danger {
    background: #dc2626;
}

.btn-outline,
.btn:not(.btn-primary):not(.btn-success):not(.btn-danger) {
    background: #ffffff;
    color: #1e293b;
    border-color: #cbd5e1;
}

.mini-chip,
.badge,
.status-badge,
[class*="badge-"] {
    border-radius: 999px;
    font-weight: 850;
    letter-spacing: 0.01em;
}

.mini-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.mini-chip--corp {
    background: #eff6ff;
    color: #1e3a8a;
    border-color: #bfdbfe;
}

.stat-card {
    min-height: 138px;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.97), rgba(248,250,252,0.97)),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 50%);
}

.stat-card strong {
    color: #0f172a;
    font-weight: 950;
}

.stat-label {
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 12px;
    font-weight: 900;
}

.table-wrap {
    border-radius: 18px;
    overflow: auto;
    background: #ffffff;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #334155;
    border-bottom: 1px solid #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 11px;
    font-weight: 950;
}

tbody tr {
    transition: background var(--transition), transform var(--transition);
}

tbody tr:hover {
    background: #f8fafc;
}

td {
    color: #1e293b;
}

.alert {
    border-radius: 18px;
    font-weight: 750;
    box-shadow: var(--shadow-sm);
}

.empty-state {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 20px;
    background: #f8fafc;
}

.empty-state-icon {
    background: #e0ecff;
    color: #1d4ed8;
}

.login-body {
    background: #eef3f8;
}

.login-card {
    width: min(460px, 100%);
    border-radius: 30px;
    padding: 28px;
    border: 1px solid rgba(226, 232, 240, 0.92);
}

.login-brand {
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.login-brand img {
    width: 66px;
    height: 66px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.login-card h1 {
    font-size: 30px;
    font-weight: 950;
    letter-spacing: -0.06em;
}

.login-card .muted {
    color: #64748b;
    font-weight: 650;
}

.map-box {
    border-radius: 22px;
    overflow: hidden;
    background: #ffffff;
}

.map-box-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.map-canvas {
    border-radius: 0;
}

.attachment-card {
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
}

.attachment-info {
    background: #f8fafc;
}

@media (min-width: 1100px) {
    body {
        background:
            radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 34rem),
            linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    }

    .app-shell--corporate {
        grid-template-columns: 292px minmax(0, 1fr);
    }

    .sidebar--corporate {
        min-height: 100vh;
        padding: 22px 18px;
    }

    .content--corporate {
        padding: 26px clamp(24px, 2.5vw, 38px) 38px;
    }

    .corp-topbar {
        position: sticky;
        top: 18px;
        z-index: 4;
    }
}

@media (max-width: 1099px) {
    .sidebar--corporate {
        width: min(88vw, 330px);
    }

    .corp-topbar {
        align-items: flex-start;
    }

    .corp-topbar__right {
        display: none;
    }
}

@media (max-width: 719px) {
    .corp-topbar {
        border-radius: 20px;
        padding: 14px;
    }

    .corp-topbar h1 {
        font-size: 22px;
    }

    .corp-topbar p {
        font-size: 12px;
    }

    .card {
        padding: 16px;
        border-radius: 20px;
    }

    .form-section {
        border-radius: 20px;
    }

    .responsive-table tr {
        background: #ffffff;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    }
}


/* Bottom Navigation Bar - padrão corporativo low-code */
.sidebar-actions--corporate {
    margin-top: auto;
    display: grid;
    gap: 10px;
}

.content--corporate {
    padding-bottom: 118px;
}

.bottom-nav--corporate {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 14px;
    z-index: 35;
    display: flex;
    justify-content: center;
    padding: 0 14px env(safe-area-inset-bottom, 0px);
    pointer-events: none;
}

.bottom-nav__inner {
    pointer-events: auto;
    width: min(720px, 100%);
    display: grid;
    gap: 8px;
    padding: 8px;
    border-radius: 26px;
    background: #ffffff;
    border: 1px solid rgba(203, 213, 225, 0.95);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    backdrop-filter: none;
}

.bottom-nav__inner--3 {
    max-width: 560px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bottom-nav__inner--4 {
    max-width: 720px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bottom-nav__item {
    min-height: 64px;
    padding: 9px 10px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    color: #334155;
    border: 1px solid transparent;
    background: transparent;
    transition: background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.bottom-nav__item:hover {
    color: #1e3a8a;
    background: #eff6ff;
    border-color: #bfdbfe;
    transform: translateY(-2px);
}

.bottom-nav__item.is-active {
    color: #ffffff;
    background: #2563eb;
    border-color: #2563eb;
    box-shadow: none;
}

.bottom-nav__icon {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    background: #f1f5f9;
    color: currentColor;
    font-weight: 950;
    line-height: 1;
}

.bottom-nav__item.is-active .bottom-nav__icon {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.bottom-nav__label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -0.01em;
}

@media (min-width: 1100px) {
    .content--corporate {
        padding-bottom: 132px;
    }

    .bottom-nav--corporate {
        left: 292px;
        bottom: 18px;
        padding-left: clamp(24px, 2.5vw, 38px);
        padding-right: clamp(24px, 2.5vw, 38px);
    }
}

@media (max-width: 719px) {
    .content--corporate {
        padding-bottom: 108px;
    }

    .bottom-nav--corporate {
        bottom: 10px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .bottom-nav__inner {
        gap: 5px;
        padding: 6px;
        border-radius: 22px;
    }

    .bottom-nav__item {
        min-height: 58px;
        padding: 7px 6px;
        border-radius: 17px;
    }

    .bottom-nav__icon {
        width: 27px;
        height: 27px;
        border-radius: 10px;
        font-size: 13px;
    }

    .bottom-nav__label {
        font-size: 10.5px;
    }
}

@media (max-width: 389px) {
    .bottom-nav__label {
        font-size: 9.5px;
    }

    .bottom-nav__item {
        padding-left: 4px;
        padding-right: 4px;
    }
}

/* Botão compacto para abrir menu quando o card superior do Dashboard está oculto */
.dashboard-mobile-menu {
    display: none;
}

@media (max-width: 1099px) {
    .dashboard-mobile-menu {
        display: inline-grid;
        place-items: center;
        width: 44px;
        height: 44px;
        margin-bottom: 12px;
        border-radius: 14px;
        background: #0f172a;
        color: #ffffff;
        border-color: #0f172a;
        box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
    }
}

/* Layout sem coluna lateral: navegação principal e saída no rodapé */
.app-shell,
.app-shell--corporate {
    display: block;
    min-height: 100vh;
}

.sidebar,
.sidebar-backdrop,
.sidebar-close,
.menu-toggle,
.dashboard-mobile-menu {
    display: none !important;
}

.content,
.content--corporate {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
}

.bottom-nav__inner--5 {
    max-width: 860px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bottom-nav__logout-form {
    margin: 0;
    min-width: 0;
    display: flex;
}

.bottom-nav__logout-form .bottom-nav__item {
    width: 100%;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
}

.bottom-nav__item--logout {
    color: #991b1b;
}

.bottom-nav__item--logout .bottom-nav__icon {
    background: #fef2f2;
}

.bottom-nav__item--logout:hover {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
    box-shadow: none;
}

@media (min-width: 1100px) {
    .app-shell,
    .app-shell--corporate {
        display: block;
        grid-template-columns: none;
    }

    .content,
    .content--corporate {
        padding-left: clamp(24px, 2.5vw, 38px);
        padding-right: clamp(24px, 2.5vw, 38px);
    }

    .bottom-nav--corporate {
        left: 0;
        right: 0;
        bottom: 18px;
        padding-left: clamp(24px, 2.5vw, 38px);
        padding-right: clamp(24px, 2.5vw, 38px);
    }
}

@media (max-width: 719px) {
    .bottom-nav__inner--5 {
        max-width: 100%;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .bottom-nav__item--logout .bottom-nav__label {
        font-size: 10px;
    }
}

/* Ajuste visual: remover efeito metálico e manter cores */
.badge,
.mini-chip,
.status-badge,
[class*="badge-"] {
    box-shadow: none !important;
    background-image: none !important;
    filter: none !important;
}

.bottom-nav__item,
.bottom-nav__item.is-active,
.bottom-nav__icon,
.btn,
.btn-primary,
.btn-success,
.btn-danger {
    background-image: none;
}


/* Ajuste visual: remover cápsula/card dos status e manter apenas texto colorido */
.badge,
.status-badge {
    min-height: auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.badge-success {
    color: #0c7a43 !important;
}

.badge-danger {
    color: #b03232 !important;
}

.badge-warning {
    color: #a16a00 !important;
}

.badge-info {
    color: #314bc6 !important;
}

.badge-neutral {
    color: #5a6678 !important;
}

/* Dashboard: cards menores e dados centralizados */
.dashboard-stats-grid {
    gap: 12px;
    align-items: stretch;
}

.dashboard-stats-grid .stat-card {
    min-height: 96px;
    padding: 16px 14px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    background: #ffffff;
}

.dashboard-stats-grid .stat-label {
    width: 100%;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
}

.dashboard-stats-grid .stat-card strong {
    width: 100%;
    text-align: center;
    font-size: 34px;
    line-height: 0.95;
}

@media (max-width: 719px) {
    .dashboard-stats-grid .stat-card {
        min-height: 86px;
        padding: 14px 12px;
    }

    .dashboard-stats-grid .stat-card strong {
        font-size: 30px;
    }
}

/* FlowDocs: seletor de status sem cápsula, mantendo apenas texto colorido */
.flowdocs-status-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.flowdocs-status-select {
    width: auto;
    min-width: 104px;
    min-height: auto;
    padding: 0 18px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    cursor: pointer;
    appearance: auto;
}

.flowdocs-status-select:focus {
    outline: 2px solid rgba(37, 99, 235, 0.28);
    outline-offset: 3px;
}

.flowdocs-status-select--pendente {
    color: #a16a00;
}

.flowdocs-status-select--enviado {
    color: #0c7a43;
}

.flowdocs-status-select--erro {
    color: #b03232;
}

/* Rankings de autuações */
.page-rankings .content--corporate {
    max-width: 1680px;
}

.page-rankings .corp-topbar {
    position: static;
}

.ranking-page {
    display: grid;
    gap: 18px;
}

.ranking-summary-grid {
    margin-bottom: 0;
}

.ranking-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: end;
}

.ranking-filter-actions {
    align-self: end;
    min-height: 48px;
}

.dashboard-rankings-card {
    margin-bottom: 16px;
}

.ranking-section-card .card-header {
    align-items: flex-start;
}

.btn-download-sheet {
    min-height: 42px;
    white-space: nowrap;
}

.ranking-table-wrap {
    border-radius: 16px;
    border: 1px solid var(--line);
    overflow: visible;
    background: #ffffff;
}

.ranking-table {
    width: 100%;
    table-layout: fixed;
}

.ranking-table thead th {
    white-space: normal;
    line-height: 1.25;
    vertical-align: middle;
}

.ranking-table tbody td {
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.ranking-table tbody tr:nth-child(odd) {
    background: rgba(248, 251, 253, 0.72);
}

.ranking-table-agents th:nth-child(1),
.ranking-table-agents td:nth-child(1) {
    width: 7%;
}

.ranking-table-agents th:nth-child(2),
.ranking-table-agents td:nth-child(2) {
    width: 24%;
}

.ranking-table-agents th:nth-child(3),
.ranking-table-agents td:nth-child(3) {
    width: 8%;
}

.ranking-table-agents th:nth-child(4),
.ranking-table-agents td:nth-child(4) {
    width: 18%;
}

.ranking-table-agents th:nth-child(5),
.ranking-table-agents td:nth-child(5),
.ranking-table-agents th:nth-child(6),
.ranking-table-agents td:nth-child(6),
.ranking-table-agents th:nth-child(7),
.ranking-table-agents td:nth-child(7) {
    width: 9%;
}

.ranking-table-agents th:nth-child(8),
.ranking-table-agents td:nth-child(8) {
    width: 16%;
}

.ranking-table-types th:nth-child(1),
.ranking-table-types td:nth-child(1) {
    width: 7%;
}

.ranking-table-types th:nth-child(2),
.ranking-table-types td:nth-child(2) {
    width: 37%;
}

.ranking-table-types th:nth-child(3),
.ranking-table-types td:nth-child(3) {
    width: 7%;
}

.ranking-table-types th:nth-child(4),
.ranking-table-types td:nth-child(4) {
    width: 15%;
}

.ranking-table-types th:nth-child(5),
.ranking-table-types td:nth-child(5) {
    width: 8%;
}

.ranking-table-types th:nth-child(6),
.ranking-table-types td:nth-child(6) {
    width: 9%;
}

.ranking-table-types th:nth-child(7),
.ranking-table-types td:nth-child(7),
.ranking-table-types th:nth-child(8),
.ranking-table-types td:nth-child(8) {
    width: 8.5%;
}

.ranking-position {
    min-width: 40px;
    height: 34px;
    padding: 0 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 800;
}

.ranking-person-cell,
.ranking-type-cell,
.ranking-date {
    display: grid;
    gap: 4px;
}

.ranking-person-cell small,
.ranking-date small {
    color: var(--text-soft);
    font-size: 12px;
}

.ranking-code {
    width: fit-content;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 850;
}

.ranking-type-cell strong {
    color: var(--text);
    font-size: 13px;
    line-height: 1.35;
}

.ranking-total {
    color: var(--primary-dark);
    font-size: 20px;
}

.ranking-percent-cell {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.ranking-meter {
    height: 8px;
    background: var(--neutral-soft);
    border-radius: 999px;
    overflow: hidden;
}

.ranking-meter span {
    display: block;
    height: 100%;
    min-width: 3px;
    background: linear-gradient(90deg, var(--primary), var(--brand-600));
    border-radius: inherit;
}

.ranking-long-text {
    min-width: 0;
    line-height: 1.35;
}

@media (min-width: 1100px) {
    .page-rankings .content--corporate {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (min-width: 720px) and (max-width: 1099px) {
    .ranking-table-wrap {
        overflow-x: auto;
    }

    .ranking-table {
        min-width: 1040px;
    }
}

@media (max-width: 719px) {
    .ranking-page {
        gap: 14px;
    }

    .ranking-filter-grid {
        grid-template-columns: 1fr;
    }

    .ranking-filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .ranking-table-wrap {
        border: 0;
        background: transparent;
        overflow: visible;
    }

    .ranking-table {
        min-width: 0;
        table-layout: auto;
    }

    .ranking-table tbody tr {
        padding: 14px;
    }

    .ranking-table tbody td {
        align-items: start;
        grid-template-columns: minmax(112px, 42%) 1fr;
    }

    .ranking-table tbody td[data-label]::before {
        margin-top: 2px;
    }

    .ranking-person-cell,
    .ranking-type-cell,
    .ranking-date,
    .ranking-percent-cell {
        min-width: 0;
    }

    .btn-download-sheet {
        width: 100%;
        white-space: normal;
        text-align: center;
    }

    .ranking-section-card .actions,
    .ranking-section-card .actions > * {
        width: 100%;
    }
}
