:root {
    --navy-950: #04172d;
    --navy-900: #082b55;
    --navy-800: #0b3b70;
    --green-700: #187642;
    --green-600: #23904f;
    --green-500: #39a85f;
    --cyan-500: #14a6a5;
    --bg: #f4f7fa;
    --surface: #ffffff;
    --border: #dce5ec;
    --text: #162331;
    --muted: #647487;
    --danger: #b42318;
    --success: #087a45;
    --shadow: 0 18px 55px rgba(8, 43, 85, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(20, 166, 165, 0.08), transparent 35%),
        var(--bg);
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.topbar {
    min-height: 84px;
    padding: 14px clamp(20px, 4vw, 64px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    color: #fff;
    background: linear-gradient(115deg, var(--navy-950), var(--navy-800));
    box-shadow: 0 8px 30px rgba(4, 23, 45, 0.22);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    padding: 4px;
}

.brand span {
    display: grid;
    gap: 2px;
}

.brand strong {
    font-size: 1.05rem;
}

.brand small {
    opacity: 0.72;
    font-size: 0.76rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-actions > a {
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    opacity: 0.9;
}

.topbar-actions > a:hover {
    opacity: 1;
    color: #8ae9b0;
}

.logout-link {
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 10px;
}

.user-chip {
    display: grid;
    padding-left: 20px;
    border-left: 1px solid rgba(255,255,255,.2);
}

.user-chip small {
    opacity: 0.68;
}

.app-main {
    width: min(1380px, calc(100% - 40px));
    margin: 0 auto;
    padding: 44px 0 80px;
}

.auth-main {
    min-height: calc(100vh - 54px);
    display: grid;
    place-items: center;
    padding: 42px 20px;
    background:
        linear-gradient(rgba(4, 23, 45, .88), rgba(4, 23, 45, .94)),
        radial-gradient(circle at 25% 20%, #176f54, transparent 28%),
        linear-gradient(135deg, #082b55, #02101e);
}

.auth-shell {
    width: min(1050px, 100%);
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    overflow: hidden;
    border-radius: 28px;
    box-shadow: 0 28px 90px rgba(0,0,0,.35);
    background: var(--surface);
}

.auth-brand {
    min-height: 650px;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(8,43,85,.95), rgba(6,95,64,.88)),
        #082b55;
}

.auth-brand img {
    width: min(360px, 100%);
    max-height: 310px;
    object-fit: contain;
    background: rgba(255,255,255,.98);
    border-radius: 24px;
    padding: 18px;
    margin-bottom: 32px;
}

.auth-brand h1 {
    margin: 0 0 10px;
    font-size: clamp(2.1rem, 5vw, 3.8rem);
    line-height: .95;
}

.auth-brand p {
    margin: 0;
    max-width: 430px;
    color: rgba(255,255,255,.78);
    font-size: 1.08rem;
}

.login-card {
    padding: 62px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-heading {
    margin-bottom: 30px;
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--green-700);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.login-heading h2,
.selection-header h1,
.context-banner h1,
.panel-heading h2 {
    margin: 0;
    color: var(--navy-950);
}

.login-heading h2 {
    font-size: 2rem;
}

.login-heading p,
.selection-header p,
.context-banner p,
.panel-heading p {
    color: var(--muted);
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.field label {
    font-weight: 800;
    font-size: .9rem;
}

.field input {
    width: 100%;
    min-height: 52px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: #fbfdff;
    transition: .2s;
}

.field input:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px rgba(57,168,95,.12);
    background: #fff;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 85px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--navy-800);
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 4px 0 24px;
    color: var(--muted);
    font-size: .88rem;
}

.btn {
    min-height: 46px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 11px;
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(115deg, var(--green-700), var(--green-500));
    box-shadow: 0 10px 24px rgba(35,144,79,.23);
}

.btn-primary:hover {
    filter: brightness(1.04);
}

.btn-secondary {
    color: var(--navy-900);
    background: #fff;
    border: 1px solid var(--border);
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: .48;
    cursor: not-allowed;
}


.alert {
    width: min(1100px, 100%);
    margin: 0 auto 24px;
    padding: 15px 18px;
    border-radius: 12px;
    font-weight: 700;
}

.auth-main > .alert {
    position: fixed;
    top: 20px;
    z-index: 10;
    width: min(700px, calc(100% - 40px));
}

.alert-erro {
    color: #7a271a;
    border: 1px solid #f7c7bd;
    background: #fff1ee;
}

.alert-sucesso {
    color: #05603a;
    border: 1px solid #a9e3c6;
    background: #ecfdf3;
}

.selection-page,
.dashboard-page {
    display: grid;
    gap: 30px;
}

.selection-header {
    max-width: 780px;
    margin: 18px auto 10px;
    text-align: center;
}

.selection-header h1 {
    font-size: clamp(2rem, 5vw, 3.3rem);
}

.selection-header p {
    margin: 14px auto 0;
    font-size: 1.02rem;
    line-height: 1.65;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.selection-grid.single-card {
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
}

.selection-form {
    margin: 0;
}

.selection-card {
    min-height: 300px;
    padding: 34px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    border: 1px solid var(--border);
    border-radius: 24px;
    color: inherit;
    text-align: left;
    text-decoration: none;
    background:
        linear-gradient(145deg, rgba(255,255,255,.98), rgba(243,250,246,.94));
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.selection-card:hover {
    transform: translateY(-5px);
    border-color: #8ed1aa;
    box-shadow: 0 25px 65px rgba(8,43,85,.16);
}

.selection-button {
    width: 100%;
    cursor: pointer;
}

.selection-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-size: 2rem;
    background: linear-gradient(145deg, #e6f7ec, #d9eef7);
}

.selection-card h2 {
    margin: 0 0 12px;
    color: var(--navy-900);
    font-size: 1.5rem;
}

.selection-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.62;
}

.selection-arrow {
    margin-top: auto;
    color: var(--green-700);
    font-weight: 900;
}

.back-link {
    width: fit-content;
    color: var(--navy-800);
    text-decoration: none;
    font-weight: 800;
}

.context-banner {
    padding: 30px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    border: 1px solid #b8d8c6;
    border-radius: 20px;
    background:
        linear-gradient(120deg, #ffffff, #eef9f2);
    box-shadow: var(--shadow);
}

.context-banner h1 {
    font-size: 2rem;
}

.context-banner p {
    margin: 8px 0 0;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stat-card {
    min-height: 155px;
    padding: 24px;
    display: grid;
    gap: 9px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(8,43,85,.08);
}

.stat-card span {
    color: var(--muted);
    font-weight: 700;
}

.stat-card strong {
    color: var(--navy-900);
    font-size: 2.4rem;
}

.stat-card small {
    color: var(--muted);
}

.panel {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow);
}

.panel-heading {
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
}

.empty-state {
    min-height: 330px;
    padding: 50px 30px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
}

.empty-icon {
    font-size: 3.4rem;
}

.empty-state h3 {
    margin: 14px 0 6px;
    color: var(--navy-900);
}

.empty-state p {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.footer {
    min-height: 54px;
    padding: 0 clamp(20px, 4vw, 64px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: rgba(255,255,255,.78);
    background: var(--navy-950);
    font-size: .78rem;
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        min-height: auto;
        padding: 38px;
    }

    .auth-brand img {
        width: 210px;
        margin-bottom: 20px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

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

@media (max-width: 720px) {
    .app-main {
        width: min(100% - 24px, 1380px);
        padding-top: 24px;
    }

    .selection-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .selection-card {
        min-height: 260px;
        padding: 26px;
    }

    .login-card {
        padding: 40px 26px;
    }

    .context-banner,
    .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .footer {
        padding: 14px 20px;
        align-items: flex-start;
        flex-direction: column;
    }

    .user-chip {
        display: none;
    }
}


.app-layout {
    width: min(1560px, calc(100% - 30px));
    margin: 24px auto 80px;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.content-area {
    min-width: 0;
    display: grid;
    gap: 24px;
}

.sidebar {
    position: sticky;
    top: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
}

.sidebar-context {
    padding: 22px;
    display: grid;
    gap: 5px;
    color: #fff;
    background: linear-gradient(135deg, var(--navy-900), var(--green-700));
}

.sidebar-context small,
.sidebar-context span {
    opacity: .78;
}

.sidebar-nav {
    padding: 14px;
    display: grid;
    gap: 4px;
}

.sidebar-nav a,
.sidebar-section {
    padding: 11px 12px;
    border-radius: 9px;
    text-decoration: none;
}

.sidebar-nav a {
    color: var(--navy-900);
    font-weight: 800;
}

.sidebar-nav a:hover {
    background: #edf7f1;
}

.sidebar-nav a.disabled {
    color: #98a5b1;
    cursor: not-allowed;
}

.sidebar-section {
    margin-top: 8px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.sidebar-back {
    margin-top: 12px;
    color: var(--green-700) !important;
    border-top: 1px solid var(--border);
    border-radius: 0 !important;
}

.page-header {
    padding: 4px 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.page-header h1 {
    margin: 0;
    color: var(--navy-950);
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.page-header p {
    margin: 8px 0 0;
    color: var(--muted);
}

.toolbar {
    padding: 20px;
    display: flex;
    align-items: end;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.field.compact {
    min-width: 300px;
    margin: 0;
}

.field select {
    width: 100%;
    min-height: 52px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: #fbfdff;
}

.table-wrap {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    background: #f8fafc;
    font-size: .78rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.data-table td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.actions-col {
    width: 150px;
}

.row-actions {
    display: flex;
    gap: 12px;
}

.row-actions a {
    color: var(--navy-800);
    font-weight: 800;
    text-decoration: none;
}

.row-actions .danger-link {
    color: var(--danger);
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 900;
    text-transform: capitalize;
}

.status-ok {
    color: #05603a;
    background: #dcfae6;
}

.status-off {
    color: #7a271a;
    background: #fee4e2;
}

.status-info {
    color: #174b7a;
    background: #e5f1fb;
}

.form-panel {
    padding: 28px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

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

.form-actions {
    margin-top: 28px;
    padding-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border);
}

.inline-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.module-card {
    min-height: 220px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 18px;
    text-decoration: none;
    background: #fff;
    box-shadow: 0 12px 35px rgba(8,43,85,.08);
}

.module-card > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--navy-800), var(--green-600));
    font-weight: 900;
}

.module-card h2 {
    margin: 18px 0 8px;
    color: var(--navy-900);
}

.module-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.module-card small {
    margin-top: auto;
    padding-top: 18px;
    color: var(--green-700);
    font-weight: 800;
}

@media (max-width: 1050px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

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

    .sidebar-section,
    .sidebar-back {
        grid-column: 1 / -1;
    }

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

@media (max-width: 720px) {
    .page-header,
    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .field.compact {
        min-width: 0;
    }

    .form-grid,
    .module-grid {
        grid-template-columns: 1fr;
    }

    .field-span-2 {
        grid-column: auto;
    }

    .sidebar-nav {
        grid-template-columns: 1fr 1fr;
    }
}

.field textarea{width:100%;padding:14px 15px;border:1px solid var(--border);border-radius:12px;outline:none;resize:vertical;background:#fbfdff;font:inherit}.field textarea:focus,.field select:focus{border-color:var(--green-500);box-shadow:0 0 0 4px rgba(57,168,95,.12);background:#fff}


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

.toolbar-wrap {
    flex-wrap: wrap;
}

.field-help,
.muted-text {
    color: var(--muted);
    font-size: .78rem;
}

@media (max-width: 720px) {
    .stats-compact {
        grid-template-columns: 1fr;
    }
}


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

.detail-panel {
    padding: 26px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.detail-grid > div {
    padding: 18px;
    display: grid;
    gap: 7px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fbfd;
}

.detail-grid small {
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 900px) {
    .stats-three,
    .detail-grid {
        grid-template-columns: 1fr;
    }
}


.documents-grid {
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.document-card {
    padding: 18px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

.document-icon {
    width: 58px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg, var(--navy-800), var(--green-600));
    font-size: .78rem;
    font-weight: 900;
}

.document-body {
    min-width: 0;
}

.document-category {
    color: var(--green-700);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.document-body h2 {
    margin: 6px 0;
    color: var(--navy-900);
    font-size: 1rem;
}

.document-body p,
.document-body small {
    display: block;
    overflow: hidden;
    margin: 0;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-actions {
    grid-column: 1 / -1;
    padding-top: 12px;
    display: flex;
    gap: 15px;
    border-top: 1px solid var(--border);
}

.document-actions a {
    color: var(--navy-800);
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
}

.document-actions .danger-link {
    color: var(--danger);
}

.upload-zone {
    min-height: 180px;
    padding: 30px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    text-align: center;
    border: 2px dashed #9db7c8;
    border-radius: 16px;
    color: var(--navy-800);
    background: #f8fbfd;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--green-500);
    background: #f1faf4;
}

.upload-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.upload-zone span {
    color: var(--muted);
    font-size: .86rem;
}

.selected-files {
    margin-top: 10px;
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: .82rem;
}

.section-help {
    margin: -10px 0 22px;
    color: var(--muted);
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.report-card {
    min-height: 240px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 18px;
    color: inherit;
    text-decoration: none;
    background: #fff;
    box-shadow: 0 12px 35px rgba(8,43,85,.08);
}

.report-card > span {
    font-size: 2rem;
}

.report-card h2 {
    margin: 18px 0 8px;
    color: var(--navy-900);
}

.report-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.report-card small {
    margin-top: auto;
    padding-top: 18px;
    color: var(--green-700);
    font-weight: 900;
}

.report-links {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    gap: 12px;
}

.report-links a {
    color: var(--green-700);
    font-weight: 900;
}

.report-page {
    background: #e9eef2;
}

.report-toolbar {
    width: min(1100px, calc(100% - 30px));
    margin: 20px auto;
    display: flex;
    justify-content: space-between;
}

.print-report {
    width: min(1100px, calc(100% - 30px));
    min-height: 297mm;
    margin: 0 auto 40px;
    padding: 40px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(0,0,0,.12);
}

.print-header {
    padding-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    border-bottom: 2px solid var(--navy-900);
}

.print-header img {
    width: 75px;
    height: 75px;
    object-fit: contain;
}

.print-header div {
    display: grid;
}

.print-header strong {
    color: var(--navy-900);
    font-size: 1.35rem;
}

.print-header span {
    color: var(--muted);
}

.print-title {
    padding: 28px 0;
}

.print-title h1 {
    margin: 0 0 8px;
    color: var(--navy-950);
}

.print-title p,
.print-title small {
    margin: 0;
    color: var(--muted);
}

.report-summary-grid {
    margin-bottom: 28px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.report-summary-grid > div {
    padding: 16px;
    display: grid;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.report-summary-grid span {
    color: var(--muted);
    font-size: .8rem;
}

.report-summary-grid strong {
    color: var(--navy-900);
}

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

.report-table th,
.report-table td {
    padding: 10px 12px;
    border: 1px solid #cfd8df;
    text-align: left;
    vertical-align: top;
}

.report-table th {
    color: var(--navy-900);
    background: #eef4f8;
}

.report-table td small {
    display: block;
    color: var(--muted);
}

.report-table-list {
    font-size: .82rem;
}

.report-total {
    margin: 0 0 18px;
    text-align: right;
}

.checklist-report {
    display: grid;
    gap: 12px;
}

.checklist-report article {
    padding: 18px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.checklist-report article > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 900;
}

.checklist-report h2 {
    margin: 0 0 5px;
    font-size: 1rem;
}

.checklist-report p {
    margin: 0 0 7px;
    color: var(--muted);
}

.check-ok > span {
    background: var(--success);
}

.check-pending > span {
    background: #c67a00;
}

.report-note {
    margin-top: 24px;
    padding: 15px;
    color: var(--muted);
    background: #f5f7f9;
    border-radius: 10px;
}

@media (max-width: 900px) {
    .documents-grid,
    .report-grid,
    .report-summary-grid {
        grid-template-columns: 1fr;
    }

    .print-report {
        padding: 22px;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    body {
        background: #fff;
    }

    .no-print {
        display: none !important;
    }

    .print-report {
        width: 100%;
        min-height: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .report-table {
        break-inside: auto;
    }

    .report-table tr {
        break-inside: avoid;
    }
}


.dashboard-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-stats .stat-card strong {
    font-size: clamp(1.35rem, 2vw, 2rem);
}

.dashboard-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.dashboard-list {
    display: grid;
}

.dashboard-list article {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border);
}

.dashboard-list article:last-child {
    border-bottom: 0;
}

.dashboard-list article > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.dashboard-list a {
    color: var(--navy-900);
    text-decoration: none;
}

.dashboard-list small {
    color: var(--muted);
}

.dashboard-list-date {
    min-width: 62px;
    padding: 8px;
    text-align: center;
    border-radius: 10px;
    color: var(--navy-900);
    background: #edf5fa;
    font-weight: 900;
}

.dashboard-list-date.is-overdue {
    color: #7a271a;
    background: #fee4e2;
}

.mini-empty {
    padding: 45px 25px;
    color: var(--muted);
    text-align: center;
}

.agenda-filters {
    padding: 16px 20px;
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}

.agenda-filters a {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 800;
}

.agenda-filters a.active {
    color: #fff;
    background: var(--navy-800);
}

.agenda-list {
    display: grid;
}

.agenda-item {
    padding: 20px;
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.agenda-overdue {
    background: #fff8f6;
}

.agenda-date {
    padding: 10px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--navy-900);
    background: #eef5fa;
}

.agenda-date strong {
    font-size: 1.7rem;
}

.agenda-date span,
.agenda-date small {
    color: var(--muted);
    font-size: .72rem;
}

.agenda-content {
    min-width: 0;
}

.agenda-content h2 {
    margin: 8px 0 5px;
    color: var(--navy-900);
    font-size: 1.1rem;
}

.agenda-content p {
    margin: 0 0 5px;
    color: var(--muted);
}

.agenda-content small {
    display: block;
    color: var(--muted);
}

.agenda-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
}

.priority,
.overdue-label {
    padding: 4px 8px;
    border-radius: 999px;
}

.priority-baixa {
    color: #315b7a;
    background: #e8f2f8;
}

.priority-normal {
    color: #31653f;
    background: #e8f6ec;
}

.priority-alta {
    color: #805900;
    background: #fff2cc;
}

.priority-urgente,
.overdue-label {
    color: #7a271a;
    background: #fee4e2;
}

.agenda-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.agenda-actions a {
    color: var(--navy-800);
    text-decoration: none;
    font-weight: 800;
}

.agenda-actions .danger-link {
    color: var(--danger);
}

.validation-list {
    display: grid;
}

.validation-item {
    padding: 20px;
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.validation-level {
    padding: 8px 10px;
    border-radius: 999px;
    text-align: center;
    font-size: .72rem;
    font-weight: 900;
}

.validation-critica .validation-level {
    color: #7a271a;
    background: #fee4e2;
}

.validation-atencao .validation-level {
    color: #805900;
    background: #fff2cc;
}

.validation-informativa .validation-level {
    color: #174b7a;
    background: #e5f1fb;
}

.validation-item h2 {
    margin: 4px 0;
    color: var(--navy-900);
    font-size: 1.05rem;
}

.validation-item p,
.validation-item small {
    margin: 0;
    color: var(--muted);
}

.success-empty {
    background: #f2fbf5;
}

@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
    }

    .agenda-item,
    .validation-item {
        grid-template-columns: 1fr;
    }

    .agenda-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 650px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}


.bank-movements {
    display: grid;
}

.bank-movement {
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 150px auto;
    gap: 18px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.movement-value {
    font-weight: 900;
    font-size: 1rem;
}

.movement-in {
    color: var(--success);
}

.movement-out {
    color: var(--danger);
}

.movement-main h2 {
    margin: 4px 0;
    color: var(--navy-900);
    font-size: 1rem;
}

.movement-main p,
.movement-main small {
    margin: 0;
    color: var(--muted);
}

.match-info {
    margin-top: 8px !important;
    color: var(--green-700) !important;
    font-weight: 800;
}

.movement-status {
    display: grid;
    gap: 6px;
}

.movement-status small {
    color: var(--muted);
}

.movement-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.movement-actions a {
    color: var(--navy-800);
    font-size: .8rem;
    font-weight: 800;
    text-decoration: none;
}

.import-help {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fbfd;
}

.import-help h2 {
    margin: 0 0 8px;
    color: var(--navy-900);
    font-size: 1rem;
}

.import-help p {
    color: var(--muted);
}

.import-help code {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 8px;
    background: #e9eff4;
}

@media (max-width: 1050px) {
    .bank-movement {
        grid-template-columns: 1fr 1fr;
    }

    .movement-main {
        grid-column: 1 / -1;
        order: -1;
    }

    .movement-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 650px) {
    .bank-movement {
        grid-template-columns: 1fr;
    }
}


.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.profile-option {
    padding: 15px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f9fbfc;
    cursor: pointer;
}

.profile-option span {
    display: grid;
    gap: 4px;
}

.profile-option small {
    color: var(--muted);
}

.audit-list {
    display: grid;
}

.audit-item {
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.audit-badge {
    padding: 8px 10px;
    border-radius: 999px;
    color: #fff;
    text-align: center;
    background: var(--navy-800);
    font-size: .75rem;
    font-weight: 900;
}

.audit-item h2 {
    margin: 4px 0;
    color: var(--navy-900);
    font-size: 1rem;
}

.audit-item p,
.audit-item small {
    margin: 0;
    color: var(--muted);
}

.warning-box {
    padding: 18px 20px;
    border: 1px solid #f3c36b;
    border-radius: 14px;
    color: #734d00;
    background: #fff8e5;
}

.warning-box p {
    margin: 6px 0 0;
}

@media (max-width: 720px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .audit-item {
        grid-template-columns: 1fr;
    }
}


/* Etapa 11: cabeçalho e rodapé fixos */
:root {
    --topbar-height: 84px;
    --footer-height: 54px;
}

body {
    padding-top: var(--topbar-height);
    padding-bottom: var(--footer-height);
}

.topbar {
    position: fixed;
    z-index: 1000;
    top: 0;
    right: 0;
    left: 0;
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    flex-wrap: nowrap;
}

.topbar-actions {
    min-width: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    scrollbar-width: thin;
}

.footer {
    position: fixed;
    z-index: 1000;
    right: 0;
    bottom: 0;
    left: 0;
    height: var(--footer-height);
    min-height: var(--footer-height);
    padding: 0 20px;
    justify-content: center;
    text-align: center;
    box-shadow: 0 -6px 24px rgba(4,23,45,.16);
}

.footer-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.auth-main {
    min-height: calc(100vh - var(--topbar-height) - var(--footer-height));
}

.app-layout {
    margin-bottom: 24px;
}

@media (max-width: 980px) {
    .topbar {
        padding: 10px 16px;
        align-items: center;
        flex-direction: row;
    }
    .brand span { display: none; }
    .brand img { width: 52px; height: 52px; }
    .topbar-actions { gap: 14px; }
}

@media (max-width: 720px) {
    .footer {
        height: var(--footer-height);
        min-height: var(--footer-height);
        padding: 0 10px;
        align-items: center;
        flex-direction: row;
    }
    .footer-content { gap: 6px; font-size: .68rem; }
    .footer-separator { display: none; }
    .footer-content span:last-child { display: none; }
}

@media print {
    body { padding: 0; }
    .topbar, .footer { display: none !important; }
}


.setup-shell {
    width: min(980px, calc(100% - 30px));
    margin: 35px auto 110px;
}

.setup-card {
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(8,43,85,.12);
}

.setup-heading {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.setup-heading img {
    width: 82px;
    height: 82px;
    object-fit: contain;
}

.setup-heading h1 {
    margin: 4px 0;
    color: var(--navy-900);
}

.setup-heading p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 650px) {
    .setup-card {
        padding: 20px;
    }

    .setup-heading {
        align-items: flex-start;
    }

    .setup-heading img {
        width: 60px;
        height: 60px;
    }
}


.document-analysis-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
    gap: 22px;
    align-items: start;
}

.document-preview-panel {
    min-height: 760px;
    overflow: hidden;
}

.document-preview-panel iframe,
.document-preview-panel img {
    width: 100%;
    height: 760px;
    display: block;
    border: 0;
    object-fit: contain;
    background: #e9eef2;
}

.analysis-actions {
    margin-bottom: 22px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 1100px) {
    .document-analysis-layout {
        grid-template-columns: 1fr;
    }

    .document-preview-panel,
    .document-preview-panel iframe,
    .document-preview-panel img {
        min-height: 520px;
        height: 520px;
    }
}


.capture-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.capture-option {
    min-height: 145px;
    padding: 20px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--navy-900);
    background: #f8fbfd;
    cursor: pointer;
    font: inherit;
}

.capture-option:hover {
    border-color: var(--green-500);
    background: #f1faf4;
}

.capture-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.capture-button {
    width: 100%;
}

.capture-icon {
    font-size: 2rem;
}

.capture-option small {
    color: var(--muted);
}

.live-camera-panel {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #081c2f;
}

.camera-view {
    position: relative;
    max-width: 900px;
    margin: auto;
    overflow: hidden;
    border-radius: 14px;
    background: #000;
}

.camera-view video {
    width: 100%;
    max-height: 68vh;
    display: block;
    object-fit: contain;
}

.document-frame {
    position: absolute;
    inset: 8%;
    border: 3px solid rgba(255,255,255,.85);
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,.22);
    pointer-events: none;
}

.camera-controls {
    padding-top: 14px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.camera-notice {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #176b3a;
    background: #eaf8ef;
    font-weight: 700;
}

.camera-notice.camera-error {
    color: #8b1e15;
    background: #feeceb;
}

.captured-previews {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.captured-preview-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.captured-preview-card img {
    width: 100%;
    height: 145px;
    display: block;
    object-fit: cover;
    background: #e9eef2;
}

.captured-preview-card span {
    padding: 8px;
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-file-item {
    padding: 9px 11px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #f8fbfd;
}

.selected-file-item button {
    border: 0;
    color: var(--danger);
    background: transparent;
    cursor: pointer;
    font-weight: 800;
}

.photo-tips {
    margin-top: 22px;
    padding: 16px 18px;
    display: grid;
    gap: 5px;
    border: 1px solid #bfd9c8;
    border-radius: 12px;
    color: #28583a;
    background: #f1faf4;
}

@media (max-width: 850px) {
    .capture-options {
        grid-template-columns: 1fr;
    }

    .capture-option {
        min-height: 105px;
    }

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

@media (max-width: 480px) {
    .captured-previews {
        grid-template-columns: 1fr;
    }
}

.dashboard-charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;margin-top:22px}.chart-panel canvas{width:100%;height:300px;padding:16px}.assistant-score{padding:24px;display:flex;align-items:center;gap:24px;border:1px solid var(--border);border-radius:18px;background:#fff;margin-bottom:22px}.score-ring{width:150px;height:150px;border-radius:50%;display:grid;place-items:center;align-content:center;background:conic-gradient(var(--green-600) calc(var(--score)*1%),#e5edf2 0);position:relative}.score-ring:after{content:'';position:absolute;inset:14px;border-radius:50%;background:#fff}.score-ring strong,.score-ring span{position:relative;z-index:1}.score-ring strong{font-size:2rem}.score-ring span{font-size:.72rem;color:var(--muted)}.security-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}.security-card{padding:24px}.recovery-codes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:18px 0}.recovery-codes code,.secret-box code{padding:12px;border-radius:8px;background:#eef3f6}.secret-box{display:grid;gap:10px;margin:18px 0;padding:18px;border:1px solid var(--border);border-radius:12px}.secret-box small{word-break:break-all;color:var(--muted)}@media(max-width:900px){.dashboard-charts,.security-grid{grid-template-columns:1fr}.assistant-score{align-items:flex-start;flex-direction:column}}


.client-portal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.client-portal-card {
    padding: 22px;
    display: grid;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 18px;
    color: inherit;
    text-decoration: none;
    background: #fff;
    box-shadow: 0 12px 32px rgba(8,43,85,.08);
}

.client-portal-card h2,
.request-item h3 {
    margin: 0;
    color: var(--navy-900);
}

.client-portal-card p,
.request-item p {
    margin: 0;
    color: var(--muted);
}

.client-portal-card > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
}

.portal-columns {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 22px;
}

.request-list {
    display: grid;
}

.request-item {
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.request-item > div:first-child {
    display: grid;
    gap: 7px;
}

.request-urgente { border-left: 5px solid #b42318; }
.request-alta { border-left: 5px solid #d97706; }
.request-normal { border-left: 5px solid #1570ef; }
.request-baixa { border-left: 5px solid #667085; }

.request-actions form,
.request-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-danger {
    color: #fff;
    background: #b42318;
}

.chat-thread {
    max-height: 460px;
    padding: 18px;
    display: grid;
    gap: 12px;
    overflow-y: auto;
}

.chat-thread article {
    max-width: 82%;
    padding: 12px 14px;
    border-radius: 14px;
    background: #eef4f8;
}

.chat-thread article.chat-own {
    margin-left: auto;
    color: #fff;
    background: var(--navy-800);
}

.chat-thread p {
    margin: 6px 0;
}

.chat-thread small {
    opacity: .75;
}

.chat-form {
    padding: 16px;
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--border);
}

.notification-list {
    display: grid;
}

.notification-item {
    padding: 18px 20px;
    display: grid;
    gap: 5px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.notification-item p {
    margin: 0;
    color: var(--muted);
}

.notification-unread {
    border-left: 5px solid var(--green-600);
    background: #f2fbf5;
}

.auth-back-link {
    margin-top: 15px;
    display: block;
    color: var(--navy-800);
    text-align: center;
    font-weight: 800;
    text-decoration: none;
}

.legal-page {
    width: min(900px, calc(100% - 30px));
    margin: 30px auto 110px;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
}

.legal-page h1,
.legal-page h2 {
    color: var(--navy-900);
}

.legal-page p {
    color: var(--muted);
    line-height: 1.7;
}

@media (max-width: 1000px) {
    .client-portal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .client-portal-grid {
        grid-template-columns: 1fr;
    }

    .request-item {
        align-items: stretch;
        flex-direction: column;
    }

    .chat-thread article {
        max-width: 95%;
    }
}


.simulation-hero {
    margin-bottom: 22px;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
}
.simulation-hero span { font-weight: 900; letter-spacing: .08em; }
.simulation-hero h2 { margin: 8px 0; font-size: 3.4rem; }
.simulation-ok { color: #175c32; background: #eaf8ef; border: 1px solid #9dd7ae; }
.simulation-blocked { color: #84241c; background: #feeceb; border: 1px solid #efaca7; }

.suggestion-list { display: grid; }
.suggestion-card {
    padding: 18px 20px;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.suggestion-card h3 { margin: 4px 0; color: var(--navy-900); }
.suggestion-card p, .suggestion-card small { margin: 0; color: var(--muted); }
.suggestion-card form { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 760px) {
    .suggestion-card { grid-template-columns: 1fr; }
}


/* ==========================================================
   MENU COMPACTO E SISTEMA GLOBAL DE ÍCONES — V2.1
   ========================================================== */

.app-icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    display: inline-block;
    vertical-align: middle;
}

.sidebar {
    width: 224px;
    min-width: 224px;
    height: calc(100vh - var(--topbar-height, 78px) - var(--footer-height, 48px));
    position: fixed;
    top: var(--topbar-height, 78px);
    bottom: var(--footer-height, 48px);
    left: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width .22s ease, min-width .22s ease;
}

.app-layout {
    padding-left: 224px;
    transition: padding-left .22s ease;
}

body.sidebar-collapsed .sidebar {
    width: 68px;
    min-width: 68px;
}

body.sidebar-collapsed .app-layout {
    padding-left: 68px;
}

.sidebar-head {
    min-height: 76px;
    padding: 12px 10px 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-context {
    min-width: 0;
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.sidebar-context small,
.sidebar-context strong,
.sidebar-context span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-toggle {
    width: 34px;
    height: 34px;
    padding: 0;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    color: #fff;
    background: rgba(255,255,255,.08);
    cursor: pointer;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,.16);
}

body.sidebar-collapsed .sidebar-toggle-icon {
    transform: rotate(180deg);
}

.sidebar-nav {
    padding: 9px 8px 14px;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

.sidebar-nav a,
.sidebar-details summary {
    min-height: 40px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 10px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.sidebar-nav a:hover,
.sidebar-details summary:hover {
    color: #fff;
    background: rgba(255,255,255,.11);
}

.sidebar-nav a .app-icon,
.sidebar-details summary .app-icon {
    color: #8fd5a9;
}

.sidebar-group {
    display: grid;
    gap: 3px;
}

.sidebar-details {
    margin-top: 5px;
}

.sidebar-details summary {
    list-style: none;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .045em;
}

.sidebar-details summary::-webkit-details-marker {
    display: none;
}

.details-chevron {
    width: 15px;
    height: 15px;
    margin-left: auto;
    transition: transform .2s ease;
}

.sidebar-details[open] .details-chevron {
    transform: rotate(90deg);
}

.sidebar-submenu {
    padding: 4px 0 4px 8px;
    display: grid;
    gap: 2px;
}

.sidebar-submenu a {
    min-height: 37px;
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: .88rem;
}

.sidebar-back {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.1);
}

body.sidebar-collapsed .sidebar-text,
body.sidebar-collapsed .sidebar-context {
    width: 0;
    max-width: 0;
    opacity: 0;
    visibility: hidden;
}

body.sidebar-collapsed .sidebar-head {
    padding: 12px 17px;
}

body.sidebar-collapsed .sidebar-nav {
    padding-left: 8px;
    padding-right: 8px;
}

body.sidebar-collapsed .sidebar-nav a,
body.sidebar-collapsed .sidebar-details summary {
    padding-left: 16px;
    padding-right: 16px;
    justify-content: center;
    gap: 0;
}

body.sidebar-collapsed .sidebar-submenu {
    padding-left: 0;
}

body.sidebar-collapsed .details-chevron {
    display: none;
}

/* Topo compacto com ícones */
.topbar-actions {
    gap: 4px;
}

.topbar-actions > a,
.topbar-more > summary {
    min-width: 58px;
    padding: 7px 8px;
    display: grid;
    place-items: center;
    gap: 3px;
    border-radius: 9px;
    font-size: .7rem;
    line-height: 1;
    text-align: center;
}

.topbar-actions > a .app-icon,
.topbar-more > summary .app-icon {
    width: 18px;
    height: 18px;
}

.nav-notification {
    position: relative;
}

.nav-notification b {
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    position: absolute;
    top: 2px;
    right: 4px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: #d92d20;
    font-size: .62rem;
}

.topbar-more {
    position: relative;
}

.topbar-more > summary {
    list-style: none;
    cursor: pointer;
}

.topbar-more > summary::-webkit-details-marker {
    display: none;
}

.topbar-dropdown {
    width: 225px;
    padding: 8px;
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 300;
    display: grid;
    gap: 3px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(8,43,85,.18);
}

.topbar-dropdown a {
    padding: 10px 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 9px;
    color: var(--navy-900);
    text-decoration: none;
}

.topbar-dropdown a:hover {
    background: #eef5f8;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-chip > span {
    display: grid;
}

.logout-link {
    color: #ffd8d4 !important;
}

/* Ícones automáticos em componentes comuns */
.btn,
.row-actions a,
.report-links a,
.movement-actions a,
.agenda-actions a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.module-card > span:first-child,
.report-card > span:first-child,
.empty-icon {
    display: grid;
    place-items: center;
}

/* Menu móvel: abre como painel flutuante */
.mobile-sidebar-button {
    display: none;
}

@media (max-width: 980px) {
    .sidebar {
        width: 260px;
        min-width: 260px;
        transform: translateX(-105%);
        box-shadow: 14px 0 35px rgba(0,0,0,.22);
        transition: transform .22s ease;
    }

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

    .app-layout,
    body.sidebar-collapsed .app-layout {
        padding-left: 0;
    }

    .mobile-sidebar-button {
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        position: fixed;
        left: 10px;
        top: calc(var(--topbar-height, 78px) + 10px);
        z-index: 120;
        border: 0;
        border-radius: 11px;
        color: #fff;
        background: var(--navy-800);
        box-shadow: 0 8px 22px rgba(8,43,85,.25);
    }

    .topbar-actions > a span,
    .topbar-more > summary span {
        display: none;
    }

    .topbar-actions > a,
    .topbar-more > summary {
        min-width: 38px;
    }

    .user-chip small {
        display: none;
    }
}

@media (max-width: 650px) {
    .brand span {
        display: none;
    }

    .user-chip {
        display: none;
    }

    .topbar-actions {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .topbar-actions::-webkit-scrollbar {
        display: none;
    }
}


/* ==========================================================
   CORREÇÃO DE LAYOUT — V2.1.1
   Remove a reserva dupla do menu e melhora telas menores.
   ========================================================== */

:root {
    --sidebar-width: 196px;
    --sidebar-collapsed-width: 64px;
}

/* O menu é fixo. O conteúdo não pode continuar usando a antiga grade de 250px. */
.app-layout {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding:
        24px
        clamp(18px, 2.6vw, 42px)
        26px
        calc(var(--sidebar-width) + clamp(18px, 2.6vw, 42px)) !important;
    display: block !important;
    grid-template-columns: none !important;
}

.content-area {
    width: 100%;
    max-width: 1500px;
    min-width: 0;
    margin: 0 auto;
}

.sidebar {
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    color: #fff;
    border: 0 !important;
    border-radius: 0 !important;
    background: linear-gradient(180deg, #092e55 0%, #063d58 52%, #087044 100%) !important;
    box-shadow: 8px 0 28px rgba(7, 35, 65, .16) !important;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width) !important;
    min-width: var(--sidebar-collapsed-width) !important;
}

body.sidebar-collapsed .app-layout {
    padding-left: calc(var(--sidebar-collapsed-width) + clamp(18px, 2.6vw, 42px)) !important;
}

.sidebar-head {
    min-height: 70px;
}

.sidebar-nav {
    padding-top: 7px;
}

.sidebar-nav a,
.sidebar-details summary {
    min-height: 36px;
    padding: 7px 9px;
    font-size: .82rem;
}

.sidebar-submenu a {
    min-height: 33px;
    font-size: .79rem;
}

.sidebar-context strong {
    font-size: .86rem;
}

.sidebar-context span,
.sidebar-context small {
    font-size: .68rem;
}

/* O dashboard deixa de forçar 5 colunas estreitas. */
.dashboard-stats,
.stats-grid.dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)) !important;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.stat-card {
    min-width: 0;
    min-height: 135px;
    padding: 20px;
}

.stat-card strong {
    overflow-wrap: anywhere;
    font-size: clamp(1.55rem, 2.2vw, 2.25rem);
}

.context-banner {
    flex-wrap: wrap;
}

.context-banner > div:first-child {
    min-width: 220px;
    flex: 1 1 360px;
}

.context-banner .inline-actions,
.context-banner > div:last-child {
    flex: 0 1 auto;
}

.dashboard-columns {
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

/* Impede tabelas e painéis de estourarem a área útil. */
.panel,
.table-wrap,
.page-header,
.context-banner,
.stats-grid,
.dashboard-columns {
    min-width: 0;
}

.table-wrap {
    overflow-x: auto;
}

/* Ajustes para notebooks e janelas divididas. */
@media (max-width: 1180px) {
    :root {
        --sidebar-width: 176px;
    }

    .app-layout {
        padding-right: 18px !important;
        padding-left: calc(var(--sidebar-width) + 18px) !important;
    }

    body.sidebar-collapsed .app-layout {
        padding-left: calc(var(--sidebar-collapsed-width) + 18px) !important;
    }

    .dashboard-stats,
    .stats-grid.dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .context-banner {
        padding: 22px;
    }

    .context-banner h1 {
        font-size: 1.55rem;
    }

    .topbar-actions > a,
    .topbar-more > summary {
        min-width: 45px;
        padding-left: 5px;
        padding-right: 5px;
    }
}

@media (max-width: 980px) {
    .sidebar {
        width: 250px !important;
        min-width: 250px !important;
    }

    .app-layout,
    body.sidebar-collapsed .app-layout {
        padding: 66px 14px 24px !important;
    }

    .dashboard-stats,
    .stats-grid.dashboard-stats,
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 620px) {
    .dashboard-stats,
    .stats-grid.dashboard-stats,
    .stats-grid,
    .dashboard-columns {
        grid-template-columns: 1fr !important;
    }

    .context-banner {
        padding: 18px;
    }

    .context-banner > div:last-child,
    .context-banner .inline-actions {
        width: 100%;
    }

    .context-banner .btn {
        flex: 1;
        justify-content: center;
    }
}


/* Correção V2.1.2 — título compacto do grupo lateral */
.sidebar-details summary {
    min-width: 0;
}

.sidebar-details summary .sidebar-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-details summary .details-chevron {
    flex: 0 0 15px;
}

body.sidebar-collapsed .sidebar-details summary .sidebar-text {
    display: none;
}


/* ==========================================================
   V2.1.4 — ADMIN, RELÓGIO DE BRASÍLIA E TOASTS
   ========================================================== */

/* Menu Admin aberto por botão, independente do comportamento de <details>. */
.topbar-more {
    position: relative;
    flex: 0 0 auto;
}

.topbar-admin-button {
    min-width: 62px;
    padding: 7px 8px;
    display: grid;
    grid-template-columns: 18px auto 12px;
    place-items: center;
    gap: 4px;
    border: 0;
    border-radius: 9px;
    color: inherit;
    background: transparent;
    font: inherit;
    font-size: .7rem;
    line-height: 1;
    cursor: pointer;
}

.topbar-admin-button:hover,
.topbar-admin-button[aria-expanded="true"] {
    background: rgba(255,255,255,.12);
}

.admin-chevron {
    width: 12px !important;
    height: 12px !important;
    transition: transform .18s ease;
}

.topbar-admin-button[aria-expanded="true"] .admin-chevron {
    transform: rotate(90deg);
}

.topbar-dropdown[hidden] {
    display: none !important;
}

.topbar-dropdown {
    width: 235px;
    max-height: calc(100vh - 95px);
    overflow-y: auto;
    position: fixed;
    top: 70px;
    right: 92px;
    z-index: 10000;
}

/* Data e hora de Brasília fixadas no topo. */
.brasilia-clock {
    min-width: 112px;
    padding: 5px 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-left: 1px solid rgba(255,255,255,.14);
    border-right: 1px solid rgba(255,255,255,.14);
    color: rgba(255,255,255,.94);
    white-space: nowrap;
}

.brasilia-clock > span {
    display: grid;
    gap: 1px;
}

.brasilia-clock strong {
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
}

.brasilia-clock small {
    font-size: .61rem;
    opacity: .78;
}

/* Notificações no canto da tela. */
.toast-container {
    width: min(370px, calc(100vw - 28px));
    position: fixed;
    top: calc(var(--topbar-height, 78px) + 14px);
    right: 14px;
    z-index: 12000;
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.app-toast {
    padding: 14px 14px 13px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 28px;
    gap: 10px;
    align-items: start;
    border: 1px solid rgba(15, 54, 87, .13);
    border-radius: 14px;
    color: var(--navy-900);
    background: rgba(255,255,255,.98);
    box-shadow: 0 18px 45px rgba(8,43,85,.22);
    pointer-events: auto;
    animation: toast-enter .25s ease both;
}

.app-toast.toast-leaving {
    animation: toast-leave .22s ease both;
}

.toast-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: var(--green-600);
}

.toast-icon .app-icon {
    width: 19px;
    height: 19px;
}

.toast-content {
    min-width: 0;
}

.toast-content strong {
    display: block;
    color: var(--navy-900);
    font-size: .91rem;
}

.toast-content p {
    margin: 4px 0 7px;
    color: var(--muted);
    font-size: .81rem;
    line-height: 1.4;
}

.toast-content a {
    color: var(--green-700);
    font-size: .78rem;
    font-weight: 900;
    text-decoration: none;
}

.toast-close {
    width: 28px;
    height: 28px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 1.05rem;
}

.toast-close:hover {
    color: var(--navy-900);
    background: #eef4f7;
}

@keyframes toast-enter {
    from { opacity: 0; transform: translateX(24px) scale(.97); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-leave {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(30px); }
}

@media (max-width: 1180px) {
    .brasilia-clock small {
        display: none;
    }

    .brasilia-clock {
        min-width: 82px;
    }

    .topbar-dropdown {
        right: 72px;
    }
}

@media (max-width: 820px) {
    .brasilia-clock {
        min-width: auto;
        padding-left: 7px;
        padding-right: 7px;
    }

    .brasilia-clock .app-icon {
        display: none;
    }

    .topbar-admin-button span {
        display: none;
    }

    .topbar-admin-button {
        min-width: 38px;
        grid-template-columns: 18px;
    }

    .admin-chevron {
        display: none;
    }

    .topbar-dropdown {
        top: 66px;
        right: 10px;
    }
}

@media (max-width: 580px) {
    .brasilia-clock {
        display: none;
    }

    .toast-container {
        top: calc(var(--topbar-height, 78px) + 8px);
        right: 8px;
        width: calc(100vw - 16px);
    }
}

.profile-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}.profile-data-list{display:grid}.profile-data-list>div{padding:13px 18px;display:grid;grid-template-columns:minmax(120px,.8fr) minmax(0,1.2fr);gap:14px;border-bottom:1px solid var(--border)}.profile-data-list span{color:var(--muted);font-size:.82rem}.profile-data-list strong{color:var(--navy-900);overflow-wrap:anywhere}@media(max-width:850px){.profile-summary-grid{grid-template-columns:1fr}}@media(max-width:520px){.profile-data-list>div{grid-template-columns:1fr;gap:4px}}


/* V2.2.1 — colaboradores compactos e formulário em modal */
.colaborador-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20000;
    padding: 18px;
    display: grid;
    place-items: center;
    background: rgba(2, 19, 34, .68);
    backdrop-filter: blur(3px);
}

.colaborador-modal-backdrop[hidden] {
    display: none !important;
}

.colaborador-modal-dialog {
    width: min(1050px, 96vw);
    height: min(820px, 94vh);
    overflow: hidden;
    border-radius: 18px;
    background: #f5f8fa;
    box-shadow: 0 28px 85px rgba(0,0,0,.36);
}

.colaborador-modal-dialog iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: #f5f8fa;
}

.modal-form-header {
    padding: 14px 18px;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    color: #fff;
    background: linear-gradient(135deg, #082b55, #087044);
}

.modal-form-header h1 {
    margin: 2px 0 0;
    color: #fff;
    font-size: 1.15rem;
}

.modal-form-header .eyebrow {
    color: rgba(255,255,255,.72);
}

.modal-x-button {
    width: 38px;
    height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 10px;
    color: #fff;
    background: rgba(255,255,255,.10);
    cursor: pointer;
    font-size: 1.65rem;
    line-height: 1;
}

.modal-x-button:hover {
    background: rgba(255,255,255,.20);
}

.auth-main .colaborador-compact-form {
    width: auto;
    margin: 12px;
    padding: 14px 16px 76px;
    border-radius: 14px;
}

.colaborador-compact-form .form-section-title {
    margin: 14px 0 8px;
    padding-bottom: 6px;
    font-size: .88rem;
}

.colaborador-compact-form .form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px 11px;
}

.colaborador-compact-form .field {
    gap: 3px;
}

.colaborador-compact-form .field label {
    font-size: .72rem;
}

.colaborador-compact-form input,
.colaborador-compact-form select,
.colaborador-compact-form textarea {
    min-height: 36px;
    padding: 7px 9px;
    font-size: .82rem;
}

.colaborador-compact-form textarea {
    min-height: 66px;
}

.colaborador-compact-form .field-span-2 {
    grid-column: span 2;
}

.compact-sticky-actions {
    margin: 0;
    padding: 10px 18px;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(8px);
}

.link-button {
    padding: 0;
    border: 0;
    color: var(--green-700);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.data-table td,
.data-table th {
    padding-top: 9px;
    padding-bottom: 9px;
}

.stats-grid .stat-card {
    min-height: 95px;
    padding: 14px 16px;
}

.stats-grid .stat-card strong {
    font-size: 1.65rem;
}

@media (max-width: 820px) {
    .colaborador-modal-backdrop {
        padding: 0;
    }

    .colaborador-modal-dialog {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

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

@media (max-width: 520px) {
    .colaborador-compact-form .form-grid {
        grid-template-columns: 1fr;
    }

    .colaborador-compact-form .field-span-2 {
        grid-column: span 1;
    }
}


/* ==========================================================
   V2.2.2 — COLABORADORES REALMENTE COMPACTOS
   ========================================================== */

.compact-page-head {
    margin-bottom: 12px;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.compact-page-head h1 {
    margin: 1px 0 0;
    color: var(--navy-900);
    font-size: 1.25rem;
}

.compact-summary {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.compact-summary span {
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: #f8fafb;
    font-size: .72rem;
}

.compact-summary strong {
    color: var(--navy-900);
    font-size: .85rem;
}

.compact-summary .summary-active {
    color: #176b3a;
    border-color: #b7ddc2;
    background: #edf9f1;
}

.btn-compact {
    min-height: 34px;
    padding: 7px 11px;
    font-size: .78rem;
}

.compact-list-panel {
    padding: 0;
    overflow: hidden;
}

.compact-filterbar {
    padding: 10px 12px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 155px auto auto;
    gap: 8px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: #f8fafb;
}

.compact-filterbar input,
.compact-filterbar select {
    min-height: 34px;
    padding: 6px 9px;
    font-size: .79rem;
}

.compact-list-panel .data-table th {
    padding: 8px 10px;
    font-size: .69rem;
}

.compact-list-panel .data-table td {
    padding: 7px 10px;
    font-size: .78rem;
    line-height: 1.18;
}

.compact-list-panel .data-table td strong {
    font-size: .8rem;
}

.compact-list-panel .data-table td small {
    margin-top: 2px;
    font-size: .66rem;
}

.compact-list-panel .row-actions {
    white-space: nowrap;
}

.cell-center {
    text-align: center;
}

.count-badge {
    min-width: 25px;
    height: 25px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: var(--navy-900);
    background: #e9f1f5;
    font-weight: 900;
}

/* Modal menor e limpo */
.colaborador-modal-backdrop {
    padding: 18px !important;
}

.colaborador-modal-dialog {
    width: min(880px, 96vw) !important;
    height: min(650px, 92vh) !important;
    border-radius: 16px !important;
    background: #fff !important;
}

.standalone-modal-body {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    color: #263746;
    background: #f4f7f9;
    font-family: Arial, Helvetica, sans-serif;
}

.standalone-collaborator-modal {
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

.collaborator-modal-header {
    min-height: 60px;
    padding: 10px 14px 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fff;
    background: linear-gradient(135deg, #082d58, #087046);
}

.collaborator-modal-header h1 {
    margin: 2px 0 0;
    color: #fff;
    font-size: 1.05rem;
}

.collaborator-modal-header .eyebrow {
    color: rgba(255,255,255,.72);
    font-size: .63rem;
}

.modal-x-button {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 1.45rem;
}

.tabbed-collaborator-form {
    min-height: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    background: #fff;
}

.form-tabs {
    padding: 9px 12px 0;
    display: flex;
    gap: 5px;
    border-bottom: 1px solid #dce5ea;
    background: #f6f9fa;
}

.form-tab {
    padding: 8px 12px;
    border: 0;
    border-bottom: 3px solid transparent;
    color: #617381;
    background: transparent;
    cursor: pointer;
    font-size: .76rem;
    font-weight: 800;
}

.form-tab.is-active {
    color: #075d3e;
    border-bottom-color: #07945f;
}

.form-tab-content {
    min-height: 0;
    padding: 14px 16px;
    display: none;
    overflow-y: auto;
}

.form-tab-content.is-active {
    display: block;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px 11px;
}

.modal-form-grid .field {
    display: grid;
    gap: 3px;
}

.modal-form-grid .field label {
    color: #4c6170;
    font-size: .68rem;
    font-weight: 800;
}

.modal-form-grid input,
.modal-form-grid select,
.modal-form-grid textarea {
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    box-sizing: border-box;
    border: 1px solid #cfdbe2;
    border-radius: 8px;
    color: #173149;
    background: #fff;
    font-size: .78rem;
}

.modal-form-grid textarea {
    min-height: 68px;
    resize: vertical;
}

.modal-form-grid .span-2 {
    grid-column: span 2;
}

.modal-form-grid .span-3 {
    grid-column: span 3;
}

.modal-form-footer {
    min-height: 55px;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #dce5ea;
    background: #f8fafb;
}

.tab-help {
    color: #758794;
    font-size: .7rem;
}

.compact-errors {
    margin: 8px 12px 0;
    padding: 8px 10px;
    font-size: .75rem;
}

@media (max-width: 900px) {
    .compact-page-head {
        grid-template-columns: 1fr auto;
    }

    .compact-summary {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .compact-filterbar {
        grid-template-columns: 1fr 145px auto;
    }
}

@media (max-width: 700px) {
    .colaborador-modal-backdrop {
        padding: 0 !important;
    }

    .colaborador-modal-dialog {
        width: 100vw !important;
        height: 100vh !important;
        border-radius: 0 !important;
    }

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

    .modal-form-grid .span-3 {
        grid-column: span 2;
    }

    .compact-filterbar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .modal-form-grid {
        grid-template-columns: 1fr;
    }

    .modal-form-grid .span-2,
    .modal-form-grid .span-3 {
        grid-column: span 1;
    }

    .form-tab {
        flex: 1;
        padding-left: 5px;
        padding-right: 5px;
        font-size: .68rem;
    }
}


/* ==========================================================
   V2.2.3 — BOTÃO SALVAR SEMPRE VISÍVEL
   ========================================================== */

.standalone-modal-body {
    height: 100vh !important;
    min-height: 0 !important;
}

.standalone-collaborator-modal {
    height: 100vh !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.collaborator-modal-header {
    flex: 0 0 60px !important;
}

.compact-errors {
    flex: 0 0 auto;
}

.collaborator-save-form {
    min-height: 0 !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.collaborator-save-form .form-tabs {
    flex: 0 0 auto !important;
}

.collaborator-save-form .form-tab-content {
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    padding-bottom: 22px !important;
}

.collaborator-save-form .form-tab-content.is-active {
    display: block !important;
}

.modal-form-footer {
    min-height: 64px !important;
    flex: 0 0 64px !important;
    position: relative !important;
    bottom: auto !important;
    z-index: 100 !important;
    box-sizing: border-box !important;
    border-top: 1px solid #cbd9e1 !important;
    background: #ffffff !important;
    box-shadow: 0 -8px 22px rgba(8,43,85,.09) !important;
}

.collaborator-save-button {
    min-width: 170px !important;
    min-height: 40px !important;
    padding: 9px 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: #087046 !important;
    cursor: pointer !important;
    font-size: .84rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

.collaborator-save-button:hover {
    background: #065b39 !important;
}

@media (max-height: 560px) {
    .collaborator-modal-header {
        flex-basis: 50px !important;
        min-height: 50px !important;
    }

    .modal-form-footer {
        min-height: 54px !important;
        flex-basis: 54px !important;
    }

    .form-tabs {
        padding-top: 4px !important;
    }

    .form-tab {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }
}

@media (max-width: 480px) {
    .tab-help {
        display: none !important;
    }

    .modal-form-footer {
        justify-content: stretch !important;
    }

    .collaborator-save-button {
        width: 100% !important;
    }
}


/* ==========================================================
   V2.2.4 — SALVAR VISÍVEL NO TOPO, RODAPÉ E BOTÃO FLUTUANTE
   ========================================================== */

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header-save {
    min-height: 34px;
    padding: 7px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 9px;
    color: #075335;
    background: #ffffff;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 900;
}

.modal-header-save:hover {
    background: #edf9f2;
}

.modal-form-footer {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
}

.modal-form-footer .collaborator-save-button {
    min-width: 190px !important;
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    background: #087046 !important;
}

.modal-floating-save {
    display: none;
}

/* Se algum CSS antigo esconder o rodapé, este botão continua disponível. */
@media (max-height: 720px) {
    .modal-floating-save {
        min-width: 108px;
        min-height: 42px;
        padding: 9px 16px;
        position: fixed;
        right: 18px;
        bottom: 14px;
        z-index: 99999;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #ffffff;
        border-radius: 999px;
        color: #ffffff;
        background: #087046;
        box-shadow: 0 10px 28px rgba(0,0,0,.28);
        cursor: pointer;
        font-size: .82rem;
        font-weight: 900;
    }

    .modal-form-footer {
        padding-right: 145px !important;
    }
}

@media (max-width: 480px) {
    .modal-header-save {
        padding-left: 11px;
        padding-right: 11px;
    }

    .modal-floating-save {
        right: 10px;
        bottom: 10px;
    }
}


/* ==========================================================
   V2.2.5 — PERFIL DO COLABORADOR COMPACTO
   ========================================================== */

.compact-profile-head {
    margin-bottom: 10px;
    padding: 11px 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.compact-profile-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.compact-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #0a315f, #087047);
    font-size: 1rem;
    font-weight: 900;
}

.compact-profile-main h1 {
    margin: 1px 0 2px;
    color: var(--navy-900);
    font-size: 1.15rem;
    line-height: 1.15;
}

.compact-profile-main p {
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: .73rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-profile-status {
    display: flex;
    align-items: center;
}

.compact-profile-actions {
    display: flex;
    gap: 7px;
}

.compact-profile-metrics {
    margin-bottom: 10px;
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.compact-profile-metrics span {
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: #fff;
    font-size: .69rem;
}

.compact-profile-metrics strong {
    color: var(--navy-900);
    font-size: .77rem;
}

.compact-profile-grid {
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.compact-profile-grid > .panel {
    padding: 0;
    overflow: hidden;
}

.compact-panel-title,
.compact-section-head {
    min-height: 40px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    background: #f8fafb;
}

.compact-panel-title h2,
.compact-section-head h2 {
    margin: 0;
    color: var(--navy-900);
    font-size: .86rem;
}

.profile-data-list > div {
    padding: 7px 12px !important;
    grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr) !important;
    gap: 9px !important;
}

.profile-data-list span {
    font-size: .68rem !important;
}

.profile-data-list strong {
    font-size: .75rem !important;
}

.compact-section-head .btn {
    min-height: 31px;
    padding: 6px 9px;
    font-size: .72rem;
}

.compact-profile-grid + .panel,
.compact-profile-grid + .panel + .panel,
.compact-profile-grid + .panel + .panel + .panel {
    margin-top: 10px;
}

.compact-section-head + .table-wrap .data-table th {
    padding: 7px 9px;
    font-size: .66rem;
}

.compact-section-head + .table-wrap .data-table td {
    padding: 7px 9px;
    font-size: .74rem;
}

@media (max-width: 850px) {
    .compact-profile-head {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .compact-profile-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .compact-profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .compact-profile-head {
        grid-template-columns: 1fr;
    }

    .compact-profile-status {
        position: absolute;
        right: 18px;
    }

    .compact-profile-actions {
        justify-content: stretch;
    }

    .compact-profile-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .compact-profile-main p {
        white-space: normal;
    }

    .profile-data-list > div {
        grid-template-columns: 1fr !important;
        gap: 2px !important;
    }
}


/* ==========================================================
   V2.2.6 — CORREÇÃO DO PERFIL DO COLABORADOR
   ========================================================== */

.compact-profile-panel {
    min-height: 0 !important;
}

.compact-detail-section {
    margin-top: 10px !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.compact-detail-section .table-wrap {
    max-height: 245px;
    overflow: auto;
}

.compact-detail-section .data-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafb;
}

.compact-detail-section .data-table th,
.compact-detail-section .data-table td {
    padding: 7px 9px !important;
    font-size: .72rem !important;
}

.compact-detail-section .data-table td a {
    font-size: .71rem;
}

.compact-section-head {
    min-height: 40px !important;
    padding: 7px 10px !important;
}

.compact-section-head > h2 {
    margin: 0 !important;
    color: var(--navy-900);
    font-size: .84rem !important;
}

.compact-profile-grid .profile-data-list > div {
    min-height: 29px;
    box-sizing: border-box;
}


/* ==========================================================
   V2.3 — DENSIDADE GLOBAL / MAIS INFORMAÇÃO POR TELA
   ========================================================== */
.content-area { max-width: 1700px !important; }
.page-header { margin-bottom:10px !important; padding:10px 14px !important; }
.page-header h1 { margin:1px 0 2px !important; font-size:1.16rem !important; line-height:1.12 !important; }
.page-header p { margin:0 !important; font-size:.71rem !important; }
.eyebrow { font-size:.59rem !important; }

.panel { border-radius:11px !important; }
.panel-heading { min-height:38px !important; padding:7px 10px !important; }
.panel-heading h2 { font-size:.85rem !important; }
.form-panel { padding:12px !important; }
.form-section-title { margin:10px 0 6px !important; font-size:.8rem !important; }
.form-grid { gap:7px 9px !important; }
.field { gap:2px !important; }
.field label { font-size:.66rem !important; }
.field input,.field select,.field textarea {
    min-height:32px !important; padding:5px 7px !important; font-size:.75rem !important;
}
.field textarea { min-height:56px !important; }
.btn { min-height:32px !important; padding:6px 10px !important; font-size:.72rem !important; }
.data-table th { padding:6px 8px !important; font-size:.63rem !important; }
.data-table td { padding:6px 8px !important; font-size:.7rem !important; line-height:1.18 !important; }
.data-table td small { font-size:.61rem !important; }
.stats-grid { gap:8px !important; }
.stat-card { min-height:78px !important; padding:10px 12px !important; }
.stat-card span,.stat-card small { font-size:.63rem !important; }
.stat-card strong { font-size:1.32rem !important; }
.toolbar,.toolbar-wrap { gap:7px !important; padding:8px !important; }
.alert { padding:8px 10px !important; font-size:.72rem !important; }
.module-card { min-height:108px !important; padding:12px !important; }
.module-card h2 { font-size:.85rem !important; }
.module-card p,.module-card small { font-size:.67rem !important; }

/* Perfil ainda mais denso */
.compact-profile-head { margin-bottom:7px !important; padding:8px 11px !important; }
.compact-profile-metrics { margin-bottom:7px !important; }
.compact-profile-grid { gap:7px !important; margin-bottom:7px !important; }
.compact-detail-section { margin-top:7px !important; }
.profile-data-list > div { padding:5px 9px !important; min-height:25px !important; }
.compact-detail-section .table-wrap { max-height:190px !important; }

/* Modais do perfil */
.generic-profile-dialog {
    width:min(780px,94vw) !important;
    height:min(570px,88vh) !important;
}
.simple-modal-shell {
    height:100vh; display:flex; flex-direction:column; overflow:hidden; background:#f5f8fa;
}
.simple-modal-form-panel {
    margin:9px 10px 10px !important; flex:1 1 auto; min-height:0; overflow-y:auto;
}
.simple-modal-actions {
    position:sticky; bottom:-12px; margin:9px -12px -12px !important;
    padding:8px 12px !important; background:#fff; border-top:1px solid var(--border); z-index:10;
}
.modal-two-cols { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
.modal-three-cols { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
.compact-upload { min-height:76px !important; padding:10px !important; }
.compact-check { align-self:end; min-height:32px; }

/* menu lateral contínuo */
.app-layout { min-height:calc(100vh - var(--topbar-height,78px) - var(--footer-height,48px)); }

@media(max-width:700px){
 .modal-three-cols,.modal-two-cols{grid-template-columns:1fr !important;}
 .field-span-2{grid-column:span 1 !important;}
}


/* ==========================================================
   V2.3.1 — VOLTAR + MODAIS DE CADASTRO
   ========================================================== */

.prestacao-return-bar {
    margin: 0 0 8px;
    display: flex;
    align-items: center;
}

.prestacao-return-button {
    min-height: 31px !important;
    padding: 6px 10px !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    font-size: .72rem !important;
}

.prestacao-return-button .app-icon {
    width: 14px;
    height: 14px;
}

/* Modal global */
.app-form-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30000;
    padding: 18px;
    display: grid;
    place-items: center;
    background: rgba(2, 18, 31, .68);
    backdrop-filter: blur(3px);
}

.app-form-modal-backdrop[hidden] {
    display: none !important;
}

.app-form-modal-dialog {
    width: min(940px, 96vw);
    height: min(700px, 93vh);
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #f5f8fa;
    box-shadow: 0 28px 90px rgba(0,0,0,.38);
}

.app-form-modal-frame {
    width: 100%;
    height: 100%;
}

#app-form-modal-frame {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: #f5f8fa;
}

.app-form-modal-close {
    width: 36px;
    height: 36px;
    padding: 0;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 10px;
    color: #fff;
    background: #0a3159;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
}

.app-form-modal-close:hover {
    background: #087046;
}

/* Quando uma página normal é carregada dentro do iframe. */
body.app-modal-body {
    min-height: 100vh;
    overflow: auto;
    background: #f5f8fa;
}

body.app-modal-body .auth-main {
    min-height: 100vh !important;
    padding: 54px 12px 14px !important;
    display: block !important;
}

body.app-modal-body .footer {
    display: none !important;
}

body.app-modal-body .page-header {
    margin-bottom: 8px !important;
    padding: 9px 11px !important;
}

body.app-modal-body .page-header h1 {
    font-size: 1rem !important;
}

body.app-modal-body .form-panel {
    margin: 0 !important;
    padding: 11px !important;
}

body.app-modal-body .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 10px -11px -11px !important;
    padding: 8px 11px !important;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,.97);
}

@media (max-width: 700px) {
    .app-form-modal-backdrop {
        padding: 0;
    }

    .app-form-modal-dialog {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}


/* ==========================================================
   V2.4 — SISTEMA PROFISSIONAL DE MODAIS
   ========================================================== */

:root {
    --modal-navy: #102a43;
    --modal-navy-soft: #243b53;
    --modal-green: #16815d;
    --modal-green-dark: #116b4d;
    --modal-bg: #f4f7f9;
    --modal-surface: #ffffff;
    --modal-border: #dbe4ea;
    --modal-text: #243746;
    --modal-muted: #71808d;
}

/* Fundo */
.app-form-modal-backdrop,
.colaborador-modal-backdrop,
.generic-profile-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 30000 !important;
    padding: 24px !important;
    display: grid !important;
    place-items: center !important;
    background: rgba(12, 28, 43, .60) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

.app-form-modal-backdrop[hidden],
.colaborador-modal-backdrop[hidden],
.generic-profile-modal[hidden] {
    display: none !important;
}

/* Caixa */
.app-form-modal-dialog,
.colaborador-modal-dialog,
.generic-profile-dialog {
    width: min(980px, 96vw) !important;
    height: min(720px, 92vh) !important;
    position: relative !important;
    display: grid !important;
    grid-template-rows: 64px minmax(0, 1fr) !important;
    overflow: hidden !important;
    border: 1px solid rgba(255,255,255,.72) !important;
    border-radius: 18px !important;
    background: var(--modal-surface) !important;
    box-shadow:
        0 32px 80px rgba(7, 28, 45, .32),
        0 8px 24px rgba(7, 28, 45, .14) !important;
}

/* Cabeçalho externo do modal */
.app-form-modal-header {
    height: 64px;
    padding: 0 18px 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--modal-border);
    background: #ffffff;
}

.app-form-modal-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-form-modal-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--modal-green);
    background: #eaf6f1;
}

.app-form-modal-icon .app-icon {
    width: 19px;
    height: 19px;
}

.app-form-modal-kicker {
    display: block;
    margin-bottom: 2px;
    color: var(--modal-muted);
    font-size: .61rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.app-form-modal-header h2 {
    margin: 0;
    overflow: hidden;
    color: var(--modal-navy);
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-form-modal-close {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    position: static !important;
    flex: 0 0 36px;
    display: grid !important;
    place-items: center !important;
    border: 1px solid var(--modal-border) !important;
    border-radius: 10px !important;
    color: #5f6f7c !important;
    background: #f8fafb !important;
    box-shadow: none !important;
    cursor: pointer;
    font-size: 1.35rem !important;
    transition: .15s ease;
}

.app-form-modal-close:hover {
    color: #8f2727 !important;
    border-color: #efc2c2 !important;
    background: #fff2f2 !important;
}

.app-form-modal-content {
    min-height: 0;
    overflow: hidden;
    background: var(--modal-bg);
}

#app-form-modal-frame,
.colaborador-modal-dialog iframe,
.generic-profile-dialog iframe {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    border: 0 !important;
    background: var(--modal-bg) !important;
}

/* Páginas quando carregadas dentro do iframe */
body.app-modal-body {
    min-height: 100vh !important;
    margin: 0 !important;
    overflow: auto !important;
    color: var(--modal-text) !important;
    background: var(--modal-bg) !important;
}

body.app-modal-body .auth-main {
    min-height: 100vh !important;
    padding: 16px !important;
    display: block !important;
    background: var(--modal-bg) !important;
}

/* O título externo já informa o contexto. */
body.app-modal-body .page-header {
    display: none !important;
}

/* Cartão de formulário dentro do modal */
body.app-modal-body .form-panel,
body.app-modal-body .panel.form-panel {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 16px 16px 76px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    border: 1px solid var(--modal-border) !important;
    border-radius: 13px !important;
    background: var(--modal-surface) !important;
    box-shadow: 0 5px 18px rgba(22, 48, 67, .05) !important;
}

/* Títulos das seções */
body.app-modal-body .form-section-title {
    margin: 14px 0 8px !important;
    padding: 0 0 7px !important;
    border-bottom: 1px solid #edf1f4 !important;
    color: var(--modal-navy) !important;
    font-size: .78rem !important;
    font-weight: 850 !important;
}

/* Grade mais organizada */
body.app-modal-body .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px 12px !important;
}

body.app-modal-body .field {
    gap: 4px !important;
}

body.app-modal-body .field label {
    color: #546775 !important;
    font-size: .67rem !important;
    font-weight: 750 !important;
}

body.app-modal-body input,
body.app-modal-body select,
body.app-modal-body textarea {
    min-height: 36px !important;
    padding: 7px 9px !important;
    border: 1px solid #ccd8df !important;
    border-radius: 8px !important;
    color: #1f3444 !important;
    background: #fff !important;
    font-size: .77rem !important;
    box-shadow: inset 0 1px 1px rgba(12,31,46,.02) !important;
    outline: none !important;
}

body.app-modal-body input:focus,
body.app-modal-body select:focus,
body.app-modal-body textarea:focus {
    border-color: #78baa1 !important;
    box-shadow: 0 0 0 3px rgba(22,129,93,.10) !important;
}

body.app-modal-body textarea {
    min-height: 70px !important;
}

/* Upload */
body.app-modal-body .upload-zone {
    min-height: 100px !important;
    padding: 16px !important;
    border: 1.5px dashed #a9bcc7 !important;
    border-radius: 11px !important;
    color: #486170 !important;
    background: #f9fbfc !important;
}

body.app-modal-body .upload-zone:hover {
    border-color: var(--modal-green) !important;
    background: #f1faf6 !important;
}

/* Alertas */
body.app-modal-body .alert {
    margin: 0 0 10px !important;
    padding: 9px 11px !important;
    border-radius: 9px !important;
    font-size: .71rem !important;
}

/* Rodapé sempre visível e profissional */
body.app-modal-body .form-actions {
    min-height: 58px !important;
    margin: 14px -16px -76px !important;
    padding: 10px 16px !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 20 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    border-top: 1px solid var(--modal-border) !important;
    background: rgba(255,255,255,.98) !important;
    box-shadow: 0 -5px 16px rgba(28, 52, 69, .05) !important;
    backdrop-filter: blur(8px) !important;
}

body.app-modal-body .form-actions .btn {
    min-width: 110px !important;
    min-height: 36px !important;
    border-radius: 8px !important;
    font-size: .74rem !important;
    font-weight: 800 !important;
}

body.app-modal-body .form-actions .btn-primary {
    color: #fff !important;
    border-color: var(--modal-green) !important;
    background: var(--modal-green) !important;
}

body.app-modal-body .form-actions .btn-primary:hover {
    background: var(--modal-green-dark) !important;
}

body.app-modal-body .form-actions .btn-secondary {
    color: #435966 !important;
    border-color: #d4dfe5 !important;
    background: #f8fafb !important;
}

/* Remove elementos desnecessários dentro de modal */
body.app-modal-body .footer,
body.app-modal-body .sidebar,
body.app-modal-body .topbar,
body.app-modal-body .prestacao-return-bar {
    display: none !important;
}

/* Modais antigos de colaboradores recebem o mesmo aspecto */
.colaborador-modal-dialog,
.generic-profile-dialog {
    grid-template-rows: minmax(0,1fr) !important;
}

.colaborador-modal-dialog::before,
.generic-profile-dialog::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
    z-index: 2;
}

/* Standalone modals dos colaboradores */
.standalone-modal-body {
    color: var(--modal-text) !important;
    background: var(--modal-bg) !important;
}

.standalone-modal-body .collaborator-modal-header {
    min-height: 58px !important;
    padding: 0 16px 0 18px !important;
    color: var(--modal-navy) !important;
    border-bottom: 1px solid var(--modal-border) !important;
    background: #fff !important;
}

.standalone-modal-body .collaborator-modal-header h1 {
    color: var(--modal-navy) !important;
    font-size: 1rem !important;
}

.standalone-modal-body .collaborator-modal-header .eyebrow {
    color: var(--modal-muted) !important;
}

.standalone-modal-body .modal-x-button {
    color: #5f6f7c !important;
    border: 1px solid var(--modal-border) !important;
    background: #f8fafb !important;
}

.standalone-modal-body .modal-x-button:hover {
    color: #8f2727 !important;
    border-color: #efc2c2 !important;
    background: #fff2f2 !important;
}

.standalone-modal-body .form-tabs {
    padding: 8px 14px 0 !important;
    border-bottom: 1px solid var(--modal-border) !important;
    background: #f8fafb !important;
}

.standalone-modal-body .form-tab {
    padding: 8px 12px !important;
    color: #687a87 !important;
    border-bottom-width: 2px !important;
    font-size: .72rem !important;
}

.standalone-modal-body .form-tab.is-active {
    color: var(--modal-green) !important;
    border-bottom-color: var(--modal-green) !important;
}

.standalone-modal-body .modal-form-grid input,
.standalone-modal-body .modal-form-grid select,
.standalone-modal-body .modal-form-grid textarea {
    border-color: #ccd8df !important;
    border-radius: 8px !important;
}

.standalone-modal-body .modal-form-footer {
    border-top-color: var(--modal-border) !important;
    background: #fff !important;
    box-shadow: 0 -5px 16px rgba(28,52,69,.05) !important;
}

.standalone-modal-body .collaborator-save-button,
.standalone-modal-body .modal-header-save,
.standalone-modal-body .modal-floating-save {
    color: #fff !important;
    border-color: var(--modal-green) !important;
    background: var(--modal-green) !important;
    box-shadow: none !important;
}

.standalone-modal-body .modal-header-save {
    color: var(--modal-green) !important;
    border: 1px solid #bcdccc !important;
    background: #f3fbf7 !important;
}

/* Responsivo */
@media (max-width: 800px) {
    .app-form-modal-backdrop,
    .colaborador-modal-backdrop,
    .generic-profile-modal {
        padding: 0 !important;
    }

    .app-form-modal-dialog,
    .colaborador-modal-dialog,
    .generic-profile-dialog {
        width: 100vw !important;
        height: 100vh !important;
        border-radius: 0 !important;
    }

    body.app-modal-body .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 520px) {
    .app-form-modal-header {
        height: 58px;
        padding-left: 12px;
        padding-right: 10px;
    }

    .app-form-modal-dialog {
        grid-template-rows: 58px minmax(0,1fr) !important;
    }

    .app-form-modal-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    body.app-modal-body .auth-main {
        padding: 10px !important;
    }

    body.app-modal-body .form-grid {
        grid-template-columns: 1fr !important;
    }

    body.app-modal-body .field-span-2 {
        grid-column: span 1 !important;
    }
}


/* V3 — Contagem regressiva eleitoral */
.election-countdown{min-width:112px;padding:5px 9px;display:flex;align-items:center;justify-content:center;gap:7px;border-left:1px solid rgba(255,255,255,.14);color:rgba(255,255,255,.96);white-space:nowrap}
.election-countdown>span{display:grid;gap:1px}.election-countdown strong{font-size:.78rem;font-variant-numeric:tabular-nums}.election-countdown small{font-size:.58rem;opacity:.76}.election-countdown .app-icon{width:16px;height:16px}.election-countdown.is-today{background:rgba(255,255,255,.12);border-radius:9px}
@media(max-width:1180px){.election-countdown small{display:none}.election-countdown{min-width:74px}}
@media(max-width:720px){.election-countdown{display:none}}


/* ==========================================================
   NOTIFICAÇÕES DA AGENDA — V3.0.1
   ========================================================== */
.agenda-toast-container {
    width: min(380px, calc(100vw - 24px));
    position: fixed;
    top: calc(var(--topbar-height, 78px) + 12px);
    right: 12px;
    z-index: 40000;
    display: grid;
    gap: 9px;
    pointer-events: none;
}

.agenda-toast {
    padding: 12px 12px 11px;
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) 28px;
    gap: 10px;
    align-items: start;
    border: 1px solid #d7e3e9;
    border-radius: 13px;
    color: #173149;
    background: rgba(255,255,255,.98);
    box-shadow: 0 16px 40px rgba(8,43,85,.20);
    pointer-events: auto;
    animation: agenda-toast-in .24s ease both;
}

.agenda-toast.is-leaving {
    animation: agenda-toast-out .22s ease both;
}

.agenda-toast-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #eef7f2;
    font-size: 1rem;
}

.agenda-toast-content {
    min-width: 0;
}

.agenda-toast-content strong {
    display: block;
    color: #102a43;
    font-size: .82rem;
}

.agenda-toast-content span {
    display: block;
    margin-top: 2px;
    color: #16815d;
    font-size: .68rem;
    font-weight: 800;
}

.agenda-toast-content p {
    margin: 5px 0 0;
    color: #677986;
    font-size: .72rem;
    line-height: 1.35;
}

.agenda-toast-close {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: #6b7c88;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
}

.agenda-toast-close:hover {
    background: #eef3f6;
}

@keyframes agenda-toast-in {
    from { opacity: 0; transform: translateX(20px) scale(.98); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes agenda-toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(24px); }
}

@media (max-width: 600px) {
    .agenda-toast-container {
        top: calc(var(--topbar-height, 78px) + 8px);
        right: 8px;
        width: calc(100vw - 16px);
    }
}


/* ==========================================================
   V3.2 — RESPONSIVO COMPLETO + TOPO + LOGIN
   ========================================================== */

:root {
    --topbar-height: 112px;
}

/* Utilitário acessível */
.sr-only {
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    position: absolute !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Topo: primeira linha + faixa de status sempre visível */
.topbar {
    height: var(--topbar-height) !important;
    min-height: var(--topbar-height) !important;
    padding: 8px clamp(12px, 2.2vw, 28px) 0 !important;
    display: grid !important;
    grid-template-columns: minmax(150px, auto) minmax(0, 1fr) !important;
    grid-template-rows: 68px 36px !important;
    gap: 0 14px !important;
    align-items: center !important;
    overflow: visible !important;
}

.topbar .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.topbar .brand img {
    width: 46px !important;
    height: 46px !important;
}

.topbar .brand strong {
    font-size: .9rem !important;
}

.topbar .brand small {
    font-size: .61rem !important;
}

.topbar-actions {
    grid-column: 2;
    grid-row: 1;
    min-width: 0 !important;
    justify-content: flex-end;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scrollbar-width: none !important;
}

.topbar-actions::-webkit-scrollbar {
    display: none;
}

.topbar-status-strip {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,.10);
}

.election-countdown,
.brasilia-clock {
    min-width: 0 !important;
    height: 30px;
    padding: 3px 9px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    border: 0 !important;
    border-radius: 8px;
    color: #fff !important;
    background: rgba(255,255,255,.07);
}

.election-countdown > span,
.brasilia-clock > span {
    display: flex !important;
    align-items: baseline;
    gap: 5px !important;
}

.election-countdown strong,
.brasilia-clock strong {
    color: #fff !important;
    font-size: .72rem !important;
    line-height: 1 !important;
    font-variant-numeric: tabular-nums;
}

.election-countdown small,
.brasilia-clock small {
    display: inline !important;
    color: rgba(255,255,255,.72) !important;
    font-size: .56rem !important;
    line-height: 1 !important;
}

.election-countdown .app-icon,
.brasilia-clock .app-icon {
    width: 14px !important;
    height: 14px !important;
}

.election-countdown.is-today {
    background: rgba(255, 209, 102, .18) !important;
}

/* botão de menu móvel */
.mobile-topbar-menu {
    display: none;
}

/* Login: botão de olho funcional e profissional */
.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 52px !important;
}

.toggle-password {
    width: 38px;
    height: 38px;
    padding: 0 !important;
    position: absolute !important;
    top: 50% !important;
    right: 7px !important;
    transform: translateY(-50%) !important;
    display: grid !important;
    place-items: center !important;
    border: 1px solid transparent !important;
    border-radius: 9px !important;
    color: #526a79 !important;
    background: transparent !important;
    cursor: pointer;
}

.toggle-password:hover,
.toggle-password:focus-visible {
    color: var(--green-700) !important;
    border-color: #cfe1d7 !important;
    background: #f2f8f5 !important;
    outline: none !important;
}

.password-eye {
    width: 19px;
    height: 19px;
}

.toggle-password .password-eye-closed {
    display: none;
}

.toggle-password.is-visible .password-eye-open {
    display: none;
}

.toggle-password.is-visible .password-eye-closed {
    display: block;
}

/* Cards e conteúdos nunca estouram viewport */
img,
video,
canvas,
svg {
    max-width: 100%;
}

.panel,
.page-header,
.context-banner,
.module-card,
.selection-card,
.stat-card,
.form-panel,
.login-card,
.auth-shell,
.content-area {
    min-width: 0;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Tablets */
@media (max-width: 1100px) {
    .topbar {
        grid-template-columns: 64px minmax(0, 1fr) !important;
    }

    .brand span {
        display: none !important;
    }

    .topbar-actions > a,
    .topbar-admin-button {
        min-width: 38px !important;
        padding: 6px !important;
    }

    .topbar-actions > a span,
    .topbar-admin-button > span:not(.app-icon) {
        display: none;
    }

    .user-chip > span {
        display: none !important;
    }

    .user-chip {
        padding-left: 8px !important;
        border-left: 0 !important;
    }
}

/* Mobile completo */
@media (max-width: 760px) {
    :root {
        --topbar-height: 100px;
        --footer-height: 46px;
    }

    body {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .topbar {
        padding: 6px 10px 0 !important;
        grid-template-columns: minmax(0, 1fr) 42px !important;
        grid-template-rows: 56px 38px !important;
        gap: 0 8px !important;
    }

    .topbar .brand {
        grid-column: 1;
        grid-row: 1;
    }

    .topbar .brand img {
        width: 42px !important;
        height: 42px !important;
    }

    .mobile-topbar-menu {
        width: 40px;
        height: 40px;
        padding: 9px;
        grid-column: 2;
        grid-row: 1;
        display: grid;
        align-content: center;
        gap: 4px;
        border: 1px solid rgba(255,255,255,.18);
        border-radius: 10px;
        color: #fff;
        background: rgba(255,255,255,.08);
        cursor: pointer;
    }

    .mobile-topbar-menu span {
        width: 100%;
        height: 2px;
        display: block;
        border-radius: 999px;
        background: currentColor;
        transition: transform .18s ease, opacity .18s ease;
    }

    body.topbar-menu-open .mobile-topbar-menu span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    body.topbar-menu-open .mobile-topbar-menu span:nth-child(2) {
        opacity: 0;
    }

    body.topbar-menu-open .mobile-topbar-menu span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .topbar-actions {
        width: min(340px, calc(100vw - 20px));
        max-height: calc(100vh - 112px);
        padding: 10px;
        position: fixed !important;
        top: 104px;
        right: 10px;
        z-index: 1400;
        display: none !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px !important;
        overflow-y: auto !important;
        border: 1px solid rgba(255,255,255,.16);
        border-radius: 14px;
        background: #082b55;
        box-shadow: 0 18px 50px rgba(0,0,0,.28);
    }

    body.topbar-menu-open .topbar-actions {
        display: grid !important;
    }

    .topbar-actions > a,
    .topbar-admin-button {
        min-width: 0 !important;
        min-height: 58px !important;
        padding: 8px 5px !important;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        color: #fff !important;
        border-radius: 10px;
        background: rgba(255,255,255,.06);
        font-size: .68rem !important;
    }

    .topbar-actions > a span,
    .topbar-admin-button > span {
        display: inline !important;
    }

    .user-chip {
        display: none !important;
    }

    .logout-link {
        border: 0 !important;
    }

    .topbar-more {
        position: static !important;
    }

    .topbar-dropdown {
        width: calc(100% - 20px) !important;
        max-height: 55vh;
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        overflow-y: auto;
    }

    .topbar-status-strip {
        grid-column: 1 / -1;
        grid-row: 2;
        height: 38px;
        justify-content: space-between;
        gap: 5px;
    }

    .election-countdown,
    .brasilia-clock {
        flex: 1 1 50%;
        height: 31px;
        padding: 3px 7px !important;
        justify-content: center !important;
    }

    .election-countdown small {
        display: inline !important;
    }

    .brasilia-clock small {
        display: none !important;
    }

    .election-countdown strong,
    .brasilia-clock strong {
        font-size: .69rem !important;
    }

    /* menu lateral móvel */
    .sidebar {
        width: min(290px, 86vw) !important;
        min-width: min(290px, 86vw) !important;
        top: var(--topbar-height) !important;
        height: calc(100vh - var(--topbar-height) - var(--footer-height)) !important;
        transform: translateX(-105%);
    }

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

    .mobile-sidebar-button {
        top: calc(var(--topbar-height) + 8px) !important;
        left: 8px !important;
    }

    .app-layout,
    body.sidebar-collapsed .app-layout {
        padding: 58px 10px 18px !important;
    }

    .app-main {
        width: calc(100% - 20px) !important;
        padding: 18px 0 64px !important;
    }

    .content-area {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* títulos/ações */
    .page-header,
    .compact-page-head,
    .compact-profile-head,
    .context-banner {
        padding: 11px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 9px !important;
    }

    .page-header > div,
    .compact-page-head > div,
    .compact-profile-head > div {
        min-width: 0;
    }

    .page-header h1,
    .compact-page-head h1,
    .compact-profile-head h1 {
        font-size: 1.08rem !important;
        overflow-wrap: anywhere;
    }

    .inline-actions,
    .page-header .inline-actions,
    .compact-head-actions,
    .compact-profile-actions,
    .form-actions {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 7px !important;
    }

    .inline-actions .btn,
    .compact-head-actions .btn,
    .compact-profile-actions .btn,
    .form-actions .btn {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* grades */
    .stats-grid,
    .dashboard-stats,
    .dashboard-columns,
    .selection-grid,
    .profile-grid,
    .compact-profile-grid,
    .profile-summary-grid,
    .form-grid,
    .modal-form-grid,
    .report-grid,
    .module-grid {
        grid-template-columns: 1fr !important;
    }

    .stat-card {
        min-height: 76px !important;
        padding: 10px 11px !important;
    }

    .stat-card strong {
        font-size: 1.25rem !important;
    }

    .panel,
    .form-panel {
        border-radius: 10px !important;
    }

    .panel-heading,
    .compact-section-head {
        padding: 8px 10px !important;
        align-items: flex-start !important;
    }

    /* formulários */
    .field,
    .form-grid .field {
        grid-column: 1 / -1 !important;
    }

    .field input,
    .field select,
    .field textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        font-size: 16px !important; /* evita zoom automático no iPhone */
    }

    .checkbox-line {
        align-items: flex-start !important;
    }

    /* tabelas: scroll horizontal seguro */
    .data-table {
        width: max-content;
        min-width: 680px;
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
    }

    .row-actions {
        white-space: nowrap;
    }

    /* modais ocupam a tela toda */
    .app-form-modal-backdrop,
    .colaborador-modal-backdrop,
    .generic-profile-modal {
        padding: 0 !important;
    }

    .app-form-modal-dialog,
    .colaborador-modal-dialog,
    .generic-profile-dialog {
        width: 100vw !important;
        height: 100dvh !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
    }

    body.app-modal-body .auth-main {
        padding: 8px !important;
    }

    body.app-modal-body .form-panel {
        padding: 10px 10px 68px !important;
    }

    /* login mobile */
    .auth-main {
        min-height: calc(100dvh - var(--footer-height)) !important;
        padding: 14px 10px 60px !important;
        place-items: start center !important;
    }

    .auth-shell {
        width: min(100%, 470px) !important;
        display: block !important;
        overflow: hidden;
        border-radius: 16px !important;
        box-shadow: 0 14px 45px rgba(0,0,0,.28) !important;
    }

    .auth-brand {
        min-height: 0 !important;
        padding: 18px 18px 16px !important;
        align-items: center !important;
        text-align: center;
    }

    .auth-brand img {
        width: 110px !important;
        max-height: 92px !important;
        margin: 0 auto 9px !important;
        padding: 7px !important;
        border-radius: 13px !important;
    }

    .auth-brand h1 {
        margin-bottom: 4px !important;
        font-size: 1.35rem !important;
    }

    .auth-brand p {
        font-size: .75rem !important;
    }

    .login-card {
        padding: 20px 16px 18px !important;
    }

    .login-heading {
        margin-bottom: 16px !important;
    }

    .login-heading h2 {
        font-size: 1.35rem !important;
    }

    .login-heading p {
        margin-top: 7px;
        font-size: .8rem !important;
    }

    .login-card .field {
        margin-bottom: 13px !important;
    }

    .login-card .field input {
        min-height: 46px !important;
        font-size: 16px !important;
    }

    .login-card .checkbox-line {
        margin: 4px 0 16px !important;
        font-size: .78rem !important;
    }

    /* rodapé móvel */
    .footer {
        height: var(--footer-height) !important;
        min-height: var(--footer-height) !important;
    }

    .footer-content {
        padding: 0 8px;
        font-size: .62rem !important;
    }
}

/* celulares muito pequenos */
@media (max-width: 390px) {
    .topbar-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .election-countdown small {
        display: none !important;
    }

    .inline-actions,
    .page-header .inline-actions,
    .compact-head-actions,
    .compact-profile-actions,
    .form-actions {
        grid-template-columns: 1fr !important;
    }

    .auth-brand p {
        display: none;
    }
}

/* orientação paisagem no celular */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    :root {
        --topbar-height: 92px;
    }

    .topbar {
        grid-template-rows: 52px 34px !important;
    }

    .topbar-actions {
        top: 96px;
        max-height: calc(100vh - 104px);
    }

    .auth-brand {
        display: none !important;
    }

    .auth-shell {
        max-width: 520px !important;
    }
}


/* ===== V3.3 MURAL ELETRONICO ===== */
.nav-mural{position:relative}.nav-mural b,.nav-notification b{min-width:17px;height:17px;padding:0 4px;display:grid;place-items:center;position:absolute;top:2px;right:2px;border-radius:999px;background:#ef4444;color:#fff;font-size:.58rem;line-height:1}
.topbar-mural-status{height:30px;padding:3px 9px;display:flex;align-items:center;gap:6px;border-radius:8px;background:rgba(255,255,255,.09);color:#fff;text-decoration:none}.topbar-mural-status>span{display:flex;align-items:baseline;gap:5px}.topbar-mural-status strong{font-size:.72rem;color:#fff}.topbar-mural-status small{font-size:.56rem;color:rgba(255,255,255,.76)}.topbar-mural-status small b{color:#fff}.topbar-mural-status .app-icon{width:14px;height:14px}
.mural-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}.mural-name,.mural-last-check{font-size:1rem!important}.mural-process-panel{margin-bottom:14px}.mural-process-list{display:flex;flex-wrap:wrap;gap:9px;padding:12px}.mural-process{padding:9px 11px;display:flex;align-items:center;gap:8px;border:1px solid #dce7ef;border-radius:10px;background:#f8fbfd}.mural-process-type,.mural-tag{padding:3px 6px;border-radius:999px;background:#e7f7ef;color:#087a45;font-size:.65rem;font-weight:800}.mural-process small{color:#687b89}.mural-cards{display:grid;gap:9px;padding:12px}.mural-card{padding:12px;border:1px solid #dde6ed;border-radius:11px;background:#fff}.mural-card.is-unread{border-left:4px solid #16a05d;background:#fbfffd}.mural-card-top{display:flex;justify-content:space-between;gap:10px;color:#647582;font-size:.72rem}.mural-card h3{margin:8px 0 4px;font-size:1rem}.mural-process-number{font-size:.72rem;font-weight:700;color:#31536c}.mural-empty{padding:34px 18px;text-align:center;color:#647582}.mural-empty strong{display:block;color:#17344c;margin-bottom:5px}.mural-live-dot{font-size:.7rem;color:#087a45;font-weight:700}.mural-detail{padding:16px}.mural-detail dl{display:grid;grid-template-columns:120px 1fr;gap:7px 12px}.mural-detail dt{font-size:.72rem;font-weight:800;color:#5c7180}.mural-detail dd{margin:0}.mural-detail-text{margin:16px 0;padding:14px;border-radius:10px;background:#f6f9fb;line-height:1.55}
@media(max-width:1100px){.mural-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.topbar-mural-status{flex:1 1 33%;justify-content:center;padding:3px 5px}.topbar-mural-status small{display:none}.topbar-status-strip{gap:4px}.election-countdown,.brasilia-clock{flex:1 1 33%}.mural-summary-grid{grid-template-columns:1fr 1fr}.mural-process-list{display:grid}.mural-process{align-items:flex-start;flex-wrap:wrap}.mural-process strong{width:100%;overflow-wrap:anywhere}.mural-detail dl{grid-template-columns:1fr}.mural-detail dt{margin-top:7px}}
@media(max-width:430px){.mural-summary-grid{grid-template-columns:1fr}.topbar-mural-status strong{font-size:.66rem}.election-countdown strong,.brasilia-clock strong{font-size:.64rem!important}}


/* ===== V3.4.1 MURAL CRON / STATUS ===== */
.topbar-mural-status {
    max-width: 330px;
}

.topbar-mural-main {
    display: flex !important;
    align-items: baseline;
    gap: 5px;
}

.topbar-mural-state {
    padding: 3px 6px;
    border-radius: 999px;
    color: rgba(255,255,255,.72);
    background: rgba(255,255,255,.08);
    font-size: .52rem;
    font-weight: 800;
    white-space: nowrap;
}

.topbar-mural-state.is-active {
    color: #bff4d7;
    background: rgba(20, 180, 100, .16);
}

.mural-operational-banner {
    margin-bottom: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #dce7ef;
    border-radius: 11px;
    background: #f7fafc;
}

.mural-operational-banner.is-active {
    border-color: #cbe8d8;
    background: #f3fbf7;
}

.mural-operational-banner > div:first-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mural-operational-banner strong {
    color: #17344c;
    font-size: .78rem;
}

.mural-operational-banner span,
.mural-operational-time {
    color: #687b89;
    font-size: .68rem;
}

@media (max-width: 900px) {
    .topbar-mural-state {
        display: none;
    }
}

@media (max-width: 760px) {
    .mural-operational-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .mural-operational-time {
        padding-top: 7px;
        border-top: 1px solid #e5edf2;
    }
}


/* ===== V3.6 MURAL ALERTS ===== */
.mural-alert-container {
    width: min(390px, calc(100vw - 24px));
    position: fixed;
    top: calc(var(--topbar-height, 112px) + 12px);
    right: 12px;
    z-index: 50000;
    display: grid;
    gap: 9px;
    pointer-events: none;
}

.mural-alert-card {
    padding: 12px;
    display: grid;
    grid-template-columns: 36px minmax(0,1fr) 28px;
    grid-template-areas:
        "icon copy x"
        "icon open open";
    gap: 7px 10px;
    border: 1px solid #cfe3d8;
    border-radius: 13px;
    background: rgba(255,255,255,.99);
    box-shadow: 0 18px 50px rgba(9, 43, 70, .22);
    pointer-events: auto;
}

.mural-alert-icon {
    grid-area: icon;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #0c7048;
    background: #eaf8f1;
    font-size: 1rem;
}

.mural-alert-copy {
    grid-area: copy;
    min-width: 0;
}

.mural-alert-copy span {
    display: block;
    color: #16815d;
    font-size: .62rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.mural-alert-copy strong {
    margin-top: 2px;
    display: block;
    color: #102a43;
    font-size: .82rem;
    line-height: 1.25;
}

.mural-alert-copy small {
    margin-top: 3px;
    display: block;
    color: #687b89;
    font-size: .68rem;
}

.mural-alert-x {
    grid-area: x;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    color: #6d7d88;
    background: transparent;
    cursor: pointer;
}

.mural-alert-x:hover {
    background: #eef3f6;
}

.mural-alert-open {
    grid-area: open;
    justify-self: end;
    padding: 6px 9px;
    border-radius: 8px;
    color: #fff;
    background: #16815d;
    text-decoration: none;
    font-size: .68rem;
    font-weight: 800;
}

@media (max-width: 600px) {
    .mural-alert-container {
        top: calc(var(--topbar-height, 100px) + 8px);
        right: 8px;
        width: calc(100vw - 16px);
    }
}


/* ===== V3.7 PROCESS MONITOR ===== */
.topbar-process-status {
    min-width: 170px;
}

.process-source-note {
    margin: 0 0 14px;
    padding: 10px 12px;
    display: flex;
    gap: 8px 12px;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid #cfe3d8;
    border-radius: 11px;
    background: #f4fbf7;
    color: #335f50;
    font-size: .74rem;
}

.process-source-note strong {
    color: #0f7149;
}

.process-movement-list {
    display: grid;
    gap: 8px;
    padding: 10px;
}

.process-movement {
    padding: 10px 11px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e1e8ed;
    border-radius: 11px;
    background: #fff;
}

.process-movement.is-unread {
    border-color: #a7d8c1;
    box-shadow: inset 3px 0 0 #16815d;
    background: #fbfffd;
}

.process-movement-main {
    min-width: 0;
}

.process-movement-top,
.process-movement-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.process-kind {
    color: #536d7a;
    font-size: .68rem;
    font-weight: 750;
}

.process-movement h3 {
    margin: 5px 0 4px;
    color: #17324d;
    font-size: .83rem;
    line-height: 1.25;
}

.process-movement-meta {
    color: #71828d;
    font-size: .66rem;
}

.process-alert-card .mural-alert-icon {
    color: #0c5f9b;
    background: #edf7ff;
}

.process-alert-card .mural-alert-copy span {
    color: #0c6da7;
}

.process-alert-card .mural-alert-open {
    background: #0c6da7;
}

@media (max-width: 760px) {
    .topbar-process-status {
        min-width: 0;
    }

    .process-movement {
        align-items: stretch;
        flex-direction: column;
    }

    .process-movement .inline-actions {
        justify-content: flex-start;
    }
}


/* ===== V3.8 LIMITE DE GASTOS ===== */
.topbar-spending-status {
    min-width: 190px;
    padding: 7px 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 11px;
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,.08);
}
.topbar-spending-status span { min-width: 0; display: grid; }
.topbar-spending-status strong { font-size: .76rem; line-height: 1.1; }
.topbar-spending-status small { margin-top: 2px; font-size: .58rem; opacity: .82; }
.topbar-spending-status.spending-atencao { background: rgba(239,184,54,.18); }
.topbar-spending-status.spending-alerta,
.topbar-spending-status.spending-critico,
.topbar-spending-status.spending-estourado { background: rgba(220,70,70,.19); }

.spending-hero {
    margin-bottom: 8px;
    padding: 15px 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border: 1px solid #cfe1eb;
    border-radius: 14px;
    background: linear-gradient(135deg,#f8fbfd,#eef6fa);
}
.spending-hero-main { display: grid; gap: 2px; }
.spending-hero-main span,
.spending-percent span { color: #627786; font-size: .7rem; font-weight: 700; }
.spending-hero-main strong { color: #123a58; font-size: clamp(1.35rem,2.3vw,2rem); }
.spending-hero-main small { color: #748693; font-size: .68rem; }
.spending-percent { text-align: right; }
.spending-percent strong { display:block; color:#0b6c4d; font-size:1.25rem; }
.spending-hero.spending-atencao .spending-percent strong { color:#9a6800; }
.spending-hero.spending-alerta .spending-percent strong,
.spending-hero.spending-critico .spending-percent strong,
.spending-hero.spending-estourado .spending-percent strong { color:#a92d2d; }

.spending-progress {
    height: 9px;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 99px;
    background: #e8eef2;
}
.spending-progress-bar { height:100%; border-radius:inherit; background:#16815d; transition:width .2s ease; }
.spending-progress-bar.spending-atencao { background:#c98b12; }
.spending-progress-bar.spending-alerta,
.spending-progress-bar.spending-critico,
.spending-progress-bar.spending-estourado { background:#c93e3e; }

.spending-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.spending-alert {
    margin: 0 0 14px;
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-radius: 10px;
    border: 1px solid #edd59c;
    background: #fff9e8;
    color: #755412;
    font-size: .73rem;
}
.spending-alert.spending-alerta,
.spending-alert.spending-critico,
.spending-alert.spending-estourado {
    border-color:#efb8b8;
    background:#fff2f2;
    color:#8b2929;
}
.spending-columns { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.spending-breakdown { display:grid; gap:0; }
.spending-breakdown > div,
.spending-category-list > div {
    padding: 9px 11px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    border-bottom:1px solid #edf1f3;
    font-size:.73rem;
}
.spending-breakdown > div:last-child,
.spending-category-list > div:last-child { border-bottom:0; }
.spending-breakdown span,
.spending-category-list span { color:#617583; }
.spending-breakdown strong,
.spending-category-list strong { color:#173a54; }
.spending-breakdown .is-total { margin-top:4px; border-radius:8px; border:0; background:#f2f7fa; }
.spending-limit-form {
    padding: 10px;
    display:grid;
    grid-template-columns:minmax(180px,240px) minmax(260px,1fr) auto;
    gap:10px;
    align-items:end;
}
.spending-limit-form .field { margin:0; }
.spending-mini-card a { font-weight:800; }
.module-card-spending { border-color:#b7dacb; }

@media (max-width: 900px) {
    .spending-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .spending-columns { grid-template-columns:1fr; }
    .spending-limit-form { grid-template-columns:1fr; }
}
@media (max-width: 560px) {
    .spending-hero { align-items:flex-start; flex-direction:column; }
    .spending-percent { text-align:left; }
    .spending-stats { grid-template-columns:1fr 1fr; }
    .topbar-spending-status { min-width:0; }
}


/* ===== V3.8.1 — Voltar somente nos módulos + formulários em modal ===== */
body.app-modal-body .page-header .btn-secondary,
body.app-modal-body .form-actions a.btn-secondary,
body.app-modal-body .form-actions a[href*="/prestacao/"] {
    display: none !important;
}

.prestacao-return-bar {
    margin: 0 0 10px;
    display: flex;
    align-items: center;
}

.prestacao-return-button {
    min-height: 34px;
    padding: 7px 11px !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem !important;
    font-weight: 800;
}

.qualification-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
    padding: 10px;
}
.qualification-summary-item {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #e3eaee;
    border-radius: 9px;
    background: #fff;
}
.qualification-summary-item span { display:block; color:#71818c; font-size:.62rem; font-weight:700; text-transform:uppercase; }
.qualification-summary-item strong { display:block; margin-top:3px; color:#17384f; font-size:.77rem; overflow-wrap:anywhere; }

@media (max-width: 760px) {
    .qualification-summary-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width: 480px) {
    .qualification-summary-grid { grid-template-columns:1fr; }
}


/* ==========================================================
   V3.8.2 — LOGIN: STATUS SUPERIOR + RODAPÉ PROFISSIONAL
   ========================================================== */

/*
 * Nas páginas sem navegação (login, recuperação etc.), o body antigo
 * reservava o espaço de 112px do topbar autenticado mesmo sem existir
 * cabeçalho. Isso criava a faixa branca no alto da tela.
 */
body.auth-page {
    padding-top: 52px !important;
}

/* Faixa superior exclusiva das telas de autenticação. */
.auth-statusbar {
    position: fixed;
    z-index: 1200;
    top: 0;
    right: 0;
    left: 0;
    height: 52px;
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 0 clamp(12px, 3vw, 34px);
    color: #fff;
    background:
        linear-gradient(90deg, #06294d 0%, #093b5d 52%, #0a5b49 100%);
    border-bottom: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 8px 24px rgba(3,20,38,.20);
}

.auth-statusbar-inner {
    width: min(1380px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.auth-statusbar .election-countdown,
.auth-statusbar .brasilia-clock {
    width: auto !important;
    min-width: 0 !important;
    height: 34px !important;
    padding: 4px 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 9px !important;
    color: #fff !important;
    background: rgba(255,255,255,.08) !important;
}

.auth-statusbar .election-countdown > span,
.auth-statusbar .brasilia-clock > span {
    display: flex !important;
    align-items: baseline !important;
    gap: 5px !important;
}

.auth-statusbar .election-countdown strong,
.auth-statusbar .brasilia-clock strong {
    color: #fff !important;
    font-size: .76rem !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.auth-statusbar .election-countdown small,
.auth-statusbar .brasilia-clock small {
    display: inline !important;
    color: rgba(255,255,255,.76) !important;
    font-size: .61rem !important;
    white-space: nowrap;
}

.auth-statusbar .app-icon {
    width: 15px !important;
    height: 15px !important;
    flex: 0 0 15px;
}

/* O login usa agora somente a altura real da barra superior. */
body.auth-page .auth-main {
    min-height: calc(100vh - 52px - var(--footer-height)) !important;
}

/* Rodapé: nome, slogan e versão com hierarquia visual clara. */
.footer-content {
    width: min(1380px, 100%);
    justify-content: center !important;
    gap: 8px !important;
    white-space: normal;
}

.footer-brand {
    color: #fff;
    font-weight: 850;
}

.footer-slogan {
    color: rgba(255,255,255,.72);
}

.footer-version {
    margin-left: 8px;
    padding: 3px 7px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 7px;
    color: rgba(255,255,255,.68);
    background: rgba(255,255,255,.06);
    font-size: .66rem;
    white-space: nowrap;
}

@media (max-width: 760px) {
    body.auth-page {
        padding-top: 78px !important;
    }

    .auth-statusbar {
        height: 78px;
        min-height: 78px;
        padding: 6px 8px;
    }

    .auth-statusbar-inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .auth-statusbar .election-countdown,
    .auth-statusbar .brasilia-clock {
        height: 58px !important;
        padding: 7px 8px !important;
        justify-content: center !important;
    }

    .auth-statusbar .election-countdown > span,
    .auth-statusbar .brasilia-clock > span {
        display: grid !important;
        gap: 2px !important;
    }

    .auth-statusbar .election-countdown strong,
    .auth-statusbar .brasilia-clock strong {
        font-size: .72rem !important;
    }

    .auth-statusbar .election-countdown small,
    .auth-statusbar .brasilia-clock small {
        display: block !important;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: .55rem !important;
    }

    body.auth-page .auth-main {
        min-height: calc(100dvh - 78px - var(--footer-height)) !important;
        padding-top: 12px !important;
    }

    .footer-content {
        gap: 5px !important;
        font-size: .62rem !important;
    }

    .footer-slogan {
        display: inline !important;
    }

    .footer-version {
        display: inline !important;
        margin-left: 2px;
        padding: 2px 5px;
        font-size: .55rem;
    }
}

@media (max-width: 480px) {
    .footer-slogan {
        display: none !important;
    }

    .footer-separator {
        display: none !important;
    }
}


/* ==========================================================
   V3.8.3 — TOPO ESTÁVEL / SEM PISCAR
   ========================================================== */

/*
 * Os indicadores do topo recebem atualizações periódicas.
 * Mantemos dimensões estáveis e desativamos animações nessas peças
 * para que a atualização dos números não provoque flash ou reflow.
 */
.topbar-status-strip,
.topbar-mural-status,
.topbar-process-status,
.topbar-spending-status,
.election-countdown,
.brasilia-clock,
.topbar-mural-state,
#process-monitor-state {
    animation: none !important;
    transition: none !important;
}

.topbar-mural-status,
.topbar-process-status,
.topbar-spending-status,
.election-countdown,
.brasilia-clock {
    contain: layout paint;
    backface-visibility: hidden;
    transform: translateZ(0);
}

#mural-unread-top,
#process-unread-top,
#election-days,
#brasilia-time {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    text-rendering: geometricPrecision;
}

#mural-unread-top,
#process-unread-top {
    min-width: 1.15em;
    text-align: center;
}

#election-days {
    min-width: 4.5em;
}

#brasilia-time {
    min-width: 5.6em;
    text-align: left;
}

.topbar-mural-state,
#process-monitor-state {
    min-width: 118px;
    text-align: center;
}

.topbar-spending-status > span {
    min-width: 146px;
}

/* Evita que um texto de status temporariamente maior empurre o restante do topo. */
.topbar-mural-state,
#process-monitor-state,
.topbar-spending-status small {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mantém o relógio e a contagem em uma única linha durante atualização. */
.election-countdown strong,
.brasilia-clock strong {
    white-space: nowrap;
}
