* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(140deg, #f1f5ff 0%, #eefbf6 100%);
    color: #1f2937;
}

.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.hero-container {
    padding: 32px;
}

.card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

.hero-card {
    max-width: 680px;
    border: 1px solid #dbe6ff;
}

.badge {
    display: inline-block;
    background: #e9efff;
    color: #1d4ed8;
    font-weight: 700;
    font-size: 0.78rem;
    border-radius: 999px;
    padding: 6px 12px;
    margin-bottom: 12px;
}

h1 {
    margin: 0 0 6px;
    font-size: 1.45rem;
}

.subtitle {
    margin: 0 0 18px;
    color: #6b7280;
    font-size: 0.95rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.form-group--margin-top {
    margin-top: 10px;
}

label {
    font-size: 0.9rem;
    margin-bottom: 6px;
}

input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
}

input:focus {
    outline: none;
    border-color: #2563eb;
}

button {
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 11px 12px;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

button:hover {
    background: #1d4ed8;
}

.links {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.links .link-button {
    display: inline-block;
    border: 1px solid #c7d5ff;
    border-radius: 8px;
    padding: 10px 12px;
    background: #eef2ff;
    color: #1d4ed8;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.links .link-button:hover {
    background: #dde7ff;
    text-decoration: none;
}

.link-button.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: auto;
}

.link-button.is-disabled:hover {
    background: #eef2ff;
}

a {
    color: #1d4ed8;
    text-decoration: none;
    font-size: 0.92rem;
}

a:hover {
    text-decoration: underline;
}

.message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.message.success {
    display: block;
    background: #ecfdf3;
    color: #166534;
}

.message.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
}

.hero-links {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.hero-links .cta {
    display: block;
    text-align: center;
    border-radius: 10px;
    padding: 12px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
}

.cta-primary {
    background: #2563eb;
    color: #ffffff;
}

.cta-primary:hover {
    background: #1d4ed8;
    text-decoration: none;
}

.cta-outline {
    border-color: #bcd0ff;
    background: #f7f9ff;
    color: #1d4ed8;
}

.cta-outline:hover {
    background: #edf2ff;
    text-decoration: none;
}

.cta-secondary {
    border-color: #d7e2f8;
    background: #ffffff;
    color: #1d4ed8;
}

.cta-secondary:hover {
    background: #f8fbff;
    text-decoration: none;
}

.dashboard-page {
    background: #f4f7fb;
    overflow-x: hidden;
}

.dashboard-layout {
    min-height: 100vh;
    padding: 20px;
}

.dashboard-wrapper {
    max-width: 1100px;
    margin: 0 auto;
}

.dashboard-header {
    background: #ffffff;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.dashboard-title {
    margin: 0;
    font-size: 1.35rem;
}

.dashboard-subtitle {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.dashboard-session-discreet {
    font-size: 0.82rem;
    opacity: 0.85;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.accounts-balance-grid {
    margin-top: 14px;
}

.dashboard-actions-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.dashboard-menu-panel {
    margin-top: 0;
}

.menu-button {
    width: auto;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #c7d5ff;
    border-radius: 8px;
    padding: 10px 12px;
    background: #eef2ff;
    color: #1d4ed8;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.menu-button:hover {
    background: #dde7ff;
    text-decoration: none;
}

.menu-button-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.account-balance-card h2 {
    color: #374151;
    font-size: 1rem;
    margin-bottom: 10px;
}

.account-card-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.account-card-actions {
    margin-top: 12px;
}

.category-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.86rem;
    color: #4b5563;
}

.category-legend-text {
    margin-right: 10px;
}

.category-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-synthetic {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde68a;
}

.badge-analytical {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.category-tree-section {
    margin-top: 24px;
}

.category-tree-title {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #111827;
}

.category-tree-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tree-filter-btn {
    width: auto;
    margin-top: 0;
    padding: 6px 12px;
    border: 1px solid #c7d5ff;
    border-radius: 999px;
    background: #eef2ff;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 600;
}

.tree-filter-btn:hover {
    background: #dde7ff;
}

.tree-filter-btn.is-active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.category-tree {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    max-height: 420px;
    overflow-y: auto;
}

.category-tree-empty {
    color: #9ca3af;
    font-size: 0.88rem;
    text-align: center;
    padding: 16px 0;
    margin: 0;
}

.category-tree-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 7px;
    margin-bottom: 2px;
    padding-left: calc(12px + var(--depth, 0) * 20px);
}

.category-tree-item:hover {
    background: #f1f5f9;
}

.tree-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.tree-name {
    font-size: 0.9rem;
    color: #1f2937;
    font-weight: 500;
    flex: 1;
    min-width: 100px;
}

.tree-code {
    font-size: 0.75rem;
    color: #6b7280;
    font-family: monospace;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 1px 6px;
}

.tree-color {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.tree-inactive {
    font-size: 0.72rem;
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 999px;
    padding: 1px 7px;
}

.dashboard-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.05);
    padding: 16px;
}

.dashboard-card h2 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #6b7280;
}

.metric-value {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.metric-caption {
    margin-top: 8px;
    color: #6b7280;
    font-size: 0.85rem;
}

.dashboard-panel {
    margin-top: 14px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.05);
    padding: 16px;
}

.dashboard-panel h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.mini-list {
    margin: 0;
    padding-left: 18px;
}

.mini-list li {
    margin-bottom: 6px;
    color: #374151;
}

.security-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f6ff;
    border: 1px solid #d9e6ff;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    color: #1e40af;
    font-size: 0.86rem;
    font-weight: 600;
}

.security-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    font-size: 0.95rem;
}

.hero-icon-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.hero-icon-item {
    background: #f8fbff;
    border: 1px solid #dbe6ff;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.hero-icon-item .icon {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 6px;
}

.hero-icon-item span:last-child {
    color: #4b5563;
    font-size: 0.82rem;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 54px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.password-toggle:hover {
    background: #eef2ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.password-toggle.is-visible {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.password-strength {
    margin: 8px 0 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #6b7280;
}

.password-strength.level-weak {
    color: #b91c1c;
}

.password-strength.level-medium {
    color: #b45309;
}

.password-strength.level-strong {
    color: #166534;
}

.password-rules {
    margin: 0;
    padding-left: 18px;
}

.password-rules li {
    margin-bottom: 4px;
    color: #6b7280;
    font-size: 0.82rem;
}

.password-rules li.is-valid {
    color: #166534;
    font-weight: 600;
}

.password-recovery-tip {
    margin: 0 0 12px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 10px;
    color: #1e3a8a;
    font-size: 0.85rem;
}

.account-create-card {
    max-width: 680px;
}

.form-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.form-fieldset legend {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e40af;
    padding: 0 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row--gap {
    gap: 10px;
}

select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
    background: #ffffff;
    color: #1f2937;
    cursor: pointer;
    appearance: auto;
}

select:focus {
    outline: none;
    border-color: #2563eb;
}

.field-hint {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 0.82rem;
}

.required {
    color: #dc2626;
}

.form-summary {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.form-summary h3 {
    margin: 0 0 10px;
    font-size: 0.92rem;
    color: #0369a1;
}

.summary-list {
    margin: 0;
    padding-left: 18px;
}

.summary-list li {
    margin-bottom: 4px;
    color: #374151;
    font-size: 0.88rem;
}

.tree-system {
    font-size: 0.72rem;
    color: #1d4ed8;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    padding: 1px 7px;
}

.tree-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.tree-btn-edit,
.tree-btn-delete {
    width: 28px;
    height: 28px;
    padding: 0;
    margin-top: 0;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #374151;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tree-btn-edit:hover {
    background: #eef2ff;
    border-color: #93c5fd;
}

.tree-btn-delete:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.form-row-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hidden {
    display: none;
}

.button-width-auto {
    width: auto;
}

.margin-top-zero {
    margin-top: 0;
}

/* ─── Modal de feedback (erro / confirmação) ──────────────────────────────── */
.ffp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 24px;
    animation: ffp-overlay-in 0.15s ease;
}

.ffp-modal-overlay[hidden] {
    display: none;
}

@keyframes ffp-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ffp-modal {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    padding: 32px 28px 24px;
    max-width: 1100px;
    width: 100%;
    text-align: center;
    animation: ffp-modal-in 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes ffp-modal-in {
    from { transform: scale(0.88); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.ffp-modal-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 12px;
}

.ffp-modal-icon--error { filter: saturate(1.4); }
.ffp-modal-icon--warn  { filter: saturate(1.2); }

.ffp-modal-title {
    margin: 0 0 10px;
    font-size: 1.15rem;
    color: #1f2937;
}

.ffp-modal-message {
    margin: 0 0 22px;
    color: #4b5563;
    font-size: 0.97rem;
    line-height: 1.55;
}

.ffp-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.ffp-modal-btn {
    width: auto;
    min-width: 90px;
    margin-top: 0;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.ffp-modal-btn--ok {
    background: #2563eb;
    color: #fff;
}

.ffp-modal-btn--ok:hover {
    background: #1d4ed8;
}

.ffp-modal-btn--cancel {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.ffp-modal-btn--cancel:hover {
    background: #e5e7eb;
}

.ffp-modal-btn--danger {
    background: #dc2626;
    color: #fff;
}

.ffp-modal-btn--danger:hover {
    background: #b91c1c;
}

.statement-create-modal {
    max-width: 1100px;
    width: 100%;
    text-align: left;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
}

.statement-create-form {
    display: grid;
    gap: 12px;
}

.ofx-reconciliation-modal {
    max-width: 1100px;
    width: 100%;
    text-align: left;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
}

.ofx-preview-container {
    margin-top: 8px;
}

.ofx-modal-actions {
    margin-top: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.ofx-preview-container .transaction-table td:first-child,
.ofx-preview-container .transaction-table td:nth-child(2),
.ofx-preview-container .transaction-table th:first-child,
.ofx-preview-container .transaction-table th:nth-child(2) {
    text-align: center;
    width: 90px;
}

.ofx-preview-container .transaction-table td:nth-child(6),
.ofx-preview-container .transaction-table th:nth-child(6) {
    min-width: 220px;
}

.ofx-preview-container .ofx-category-select {
    width: 100%;
    margin-top: 0;
}

.ofx-preview-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.transaction-layout {
    display: grid;
    gap: 14px;
}

.transaction-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.transaction-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.transaction-table th,
.transaction-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 8px;
    text-align: left;
    font-size: 0.9rem;
    vertical-align: middle;
}

.transaction-table th {
    color: #6b7280;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.transaction-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.transaction-table th.sortable:hover {
    background: #f9fafb;
}

.sort-icon {
    margin-left: 4px;
    font-size: 0.7rem;
    color: #9ca3af;
}

.transaction-table .cell-amount {
    font-weight: 700;
    color: #111827;
    text-align: right;
}

.transaction-table .cell-amount--negative,
.category-expense {
    color: #dc2626;
}

.transaction-table .cell-amount--positive,
.category-income {
    color: #16a34a;
}

.transaction-table .cell-balance {
    font-weight: 700;
    text-align: right;
}

.cell-balance--positive {
    color: #1d4ed8;
}

.cell-balance--negative {
    color: #dc2626;
}

.subtotal-row {
    background: #f9fafb;
    font-weight: 600;
}

.subtotal-row .subtotal-label {
    color: #4b5563;
    text-align: right;
    padding-right: 8px;
}

.subtotal-row .subtotal-amount {
    color: #374151;
    font-weight: 700;
}

.total-row {
    background: #f3f4f6;
    font-weight: 700;
    border-top: 2px solid #d1d5db;
}

.total-row .total-label {
    color: #111827;
    text-align: right;
    padding-right: 8px;
}

.total-row .total-amount {
    color: #111827;
}

.total-row--reconciled {
    background: #ecfdf5;
}

.total-row--reconciled .total-label {
    color: #166534;
}

.total-row--reconciled .total-amount {
    color: #166534;
}

.total-row--pending {
    background: #fefce8;
}

.total-row--pending .total-label {
    color: #854d0e;
    text-align: right;
    padding-right: 8px;
}

.total-row--pending .total-amount {
    color: #854d0e;
}

/* Status and Reconciliation Chips */
.reconciled-chip {
    display: inline-block;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 9px;
    color: #166534;
    background: #dcfce7;
    border: 1px solid #86efac;
}

.not-reconciled-chip {
    display: inline-block;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 9px;
    color: #854d0e;
    background: #fef9c3;
    border: 1px solid #fde68a;
}

/* Icon Styles */
.checkbox-icon,
.icon-pen,
.icon-trash {
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/.checkbox-icon--filled {
    color: #16a34a;
}

/* Pagination styling */
.statement-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.statement-pagination button {
    flex: 1 1 calc(33.333% - 14px);
    max-width: 150px;
}

#page-info {
    flex: 1 1 calc(33.333% - 14px);
    text-align: center;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.statement-export-actions {
    display: flex;
    width: 100%;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.export-action-btn {
    flex: 1 1 calc(33.333% - 7px);
    width: auto;
    margin-top: 0;
    padding: 10px 12px;
    border: 1px solid #c7d5ff;
    border-radius: 8px;
    background: #eef2ff;
    color: #1d4ed8;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.export-action-btn:hover {
    background: #dde7ff;
}

.export-action-btn-icon {
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 900px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-actions {
        width: 100%;
    }

    .dashboard-actions button,
    .dashboard-actions a,
    .dashboard-actions .menu-button,
    .dashboard-actions-panel .menu-button,
    .dashboard-actions-panel .link-button {
        width: 100%;
        justify-content: center;
    }

    .dashboard-actions-panel {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .card,
    .dashboard-card,
    .dashboard-panel,
    .ffp-modal,
    .modal-content,
    .invoice-card {
        font-size: 1.02rem;
        line-height: 1.5;
    }

    label,
    .field-hint,
    .subtitle,
    .dashboard-subtitle,
    .metric-caption,
    .security-strip,
    .message,
    .invoice-detail-label,
    .invoice-amount-label,
    .invoice-status-message,
    .tree-name,
    .tree-code,
    .tree-inactive,
    .category-tree-empty {
        font-size: 0.98rem;
        line-height: 1.45;
    }

    input,
    select,
    button,
    .menu-button,
    .link-button,
    .button-primary,
    .button-secondary,
    .button-danger,
    .export-action-btn,
    .invoice-action-btn,
    .ffp-modal-btn,
    .tree-filter-btn {
        font-size: 1.02rem;
    }
}

@media (max-width: 480px) {
    .card,
    .dashboard-card,
    .dashboard-panel,
    .ffp-modal,
    .modal-content,
    .invoice-card {
        font-size: 1.03rem;
    }

    label,
    .field-hint,
    .subtitle,
    .dashboard-subtitle,
    .metric-caption,
    .security-strip,
    .message,
    .invoice-detail-label,
    .invoice-amount-label,
    .invoice-status-message,
    .tree-name,
    .tree-code,
    .tree-inactive,
    .category-tree-empty {
        font-size: 0.96rem;
    }
}

/* Investimentos */
.investment-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.investment-tab-btn {
    width: auto;
    margin-top: 0;
    padding: 8px 14px;
    border: 1px solid #c7d5ff;
    border-radius: 999px;
    background: #eef2ff;
    color: #1d4ed8;
    font-size: 0.88rem;
    font-weight: 600;
}

.investment-tab-btn:hover {
    background: #dde7ff;
}

.investment-tab-btn.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.investment-tab-content {
    display: none;
}

.investment-tab-content.is-active {
    display: block;
}

.investment-section-title {
    margin-top: 0;
}

/* Faturas do cartão */
.invoices-list {
    display: grid;
    gap: 12px;
}

.invoice-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.invoice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.invoice-period {
    font-weight: 700;
    color: #111827;
}

.invoice-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.invoice-status--open {
    background: #fff7ed;
    color: #c2410c;
}

.invoice-status--closed {
    background: #eff6ff;
    color: #1d4ed8;
}

.invoice-status--paid {
    background: #ecfdf3;
    color: #166534;
}

.invoice-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    margin-bottom: 10px;
}

.invoice-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.invoice-detail-label {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
}

.invoice-detail-value,
.invoice-amount-value {
    font-weight: 700;
    color: #111827;
}

.invoice-amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    margin-bottom: 10px;
}

.invoice-amount-label {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
}

.invoice-amount-value--negative {
    color: #dc2626;
}

.invoice-amount-value--positive {
    color: #16a34a;
}

.invoice-actions {
    display: grid;
    gap: 8px;
}

.invoice-action-btn {
    width: 100%;
    min-height: 44px;
    margin-top: 0;
}

.invoice-status-message {
    font-size: 0.86rem;
    padding: 10px 12px;
    border-radius: 10px;
    line-height: 1.35;
}

.invoice-status-message--warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.invoice-status-message--success {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #86efac;
}

/* Permissões ADM */
#permissions-body td label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .investment-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .investment-tab-btn {
        width: 100%;
        min-height: 44px;
        white-space: normal;
        line-height: 1.2;
    }

    .investment-section-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .dashboard-actions-panel--no-margin,
    .dashboard-actions-panel--margin-top {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #statement-filter-form .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    #statement-filter-form .dashboard-actions-panel {
        grid-template-columns: 1fr;
    }

    #open-transaction-modal,
    #open-transfer-modal {
        width: 100%;
        min-width: 0;
        margin-top: 0;
    }

    .invoice-details {
        grid-template-columns: 1fr;
    }

    .invoice-header {
        align-items: flex-start;
    }

    .invoice-amount {
        flex-direction: column;
        align-items: flex-start;
    }

    #permissions-body tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
        overflow: hidden;
    }

    #permissions-body td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        padding: 10px 12px;
        border-bottom: 1px solid #eef2f7;
        text-align: right;
    }

    #permissions-body td:last-child {
        border-bottom: 0;
    }

    #permissions-body td::before {
        content: attr(data-label);
        flex: 1 1 45%;
        text-align: left;
        font-weight: 600;
        color: #475569;
        min-width: 96px;
        padding-right: 8px;
    }

    #permissions-body td > * {
        flex: 1 1 auto;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .investment-tabs {
        grid-template-columns: 1fr;
    }

    .invoice-card {
        padding: 12px;
    }

    .invoice-actions {
        gap: 6px;
    }
}

@media (max-width: 768px) {
    .transaction-table-wrapper {
        overflow-x: hidden;
    }

    .transaction-table {
        min-width: 0;
    }

    .transaction-table,
    .transaction-table tbody {
        display: block;
        width: 100%;
    }

    .transaction-table thead {
        display: none;
    }

    .transaction-table tbody {
        display: grid;
        gap: 12px;
    }

    .transaction-table tr {
        display: block;
        margin: 0;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
        overflow: hidden;
        padding: 12px;
    }

    .transaction-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        padding: 8px 0;
        border: 0;
        text-align: right;
        min-height: 44px;
        line-height: 1.45;
        font-size: 1rem;
    }

    .transaction-table td + td {
        border-top: 1px solid #eef2f7;
    }

    .transaction-table td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        text-align: left;
        font-weight: 700;
        color: #475569;
        min-width: 100px;
        padding-right: 8px;
        font-size: 0.9rem;
        line-height: 1.35;
    }

    .transaction-table td > * {
        flex: 1 1 auto;
        min-width: 0;
        text-align: right;
        font-size: 1rem;
        line-height: 1.45;
    }

    .transaction-table td[data-label="Data"],
    .transaction-table td[data-label="Valor"] {
        font-weight: 700;
        color: #111827;
    }

    .transaction-table td[data-label="Valor"] {
        white-space: nowrap;
    }

    .transaction-table .cell-amount,
    .transaction-table .cell-balance,
    .transaction-table .subtotal-amount,
    .transaction-table .subtotal-balance,
    .transaction-table .total-amount {
        text-align: right;
        font-size: 1rem;
    }

    .transaction-row-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .transaction-row-action-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .transaction-layout input,
    .transaction-layout select,
    .transaction-layout button,
    .transaction-layout .menu-button,
    .transaction-layout .link-button,
    .transaction-layout .button-primary,
    .transaction-layout .button-secondary,
    .transaction-layout .button-danger,
    .transaction-layout .export-action-btn,
    .transaction-layout .transaction-row-action-btn {
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .transaction-table tr {
        padding: 10px;
    }

    .transaction-table td {
        padding: 9px 0;
        font-size: 1rem;
    }

    .transaction-table td::before {
        min-width: 90px;
        font-size: 0.9rem;
    }

    .transaction-table td > * {
        font-size: 1rem;
    }

    .transaction-row-actions {
        gap: 6px;
    }

    .transaction-row-action-btn {
        flex: 1 1 44px;
    }
}

/* Contas a pagar */
.payable-layout {
    display: grid;
    gap: 14px;
}

.payable-table th,
.payable-table td,
.payable-installments-table th,
.payable-installments-table td {
    white-space: nowrap;
}

.payable-status-badge {
    display: inline-block;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 9px;
    border: 1px solid transparent;
}

.payable-status-badge--open {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.payable-status-badge--partial {
    color: #854d0e;
    background: #fef9c3;
    border-color: #fde68a;
}

.payable-status-badge--paid {
    color: #166534;
    background: #dcfce7;
    border-color: #86efac;
}

.payable-status-badge--overdue {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fca5a5;
}

.payable-status-badge--closed {
    color: #334155;
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.payable-action-btn {
    width: auto;
    margin-top: 0;
}

.payable-action-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.payable-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.payable-detail-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.payable-detail-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
}

.payable-detail-value {
    color: #111827;
    font-size: 0.9rem;
    word-break: break-word;
}

.payable-installments-title {
    margin-top: 6px;
    margin-bottom: 10px;
}

.payable-detail-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.payable-detail-panel-header h3 {
    margin: 0;
}

.payable-installment-inline-input {
    width: 120px;
    margin: 0;
    padding: 6px 8px;
}

@media (max-width: 768px) {
    .payable-table,
    .payable-installments-table {
        min-width: 0;
    }
}

/* ─── Botão de perigo (excluir) ──────────────────────────────────────────── */
.button-danger {
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.button-danger:hover {
    background: #b91c1c;
}

/* ─── Barra de confirmação inline ────────────────────────────────────────── */
.confirm-inline-bar[hidden] {
    display: none;
}

.confirm-inline-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #fef9c3;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
}

.confirm-inline-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.confirm-inline-text {
    flex: 1;
    font-size: 0.95rem;
    color: #78350f;
    white-space: pre-line;
}

.confirm-inline-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

