:root {
    --navy: #0f3b53;
    --gold: #c79b5b;
    --beige: #e1ccb5;
    --cream: #feedde;
    --muted: #7a8694;
    --line: #e6e0d8;
    --danger: #9b3b3b;
    --card-radius: 18px;
    --control-radius: 12px;
    --shadow-card: 0 18px 50px rgba(15, 59, 83, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    color: var(--navy);
    background: var(--cream);
}

body.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

.login-page__background {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-page__background-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: cover;
    object-position: center center;
}

.login-page__overlay {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1.25rem 1rem;
    box-sizing: border-box;
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(100%, 432px);
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);
    padding: 4.85rem 2.85rem 1.85rem;
    animation: login-rise 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes login-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.login-card__brand {
    text-align: center;
    margin-bottom: 1.35rem;
}

.login-card__logo {
    display: block;
    width: min(100%, 248px);
    height: auto;
    margin: 0 auto 1.15rem;
    object-fit: contain;
    object-position: center;
}

.login-card__title {
    margin: 0;
    font-size: 1.28rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--navy);
}

.login-card__subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.92rem;
    color: var(--muted);
}

.login-card__alert {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    background: #f8ecec;
    color: var(--danger);
    font-size: 0.9rem;
}

.login-form {
    display: grid;
    gap: 0.95rem;
}

.login-field__label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy);
}

.login-field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.login-field__icon {
    position: absolute;
    left: 0.9rem;
    color: #9aa3ad;
    display: inline-flex;
    pointer-events: none;
}

.login-field__input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: var(--control-radius);
    padding: 0 2.75rem 0 2.7rem;
    font: inherit;
    color: var(--navy);
    background: #fff;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-field__input::placeholder {
    color: #a3adb8;
}

.login-field__input:focus {
    border-color: #6f8fa0;
    box-shadow: 0 0 0 3px rgba(15, 59, 83, 0.12);
}

.login-field__toggle {
    position: absolute;
    right: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9aa3ad;
    cursor: pointer;
}

.login-field__toggle:hover,
.login-field__toggle:focus-visible {
    color: var(--navy);
    background: #f7efe6;
    outline: none;
}

.login-form__meta {
    display: flex;
    justify-content: flex-end;
    margin-top: -0.15rem;
}

.login-form__forgot {
    font-size: 0.88rem;
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 2px;
    pointer-events: none;
}

.login-form__submit {
    margin-top: 0.35rem;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    border: 0;
    border-radius: var(--control-radius);
    background: var(--navy);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.login-form__submit:hover {
    background: #0c3145;
    box-shadow: 0 10px 24px rgba(15, 59, 83, 0.22);
}

.login-form__submit:active {
    transform: translateY(1px);
}

.login-form__submit:focus-visible {
    outline: 3px solid #d8b887;
    outline-offset: 2px;
}

.login-card__footer {
    margin-top: 1.35rem;
}

.login-card__divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.login-card__divider::before,
.login-card__divider::after {
    content: '';
    height: 1px;
    background: var(--line);
}

.login-card__secure {
    margin: 0.85rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.inicio-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(225, 204, 181, 0.55), transparent 42%),
        var(--cream);
}

.inicio-shell {
    width: min(920px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 3rem 0;
}

.inicio-shell__header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
    background: #fff;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 12px 32px rgba(15, 59, 83, 0.08);
}

.inicio-shell__header h1 {
    margin: 0;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}

.inicio-shell__header p {
    margin: 0.45rem 0 0;
    color: var(--muted);
}

.inicio-shell__logout {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--navy);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.inicio-shell__logout:hover {
    border-color: var(--navy);
}

@media (max-width: 640px) {
    .login-card {
        padding: 1.85rem 1.25rem 1.5rem;
    }

    .login-card__logo {
        width: min(100%, 220px);
    }

    .inicio-shell__header {
        flex-direction: column;
    }
}

@media (max-height: 720px) {
    .login-page__overlay {
        padding: 0.75rem 1rem;
    }

    .login-card {
        padding: 1.85rem 1.6rem 1.5rem;
    }

    .login-card__logo {
        width: min(100%, 220px);
        margin-bottom: 0.9rem;
    }

    .login-card__brand {
        margin-bottom: 1.1rem;
    }

    .login-card__footer {
        margin-top: 1.1rem;
    }
}

/* =========================================================
   App shell — área autenticada (molde global)
   ========================================================= */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-body {
    margin: 0;
    min-height: 100vh;
    background: #f7f1ea;
    color: var(--navy);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.app-topbar {
    background: var(--navy);
    color: #f4f7fa;
}

.app-topbar__inner,
.app-header__inner,
.app-nav__inner,
.app-main__inner,
.app-footer__inner {
    width: min(1180px, calc(100% - 2.5rem));
    margin: 0 auto;
}

.app-topbar__inner {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.72rem;
}

.app-topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.app-topbar__copy {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.app-topbar__sep {
    opacity: 0.55;
}

.app-topbar__date {
    margin: 0;
    opacity: 0.92;
    white-space: nowrap;
}

.app-header {
    background: #fbf6f0;
    border-bottom: 1px solid rgba(15, 59, 83, 0.06);
}

.app-header__inner {
    padding: 0.55rem 0 0.45rem;
}

.app-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.app-brand__logo {
    display: block;
    width: min(172px, 40vw);
    height: auto;
    object-fit: contain;
    background: transparent;
}

.app-header__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.app-search {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: min(240px, 34vw);
    height: 34px;
    padding: 0 0.8rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(15, 59, 83, 0.08);
    color: var(--muted);
    font-size: 0.875rem;
}

.app-search input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    color: var(--navy);
}

.app-search input::placeholder {
    color: #9aa3ad;
}

.app-icon-btn,
.app-user {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--navy);
    cursor: pointer;
    padding: 0;
}

.app-user-menu {
    position: relative;
}

.app-user-menu.is-open .app-user {
    background: rgba(15, 59, 83, 0.05);
}

.app-user-menu__dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 40;
    min-width: 200px;
    padding: 0.4rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(15, 59, 83, 0.08);
    box-shadow: 0 14px 34px rgba(15, 59, 83, 0.14);
}

.app-user-menu__item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--navy);
    text-decoration: none;
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.app-user-menu__item:hover {
    background: rgba(15, 59, 83, 0.05);
}

.app-user-menu__item--danger {
    color: #8a3b3b;
}

.app-user-menu form {
    margin: 0;
}

.app-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
}

.app-icon-btn:hover,
.app-user:hover {
    background: rgba(15, 59, 83, 0.05);
}

.app-icon-btn__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--gold);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.app-user {
    gap: 0.35rem;
    padding: 0.2rem 0.35rem 0.2rem 0.2rem;
    border-radius: 999px;
}

.app-user__avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--navy);
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.app-nav {
    overflow-x: auto;
}

.app-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: max-content;
}

.app-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--navy);
    font-size: 0.84rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 160ms ease, color 160ms ease;
}

.app-nav__link:hover {
    background: rgba(199, 155, 91, 0.12);
}

.app-nav__link.is-active {
    background: var(--gold);
    color: #fff;
}

.app-nav__icon {
    display: inline-flex;
}

.app-main {
    flex: 1;
    position: relative;
    background:
        radial-gradient(circle at 92% 88%, rgba(225, 204, 181, 0.45), transparent 28%),
        #f7f1ea;
}

.app-main__inner {
    padding: 1.75rem 0 2.5rem;
}

.app-welcome {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.app-welcome__eyebrow {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8b949e;
    font-weight: 600;
}

.app-welcome__title {
    margin: 0.35rem 0 0;
    font-size: clamp(1.7rem, 2.4vw, 2.15rem);
    letter-spacing: -0.03em;
    color: var(--navy);
}

.app-welcome__subtitle {
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.app-welcome__motto {
    text-align: right;
    max-width: 11rem;
}

.app-welcome__motto p {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8b949e;
    line-height: 1.45;
    font-weight: 600;
}

.app-welcome__waves {
    display: inline-flex;
    margin-top: 0.55rem;
}

.app-mold__row {
    display: grid;
    gap: 1rem;
}

.app-mold__row--metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.app-mold__row--panels {
    grid-template-columns: 1.35fr 1fr;
}

.app-mold__card,
.app-mold__panel {
    background: rgba(225, 204, 181, 0.38);
    border-radius: 18px;
    border: 1px solid rgba(199, 155, 91, 0.12);
}

.app-mold__card {
    min-height: 92px;
}

.app-mold__panel {
    min-height: 280px;
}

.app-mold__hint,
.app-mold__placeholder {
    margin: 1.1rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.app-mold__placeholder {
    background: rgba(255, 255, 255, 0.55);
    border: 1px dashed rgba(15, 59, 83, 0.18);
    border-radius: 16px;
    padding: 2rem;
}

.app-mold__placeholder p {
    margin: 0;
}

.app-mold__placeholder p + p {
    margin-top: 0.45rem;
}

.app-footer {
    position: relative;
    margin-top: auto;
    background: #fbf6f0;
    border-top: 1px solid rgba(15, 59, 83, 0.06);
    overflow: hidden;
}

.app-footer__inner {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.15rem 0;
    position: relative;
    z-index: 1;
}

.app-footer__brand p {
    margin: 0;
    color: #6d7884;
    font-size: 0.9rem;
}

.app-footer__tagline {
    margin-top: 0.3rem !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9aa3ad !important;
}

.app-footer__links {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #8b949e;
    font-size: 0.88rem;
}

.app-footer__links a,
.app-footer__logout button {
    color: inherit;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.app-footer__links a:hover,
.app-footer__logout button:hover {
    color: var(--navy);
}

.app-footer__decor {
    position: absolute;
    right: -40px;
    bottom: -50px;
    width: 180px;
    height: 180px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(225, 204, 181, 0.55) 0%, rgba(225, 204, 181, 0.18) 55%, transparent 70%);
    pointer-events: none;
}

.app-footer__decor::before {
    content: '';
    position: absolute;
    left: -36px;
    top: 28px;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: rgba(199, 155, 91, 0.18);
}

@media (max-width: 980px) {
    .app-mold__row--metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-mold__row--panels {
        grid-template-columns: 1fr;
    }

    .app-welcome {
        flex-direction: column;
    }

    .app-welcome__motto {
        text-align: left;
    }
}

@media (max-width: 720px) {
    .app-topbar__inner,
    .app-header__inner,
    .app-main__inner,
    .app-footer__inner {
        width: min(1180px, calc(100% - 1.5rem));
    }

    .app-header__top {
        flex-wrap: wrap;
    }

    .app-header__actions {
        width: 100%;
    }

    .app-search {
        min-width: 0;
        flex: 1;
    }

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

    .app-topbar__date {
        display: none;
    }
}

/* =========================================================
   Configurações / cadastro de clientes
   ========================================================= */

.cfg-alert {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.92rem;
}

.cfg-alert--success {
    background: #eaf6ef;
    color: #1f6b45;
}

.cfg-alert--error {
    background: #f8ecec;
    color: var(--danger);
}

.cfg-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.2fr);
    gap: 1.1rem;
    align-items: start;
}

.cfg-panel {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 59, 83, 0.08);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 10px 28px rgba(15, 59, 83, 0.05);
}

.cfg-panel__header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--navy);
}

.cfg-panel__header p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.cfg-form {
    display: grid;
    gap: 0.85rem;
    margin-top: 1.1rem;
}

.cfg-field {
    display: grid;
    gap: 0.35rem;
}

.cfg-field[hidden] {
    display: none !important;
}

.cfg-field label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--navy);
}

.cfg-field input,
.cfg-field select,
.cfg-field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    font: inherit;
    color: var(--navy);
    background: #fff;
    outline: none;
}

.cfg-field input:focus,
.cfg-field select:focus,
.cfg-field textarea:focus,
.cfg-table select:focus {
    border-color: #6f8fa0;
    box-shadow: 0 0 0 3px rgba(15, 59, 83, 0.1);
}

.cfg-field .lan-cat__search {
    height: 42px;
    padding: 0 2.2rem 0 0.9rem;
}

.cfg-table .lan-cat__search {
    height: 40px;
    min-width: 14rem;
    padding: 0 2.2rem 0 0.85rem;
}

.cc-parcela {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cc-compra__input {
    width: 100%;
    min-width: 8rem;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 0.75rem;
    font: inherit;
    color: var(--navy);
    background: #fff;
}

.cc-parcela .cc-compra__input {
    width: 4.2rem;
    min-width: 0;
    padding: 0 0.45rem;
    text-align: center;
}

.cc-compra__salvar {
    margin-top: 0.45rem;
    height: 34px;
    padding: 0 0.85rem;
    border: 0;
    border-radius: 999px;
    background: var(--navy);
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.cfg-table select {
    width: 100%;
    min-width: 12rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.55rem 0.75rem;
    font: inherit;
    color: var(--navy);
    background: #fff;
    outline: none;
}

.cfg-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    color: var(--navy);
}

.cfg-submit {
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: var(--navy);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.cfg-submit:hover {
    background: #0c3145;
}

.cfg-empty {
    margin-top: 1.1rem;
    padding: 1.25rem;
    border-radius: 14px;
    border: 1px dashed rgba(15, 59, 83, 0.18);
    color: var(--muted);
}

.cfg-empty p {
    margin: 0;
}

.cfg-empty p + p {
    margin-top: 0.35rem;
}

.cfg-table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
}

.cfg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.cfg-table th,
.cfg-table td {
    padding: 0.75rem 0.55rem;
    text-align: left;
    border-bottom: 1px solid rgba(15, 59, 83, 0.08);
    vertical-align: top;
}

.cfg-table th {
    color: #6d7884;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lan-importar-remover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8a3b3b;
    cursor: pointer;
}

.lan-importar-remover:hover {
    background: rgba(138, 59, 59, 0.08);
}

.lan-importar-nova {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(15, 59, 83, 0.08);
}

.lan-importar-nova__titulo {
    margin: 0;
    font-weight: 600;
    color: var(--navy);
}

.lan-importar-nova__campos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.75rem;
    align-items: end;
}

.lan-importar-nova__campos .cfg-field {
    min-width: 7.5rem;
}

.lan-importar-nova__descricao {
    flex: 1 1 14rem;
}

.lan-importar-nova .cfg-field > span {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--navy);
}

.lan-importar-nova__estorno {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 42px;
    font-weight: 600;
    color: var(--navy);
}

.lan-importar-nova .cfg-submit {
    height: 42px;
}

.cfg-panel > [data-importar-confirmar] {
    margin-top: 1rem;
}

.lan-importar-remover:disabled {
    opacity: 0.5;
    cursor: default;
}

.cfg-table__note {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 400;
}

.cfg-status {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.cfg-status--ativo {
    background: #eaf6ef;
    color: #1f6b45;
}

.cfg-status--inativo {
    background: #f3f0ea;
    color: #7a6a52;
}

.cfg-status--arquivado {
    background: #eceff3;
    color: #5b6773;
}

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

/* ============================================================
   Contas e Cartões (REQ-009 / REQ-017)
   ============================================================ */

.cc-toolbar {
    margin: 0 0 1rem;
}

.cc-list {
    margin-top: 1.25rem;
}

.cc-extracao + .cc-extracao {
    margin-top: 1.25rem;
}

.cc-extracao h3 {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.cc-extracao h3 span {
    color: #6d7884;
    font-weight: 400;
}

.cc-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.cc-form-inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem 1rem;
    align-items: end;
}

.cc-link {
    color: var(--accent, #1f6f5b);
    font-weight: 600;
    text-decoration: none;
}

.cc-link:hover {
    text-decoration: underline;
}

.cc-resumo {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}

.cc-resumo > div {
    background: rgba(31, 111, 91, 0.06);
    border: 1px solid rgba(31, 111, 91, 0.12);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    display: grid;
    gap: 0.25rem;
}

.cc-resumo span {
    color: var(--muted);
    font-size: 0.85rem;
}

.cc-resumo strong {
    font-size: 1.15rem;
}

.cc-dl {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.cc-dl div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 0.5rem;
}

.cc-dl dt {
    color: var(--muted);
    font-weight: 500;
}

.cc-dl dd {
    margin: 0;
    font-weight: 600;
}

@media (max-width: 720px) {
    .cc-field-row,
    .cc-resumo {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Lançamentos (REQ-011 / REQ-010)
   ============================================================ */

.lan-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.lan-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.1rem;
    border-radius: 999px;
    background: #0f3b53;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(15, 59, 83, 0.18);
}

.lan-fab:hover {
    background: #0c3044;
}

.lan-capture {
    position: relative;
    width: min(46rem, 100%);
    margin: 0 auto 1.5rem;
}

.lan-capture .lan-form {
    width: 100%;
    max-width: none;
    margin: 0;
}

.lan-import {
    position: absolute;
    top: 0;
    left: calc(100% + 0.85rem);
    margin: 0;
}

.lan-mais {
    margin: 0.25rem 0 0.85rem;
}

.lan-mais summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.75rem;
}

.lan-import__btn {
    display: inline-block;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 59, 83, 0.2);
    background: #fff;
    color: var(--navy);
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.lan-import__btn:hover {
    border-color: var(--navy);
}

@media (max-width: 1100px) {
    .lan-import {
        position: static;
        display: flex;
        justify-content: flex-end;
        margin: 0 0 0.65rem;
    }
}

.lan-cat {
    position: relative;
}

.lan-cat__control {
    position: relative;
}

.lan-cat__search {
    width: 100%;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(15, 59, 83, 0.15);
    background: #fff;
    color: var(--navy, #0f3b53);
    font: inherit;
    padding: 0 2.2rem 0 0.9rem;
}

.lan-cat__search:focus {
    outline: none;
    border-color: rgba(15, 59, 83, 0.35);
    box-shadow: 0 0 0 3px rgba(15, 59, 83, 0.08);
}

.lan-cat__clear {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.6rem;
    height: 1.6rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted, #5b6773);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.lan-cat__clear:hover {
    background: rgba(15, 59, 83, 0.08);
}

.lan-cat__list {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    max-height: 16rem;
    overflow: auto;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    background: #fff;
    border: 1px solid rgba(15, 59, 83, 0.12);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 59, 83, 0.12);
}

.lan-cat__list.lan-cat__list--float {
    position: fixed;
    z-index: 40;
    right: auto;
    margin: 0;
}

.lan-cat__option {
    display: grid;
    gap: 0.1rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
}

.lan-cat__option[hidden],
.lan-cat__empty[hidden],
.lan-cat__create[hidden] {
    display: none !important;
}

.lan-cat__option.is-active {
    background: rgba(15, 59, 83, 0.08);
}

.lan-cat__option:hover,
.lan-cat__option:focus {
    background: rgba(15, 59, 83, 0.06);
    outline: none;
}

.lan-cat__option--empty {
    color: var(--muted, #5b6773);
    font-size: 0.9rem;
}

.lan-cat__pai {
    color: var(--muted, #5b6773);
    font-size: 0.78rem;
}

.lan-cat__empty {
    padding: 0.7rem;
    color: var(--muted, #5b6773);
    font-size: 0.9rem;
}

.lan-cat__create {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.35rem;
    padding: 0.65rem 0.7rem;
    border-top: 1px solid rgba(15, 59, 83, 0.08);
}

.lan-cat__create-title {
    margin: 0;
    color: var(--navy, #0f3b53);
    font-size: 0.88rem;
}

.lan-cat__create-grupo {
    display: grid;
    gap: 0.2rem;
    color: var(--muted, #5b6773);
    font-size: 0.75rem;
}

.lan-cat__create-grupo select,
.lan-cat__create button {
    height: 34px;
    border-radius: 10px;
    font: inherit;
}

.lan-cat__create-grupo select {
    border: 1px solid rgba(15, 59, 83, 0.15);
    background: #fff;
    color: var(--navy, #0f3b53);
    padding: 0 0.55rem;
}

.lan-cat__create button {
    border: 0;
    background: var(--navy, #0f3b53);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.lan-cat__create-erro {
    margin: 0;
    color: #8a2222;
    font-size: 0.8rem;
}

.lan-cat__status {
    margin: 0.25rem 0 0;
    color: #2f6b3c;
    font-size: 0.75rem;
}

.lan-cat__status.is-erro {
    color: #8a2222;
}

.lan-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.lan-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.lan-chip {
    display: inline-flex;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 59, 83, 0.15);
    color: var(--muted, #5b6773);
    text-decoration: none;
    font-size: 0.9rem;
}

.lan-chip.is-active {
    background: rgba(15, 59, 83, 0.08);
    color: #0f3b53;
    font-weight: 600;
}

.lan-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lan-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
}

.lan-item__main {
    display: grid;
    gap: 0.2rem;
}

.lan-item__main span {
    color: var(--muted, #5b6773);
    font-size: 0.88rem;
}

.lan-item__valor.is-receita { color: #1f6f5b; }
.lan-item__valor.is-despesa { color: #8a2222; }

.lan-form {
    max-width: 40rem;
}

.lan-form__hint {
    margin: 0 0 0.75rem;
    color: var(--muted, #5b6773);
    font-size: 0.9rem;
}

.lan-form__aviso {
    margin: 0.5rem 0 0;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    background: rgba(199, 155, 91, 0.12);
    color: #6a4f1d;
    font-size: 0.9rem;
}

.lan-fieldset {
    border: 0;
    margin: 0 0 1rem;
    padding: 0;
}

.lan-fieldset legend {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.lan-tipo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.lan-tipo__opt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid rgba(15, 59, 83, 0.15);
    border-radius: 12px;
    cursor: pointer;
}

.lan-preview {
    display: grid;
    gap: 0.5rem;
}

.lan-preview__row {
    display: grid;
    gap: 0.25rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
}

.lan-preview__fatura {
    max-width: 8rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(15, 59, 83, 0.2);
    border-radius: 8px;
}

.lan-parcelas {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.lan-parcela {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.lan-parcela > div {
    display: grid;
    gap: 0.2rem;
}

.lan-parcela__pagar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: end;
}

.lan-parcela__pagar .cfg-submit {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
}

@media (max-width: 720px) {
    .lan-hero {
        flex-direction: column;
    }

    .lan-fab {
        position: sticky;
        bottom: 1rem;
        z-index: 5;
        align-self: stretch;
        text-align: center;
    }
}

/* ============================================================
   Planejamento financeiro (REQ-002)
   ============================================================ */

.plan {
    display: grid;
    gap: 1.25rem;
}

.plan-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.plan-hero__eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plan-hero__title {
    margin: 0.2rem 0 0.45rem;
    color: var(--navy);
    font-size: clamp(1.6rem, 2.4vw, 2rem);
}

.plan-hero__subtitle {
    margin: 0;
    max-width: 46rem;
    color: var(--muted);
    line-height: 1.45;
}

.plan-save {
    margin: 0;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 59, 83, 0.08);
    color: var(--navy);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.plan-save[data-kind="pending"] { background: rgba(199, 155, 91, 0.18); }
.plan-save[data-kind="error"] { background: rgba(176, 52, 52, 0.12); color: #8a2222; }

.plan-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: space-between;
    align-items: center;
}

.plan-toolbar__filters,
.plan-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.plan-select select,
.plan-select input[type="month"],
.plan-search input,
.plan-client-chip {
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(15, 59, 83, 0.1);
    background: #fff;
    color: var(--navy);
    font: inherit;
    padding: 0 0.95rem;
}

.plan-select input[type="month"] {
    min-width: 11.5rem;
    cursor: pointer;
    color-scheme: light;
}

.mensal-eixo {
    border: 0;
    margin: 0;
    padding: 0;
}

.mensal-eixo .lan-tipo {
    grid-template-columns: repeat(3, minmax(8.5rem, 1fr));
}

.plan-select input[type="month"]::-webkit-calendar-picker-indicator {
    opacity: 0.55;
    cursor: pointer;
    margin-left: 0.25rem;
}

.plan-select input[type="month"]:focus {
    outline: none;
    border-color: rgba(15, 59, 83, 0.35);
    box-shadow: 0 0 0 3px rgba(15, 59, 83, 0.08);
}

.plan-search input { min-width: min(240px, 70vw); }
.plan-client-chip {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.plan-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 40px;
    padding: 0 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 59, 83, 0.1);
    background: #fff;
    color: var(--navy);
    font-size: 0.86rem;
    cursor: pointer;
    user-select: none;
}

.plan-check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--navy);
    cursor: pointer;
}

.plan-view-toggle {
    display: inline-flex;
    border-radius: 999px;
    background: rgba(15, 59, 83, 0.06);
    padding: 0.2rem;
}

.plan-view-toggle__btn {
    border: 0;
    background: transparent;
    color: var(--navy);
    font: inherit;
    font-size: 0.82rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
}

.plan-view-toggle__btn.is-active {
    background: var(--gold);
    color: #fff;
    font-weight: 600;
}

.plan-view-toggle__btn:disabled { opacity: 0.45; cursor: not-allowed; }
.plan-view-toggle__btn:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

.plan[data-visao="compacta"] .plan-matrix-wrap { display: none; }
.plan[data-visao="mensal"] .plan-compact { display: none; }

.plan-compact {
    list-style: none;
    margin: 0;
    padding: 0.15rem 0 0;
    display: grid;
    gap: 0.45rem;
}

.plan-compact-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: #fbf7f1;
}

.plan-compact-item__main {
    min-width: 0;
    display: grid;
    gap: 0.15rem;
}

.plan-compact-item__name {
    margin: 0;
    color: var(--navy);
    font-weight: 600;
}

.plan-compact-item__value {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    text-align: left;
    font: inherit;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--navy);
    cursor: pointer;
}

.plan-compact-item__value:hover { color: var(--gold); }
.plan-compact-item__value.is-empty { color: #9aa4ad; font-weight: 500; }
.plan-compact-item__value:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}

.plan-compact-item__flag {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.plan-compact-item__recorrente {
    margin-top: 0.2rem;
    width: fit-content;
    gap: 0.4rem;
    cursor: pointer;
}

.plan-compact-empty {
    color: var(--muted);
    font-size: 0.88rem;
    padding: 0.35rem 0.15rem;
}

.plan-search-empty {
    margin: 0;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #fff;
    color: var(--muted);
    border: 1px dashed rgba(15, 59, 83, 0.16);
}

.plan-mark {
    background: rgba(199, 155, 91, 0.35);
    color: inherit;
    border-radius: 3px;
    padding: 0 0.1em;
}

.plan-summary__row--saldo.is-negative strong { color: #8a2222; }

.plan-recorte {
    position: relative;
    margin-top: 0.75rem;
}

.plan-summary__meses {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(15, 59, 83, 0.25);
    text-underline-offset: 0.2em;
}

.plan-summary__meses:hover,
.plan-summary__meses:focus-visible {
    color: var(--navy);
}

.plan-recorte__pop {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.4rem);
    z-index: 5;
    display: grid;
    gap: 0.65rem;
    padding: 0.85rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(15, 59, 83, 0.1);
    box-shadow: 0 10px 28px rgba(15, 59, 83, 0.12);
}

.plan-recorte__pop[hidden] {
    display: none;
}

.plan-recorte__hint,
.plan-recorte__erro {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--muted);
}

.plan-recorte__erro { color: #8a2222; }

.plan-recorte__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.plan-recorte__fields label {
    display: grid;
    gap: 0.25rem;
    color: var(--navy);
    font-size: 0.78rem;
}

.plan-recorte__fields select {
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(15, 59, 83, 0.12);
    padding: 0 0.5rem;
    font: inherit;
    background: #fff;
}

.plan-recorte__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

.plan-btn {
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    background: rgba(15, 59, 83, 0.08);
    color: var(--navy);
}

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

.plan-btn--danger {
    background: #8a2222;
    color: #fff;
}

.plan-dialog__lead,
.plan-dialog__note {
    margin: 0;
    line-height: 1.45;
}

.plan-dialog__lead {
    color: var(--navy);
    font-size: 1rem;
}

.plan-dialog__note {
    color: var(--muted);
    font-size: 0.86rem;
}

.plan-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.1rem;
    align-items: start;
}

.plan-main { display: grid; gap: 0.85rem; min-width: 0; }

.plan-section {
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(15, 59, 83, 0.06);
    overflow: hidden;
    border-left: 4px solid var(--navy);
}

.plan-section--receita { border-left-color: #5f8f6b; }
.plan-section--moradia { border-left-color: #4d7ea8; }
.plan-section--alimentacao { border-left-color: #c4a24a; }
.plan-section--saude { border-left-color: #7a8fbe; }
.plan-section--transporte { border-left-color: #6d8b74; }
.plan-section--lazer { border-left-color: #b8876a; }
.plan-section--educacao { border-left-color: #8a7bb5; }
.plan-section--pet { border-left-color: #9a7a5c; }
.plan-section--pessoal { border-left-color: #7f9aa8; }
.plan-section--financeiro { border-left-color: #5c738a; }
.plan-section--filhos { border-left-color: #a67c8b; }
.plan-section--empresas { border-left-color: #6e7f6a; }
.plan-section--outros { border-left-color: #8a8a8a; }

.plan-section__header {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: center;
    border: 0;
    background: transparent;
    padding: 0.85rem 1rem;
    cursor: pointer;
    text-align: left;
    color: var(--navy);
    font: inherit;
}

.plan-section__name { font-weight: 700; letter-spacing: 0.04em; }
.plan-section__summary { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.plan-section__summary small { font-weight: 500; }

.plan-section__body { padding: 0 0.75rem 0.85rem; }

.plan-matrix-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(15, 59, 83, 0.06);
}

.plan-matrix {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.84rem;
}

.plan-matrix th,
.plan-matrix td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid rgba(15, 59, 83, 0.06);
    white-space: nowrap;
    background: #fff;
}

.plan-matrix th {
    color: var(--muted);
    font-weight: 600;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fbf7f1;
}

.plan-matrix__sticky {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    overflow: hidden;
    background: #fff;
    box-shadow: 1px 0 0 rgba(15, 59, 83, 0.08);
}

.plan-matrix__sticky--2 {
    left: 150px;
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    z-index: 3;
    overflow: hidden;
}

.plan-matrix thead .plan-matrix__sticky { z-index: 4; background: #fbf7f1; }

.plan-matrix__total td {
    border-bottom: 0;
    border-top: 1px solid rgba(15, 59, 83, 0.12);
    background: #f7f3ec;
    font-weight: 700;
    color: var(--navy);
}

.plan-matrix__total .plan-matrix__sticky,
.plan-matrix__total .plan-matrix__sticky--2 {
    background: #f7f3ec;
}

.plan-total-cell {
    display: inline-block;
    min-width: 4.5rem;
    font-variant-numeric: tabular-nums;
}

.plan-total-cell.is-empty {
    color: var(--muted);
    font-weight: 500;
}

.plan-item-name {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: var(--navy);
}

.plan-cell {
    border: 0;
    background: transparent;
    color: var(--navy);
    font: inherit;
    min-width: 92px;
    padding: 0.35rem 0.4rem;
    border-radius: 8px;
    cursor: text;
    text-align: right;
}

.plan-cell:hover { background: rgba(199, 155, 91, 0.12); }
.plan-cell.is-empty { color: #9aa4ad; }
.plan-cell__input {
    width: 88px;
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 0.3rem 0.4rem;
    font: inherit;
    text-align: right;
}

.plan-switch {
    border: 0;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    background: #e8ecef;
    color: #5b6773;
}

.plan-switch.is-on {
    background: rgba(95, 143, 107, 0.2);
    color: #2f6b3c;
}

.plan-recorrente {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.plan-recorrente input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.plan-recorrente__ui {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #d5dde3;
    position: relative;
    transition: background 0.15s ease;
}

.plan-recorrente__ui::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 59, 83, 0.25);
    transition: transform 0.15s ease;
}

.plan-recorrente input:checked + .plan-recorrente__ui {
    background: #5f8f6b;
}

.plan-recorrente input:checked + .plan-recorrente__ui::after {
    transform: translateX(18px);
}

.plan-recorrente input:focus-visible + .plan-recorrente__ui {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.plan-recorrente input:disabled + .plan-recorrente__ui {
    opacity: 0.55;
}

.plan-add-inline {
    margin-top: 0.65rem;
    border: 0;
    background: transparent;
    color: var(--navy);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0.35rem 0.2rem;
}

.plan-row-remove {
    border: 0;
    background: transparent;
    color: #9aa4ad;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.35rem;
}

.plan-row-remove:hover { color: #8a2222; }

.plan-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    white-space: nowrap;
}

.plan-row-edit {
    border: 0;
    background: transparent;
    color: #9aa4ad;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0 0.35rem;
    line-height: 1;
}

.plan-row-edit:hover { color: var(--navy); }

.plan-aside { display: grid; gap: 0.85rem; position: sticky; top: 1rem; }

.plan-summary,
.plan-note {
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(15, 59, 83, 0.06);
    padding: 1rem;
}

.plan-summary h2 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    color: var(--navy);
}

.plan-summary__period {
    margin: 0 0 0.85rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.plan-summary__row {
    display: grid;
    gap: 0.15rem;
    padding: 0.65rem 0;
    border-top: 1px solid rgba(15, 59, 83, 0.06);
}

.plan-summary__row span { color: var(--muted); font-size: 0.82rem; }
.plan-summary__row strong { color: var(--navy); font-size: 1.05rem; }
.plan-summary__row small { color: var(--muted); }
.plan-summary__row--saldo strong { color: #2f6b3c; }

.plan-note p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.plan-dialog {
    border: 0;
    border-radius: 16px;
    padding: 0;
    width: min(480px, calc(100vw - 1.5rem));
    max-height: calc(100vh - 2rem);
    overflow: auto;
    box-shadow: 0 18px 50px rgba(15, 59, 83, 0.2);
}

.plan-dialog::backdrop { background: rgba(15, 59, 83, 0.35); }

.plan-dialog__form {
    display: grid;
    gap: 0.75rem;
    padding: 1.1rem;
    padding-bottom: max(1.1rem, env(safe-area-inset-bottom));
}

.plan-dialog__form h3 { margin: 0; color: var(--navy); }
.plan-dialog__form label {
    display: grid;
    gap: 0.35rem;
    color: var(--navy);
    font-size: 0.88rem;
}

.plan-dialog__form input[type="text"],
.plan-dialog__form input[type="number"],
.plan-dialog__form select {
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(15, 59, 83, 0.12);
    padding: 0 0.75rem;
    font: inherit;
    background: #fff;
    color: var(--navy);
    width: 100%;
    box-sizing: border-box;
}

.plan-check {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    grid-template-columns: none !important;
}

.plan-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.plan-dialog__error { margin: 0; color: #8a2222; font-size: 0.85rem; }

.plan-matrix th:not(.plan-matrix__sticky),
.plan-matrix td:not(.plan-matrix__sticky) {
    min-width: 4.5rem;
}

@media (max-width: 1100px) {
    .plan-layout { grid-template-columns: 1fr; }
    .plan-aside { position: static; }
}

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

    .plan-toolbar__filters,
    .plan-toolbar__actions {
        width: 100%;
    }

    .plan-toolbar__actions {
        justify-content: space-between;
    }

    .plan-view-toggle {
        flex: 1;
    }

    .plan-view-toggle__btn {
        flex: 1;
        text-align: center;
    }

    .plan-search input {
        width: 100%;
        min-width: 0;
    }

    .plan-select {
        flex: 1;
        min-width: 0;
    }

    .plan-select select,
    .plan-select input[type="month"] {
        width: 100%;
    }

    .plan-recorte__pop {
        position: static;
        margin-top: 0.5rem;
        box-shadow: none;
    }

    .plan-dialog {
        width: calc(100vw - 1rem);
        margin: auto;
    }
}
