/* DMB FinCore - padrão visual compartilhado dos módulos. */
:root {
    --fincore-white: #fff;
    --fincore-danger: #dc2626;
    --fincore-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    --fincore-shadow-hover: 0 14px 34px rgba(15, 23, 42, .1);
    --fincore-radius: 16px;
}

.module-page, .feature-page, .finance-page, .page-container,
.dashboard-page, .account-page {
    width: 100%; display: flex; flex-direction: column; gap: 1.25rem;
}

.module-header, .feature-header, .finance-page-header, .page-header,
.page-heading, .dashboard-header {
    min-height: 3.25rem; display: flex; align-items: flex-start;
    justify-content: space-between; gap: 1rem;
}

.module-header h1, .feature-title, .finance-page-header h1,
.page-header h1, .page-heading h1, .dashboard-header h1 {
    margin: 0; color: var(--fincore-navy);
    font-size: clamp(1.8rem, 2.6vw, 2.35rem); font-weight: 900;
    letter-spacing: -.035em; line-height: 1.05;
}

.module-subtitle, .module-header p, .feature-subtitle, .finance-page-header p,
.page-header p, .page-heading p, .dashboard-header p {
    max-width: 760px; margin: .45rem 0 0; color: var(--fincore-muted);
    font-size: .98rem; line-height: 1.5;
}

.module-header-actions, .page-header-actions, .dashboard-actions {
    display: flex; align-items: center; justify-content: flex-end;
    gap: .65rem; flex-wrap: wrap;
}

.summary-grid, .feature-cards, .finance-summary-grid, .dashboard-summary-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem;
}

.summary-card, .feature-card, .finance-summary-card, .dashboard-summary-card {
    min-width: 0; min-height: 96px; display: flex; align-items: center;
    gap: .9rem; padding: 1rem 1.1rem; border: 1px solid var(--fincore-border);
    border-radius: var(--fincore-radius); background: var(--fincore-surface);
    box-shadow: var(--fincore-shadow);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.summary-card:hover, .feature-card:hover, .finance-summary-card:hover,
.dashboard-summary-card:hover {
    transform: translateY(-1px); border-color: #cbd8e8;
    box-shadow: var(--fincore-shadow-hover);
}

.summary-card > div:last-child, .feature-card > div:last-child,
.finance-summary-card > div:last-child { min-width: 0; }

.summary-icon, .feature-card-icon, .finance-summary-icon, .dashboard-summary-icon {
    width: 48px; height: 48px; display: grid; place-items: center;
    flex: 0 0 48px; border-radius: 14px; color: var(--fincore-blue);
    background: #dbeafe; font-size: 1.25rem; font-weight: 900;
}

.summary-icon.success, .summary-icon.green, .summary-green,
.finance-summary-icon-success { color: #047857; background: #d1fae5; }
.summary-icon.warning, .summary-icon.yellow, .summary-icon.amber,
.summary-yellow, .summary-amber, .finance-summary-icon-warning {
    color: #b45309; background: #fef3c7;
}
.summary-icon.red, .summary-red, .finance-summary-icon-danger {
    color: #b91c1c; background: #fee2e2;
}
.summary-icon.money, .finance-summary-icon-money {
    color: #1d4ed8; background: #e0e7ff;
}

.summary-card span, .feature-card-label, .finance-summary-card span,
.dashboard-summary-card span {
    display: block; color: var(--fincore-muted); font-size: .82rem;
    font-weight: 700; line-height: 1.2;
}

.summary-card strong, .feature-card-value, .finance-summary-card strong,
.dashboard-summary-card strong {
    display: block; max-width: 100%; margin-top: .28rem; overflow-wrap: anywhere;
    color: var(--fincore-navy); font-size: clamp(1.22rem, 1.6vw, 1.65rem);
    font-weight: 900; letter-spacing: -.025em; line-height: 1.08;
}

.summary-card small, .feature-card-help, .finance-summary-card small,
.dashboard-summary-card small {
    display: block; margin-top: .25rem; color: var(--fincore-muted);
    font-size: .76rem; line-height: 1.25;
}

.panel-card, .filter-card, .feature-filters, .finance-filter-card,
.finance-filters-card, .form-card, .form-section, .finance-form-card,
.finance-lot-card, .table-card, .feature-table-card, .finance-table-card,
.dashboard-panel, .account-card {
    border: 1px solid var(--fincore-border); border-radius: var(--fincore-radius);
    background: var(--fincore-surface); box-shadow: var(--fincore-shadow);
}

.filter-card, .feature-filters, .finance-filter-card, .finance-filters-card {
    padding: 1rem;
}

.filter-grid, .feature-filter-grid, .finance-filter-grid {
    display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
    gap: .85rem; align-items: end;
}

.filter-card:not(:has(.filter-grid)) {
    display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
    gap: .85rem; align-items: end;
}

.accounts-filter-grid {
    display: grid; grid-template-columns: minmax(240px, 1.5fr) repeat(2, minmax(160px, 1fr)) auto;
    gap: .85rem; align-items: end;
}
.vehicles-filter-card { grid-template-columns: repeat(3, minmax(150px, 1fr)) !important; }

.finance-field, .form-field, .form-group {
    min-width: 0; display: flex; flex-direction: column; gap: .38rem;
}
.filter-actions, .filter-action, .finance-filter-actions {
    display: flex; align-items: flex-end; justify-content: flex-end;
}
.filter-actions > button, .filter-action > button,
.finance-filter-actions > button, .finance-filter-card > button {
    min-height: 46px; white-space: nowrap;
}

.table-card, .feature-table-card, .finance-table-card { overflow: hidden; }
.table-header, .table-card-header, .feature-table-header, .finance-table-header {
    min-height: 72px; display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--fincore-border);
}
.table-header h2, .table-card-header h2, .feature-table-title,
.finance-table-header h2 {
    margin: 0; color: var(--fincore-navy); font-size: 1.3rem;
    font-weight: 900; letter-spacing: -.02em;
}
.table-header span, .table-card-header span, .feature-record-count,
.finance-table-header span {
    display: block; margin-top: .18rem; color: var(--fincore-muted);
    font-size: .86rem; font-weight: 700;
}
.table-responsive, .table-wrapper, .feature-table-responsive,
.finance-table-wrapper, .finance-responsive-table { width: 100%; overflow-x: auto; }

.data-table, .app-table, .feature-table, .finance-table, .table.table-striped {
    width: 100%; border-collapse: collapse; background: var(--fincore-surface);
}
.data-table thead, .app-table thead, .feature-table thead,
.finance-table thead, .table.table-striped thead {
    color: #fff; background: var(--fincore-navy);
}
.data-table th, .data-table td, .app-table th, .app-table td,
.feature-table th, .feature-table td, .finance-table th, .finance-table td,
.table.table-striped th, .table.table-striped td {
    padding: .82rem 1rem; border-bottom: 1px solid var(--fincore-border);
    text-align: left; vertical-align: middle;
}
.data-table th, .app-table th, .feature-table th, .finance-table th,
.table.table-striped th {
    color: #fff; font-size: .76rem; font-weight: 850;
    letter-spacing: .015em; white-space: nowrap;
}
.data-table td, .app-table td, .feature-table td, .finance-table td,
.table.table-striped td {
    color: var(--fincore-text); font-size: .86rem; line-height: 1.35;
}
.data-table tbody tr:hover, .app-table tbody tr:hover, .feature-table tbody tr:hover,
.finance-table tbody tr:hover, .table.table-striped tbody tr:hover { background: #f8fbff; }
.data-table td strong, .app-table td strong, .feature-table td strong,
.finance-table td strong { color: var(--fincore-navy); font-weight: 850; }
.data-table td > span, .app-table td > span, .finance-row-subtitle {
    display: block; margin-top: .15rem; color: var(--fincore-muted); font-size: .78rem;
}
.empty-table, .empty-state, .feature-empty, .finance-empty-row, .empty-table-message {
    padding: 2.5rem 1rem !important; color: var(--fincore-muted) !important;
    font-weight: 700; text-align: center !important;
}
.table-footer, .feature-pagination, .finance-pagination, .pagination-footer {
    min-height: 58px; display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: .8rem 1.1rem; color: var(--fincore-muted); font-size: .82rem;
}

.entity-cell, .table-main-cell, .unit-name {
    display: flex; align-items: center; gap: .75rem;
}
.entity-icon, .row-icon, .table-icon, .unit-icon {
    width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px;
    border-radius: 11px; color: var(--fincore-blue); background: #dbeafe;
}
.badge, .type-badge, .feature-badge, .status-pill, .finance-status,
.unit-status-badge {
    min-width: 70px; display: inline-flex !important; align-items: center;
    justify-content: center; padding: .34rem .65rem; border-radius: 999px;
    color: #047857; background: #d1fae5; font-size: .76rem; font-weight: 850;
    line-height: 1.1; white-space: nowrap;
}
.badge.warning, .feature-badge-warning, .status-pill.pending,
.finance-status-warning { color: #b45309; background: #fef3c7; }
.badge.danger, .feature-badge-danger, .status-pill.inactive,
.finance-status-danger, .unit-status-badge.inactive { color: #b91c1c; background: #fee2e2; }
.feature-badge-info, .finance-status-info { color: #1d4ed8; background: #dbeafe; }
.finance-status-success, .status-pill.active, .unit-status-badge.active {
    color: #047857; background: #d1fae5;
}

.table-actions, .feature-actions, .finance-inline-actions, .finance-table-actions {
    display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
}
.btn-table, .action-button, .primary-button, .secondary-button,
.feature-button-primary, .feature-button-secondary, .feature-button-danger,
.finance-action-button {
    min-height: 38px; display: inline-flex; align-items: center; justify-content: center;
    gap: .4rem; padding: .52rem .8rem; border: 1px solid transparent;
    border-radius: 10px; color: #fff; background: var(--fincore-blue);
    font-size: .82rem; font-weight: 800; line-height: 1; text-decoration: none;
    white-space: nowrap; cursor: pointer;
}
.secondary-button, .feature-button-secondary, .finance-action-button-outline {
    border-color: #bfdbfe; color: var(--fincore-blue); background: #eff6ff;
}
.feature-button-danger, .btn-table.danger, .action-button.danger {
    color: #b91c1c; background: #fef2f2; border-color: #fecaca;
}
.primary-button.small, .finance-action-button-small, .btn-table {
    min-height: 34px; padding: .45rem .65rem; font-size: .76rem;
}

.dashboard-welcome {
    position: relative; min-height: 190px; display: flex; align-items: center;
    overflow: hidden; padding: clamp(1.5rem, 4vw, 2.6rem); border-radius: 20px;
    color: #fff; background: linear-gradient(120deg, #071a31 0%, #0b2a50 55%, #1557d5 100%);
    box-shadow: 0 16px 36px rgba(11, 31, 58, .18);
}
.dashboard-welcome::after {
    content: ""; position: absolute; right: -80px; bottom: -140px;
    width: 360px; height: 360px; border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    box-shadow: 0 0 0 54px rgba(255,255,255,.035), 0 0 0 108px rgba(255,255,255,.025);
}
.dashboard-welcome-content { position: relative; z-index: 1; max-width: 700px; }
.dashboard-eyebrow {
    color: #93c5fd; font-size: .76rem; font-weight: 850;
    letter-spacing: .08em; text-transform: uppercase;
}
.dashboard-welcome h1 {
    margin: .5rem 0; color: #fff; font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 900; letter-spacing: -.04em;
}
.dashboard-welcome p { max-width: 610px; color: #dbeafe; line-height: 1.55; }
.dashboard-links {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem;
}
.dashboard-link {
    min-height: 110px; display: flex; flex-direction: column; justify-content: space-between;
    gap: 1rem; padding: 1.1rem; border: 1px solid var(--fincore-border);
    border-radius: var(--fincore-radius); background: #fff; box-shadow: var(--fincore-shadow);
    transition: 160ms ease;
}
.dashboard-link:hover {
    transform: translateY(-2px); border-color: #93c5fd; box-shadow: var(--fincore-shadow-hover);
}
.dashboard-link span { color: var(--fincore-blue); font-size: 1.35rem; }
.dashboard-link strong { color: var(--fincore-navy); font-size: .95rem; }
.dashboard-link small { color: var(--fincore-muted); font-size: .78rem; }

.document-import-panel {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center; gap: 1rem; padding: 1.1rem 1.25rem;
    border: 1px dashed #93c5fd; border-radius: var(--fincore-radius);
    background: linear-gradient(90deg, #eff6ff 0%, #fff 75%);
}
.document-import-icon {
    width: 48px; height: 48px; display: grid; place-items: center;
    border-radius: 14px; color: var(--fincore-blue); background: #dbeafe;
    font-size: 1.35rem; font-weight: 900;
}
.document-import-copy h2 {
    margin: 0; color: var(--fincore-navy); font-size: 1.1rem; font-weight: 900;
}
.document-import-copy p {
    margin-top: .3rem; color: var(--fincore-muted); font-size: .86rem; line-height: 1.4;
}

/* Acesso e páginas públicas de conta */
.auth-shell {
    min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .9fr) minmax(440px, 1.1fr);
    background: #f4f7fb;
}
.auth-brand-panel {
    position: relative; display: flex; flex-direction: column; justify-content: space-between;
    overflow: hidden; padding: clamp(2rem, 5vw, 4.5rem); color: #fff;
    background: linear-gradient(145deg, #071a31 0%, #0b2a50 55%, #1557d5 100%);
}
.auth-brand-panel::after {
    content: ""; position: absolute; right: -150px; bottom: -180px;
    width: 480px; height: 480px; border: 1px solid rgba(255,255,255,.1);
    border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.02);
}
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 1.15rem; }
.auth-brand-mark {
    width: 76px; height: 76px; object-fit: contain; flex: 0 0 auto;
}
.auth-brand strong, .auth-brand > div > span { display: block; }
.auth-brand strong { color: #fff; font-size: clamp(2rem, 3vw, 2.7rem); line-height: .95; letter-spacing: -.055em; }
.auth-brand strong span, .auth-brand strong b { display: inline; color: #fff; font-size: inherit; }
.auth-brand strong b { color: #00d2ff; }
.auth-brand > div > span { margin-top: .55rem; color: #bfdbfe; font-size: .82rem; letter-spacing: .18em; text-transform: uppercase; }
.auth-brand-message { position: relative; z-index: 1; max-width: 520px; }
.auth-brand-message > span {
    color: #93c5fd; font-size: .76rem; font-weight: 850;
    letter-spacing: .08em; text-transform: uppercase;
}
.auth-brand-message h1 {
    margin: .65rem 0; color: #fff; font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 900; letter-spacing: -.045em; line-height: 1.02;
}
.auth-brand-message p { color: #dbeafe; font-size: 1rem; }
.auth-content {
    width: min(100%, 720px); align-self: center; justify-self: center;
    padding: clamp(1.5rem, 5vw, 4rem);
}
.auth-card, .auth-content > .row, .auth-content > section {
    padding: clamp(1.35rem, 3vw, 2rem); border: 1px solid var(--fincore-border);
    border-radius: 18px; background: #fff; box-shadow: var(--fincore-shadow);
}
.auth-content > h1 { margin-bottom: 1rem; color: var(--fincore-navy); }
.auth-title { margin-bottom: 1.4rem; }
.auth-title h1 {
    margin: 0; color: var(--fincore-navy); font-size: 1.75rem;
    font-weight: 900; letter-spacing: -.03em;
}
.auth-title p { margin-top: .4rem; color: var(--fincore-muted); line-height: 1.45; }
.auth-form { display: flex; flex-direction: column; gap: .9rem; }
.auth-options { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.auth-options-end { justify-content: flex-end; }
.auth-check { display: inline-flex; align-items: center; gap: .5rem; color: var(--fincore-muted); }
.auth-check input { width: 18px; min-height: 18px; height: 18px; }
.auth-links { display: flex; flex-direction: column; gap: .45rem; margin-top: .5rem; }
.auth-links a, .auth-content a { color: var(--fincore-blue); font-weight: 700; }
.auth-divider { display: flex; align-items: center; gap: .75rem; color: var(--fincore-muted); font-size: .76rem; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--fincore-border); }

/* Utilitários usados pelas páginas padrão do Identity. */
.row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.w-100 { width: 100%; }
.mb-3 { margin-bottom: .9rem; }
.mt-2 { margin-top: .5rem; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.mx-auto { margin-inline: auto; }
.form-check-input { width: 18px; height: 18px; min-height: 18px; }
.btn-link { color: var(--fincore-blue); background: transparent; }

@media (max-width: 850px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand-panel { min-height: 230px; gap: 3rem; padding: 1.5rem; }
    .auth-brand-message h1 { font-size: 2rem; }
    .auth-content { padding: 1.25rem; }
}

@media (max-width: 1280px) {
    .filter-grid, .feature-filter-grid, .finance-filter-grid,
    .filter-card:not(:has(.filter-grid)), .vehicles-filter-card {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 1050px) {
    .summary-grid, .feature-cards, .finance-summary-grid,
    .dashboard-summary-grid, .dashboard-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .filter-grid, .feature-filter-grid, .finance-filter-grid,
    .filter-card:not(:has(.filter-grid)), .accounts-filter-grid, .vehicles-filter-card {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 700px) {
    .module-header, .feature-header, .finance-page-header, .page-header,
    .page-heading, .dashboard-header, .table-header, .table-card-header,
    .feature-table-header, .finance-table-header, .table-footer,
    .feature-pagination, .finance-pagination, .pagination-footer {
        align-items: stretch; flex-direction: column;
    }
    .summary-grid, .feature-cards, .finance-summary-grid, .dashboard-summary-grid,
    .dashboard-links, .filter-grid, .feature-filter-grid, .finance-filter-grid,
    .filter-card:not(:has(.filter-grid)), .accounts-filter-grid, .vehicles-filter-card {
        grid-template-columns: 1fr !important;
    }
    .module-header-actions, .module-header-actions > *, .filter-actions > *,
    .filter-action > *, .finance-filter-actions > * { width: 100%; }
    .data-table, .app-table, .feature-table, .finance-table { min-width: 860px; }
    .document-import-panel { grid-template-columns: auto 1fr; }
    .document-import-panel > button { grid-column: 1 / -1; width: 100%; }
}
