:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --sidebar: #0d1724;
    --sidebar-soft: #172333;
    --text: #182230;
    --muted: #758195;
    --border: #e6eaf0;
    --accent: #2563eb;
    --accent-soft: #eef4ff;
    --positive: #16845b;
    --negative: #c94a4a;
    --shadow: 0 12px 35px rgba(17, 31, 50, .06);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
}

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(
            circle at top left,
            #1a2a3e,
            transparent 42%
        ),
        var(--sidebar);
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 28px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--accent);
    font-size: 19px;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(37, 99, 235, .3);
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 15px;
}

.brand span {
    margin-top: 3px;
    color: #8290a4;
    font-size: 11px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    min-height: 44px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    color: #91a0b4;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: .18s ease;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,.055);
}

.nav-item.active {
    color: #fff;
    background: var(--sidebar-soft);
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-icon {
    width: 18px;
    text-align: center;
    font-size: 16px;
}

.nav-divider {
    height: 1px;
    margin: 14px 10px;
    background: rgba(255,255,255,.07);
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 10px 2px;
    border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-footer span,
.sidebar-footer strong {
    display: block;
}

.sidebar-footer span {
    color: #68778c;
    font-size: 10px;
}

.sidebar-footer strong {
    margin-top: 4px;
    color: #a6b1c0;
    font-size: 11px;
}

.main-content {
    width: calc(100% - 250px);
    margin-left: 250px;
    padding: 42px 46px 60px;
}

.page-header {
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
}

.eyebrow,
.panel-kicker {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}

.page-header h1 {
    margin: 7px 0 5px;
    font-size: 30px;
    letter-spacing: -.04em;
}

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

.header-actions {
    padding: 9px 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #20a66a;
    box-shadow: 0 0 0 4px rgba(32,166,106,.1);
}

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

.hero-card {
    min-height: 150px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.hero-card.primary {
    border-color: #dce7ff;
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f2f6ff
        );
}

.card-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.hero-value {
    margin-top: 15px;
    font-size: clamp(20px, 2vw, 29px);
    letter-spacing: -.045em;
}

.card-footnote {
    margin-top: auto;
    color: #98a2b2;
    font-size: 10px;
}

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

.panel {
    min-height: 220px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel-header {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.panel h2 {
    margin: 6px 0 0;
    font-size: 17px;
    letter-spacing: -.02em;
}

.month-pill {
    padding: 6px 9px;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.metric {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafbfd;
}

.metric span,
.metric strong {
    display: block;
}

.metric span {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 10px;
}

.metric strong {
    font-size: 16px;
}

.metric.highlighted {
    border-color: #dbe6ff;
    background: var(--accent-soft);
}

.positive {
    color: var(--positive);
}

.negative {
    color: var(--negative);
}

.list-metrics {
    display: flex;
    flex-direction: column;
}

.list-metrics > div {
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
}

.list-metrics > div:last-child {
    border-bottom: 0;
}

.list-metrics span {
    color: var(--muted);
    font-size: 11px;
}

.list-metrics strong {
    font-size: 13px;
}

.accent-panel {
    color: #fff;
    border-color: transparent;
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(57,126,255,.3),
            transparent 42%
        ),
        #111d2b;
}

.accent-panel .panel-kicker {
    color: #76a5ff;
}

.accent-panel h2 {
    margin-bottom: 28px;
}

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

.balance-row > div {
    padding: 15px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 11px;
    background: rgba(255,255,255,.035);
}

.balance-row span,
.balance-row strong {
    display: block;
}

.balance-row span {
    margin-bottom: 8px;
    color: #8594a8;
    font-size: 10px;
}

.balance-row strong {
    font-size: 17px;
}

@media (max-width: 1100px) {
    .hero-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 820px) {
    .sidebar {
        display: none;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 28px 20px;
    }

    .content-grid,
    .hero-grid {
        grid-template-columns: 1fr;
    }

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


/* ==========================================================
   DASHBOARD — REFINAMENTO VISUAL V1.1
   ========================================================== */

.main-content {
    max-width: 1600px;
}

.hero-card {
    min-height: 138px;
    padding: 20px 22px;
}

.hero-card.primary {
    position: relative;
    overflow: hidden;
}

.hero-card.primary::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    right: -45px;
    top: -45px;
    border-radius: 50%;
    background: rgba(37, 99, 235, .06);
}

.hero-card.primary .hero-value {
    position: relative;
    z-index: 1;
}

.hero-value {
    margin-top: 13px;
}

.content-grid {
    gap: 16px;
}

.panel {
    min-height: 195px;
    padding: 22px 24px;
}

.panel-header {
    margin-bottom: 20px;
}

.result-grid {
    gap: 9px;
}

.metric {
    padding: 14px 16px;
}

.list-metrics > div {
    min-height: 42px;
}

.accent-panel {
    min-height: 195px;
}

.accent-panel h2 {
    margin-bottom: 22px;
}

.balance-row > div {
    padding: 14px 15px;
}


/* Desktop grande */
@media (min-width: 1400px) {

    .main-content {
        padding-left: 50px;
        padding-right: 50px;
    }

    .hero-grid {
        gap: 18px;
    }
}


/* ==========================================================
   FIM — DASHBOARD REFINAMENTO V1.1
   ========================================================== */


/* ==========================================================
   MOVIMENTAÇÕES
   ========================================================== */

.movements-header {
    margin-bottom: 24px;
}

.movements-header-actions {
    display: flex;
    align-items: center;
}

.pending-summary {
    min-width: 180px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid #f1dfb7;
    border-radius: 12px;
    background: #fffaf0;
}

.pending-summary span {
    color: #92712f;
    font-size: 10px;
    font-weight: 700;
}

.pending-summary strong {
    color: #a36d00;
    font-size: 18px;
}

.movements-filters-panel {
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.movements-filters {
    display: grid;
    grid-template-columns:
        minmax(230px, 1.6fr)
        repeat(6, minmax(120px, 1fr))
        auto;
    gap: 12px;
    align-items: end;
}

.filter-search,
.filter-field {
    min-width: 0;
}

.filter-search label,
.filter-field label {
    margin-bottom: 7px;
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.filter-search input,
.filter-field input,
.filter-field select {
    width: 100%;
    height: 40px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: #fbfcfe;
    color: var(--text);
    font: inherit;
    font-size: 11px;
    transition: .16s ease;
}

.filter-search input:focus,
.filter-field input:focus,
.filter-field select:focus {
    border-color: #a9c3ff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .07);
}

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

.button-primary,
.button-secondary {
    height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.button-primary {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.button-primary:hover {
    background: #1d55d5;
}

.button-secondary {
    border: 1px solid var(--border);
    background: #fff;
    color: #667386;
}

.button-secondary:hover {
    background: #f7f9fc;
}

.movements-table-panel {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.movements-table-header {
    min-height: 76px;
    padding: 19px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
}

.movements-table-header h2 {
    margin: 5px 0 0;
    font-size: 16px;
}

.movements-count {
    padding: 6px 9px;
    border-radius: 8px;
    background: #f2f5f9;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

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

.movements-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 970px;
}

.movements-table th {
    height: 42px;
    padding: 0 14px;
    border-bottom: 1px solid var(--border);
    background: #fafbfd;
    color: #8a95a5;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
}

.movements-table td {
    min-height: 62px;
    padding: 13px 14px;
    border-bottom: 1px solid #edf0f4;
    color: #465164;
    font-size: 11px;
    vertical-align: middle;
}

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

.movements-table tbody tr:hover td {
    background: #fbfcff;
}

.date-cell {
    white-space: nowrap;
    color: #758195 !important;
}

.description-cell {
    min-width: 230px;
}

.description-cell strong,
.description-cell span {
    display: block;
}

.description-cell strong {
    margin-bottom: 4px;
    color: #263142;
    font-size: 11px;
}

.description-cell span {
    max-width: 300px;
    overflow: hidden;
    color: #929dac;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.origin-primary {
    color: #3d4858;
    font-size: 10px;
    font-weight: 700;
}

.origin-secondary {
    margin-top: 3px;
    color: #98a2b1;
    font-size: 9px;
}

.category-empty {
    color: #a3acb9;
    font-size: 9px;
    font-style: italic;
}

.type-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 9px;
    font-weight: 700;
}

.type-badge {
    background: #f2f5f9;
    color: #647184;
}

.status-classificada {
    background: #edf8f3;
    color: #24825c;
}

.status-pendente {
    background: #fff6e5;
    color: #a36b00;
}

.status-ignorada {
    background: #f2f3f5;
    color: #7c8490;
}

.align-right {
    text-align: right !important;
}

.movement-value {
    white-space: nowrap;
    font-size: 11px !important;
    font-weight: 800;
}

.value-positive {
    color: var(--positive) !important;
}

.value-negative {
    color: var(--negative) !important;
}

.value-neutral {
    color: #687588 !important;
}

.text-muted {
    color: #a8b0bc;
}

.empty-table {
    height: 230px;
}

.empty-table-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-table-content strong {
    margin-bottom: 7px;
    color: #4c5869;
    font-size: 13px;
}

.empty-table-content span {
    color: #98a2b1;
    font-size: 10px;
}


@media (max-width: 1500px) {

    .movements-filters {
        grid-template-columns:
            repeat(4, minmax(150px, 1fr));
    }

    .filter-search {
        grid-column: span 2;
    }

    .filter-actions {
        align-self: end;
    }
}


@media (max-width: 900px) {

    .movements-filters {
        grid-template-columns: 1fr;
    }

    .filter-search {
        grid-column: auto;
    }

    .filter-actions {
        width: 100%;
    }

    .button-primary,
    .button-secondary {
        flex: 1;
    }

    .movements-header {
        flex-direction: column;
    }
}


/* ==========================================================
   FIM — MOVIMENTAÇÕES
   ========================================================== */


/* ==========================================================
   CLASSIFICAÇÃO DE MOVIMENTAÇÃO
   ========================================================== */

.classification-grid {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 20px;
}

.classification-card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.classification-description {
    margin: 10px 0 6px;
    color: var(--text);
    font-size: 21px;
    line-height: 1.25;
}

.classification-original {
    color: #8d98a8;
    font-size: 11px;
}

.classification-value {
    margin: 28px 0;
    color: #243044;
    font-size: 31px;
    font-weight: 800;
    letter-spacing: -.03em;
}

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

.classification-details > div {
    padding: 14px;
    border: 1px solid #edf0f4;
    border-radius: 11px;
    background: #fafbfd;
}

.classification-details span,
.classification-details strong {
    display: block;
}

.classification-details span {
    margin-bottom: 5px;
    color: #919baa;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.classification-details strong {
    color: #445064;
    font-size: 11px;
}

.classification-form-card {
    min-height: 400px;
}

.classification-form {
    margin-top: 17px;
}

.classification-type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.classification-type-option {
    cursor: pointer;
}

.classification-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.classification-type-box {
    min-height: 92px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafbfd;
    transition: .15s ease;
}

.classification-type-box strong {
    margin-bottom: 5px;
    color: #344055;
    font-size: 13px;
}

.classification-type-box small {
    color: #929dac;
    font-size: 9px;
    line-height: 1.45;
}

.classification-type-option input:checked
+ .classification-type-box {
    border-color: #9db8fa;
    background: #f3f7ff;
    box-shadow:
        inset 0 0 0 1px rgba(37, 99, 235, .07);
}

.classification-type-option input:checked
+ .classification-type-box strong {
    color: var(--accent);
}

.classification-field {
    margin-top: 22px;
}

.classification-field label {
    margin-bottom: 7px;
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.classification-field select {
    width: 100%;
    height: 43px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: #fbfcfe;
    color: var(--text);
    font: inherit;
    font-size: 11px;
}

.classification-field select:focus {
    border-color: #a9c3ff;
    background: #fff;
    box-shadow:
        0 0 0 3px rgba(37, 99, 235, .07);
}

.classification-field small {
    margin-top: 7px;
    display: block;
    color: #9aa4b2;
    font-size: 9px;
}

.classification-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.classification-actions .button-primary,
.classification-actions .button-secondary {
    min-width: 135px;
}

.form-message {
    margin-top: 14px;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 650;
}

.form-message-error {
    border: 1px solid #f3cccc;
    background: #fff4f4;
    color: #b24444;
}

.classification-complete {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.classification-complete strong {
    color: #2f3b4e;
    font-size: 14px;
}

.classification-complete span {
    color: #758195;
    font-size: 11px;
}

.classification-complete .button-primary {
    margin-top: 12px;
    align-self: flex-start;
}

.movement-description-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.movement-description-link strong {
    transition: .15s ease;
}

.movement-description-link:hover strong {
    color: var(--accent);
}


@media (max-width: 1000px) {

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

}


@media (max-width: 650px) {

    .classification-details,
    .classification-type-selector {
        grid-template-columns: 1fr;
    }

}


/* ==========================================================
   FIM — CLASSIFICAÇÃO DE MOVIMENTAÇÃO
   ========================================================== */


/* Transferência na classificação */

.classification-type-selector {
    grid-template-columns: repeat(3, 1fr);
}

.classification-transfer-fields {
    margin-top: 4px;
}

.classification-transfer-fields[hidden],
#campo-categoria[hidden] {
    display: none !important;
}

@media (max-width: 800px) {
    .classification-type-selector {
        grid-template-columns: 1fr;
    }
}


.form-message-success {
    border: 1px solid #c9e8d6;
    background: #f1fbf5;
    color: #28764a;
}

.form-message-info {
    border: 1px solid #d9e3f4;
    background: #f5f8fd;
    color: #53657f;
}


/* ==========================================================
   DASHBOARD — PLANEJAMENTO FINANCEIRO
   ========================================================== */

.planning-panel {
    min-height: 0;
    margin-bottom: 16px;
}

.planning-table {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.planning-row {
    min-height: 54px;
    padding: 0 16px;
    display: grid;
    grid-template-columns:
        minmax(130px, 1.1fr)
        repeat(3, minmax(110px, 1fr));
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid var(--border);
}

.planning-row:last-child {
    border-bottom: 0;
}

.planning-row strong {
    font-size: 12px;
}

.planning-row span {
    font-size: 12px;
    text-align: right;
}

.planning-heading {
    min-height: 38px;
    background: #fafbfd;
}

.planning-heading span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.planning-summary {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.planning-summary > div {
    min-height: 74px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fafbfd;
}

.planning-summary span {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 9px;
}

.planning-summary strong {
    font-size: 16px;
}

.planning-summary-primary {
    border-color: #dbe6ff !important;
    background: var(--accent-soft) !important;
}

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

.dashboard-position-panel {
    grid-column: 1 / -1;
}

@media (max-width: 820px) {

    .planning-row {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 14px 16px;
    }

    .planning-heading {
        display: none;
    }

    .planning-row span {
        text-align: left;
    }

    .planning-summary {
        grid-template-columns: 1fr;
    }

    .dashboard-secondary-grid {
        grid-template-columns: 1fr;
    }

}


/* ==========================================================
   FIM — DASHBOARD / PLANEJAMENTO FINANCEIRO
   ========================================================== */


/* ==========================================================
   PLANEJAMENTO — TELA DE RECORRÊNCIAS
   ========================================================== */

.planning-management-grid {
    display: grid;
    grid-template-columns: minmax(320px, .85fr) minmax(0, 1.4fr);
    gap: 18px;
}

.planning-form-panel,
.planning-rules-panel {
    min-height: 0;
}

.planning-form {
    margin-top: 6px;
}

.planning-type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.planning-form-row {
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 12px;
}

.planning-rules-list {
    display: flex;
    flex-direction: column;
}

.planning-rule-item {
    min-height: 64px;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--border);
}

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

.planning-rule-main {
    min-width: 0;
}

.planning-rule-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.planning-rule-title strong {
    font-size: 12px;
}

.planning-rule-type {
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.planning-rule-type-receita {
    background: #edf8f2;
    color: var(--positive);
}

.planning-rule-type-despesa {
    background: #fff0f0;
    color: var(--negative);
}

.planning-rule-meta {
    margin-top: 5px;
    display: block;
    color: var(--muted);
    font-size: 9px;
}

.planning-rule-value {
    white-space: nowrap;
    font-size: 13px;
    font-weight: 750;
}

.planning-empty-state {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.planning-empty-state strong {
    margin-bottom: 7px;
    font-size: 13px;
}

.planning-empty-state span {
    max-width: 320px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
}

@media (max-width: 950px) {

    .planning-management-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 650px) {

    .planning-form-row,
    .planning-type-selector {
        grid-template-columns: 1fr;
    }

}


/* ==========================================================
   FIM — PLANEJAMENTO / RECORRÊNCIAS
   ========================================================== */


/* ==========================================================
   PLANEJAMENTO — ACABAMENTO DOS CAMPOS
   ========================================================== */

.planning-form .classification-field {
    margin-top: 18px;
}

.planning-form .classification-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
}

.planning-form .classification-field input,
.planning-form .classification-field select {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 11px;
    outline: none;
    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.planning-form .classification-field input:focus,
.planning-form .classification-field select:focus {
    border-color: #7aa7ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}

.planning-form .classification-field input::placeholder {
    color: #9aa7ba;
}

.planning-form .classification-field small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 9px;
}

.planning-form-row .classification-field {
    min-width: 0;
}

.planning-form .classification-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}

.planning-form .classification-actions .button-primary {
    min-height: 44px;
    padding-left: 18px;
    padding-right: 18px;
}


/* ==========================================================
   FIM — PLANEJAMENTO / ACABAMENTO DOS CAMPOS
   ========================================================== */


/* ==========================================================
   DASHBOARD — EVOLUÇÃO FINANCEIRA
   ========================================================== */

.dashboard-evolution-section {
    margin-top: 28px;
    margin-bottom: 28px;
}

.section-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.section-heading-row h2 {
    margin: 4px 0 6px;
}

.section-heading-row p {
    margin: 0;
    color: var(--text-muted);
}

.dashboard-evolution-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 18px;
}

.evolution-panel {
    min-width: 0;
}

.evolution-comparison {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.evolution-comparison > div {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.018);
}

.evolution-comparison span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-bottom: 6px;
}

.evolution-comparison strong {
    font-size: 0.96rem;
}

.evolution-empty-note {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.chart-wrap {
    position: relative;
    width: 100%;
    min-height: 280px;
}

.dashboard-chart {
    display: block;
    width: 100%;
    max-width: 100%;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend-line,
.legend-box {
    display: inline-block;
    flex: 0 0 auto;
}

.legend-line {
    width: 22px;
    height: 3px;
    border-radius: 99px;
}

.legend-box {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.legend-primary,
.legend-positive {
    background: var(--primary);
}

.legend-secondary {
    background: #6fa8ff;
}

.legend-negative {
    background: #f07474;
}

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

@media (max-width: 720px) {
    .section-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .evolution-comparison {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   FIM — DASHBOARD EVOLUÇÃO FINANCEIRA
   ========================================================== */


/* ==========================================================
   CARTÕES — FORMULÁRIO DE EDIÇÃO
   ========================================================== */

.card-edit-panel {
    width: 100%;
    box-sizing: border-box;
}

.card-form-row {
    display: grid;
    gap: 14px;
}

.card-form-row-brand {
    grid-template-columns: minmax(0, 3fr) minmax(150px, 1fr);
}

.card-form-row-financial {
    grid-template-columns:
        minmax(0, 2fr)
        minmax(130px, 1fr)
        minmax(130px, 1fr);
}

.card-form-row .classification-field {
    min-width: 0;
}

.card-active-field {
    margin-top: 22px;
}

.card-active-field label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
}

.card-edit-form .card-active-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0;
    padding: 0;
    flex: 0 0 16px;
    accent-color: var(--accent);
    box-shadow: none;
}

@media (max-width: 800px) {

    .card-form-row-brand,
    .card-form-row-financial {
        grid-template-columns: 1fr;
    }

}

/* ==========================================================
   FIM — CARTÕES / FORMULÁRIO DE EDIÇÃO
   ========================================================== */

/* Cadastros e acompanhamento dos módulos financeiros. */
.erp-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.erp-panel { padding: 24px; margin-bottom: 24px; }
.erp-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.erp-table { overflow-x: auto; }
.erp-table table { width: 100%; border-collapse: collapse; }
.erp-table th, .erp-table td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--border, #e5e7eb); }
.erp-form { max-width: 780px; display: grid; gap: 20px; }
.erp-form input:not([type=checkbox]), .erp-form select, .erp-form textarea { width: 100%; padding: 12px; border: 1px solid var(--border, #d5d9df); border-radius: 8px; box-sizing: border-box; font: inherit; }
.erp-form input[type=checkbox] { width: 18px; height: 18px; }
.erp-form label { display: block; margin-bottom: 8px; }
.erp-form .errorlist { color: #b42318; padding-left: 20px; }
.erp-search { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.erp-search input { padding: 10px; border: 1px solid #d5d9df; border-radius: 8px; }
@media (max-width: 800px) { .erp-metrics { grid-template-columns: 1fr; } .erp-panel { padding: 16px; } }

.mobile-header { display: none; }
.sidebar { overflow-y: auto; z-index: 20; }
.main-content { min-width: 0; }
.erp-actions form, .inline-form { margin: 0; display: inline-block; }
.erp-table th, .erp-table td { font-size: 13px; line-height: 1.5; }
.erp-table a { display: inline-block; padding: 6px 0; }
.text-button { background: none; border: 0; color: #b42318; cursor: pointer; padding: 8px; }
.logout-button { background: transparent; color: white; border: 1px solid #465164; border-radius: 8px; padding: 8px 18px; margin-top: 10px; cursor: pointer; }
.login-shell { max-width: 440px; margin: 8vh auto; padding: 32px; background: white; border-radius: 20px; box-shadow: var(--shadow); }
.login-shell .brand-mark { color: white; margin-bottom: 24px; }
.login-shell p { color: var(--muted); line-height: 1.6; }
:focus-visible { outline: 3px solid #60a5fa; outline-offset: 3px; }
@media (max-width: 820px) {
  .mobile-header { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; min-height: 60px; padding: 10px 16px; background: #0d1724; color: white; }
  .mobile-brand { color: white; font-size: 18px; font-weight: 700; text-decoration: none; }
  #menu-toggle { min-height: 44px; padding: 8px 16px; border: 1px solid #465164; border-radius: 8px; color: white; background: #172333; font-size: 16px; }
  .sidebar { display: none; top: 60px; width: min(320px, 90vw); bottom: 0; }
  .sidebar.is-open { display: flex; }
  .main-content { width: 100%; margin: 0; padding: 24px 16px 40px; }
  .page-header { flex-direction: column; gap: 16px; }
  .page-header h1 { font-size: 26px; }
  .hero-grid { grid-template-columns: 1fr; }
  .erp-actions { gap: 12px; }
  .erp-actions .button-primary, .erp-actions .button-secondary { min-height: 44px; }
  input, select, textarea { font-size: 16px !important; }
  .erp-table table { min-width: 640px; }
  .panel { min-width: 0; }
  .login-shell { margin: 24px 16px; }
}
.erp-actions .button-primary, .erp-actions .button-secondary, .erp-form button { font-size: 14px; }
@media (max-width: 650px) {
  .erp-table table.mobile-cards { min-width: 0; display: block; }
  .mobile-cards thead { display: none; }
  .mobile-cards tbody, .mobile-cards tr { display: block; }
  .mobile-cards tr { border: 1px solid var(--border); border-radius: 12px; margin: 16px 0; padding: 8px; }
  .mobile-cards td { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 6px; }
  .mobile-cards td::before { content: attr(data-label); color: var(--muted); font-weight: 500; margin-right: auto; }
  .mobile-cards td[colspan]::before { content: none; }
  .mobile-cards td:last-child { border-bottom: 0; }
}
.import-steps { display: flex; gap: 20px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 24px; background: #eaf1f8; border-radius: 12px; color: #526276; font-size: 13px; }
.import-steps strong { color: var(--accent); }
.document-text { max-height: 380px; overflow: auto; white-space: pre-wrap; font-size: 12px; line-height: 1.7; }
.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.document-grid label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.document-grid input:not([type=checkbox]), .document-grid select { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.document-grid input[type=checkbox], .review-confirm input { width: 18px; height: 18px; accent-color: var(--accent); }
.document-row { min-width: 0; }
.document-row legend { font-size: 14px; font-weight: 700; padding: 0 6px; }
.document-row details { margin-top: 16px; font-size: 12px; color: var(--muted); }
.document-review .errorlist { color: #b42318; }
@media (max-width: 650px) { .document-grid { grid-template-columns: 1fr; } .import-steps { gap: 10px; } }

/* Identidade pessoal GR e central de documentos. */
.brand-mark {color:#0d1724;background:#e0c18b;font-size:19px;letter-spacing:-1px;flex-shrink:0}
.import-options {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin-bottom:24px}
.import-options article {display:flex;flex-direction:column;align-items:flex-start;gap:12px}
.import-options p {color:var(--muted);line-height:1.6;flex:1;margin:0}
.import-options h2 {margin:0}
.document-row {min-width:0}
.document-grid > div {min-width:0}
@media(max-width:1100px){.import-options{grid-template-columns:1fr}}
.erp-panel {min-height:0}
.login-shell .brand-mark {color:#0d1724}

.allocation-row{width:100%;display:grid;gap:8px;margin:10px 0}.allocation-row span{font-size:13px;color:var(--muted)}.allocation-row progress{width:100%;height:10px;accent-color:var(--accent)}

/* Controles de instalação só aparecem quando o navegador os disponibiliza. */
[hidden] { display: none !important; }
