:root {
    --bg: #f3f5fb;
    --panel: #ffffff;
    --ink: #1d2552;
    --muted: #6b7391;
    --brand: #1a4fd9;
    --brand-deep: #0f2f88;
    --accent: #00a9a5;
    --line: #e7eaf5;
    --shadow: 0 12px 26px rgba(26, 43, 90, 0.08);
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Poppins", "Segoe UI", sans-serif;
    background: radial-gradient(circle at 10% -15%, #dde8ff 0, transparent 36%),
        radial-gradient(circle at 95% 0%, #d8f5f2 0, transparent 26%),
        var(--bg);
    color: var(--ink);
}

body.loading-auth .app {
    visibility: hidden;
}

body.login-body {
    min-height: 100vh;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: min(460px, 100%);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.login-logo {
    width: 190px;
    background: #ffffff;
    border: 1px solid #dfe5f7;
    border-radius: 8px;
    padding: 4px 7px;
}

.login-card h1 {
    margin: 16px 0 6px;
}

.login-card p {
    margin: 0 0 16px;
    color: var(--muted);
}

.login-form {
    grid-template-columns: 1fr;
}

a {
    text-decoration: none;
    color: #464feb;
}

.app {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, #0d1f59 0%, #0a1742 100%);
    color: #eff3ff;
    padding: 22px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    padding: 10px 8px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border-radius: 10px;
}

.brand-logo {
    width: 100%;
    max-width: 242px;
    display: block;
    height: auto;
    object-fit: contain;
    border-radius: 7px;
    background: #ffffff;
    border: 1px solid #dfe5f7;
    padding: 5px 7px;
}

.menu-title {
    margin: 16px 8px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #a7b1d9;
}

.nav a {
    display: block;
    color: #e8edff;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 10px;
    transition: background 0.2s ease;
    font-weight: 500;
}

.nav a.active,
.nav a:hover {
    background: rgba(99, 127, 255, 0.28);
}

.nav a.requires-global-admin {
    opacity: 0.72;
    border-left: 2px solid rgba(0, 169, 165, 0.7);
    padding-left: 10px;
}

.main {
    padding: 20px;
}

.topbar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-logo {
    width: 148px;
    max-width: 23vw;
    display: block;
    height: auto;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #dfe5f7;
    border-radius: 8px;
    padding: 3px 6px;
}

.hero {
    margin: 20px 0 14px;
}

.hero h2 {
    margin: 0;
    font-size: 34px;
}

.hero p {
    margin: 6px 0 0;
    color: var(--muted);
}

.data-status {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #3557c2;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 14px;
}

.kpi h3 {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.kpi strong {
    display: block;
    margin-top: 8px;
    font-size: 34px;
    line-height: 1;
}

.board {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1.7fr 1fr 1fr;
    gap: 12px;
}

.chart-placeholder {
    margin-top: 12px;
    height: 220px;
    border-radius: 10px;
    background: linear-gradient(180deg, #f9fbff 0%, #eef3ff 100%);
    border: 1px solid #dde5fc;
    position: relative;
    overflow: hidden;
}

.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #7282b6;
    font-size: 13px;
}

.chart-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.chart-toggle {
    border: 1px solid #d7dff6;
    border-radius: 999px;
    background: #ffffff;
    color: #51618f;
    font-size: 12px;
    padding: 5px 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chart-toggle.active {
    border-color: #4f6de0;
    color: #1f3ea8;
    background: #eef2ff;
}

.chart-toggle i {
    width: 10px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
}

.chart-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.chart-grid {
    stroke: #d9e2fb;
    stroke-width: 1;
}

.chart-axis-text {
    fill: #6f7ba8;
    font-size: 10px;
    font-family: "Poppins", "Segoe UI", sans-serif;
}

.chart-line-work {
    fill: none;
    stroke: #275dff;
    stroke-width: 2.5;
}

.chart-line-work-ok {
    stroke: #2fbb73;
    stroke-width: 2.6;
}

.chart-line-work-warn {
    stroke: #f0a135;
    stroke-width: 2.6;
}

.chart-line-extra {
    fill: none;
    stroke: #2fbb73;
    stroke-width: 2.5;
}

.chart-line-falta {
    fill: none;
    stroke: #e66262;
    stroke-width: 2.5;
}

.chart-line-target {
    stroke: #8e7d3b;
    stroke-width: 1.4;
    stroke-dasharray: 5 4;
}

.chart-target-text {
    fill: #6e5f2f;
    font-size: 10px;
    font-family: "Poppins", "Segoe UI", sans-serif;
}

.chart-point-work {
    fill: #275dff;
}

.chart-point-work-ok {
    fill: #2fbb73;
}

.chart-point-work-warn {
    fill: #f0a135;
}

.chart-point-extra {
    fill: #2fbb73;
}

.chart-point-falta {
    fill: #e66262;
}

.chart-point {
    cursor: pointer;
}

.chart-under-target-badge {
    fill: #f6d4d4;
    stroke: #c93f3f;
    stroke-width: 1;
}

.chart-under-target-text {
    fill: #8f1f1f;
    font-size: 9px;
    font-family: "Poppins", "Segoe UI", sans-serif;
    font-weight: 700;
    pointer-events: none;
}

.chart-legend {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 8px 0 0;
    color: #51618f;
    font-size: 12px;
}

.chart-tooltip {
    display: none;
    position: absolute;
    z-index: 2;
    pointer-events: none;
    background: rgba(20, 31, 66, 0.92);
    color: #ffffff;
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 6px;
    max-width: 220px;
}

.chart-target-insight {
    margin-top: 8px;
    font-size: 12px;
    border-radius: 8px;
    padding: 6px 8px;
}

.chart-target-insight-ok {
    color: #1f5c3b;
    background: #e8f6ee;
    border: 1px solid #bfe7ce;
}

.chart-target-insight-warn {
    color: #7d3f0d;
    background: #fff2e4;
    border: 1px solid #f2d5b3;
}

.chart-compliance {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.chart-compliance-item {
    border: 1px solid #dce4fa;
    background: #f7f9ff;
    border-radius: 8px;
    padding: 7px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chart-compliance-item small {
    color: #6473a6;
    font-size: 11px;
}

.chart-compliance-item strong {
    color: #213a8b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.chart-legend i {
    width: 12px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
}

.chart-target-chip {
    background: repeating-linear-gradient(
        90deg,
        #8e7d3b,
        #8e7d3b 4px,
        transparent 4px,
        transparent 8px
    ) !important;
    border: 1px solid rgba(142, 125, 59, 0.35);
}

.series-list {
    margin: 0;
    padding: 10px;
    list-style: none;
}

.series-list li {
    display: grid;
    grid-template-columns: 80px 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 6px;
    border-bottom: 1px dashed #dce1f1;
    color: #35477f;
    font-size: 13px;
}

.series-list li strong {
    color: #1f2e5a;
}

.panel-title {
    margin: 0 0 10px;
    font-size: 20px;
}

.notificacoes-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notificacoes-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e7eeff;
    color: #2348b1;
    border: 1px solid #cfdafc;
    font-size: 12px;
    font-weight: 700;
}

.notificacoes-contador {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #d8e2fb;
    background: #f5f8ff;
    color: #4860a8;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.aprovacoes-total-badge {
    position: relative;
    cursor: pointer;
}

.aprovacoes-total-badge:hover {
    transform: translateY(-1px);
}

.aprovacoes-total-badge[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 0;
    bottom: -32px;
    background: rgba(20, 31, 66, 0.95);
    color: #ffffff;
    font-size: 11px;
    padding: 5px 8px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 2;
}

.list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.list li {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #dce1f1;
    padding: 10px 0;
    color: var(--muted);
}

.notificacao-item {
    align-items: flex-start !important;
    gap: 10px;
}

.notificacao-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 78%;
}

.notificacao-tag {
    display: inline-flex;
    width: fit-content;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid #d8e2fb;
    background: #f5f8ff;
    color: #4860a8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.notificacao-meta {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.notificacao-action {
    border: 1px solid #c7d5ff;
    color: #2b4bb6;
    background: #edf2ff;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 7px;
    cursor: pointer;
}

.aprovacao-item {
    align-items: flex-start !important;
    gap: 10px;
}

.aprovacoes-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.aprovacoes-toolbar select {
    border: 1px solid #d0daf6;
    border-radius: 8px;
    background: #f7faff;
    color: #2a488d;
    font-size: 12px;
    padding: 5px 8px;
}

.aprovacoes-toolbar input[type="search"] {
    border: 1px solid #d0daf6;
    border-radius: 8px;
    background: #f7faff;
    color: #2a488d;
    font-size: 12px;
    padding: 5px 8px;
    width: 100%;
    min-width: 130px;
}

.notificacoes-limpar-filtros {
    position: relative;
    border: 1px solid #d0daf6;
    border-radius: 8px;
    background: #f3f7ff;
    color: #3150b2;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 8px;
    cursor: pointer;
    white-space: nowrap;
}

.notificacoes-limpar-filtros[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 0;
    bottom: -32px;
    background: rgba(20, 31, 66, 0.95);
    color: #ffffff;
    font-size: 11px;
    padding: 5px 8px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 2;
}

.aprovacoes-feedback {
    display: none;
    margin-top: 8px;
    border-radius: 8px;
    padding: 7px 8px;
    font-size: 12px;
}

.aprovacoes-feedback.show {
    display: block;
}

.aprovacoes-feedback.ok {
    border: 1px solid #bfe7ce;
    background: #e8f6ee;
    color: #1f5c3b;
}

.aprovacoes-feedback.warn {
    border: 1px solid #f1c8c8;
    background: #fdeeee;
    color: #8a2c2c;
}

.aprovacoes-carregar-mais {
    display: none;
    margin-top: 8px;
    width: 100%;
    border: 1px solid #d0daf6;
    background: #f3f7ff;
    color: #3150b2;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.aprovacoes-carregar-mais.show {
    display: block;
}

.notificacoes-carregar-mais {
    display: none;
    margin-top: 8px;
    width: 100%;
    border: 1px solid #d0daf6;
    background: #f3f7ff;
    color: #3150b2;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.notificacoes-carregar-mais.show {
    display: block;
}

.aprovacao-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 76%;
}

.aprovacao-meta {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.aprovacao-prioridade {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid #d8e2fb;
}

.aprovacao-prioridade.alta {
    color: #8c2828;
    background: #fdeaea;
    border-color: #f1c3c3;
}

.aprovacao-prioridade.media {
    color: #8b5b11;
    background: #fff2df;
    border-color: #f0d5a9;
}

.aprovacao-actions {
    display: inline-flex;
    gap: 6px;
}

.aprovacao-action {
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 7px;
    cursor: pointer;
}

.aprovacao-action.aprovar {
    border: 1px solid #b5e3c6;
    background: #e8f8ef;
    color: #1a6f43;
}

.aprovacao-action.reprovar {
    border: 1px solid #efc5c5;
    background: #fdeeee;
    color: #8a2c2c;
}

.aprovacao-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.aprovacao-modal {
    display: none;
    margin-top: 10px;
    border: 1px solid #f0d2d2;
    border-radius: 10px;
    background: #fff7f7;
    padding: 10px;
}

.aprovacao-modal.is-open {
    display: block;
}

.aprovacao-modal label {
    display: block;
    font-size: 12px;
    color: #8a3333;
    margin-bottom: 6px;
}

.aprovacao-modal textarea {
    width: 100%;
    border: 1px solid #efc5c5;
    border-radius: 8px;
    padding: 7px 8px;
    font-size: 12px;
    font-family: "Poppins", "Segoe UI", sans-serif;
    resize: vertical;
    min-height: 68px;
}

.aprovacao-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.aprovacao-modal-btn {
    border-radius: 8px;
    padding: 6px 9px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.aprovacao-modal-btn.cancelar {
    border: 1px solid #d6def7;
    background: #f5f8ff;
    color: #3f559a;
}

.aprovacao-modal-btn.confirmar {
    border: 1px solid #efb6b6;
    background: #fbe4e4;
    color: #8c2d2d;
}

.tables {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

tr th,
tr td {
    border: 1px solid #e6e6e6;
}

tr th {
    background-color: #f5f5f5;
}

th,
td {
    text-align: left;
    padding: 8px;
}

.badge {
    font-size: 12px;
    padding: 3px 7px;
    border-radius: 999px;
}

.badge.ok {
    background: #daf6e4;
    color: #11673a;
}

.badge.warn {
    background: #ffe9cf;
    color: #9c5f0e;
}

.insight {
    padding: 10px;
    border-radius: 10px;
    background: #f7faff;
    border: 1px solid #dfe9ff;
    color: #3a4a7f;
    margin-bottom: 10px;
}

.auth-panel p {
    margin-top: -2px;
    margin-bottom: 10px;
    color: var(--muted);
}

.auth-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) 160px;
    gap: 10px;
    align-items: end;
}

.auth-form label,
.module-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form span {
    font-size: 12px;
    color: #4d5c8f;
    font-weight: 600;
}

input,
select,
button {
    font-family: "Poppins", "Segoe UI", sans-serif;
}

.auth-form input,
.module-form input,
.module-form select {
    border: 1px solid #d0daf6;
    border-radius: 9px;
    background: #f7faff;
    color: #203877;
    font-size: 13px;
    padding: 8px 10px;
}

.auth-form button,
.module-form button,
.topbar-btn,
.row-btn {
    border: 1px solid #2f58cf;
    border-radius: 9px;
    background: #2f58cf;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 11px;
    cursor: pointer;
}

.topbar-btn {
    font-size: 12px;
    padding: 6px 10px;
}

.topbar-user {
    font-size: 12px;
    color: #3557c2;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid #d2ddff;
    padding: 6px 10px;
    background: #f4f7ff;
}

.row-btn {
    border-color: #d4def8;
    background: #f4f7ff;
    color: #2e4aa7;
    padding: 4px 7px;
    font-size: 11px;
}

.row-btn.danger {
    border-color: #efc6c6;
    background: #fdeeee;
    color: #842e2e;
}

.row-btn.success {
    border-color: #b9e2ca;
    background: #e8f8ef;
    color: #1a6f43;
}

.row-actions {
    display: inline-flex;
    gap: 6px;
}

.system-message {
    display: none;
    margin: 12px 0;
    border-radius: 10px;
    border: 1px solid #d2ddff;
    background: #f4f7ff;
    color: #2f4fa8;
    padding: 8px 10px;
    font-size: 13px;
}

.system-message.show {
    display: block;
}

.system-message.error {
    border-color: #efc6c6;
    background: #fdeeee;
    color: #842e2e;
}

/* ===== Aviso de Licença ===== */
.licenca-banner {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid transparent;
}

.licenca-banner.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

.licenca-banner.aviso {
    background: #fff8e6;
    border-color: #f7c948;
    color: #7a5c00;
}

.licenca-banner.bloqueado {
    background: #fdeeee;
    border-color: #efc6c6;
    color: #842e2e;
}

.licenca-banner .licenca-banner-icone {
    font-size: 16px;
    flex-shrink: 0;
}

.licenca-banner .licenca-banner-texto {
    flex: 1;
}

.licenca-banner .licenca-banner-link {
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0.8;
    white-space: nowrap;
}


.workspace-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.module-card {
    min-height: 320px;
}

.module-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.module-form.secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-form button {
    grid-column: 1 / -1;
}

.module-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #d7e2ff;
    border-radius: 10px;
    background: #f6f9ff;
    color: #2f4fa8;
    font-size: 13px;
}

.table-wrap {
    overflow-x: auto;
}

.table-wrap table {
    min-width: 520px;
}

.page-header {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.page-header h1 {
    margin: 0 0 6px;
}

.page-header p {
    margin: 0;
    color: var(--muted);
}

.module-page-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.module-page-kpi strong {
    display: block;
    margin-top: 6px;
    font-size: 30px;
    line-height: 1;
}

.module-page-filters {
    margin-bottom: 12px;
}

.module-page-filters input[type="search"],
.module-page-filters select {
    border: 1px solid #d0daf6;
    border-radius: 8px;
    background: #f7faff;
    color: #2a488d;
    font-size: 12px;
    padding: 5px 8px;
}

.module-page-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #2a488d;
}

.module-page-list-card {
    margin-bottom: 12px;
}

.module-page-pagination {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.module-page-counter {
    font-size: 12px;
    color: #4860a8;
    border: 1px solid #d8e2fb;
    background: #f5f8ff;
    border-radius: 999px;
    padding: 5px 10px;
}

.module-page-status {
    display: inline-flex;
    margin-top: 8px;
    color: #3557c2;
    font-size: 12px;
    font-weight: 500;
}

.module-page-status.error {
    color: #842e2e;
}

.folha-controls {
    display: grid;
    grid-template-columns: 220px 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.folha-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.folha-field span,
.folha-mode legend {
    font-size: 12px;
    color: #4d5c8f;
    font-weight: 600;
}

.folha-field input,
.folha-field select {
    border: 1px solid #d0daf6;
    border-radius: 9px;
    background: #f7faff;
    color: #203877;
    font-size: 13px;
    padding: 8px 10px;
}

.folha-mode {
    border: 1px solid #d7e2ff;
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
}

.folha-mode label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #2f4fa8;
}

.folha-preview {
    display: grid;
    gap: 12px;
}

.folha-sheet {
    border: 1px solid #dce3f9;
    border-radius: 10px;
    padding: 10px;
    background: #fbfcff;
}

.folha-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.folha-sheet-header h4 {
    margin: 0;
    font-size: 15px;
}

.folha-sheet-header small {
    color: #5f709f;
    font-size: 12px;
}

.folha-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #3d538f;
    margin-bottom: 8px;
}

body:not(.authenticated) .workspace-grid {
    display: none;
}

body:not(.authenticated) .topbar-btn {
    display: none;
}

@media (max-width: 1280px) {
    .kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .board,
    .tables,
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .auth-form {
        grid-template-columns: 1fr;
    }

    .module-page-grid {
        grid-template-columns: 1fr;
    }

    .folha-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 5;
    }

    .hero h2 {
        font-size: 28px;
    }

    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar-right {
        gap: 10px;
        flex-wrap: wrap;
    }

    .topbar-logo {
        width: 118px;
        max-width: 34vw;
    }

    .module-form,
    .module-form.secondary {
        grid-template-columns: 1fr;
    }

    .module-intro {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .chart-compliance {
        grid-template-columns: 1fr;
    }

    .topbar-logo {
        display: none;
    }

    .brand-logo {
        max-width: 220px;
    }
}
