* {
    box-sizing: border-box;
}

:root {
    --app-primary: #0ea5b9;
    --app-primary-dark: #078ca0;
    --app-blue: #338bd3;
    --app-success: #7ac943;
    --app-danger: #ff3b3f;
    --app-warning: #a85b00;
    --app-muted: #8b95a5;
    --app-light: #f5f7fb;
    --app-border: #dce3ee;
    --app-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

body {
    min-height: 100vh;
    background: #ffffff;
    color: #364152;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    text-decoration: none;
}

.disabled-link {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Login */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 185, 0.18), transparent 30%),
        linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #ffffff;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.login-brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--app-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.login-brand h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
}

.login-brand p {
    margin: 2px 0 0;
    color: #64748b;
    font-size: 14px;
}

/* Layout base */
.app-shell {
    min-height: 100vh;
}

.app-main-wrap {
    padding-left: 62px;
    padding-top: 68px;
    min-height: 100vh;
}

.app-content {
    padding: 24px 28px 40px;
    max-width: 1480px;
    margin: 0 auto;
}

.quick-rail {
    position: fixed;
    left: 0;
    top: 68px;
    bottom: 0;
    width: 62px;
    background: #e8f0fa;
    border-right: 1px solid #d1ddeb;
    z-index: 1030;
    display: flex;
    align-items: center;
    flex-direction: column;
    padding-top: 18px;
    gap: 12px;
    box-shadow: 4px 0 12px rgba(15, 23, 42, 0.08);
}

.rail-action,
.rail-link {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 25px;
    transition: 0.2s;
}

.rail-action:hover,
.rail-link:hover,
.rail-link.active {
    transform: translateY(-1px);
    background: #ffffff;
    color: var(--app-primary);
}

.rail-income {
    background: var(--app-success);
    color: #ffffff;
}

.rail-expense {
    background: var(--app-danger);
    color: #ffffff;
}

.rail-income:hover,
.rail-expense:hover {
    color: #ffffff;
    filter: brightness(0.96);
}

.rail-action .bi-arrow-left-short,
.rail-action .bi-arrow-right-short {
    position: absolute;
    bottom: 2px;
    right: 1px;
    font-size: 22px;
}

/* Topbar */
.yampa-like-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: var(--app-primary);
    color: #ffffff;
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    align-items: center;
    z-index: 1040;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.18);
}

.topbar-logo-area {
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0 26px;
    background: rgba(0,0,0,0.04);
}

.topbar-logo-area span {
    font-size: 33px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1.5px;
}

.topbar-logo-area img {
    max-height: 42px;
    max-width: 180px;
    object-fit: contain;
}

.topbar-nav {
    height: 68px;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.topbar-nav a {
    min-width: 112px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 13px;
    font-weight: 600;
    gap: 3px;
    padding: 6px 12px;
    transition: 0.2s;
}

.topbar-nav a i {
    font-size: 24px;
}

.topbar-nav a:hover,
.topbar-nav a.active {
    background: var(--app-blue);
    color: #ffffff;
}

.topbar-profile {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 22px;
}

.profile-text {
    text-align: right;
    line-height: 1.2;
    max-width: 170px;
}

.profile-text strong,
.profile-text small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-icon {
    width: 38px;
    height: 38px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 27px;
}

.profile-icon span {
    position: absolute;
    top: -9px;
    right: -7px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-logout {
    color: #ffffff;
    font-size: 22px;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.03fr 1.25fr 1.15fr;
    gap: 18px;
    margin-bottom: 26px;
}

.finance-card {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: var(--app-shadow);
    overflow: hidden;
    min-height: 310px;
}

.finance-card-header {
    min-height: 52px;
    background: #d8e1ec;
    color: #667085;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    font-weight: 800;
    font-size: 16px;
}

.finance-card-body {
    padding: 18px;
}

.info-icon {
    color: var(--app-primary);
    font-size: 20px;
}

.fin-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #dde3eb;
    margin-bottom: 16px;
}

.fin-row:last-child {
    border-bottom: none;
}

.fin-label {
    font-size: 16px;
    color: #111827;
    font-weight: 800;
}

.fin-sub {
    display: block;
    color: #667085;
    font-size: 13px;
    margin-top: 4px;
}

.fin-value {
    display: block;
    color: #1f2937;
    font-size: 22px;
    margin-top: 6px;
}

.health-box {
    margin-top: 12px;
}

.health-title {
    font-weight: 800;
    color: #111827;
    margin-bottom: 10px;
}

.health-track {
    display: flex;
    align-items: center;
}

.health-score {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: #d8ffe8;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    margin-right: 8px;
}

.health-pill {
    min-height: 50px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    font-size: 13px;
}

.health-pill.warning {
    background: #fff4d6;
    color: #d29a00;
    border-radius: 22px 0 0 22px;
}

.health-pill.efficiency {
    background: #bdeff7;
    color: #0891b2;
}

.health-pill.trend {
    background: #fff4d6;
    color: #d29a00;
    border-radius: 0 22px 22px 0;
}

.payments-table {
    width: 100%;
}

.payments-table th,
.payments-table td {
    padding: 10px 8px;
    font-size: 14px;
}

.payments-table th {
    color: #8b95a5;
    text-align: right;
    font-size: 12px;
    text-transform: uppercase;
}

.payments-table th:first-child,
.payments-table td:first-child {
    text-align: left;
}

.payments-table td {
    text-align: right;
    font-weight: 700;
}

.value-danger {
    color: #ef4444;
}

.value-success {
    color: #6fa33b;
}

.payment-summary {
    border-top: 1px solid #dde3eb;
    margin-top: 16px;
    padding-top: 16px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: #667085;
    font-weight: 700;
}

.balance-list {
    padding: 8px 0;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #dde3eb;
    font-weight: 700;
}

.balance-total {
    background: #e5e7eb;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 900;
}

.action-sections {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 18px;
    margin-bottom: 26px;
}

.action-panel {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    background: #ffffff;
}

.action-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.action-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.action-panel-title strong {
    font-size: 22px;
    color: #111827;
}

.action-panel-title span {
    font-size: 22px;
}

.action-link {
    margin-left: auto;
    color: #08798a;
    text-decoration: underline;
    font-size: 14px;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.action-buttons.three {
    grid-template-columns: repeat(3, 1fr);
}

.action-tile {
    min-height: 84px;
    border: none;
    border-radius: 8px;
    background: #eefaff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 17px;
    text-align: left;
    color: #0f172a;
    transition: 0.2s;
}

.action-tile:hover {
    transform: translateY(-2px);
}

.action-tile.active {
    background: #a9e9f5;
    position: relative;
}

.action-tile i {
    font-size: 30px;
    color: #073642;
}

.open-badge {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: #6bd643;
    color: #14532d;
    font-size: 12px;
    padding: 5px 14px;
    border-radius: 18px;
}

.business-comparison {
    border-top: 1px solid #d8d8d8;
    padding-top: 24px;
}

.business-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}

.business-header h2 {
    font-size: 32px;
    color: #111827;
    margin: 0 0 5px;
}

.business-header p {
    margin: 0;
    color: #667085;
}

.business-sector {
    text-align: right;
}

.business-sector strong {
    display: block;
    font-size: 18px;
    color: #111827;
}

.alert-focus {
    border: 1px solid #ffd8a8;
    background: #fff1e6;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 26px;
}

.alert-focus small {
    color: #a85b00;
}

.alert-focus strong {
    display: block;
    color: #9a4d00;
    font-size: 28px;
}

.indicator-tabs {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-bottom: 0;
}

.indicator-tab {
    border: 1px solid #9fe3ef;
    border-radius: 12px 12px 0 0;
    padding: 14px;
    min-height: 90px;
    background: #ffffff;
    font-weight: 800;
    color: #08798a;
}

.indicator-tab.danger {
    background: #fff1e6;
    border-color: #ffd8a8;
    color: #a85b00;
}

.indicator-box {
    background: #fff1e6;
    border: 1px solid #ffd8a8;
    border-top: none;
    padding: 26px 36px;
    border-radius: 0 0 12px 12px;
    margin-bottom: 26px;
}

.indicator-content {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 34px;
    align-items: center;
}

.indicator-big {
    background: #a85500;
    color: #ffffff;
    border-radius: 14px;
    padding: 28px;
    text-align: center;
}

.indicator-big strong {
    display: block;
    font-size: 38px;
}

.indicator-big span {
    display: block;
    font-size: 24px;
    font-weight: 900;
}

.indicator-big small {
    display: block;
    margin-top: 18px;
    font-size: 17px;
}

.indicator-text h3 {
    color: #9a4d00;
    font-size: 22px;
    margin-bottom: 10px;
}

.indicator-bar {
    height: 10px;
    border-radius: 20px;
    background: linear-gradient(90deg, #068c9f 0%, #068c9f 37%, #008a3d 37%, #008a3d 65%, #a85500 65%, #a85500 100%);
    margin: 20px 0 10px;
    position: relative;
}

.indicator-labels {
    display: flex;
    justify-content: space-around;
    font-size: 13px;
    font-weight: 800;
}

.chart-panel {
    background: #ffffff;
    box-shadow: var(--app-shadow);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 24px;
}

.chart-header {
    background: #d8e1ec;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    color: #667085;
    font-weight: 800;
}

.chart-body {
    padding: 24px;
}

/* Modal lateral lançamento */
.quick-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    z-index: 1050;
    display: none;
}

.quick-drawer-backdrop.show {
    display: block;
}

.quick-drawer {
    position: fixed;
    top: 68px;
    right: -560px;
    width: 560px;
    height: calc(100vh - 68px);
    background: #ffffff;
    z-index: 1060;
    box-shadow: -8px 0 28px rgba(15, 23, 42, 0.2);
    transition: 0.25s ease;
    display: flex;
    flex-direction: column;
}

.quick-drawer.show {
    right: 0;
}

.quick-drawer-header {
    height: 72px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
}

.quick-drawer-header.receita {
    background: var(--app-success);
}

.quick-drawer-header.despesa {
    background: var(--app-danger);
}

.quick-drawer-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 900;
}

.quick-drawer-close {
    border: 2px solid #ffffff;
    color: #ffffff;
    background: transparent;
    border-radius: 50%;
    width: 30px;
    height: 30px;
}

.quick-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
}

.quick-drawer-footer {
    border-top: 1px solid #dce3ee;
    background: #e8f0fa;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 12px;
}

.form-label {
    font-weight: 800;
    color: #7b8797;
}

.optional-pill {
    float: right;
    background: #dce3ee;
    color: #7b8797;
    border-radius: 18px;
    padding: 2px 12px;
    font-size: 12px;
}

.advanced-area {
    border-top: 1px solid #e5e7eb;
    padding-top: 18px;
    margin-top: 10px;
    display: none;
}

.advanced-area.show {
    display: block;
}

.launch-type-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.launch-type-group button {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 12px;
    font-weight: 800;
    color: #667085;
}

.launch-type-group button.active {
    background: #64748b;
    color: #ffffff;
}

/* Compatibilidade páginas anteriores */
.metric-card,
.panel-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
    height: 100%;
}

.metric-card .metric-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #eef2ff;
    color: var(--app-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 18px;
}

.metric-card h3 {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 26px;
    color: #111827;
}

.metric-card small {
    display: block;
    margin-top: 5px;
    color: #94a3b8;
}

.panel-card h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 18px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #eef2ff;
    color: var(--app-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-soft-success {
    background: #dcfce7;
    color: #166534;
}

.badge-soft-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-soft-warning {
    background: #fef3c7;
    color: #92400e;
}

.table > :not(caption) > * > * {
    padding: 14px 12px;
}

.sidebar-backdrop {
    display: none;
}

/* Responsivo */
@media (max-width: 1199px) {
    .dashboard-grid,
    .action-sections {
        grid-template-columns: 1fr;
    }

    .indicator-tabs {
        grid-template-columns: repeat(4, 1fr);
    }

    .yampa-like-topbar {
        grid-template-columns: 190px 1fr 220px;
    }

    .topbar-nav a {
        min-width: 90px;
    }
}

@media (max-width: 991px) {
    .yampa-like-topbar {
        grid-template-columns: 1fr auto;
    }

    .topbar-nav {
        display: none;
    }

    .topbar-profile {
        padding-right: 12px;
    }

    .quick-rail {
        top: 68px;
    }

    .app-main-wrap {
        padding-left: 62px;
    }

    .quick-drawer {
        width: calc(100vw - 62px);
    }

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

    .business-sector {
        text-align: left;
    }

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

    .action-buttons,
    .action-buttons.three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    .app-content {
        padding: 16px;
    }

    .topbar-logo-area {
        padding: 0 16px;
    }

    .topbar-logo-area span {
        font-size: 26px;
    }

    .profile-text {
        display: none;
    }

    .dashboard-grid {
        gap: 14px;
    }

    .fin-row {
        flex-direction: column;
    }

    .indicator-tabs {
        grid-template-columns: repeat(2, 1fr);
    }

    .business-header h2 {
        font-size: 26px;
    }

    .quick-drawer-footer {
        grid-template-columns: 1fr;
    }
}

/* Livro diário / movimentações */
.ledger-toolbar {
    background: #ffffff;
    border-radius: 6px;
    box-shadow: var(--app-shadow);
    padding: 22px;
    margin-bottom: 18px;
}

.ledger-main-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.ledger-search {
    max-width: 560px;
    width: 100%;
    position: relative;
}

.ledger-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 20px;
}

.ledger-search input {
    padding-left: 44px;
    height: 46px;
}

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

.ledger-icon-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: #91a1b5;
    font-size: 24px;
    border-radius: 8px;
    transition: .2s;
}

.ledger-icon-btn:hover,
.ledger-icon-btn.active {
    background: #e8f6fb;
    color: var(--app-primary);
}

.ledger-filter-area {
    display: none;
    margin-top: 18px;
    border-top: 1px solid #e5e7eb;
    padding-top: 18px;
}

.ledger-filter-area.show {
    display: block;
}

.ledger-table-card {
    background: #ffffff;
    border-radius: 6px;
    box-shadow: var(--app-shadow);
    overflow: hidden;
}

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

.ledger-table {
    width: 100%;
    min-width: 1280px;
    border-collapse: collapse;
}

.ledger-table thead th {
    background: var(--app-primary);
    color: #ffffff;
    padding: 16px 12px;
    font-size: 14px;
    white-space: nowrap;
    border-right: 1px solid rgba(0,0,0,.15);
    vertical-align: middle;
}

.ledger-table tbody td {
    padding: 15px 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
    font-weight: 600;
    white-space: nowrap;
}

.ledger-table tbody tr:nth-child(even) {
    background: #f7f7f7;
}

.ledger-table tbody tr:hover {
    background: #eaf8fc;
}

.ledger-edit-btn {
    border: none;
    background: transparent;
    color: #338bd3;
    font-size: 20px;
}

.ledger-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px;
}

.ledger-pagination a,
.ledger-pagination span {
    min-width: 34px;
    height: 34px;
    border-radius: 6px;
    background: var(--app-primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    font-weight: 800;
}

.ledger-pagination span.current {
    background: #ffffff;
    color: var(--app-primary);
    border: 1px solid var(--app-primary);
}

.columns-dropdown {
    position: relative;
}

.columns-menu {
    position: absolute;
    right: 0;
    top: 52px;
    width: 260px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: var(--app-shadow);
    padding: 12px;
    z-index: 1080;
    display: none;
}

.columns-menu.show {
    display: block;
}

.columns-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 4px;
    color: #4b5563;
    font-weight: 700;
    cursor: pointer;
}

.columns-menu input {
    width: 18px;
    height: 18px;
}

.ledger-status {
    display: inline-flex;
    align-items: center;
    min-width: 86px;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 800;
}

.ledger-status.pago,
.ledger-status.recebido {
    background: #dcfce7;
    color: #166534;
}

.ledger-status.pendente {
    background: #fef3c7;
    color: #92400e;
}

.ledger-status.cancelado {
    background: #fee2e2;
    color: #991b1b;
}

.ledger-type {
    font-weight: 900;
}

.ledger-type.receita {
    color: #16a34a;
}

.ledger-type.despesa {
    color: #dc2626;
}

.mov-modal-header.receita {
    background: var(--app-success);
    color: #ffffff;
}

.mov-modal-header.despesa {
    background: var(--app-danger);
    color: #ffffff;
}

.mov-modal-header .btn-close {
    filter: invert(1);
}

@media (max-width: 768px) {
    .ledger-toolbar {
        padding: 16px;
    }

    .ledger-main-actions {
        align-items: stretch;
    }

    .ledger-search {
        max-width: 100%;
    }

    .ledger-icons {
        width: 100%;
        justify-content: space-between;
    }
}

/* Livro diário / movimentações */
.ledger-toolbar {
    background: #ffffff;
    border-radius: 6px;
    box-shadow: var(--app-shadow);
    padding: 22px;
    margin-bottom: 18px;
}

.ledger-main-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.ledger-search {
    max-width: 560px;
    width: 100%;
    position: relative;
}

.ledger-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 20px;
}

.ledger-search input {
    padding-left: 44px;
    height: 46px;
}

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

.ledger-icon-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: #91a1b5;
    font-size: 24px;
    border-radius: 8px;
    transition: .2s;
}

.ledger-icon-btn:hover,
.ledger-icon-btn.active {
    background: #e8f6fb;
    color: var(--app-primary);
}

.ledger-filter-area {
    display: none;
    margin-top: 18px;
    border-top: 1px solid #e5e7eb;
    padding-top: 18px;
}

.ledger-filter-area.show {
    display: block;
}

.ledger-table-card {
    background: #ffffff;
    border-radius: 6px;
    box-shadow: var(--app-shadow);
    overflow: hidden;
}

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

.ledger-table {
    width: 100%;
    min-width: 1280px;
    border-collapse: collapse;
}

.ledger-table thead th {
    background: var(--app-primary);
    color: #ffffff;
    padding: 16px 12px;
    font-size: 14px;
    white-space: nowrap;
    border-right: 1px solid rgba(0,0,0,.15);
    vertical-align: middle;
}

.ledger-table tbody td {
    padding: 15px 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
    font-weight: 600;
    white-space: nowrap;
}

.ledger-table tbody tr:nth-child(even) {
    background: #f7f7f7;
}

.ledger-table tbody tr:hover {
    background: #eaf8fc;
}

.ledger-edit-btn {
    border: none;
    background: transparent;
    color: #338bd3;
    font-size: 20px;
}

.ledger-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px;
}

.ledger-pagination a,
.ledger-pagination span {
    min-width: 34px;
    height: 34px;
    border-radius: 6px;
    background: var(--app-primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    font-weight: 800;
}

.ledger-pagination span.current {
    background: #ffffff;
    color: var(--app-primary);
    border: 1px solid var(--app-primary);
}

.columns-dropdown {
    position: relative;
}

.columns-menu {
    position: absolute;
    right: 0;
    top: 52px;
    width: 260px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: var(--app-shadow);
    padding: 12px;
    z-index: 1080;
    display: none;
}

.columns-menu.show {
    display: block;
}

.columns-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 4px;
    color: #4b5563;
    font-weight: 700;
    cursor: pointer;
}

.columns-menu input {
    width: 18px;
    height: 18px;
}

.ledger-status {
    display: inline-flex;
    align-items: center;
    min-width: 86px;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 800;
}

.ledger-status.pago,
.ledger-status.recebido {
    background: #dcfce7;
    color: #166534;
}

.ledger-status.pendente {
    background: #fef3c7;
    color: #92400e;
}

.ledger-status.cancelado {
    background: #fee2e2;
    color: #991b1b;
}

.ledger-type {
    font-weight: 900;
}

.ledger-type.receita {
    color: #16a34a;
}

.ledger-type.despesa {
    color: #dc2626;
}

.mov-modal-header.receita {
    background: var(--app-success);
    color: #ffffff;
}

.mov-modal-header.despesa {
    background: var(--app-danger);
    color: #ffffff;
}

.mov-modal-header .btn-close {
    filter: invert(1);
}

@media (max-width: 768px) {
    .ledger-toolbar {
        padding: 16px;
    }

    .ledger-main-actions {
        align-items: stretch;
    }

    .ledger-search {
        max-width: 100%;
    }

    .ledger-icons {
        width: 100%;
        justify-content: space-between;
    }
}

/* Correção do modal lateral de Entrada/Saída */
.quick-drawer {
    overflow: hidden;
}

.quick-drawer form {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.quick-drawer-header {
    flex: 0 0 auto;
}

.quick-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 120px;
}

.quick-drawer-footer {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 5;
}

/* Melhora rolagem do modal de movimentações */
#modalMovimentacao .modal-dialog {
    max-height: calc(100vh - 40px);
}

#modalMovimentacao .modal-content {
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

#modalMovimentacao .modal-body {
    overflow-y: auto;
}

/* Garante que botões laterais fiquem clicáveis */
.quick-rail {
    pointer-events: auto;
}

.rail-action {
    cursor: pointer;
    z-index: 2;
}

/* Correção de fundo do modal lateral no mobile */
.quick-drawer,
.quick-drawer form,
.quick-drawer-body {
    background: #ffffff;
}

.quick-drawer-body {
    position: relative;
    z-index: 1;
}

.quick-drawer-footer {
    background: #e8f0fa;
    border-top: 1px solid #dce3ee;
    box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.08);
}

.quick-drawer-backdrop {
    background: rgba(15, 23, 42, 0.45);
}

@media (max-width: 575px) {
    body {
        background: #ffffff;
    }

    .quick-drawer {
        top: 68px;
        right: -100%;
        width: calc(100vw - 62px);
        height: calc(100vh - 68px);
        background: #ffffff;
    }

    .quick-drawer.show {
        right: 0;
        background: #ffffff;
    }

    .quick-drawer form {
        background: #ffffff;
        height: 100%;
    }

    .quick-drawer-body {
        background: #ffffff;
        padding: 18px;
        padding-bottom: 140px;
        overflow-y: auto;
    }

    .quick-drawer-footer {
        background: #e8f0fa;
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 20;
    }

    .advanced-area {
        background: #ffffff;
    }

    .quick-drawer input,
    .quick-drawer select,
    .quick-drawer textarea {
        background: #ffffff;
    }
}
