:root {
    --primary: #2f49d0;
    --primary-dark: #18214b;
    --primary-light: #f0f3ff;
    --success: #0b8a60;
    --danger: #c0392b;
    --text: #1e2a3a;
    --muted: #7f8ea3;
    --border-radius: 16px;
    --shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    --sidebar-width: 310px;
    --card-bg: #f4f6ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: DejaVu Sans, sans-serif;
    background: #f5f7fb;
    color: var(--text);
}

body.modal-open {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.user-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: stretch;
}

.user-greeting {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-greeting:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar {
    background: var(--primary-dark);
    color: #fff;
    padding: 48px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    font-weight: 600;
}

.brand-logo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08);
}

.brand-text h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
    color: #fff;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.sidebar nav a {
    font-size: 16px;
    padding: 12px 18px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    transition: background 0.2s ease;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar nav a.logout-link {
    color: rgba(255, 180, 180, 0.9);
}

.sidebar nav a.logout-link:hover {
    background: rgba(255, 87, 87, 0.12);
    color: #fff;
}

.top-banner {
    position: fixed;
    left: var(--sidebar-width);
    right: 0;
    top: 0;
    width: calc(100% - var(--sidebar-width));
    height: 94px;
    background: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    z-index: 15;
    box-shadow: 0 6px 12px rgba(10, 24, 61, 0.18);
}

.content {
    padding: 160px 40px 40px;
    background: linear-gradient(180deg, #f7f9ff 0%, #eef2ff 120%);
}

.page-header-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title h2 {
    font-size: 28px;
    font-weight: 600;
}

.card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card h3 {
    font-size: 20px;
    margin-bottom: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.finance-title-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.finance-title-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

.finance-primary {
    flex: 0 0 320px;
    max-width: 360px;
}

.finance-primary .inline-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}

.client-summary.large {
    background: #eef1ff;
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: inset 0 0 0 1px rgba(45, 67, 194, 0.12);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.client-summary.large .selected-client {
    background: transparent;
    padding: 0;
    box-shadow: none;
    min-width: 0;
}

.client-summary.large .btn {
    margin-top: 4px;
    width: 100%;
}

.finance-primary small {
    display: block;
    margin-top: 8px;
}

.finance-secondary {
    flex: 1 1 420px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.finance-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.finance-field-row .form-group {
    flex: 0 0 auto;
    min-width: 140px;
}

.finance-field-row .mini-date {
    flex: 0 0 140px;
    max-width: 150px;
}

.finance-field-row .mini-money {
    flex: 0 0 150px;
    max-width: 160px;
}

.finance-field-row .parcel-field {
    flex: 0 0 80px;
    max-width: 90px;
}

.finance-field-row .short-field {
    flex: 0 0 150px;
    max-width: 170px;
}

.finance-field-row .parcel-preview {
    flex: 0 0 140px;
    max-width: 150px;
}

.finance-field-row.single {
    justify-content: flex-start;
}

.finance-field-row.single .reference-field,
.finance-field-row.single .observation-field {
    flex: 0 0 320px;
    max-width: 360px;
}

.reference-field input,
.observation-field textarea {
    border-radius: 14px;
    min-height: 64px;
}

.observation-field textarea {
    resize: vertical;
    min-height: 70px;
}

.is-hidden {
    display: none !important;
}

.btn.full-width {
    width: 100%;
}

.finance-new-title .form-actions {
    justify-content: flex-start;
    gap: 12px;
}

.form-group-small input {
    width: 120px;
}

.form-row.columns-client-main {
    grid-template-columns: minmax(200px, 2.2fr) minmax(140px, 1fr) minmax(150px, 1fr) minmax(70px, 0.6fr) minmax(160px, 1.1fr);
}

.form-row.columns-address {
    grid-template-columns: minmax(200px, 2.5fr) minmax(80px, 0.7fr) minmax(160px, 1.3fr);
}

.form-row.columns-vehicle {
    grid-template-columns: minmax(140px, 1.1fr) minmax(180px, 1.3fr) minmax(140px, 1.1fr) minmax(90px, 0.7fr) minmax(120px, 0.9fr);
}

.summary-box {
    background: #f1f4ff;
    border-radius: 30px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: inset 0 0 0 1px rgba(47, 73, 208, 0.12);
}

.summary-box-link {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.summary-box-link:hover,
.summary-box-link:focus-visible {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(47, 73, 208, 0.2), 0 8px 16px rgba(47, 73, 208, 0.12);
}

.summary-box strong {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-dark);
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #d9e1f5;
    background: #f9fbff;
    font-size: 14px;
    color: var(--text);
}
.textarea-compact {
    min-height: 52px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 16px rgba(47, 73, 208, 0.2);
}

.btn-secondary {
    background: #e8edff;
    color: var(--primary);
}

.btn-danger {
    background: rgba(245, 26, 1, 0.1);
    color: var(--danger);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eef2ff;
    font-size: 16px;
}

.table th {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    text-align: center;
}

.table tbody tr:hover {
    background: #f3f5ff;
}

.table-subactions {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.flash-container {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash {
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: var(--shadow);
}

.flash.success {
    background: rgba(11, 138, 96, 0.12);
    color: var(--success);
}

.flash.error {
    background: rgba(192, 57, 43, 0.12);
    color: var(--danger);
}

.badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
}

.table-actions {
    display: inline-flex;
    gap: 8px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 9, 30, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 20;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: var(--border-radius);
    width: min(720px, 95vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
    padding: 20px 24px;
    border-bottom: 1px solid #eef2ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-footer {
    border-top: 1px solid #eef2ff;
    border-bottom: none;
    justify-content: flex-end;
    gap: 10px;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

[data-card-net] {
    display: none;
}

[data-card-net].is-visible {
    display: block;
}

[data-card-net] small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
}

.modal-form .form-group input {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #d9e1f5;
    background: #f9fbff;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d9e1f5;
    border-radius: 12px;
    background: #f7f9ff;
    margin-bottom: 16px;
}

.list {
    display: flex;
    flex-direction: column;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 6px;
    margin-top: 16px;
}

.list-item {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #eef2ff;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: border 0.2s ease, background 0.2s ease;
}

.list-item-compact {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    font-size: 14px;
    color: var(--primary-dark);
    flex-wrap: wrap;
}

.list-item-compact span {
    white-space: nowrap;
    margin-right: 8px;
}

.list-item-compact .client-label {
    font-weight: 600;
    color: var(--primary);
}

.list-item-compact .client-value {
    color: var(--primary-dark);
    margin-right: 12px;
}

.list-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.list-item strong {
    font-size: 15px;
}

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

.text-muted {
    color: black;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.table input[type="text"],
.table input[type="number"],
.table select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #d9e1f5;
    background: #f9fbff;
}

.table .item-description {
    display: block;
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.table select:disabled,
.table input[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.currency-input {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.line-total {
    white-space: nowrap;
}

.table button:not(.btn) {
    border: none;
    background: none;
    color: var(--danger);
    cursor: pointer;
    font-weight: 600;
}

.total-row {
    font-weight: 700;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-actions .search-input {
    height: 48px;
    padding: 0 18px;
    margin-bottom: 0;
    line-height: 48px;
}

.section-actions .btn,
.section-actions button {
    height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.client-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.selected-client {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f1f4ff;
    padding: 14px 18px;
    border-radius: 14px;
    min-height: 64px;
    min-width: 260px;
    box-shadow: inset 0 0 0 1px rgba(47, 73, 208, 0.08);
}

.selected-client strong {
    font-size: 15px;
}

.status-update-form {
    margin-top: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.status-select {
    appearance: none;
    border-radius: 12px;
    border: 1px solid #d9e1f5;
    background: var(--card-bg);
    padding: 10px 18px;
    font-weight: 600;
    color: var(--primary-dark);
    min-width: 150px;
    box-shadow: inset 0 1px 2px rgba(20, 31, 75, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.status-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(66, 99, 255, 0.15);
}

.finance-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}

.finance-dashboard-header h3 {
    margin-bottom: 8px;
}

.dashboard-filter {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.dashboard-filter .form-group {
    min-width: 170px;
}

.dashboard-filter-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.dashboard-quick {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 999px;
    background: #f0f3ff;
}

.dashboard-checkbox input {
    transform: scale(1.1);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.dashboard-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card-link .dashboard-card {
    height: 100%;
}

.dashboard-card-link:hover .dashboard-card,
.dashboard-card-link:focus-visible .dashboard-card {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(31, 41, 87, 0.12);
}

.dashboard-card {
    background: linear-gradient(135deg, #f9fbff 0%, #eef2ff 100%);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 12px 24px rgba(31, 41, 87, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-card strong {
    font-size: 22px;
    color: var(--primary-dark);
}

.dashboard-card small {
    font-size: 13px;
}

.dashboard-card-accent {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.12), rgba(46, 204, 113, 0.22));
}

.dashboard-card-danger {
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.12), rgba(192, 57, 43, 0.24));
}

.dashboard-chart-card {
    margin-bottom: 24px;
}

.dashboard-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.dashboard-legend {
    display: flex;
    gap: 12px;
    align-items: center;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f1f3ff;
}

.legend-in::before,
.legend-out::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-in::before {
    background: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15);
}

.legend-out::before {
    background: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.dashboard-chart {
    width: 100%;
    min-height: 260px;
    position: relative;
}

.dashboard-chart svg {
    width: 100%;
    height: 280px;
}

.chart-tooltip {
    position: absolute;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(31, 41, 87, 0.18);
    transform: translate(-50%, -120%);
    pointer-events: none;
    font-size: 12px;
    color: var(--text);
    z-index: 2;
}

.chart-tooltip strong {
    font-size: 14px;
    color: var(--primary-dark);
}

.chart-tooltip span {
    color: var(--muted);
}

.dashboard-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.dashboard-list header {
    margin-bottom: 12px;
}

.dashboard-list ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dashboard-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid #e3e8fb;
}

.dashboard-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dashboard-list .list-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-list .list-primary {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dashboard-list .list-title {
    color: var(--primary-dark);
}

.dashboard-list .btn-link {
    padding: 0;
}

@media (max-width: 900px) {
    .dashboard-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-quick {
        justify-content: space-between;
    }
}


@media (max-width: 1200px) {
    :root {
        --sidebar-width: 260px;
    }

    .top-banner {
        height: 88px;
        font-size: 22px;
    }

    .content {
        padding: 140px 32px 32px;
    }
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 100%;
    }

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

    .sidebar {
        width: 100%;
        padding: 28px 20px;
        align-items: center;
        gap: 20px;
    }

    .sidebar nav {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        align-items: stretch;
    }

    .top-banner {
        position: sticky;
        left: 0;
        right: 0;
        top: 0;
        width: 100%;
        height: 72px;
        font-size: 18px;
    }

    .content {
        padding: 112px 16px 32px;
    }
}
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f7f9ff 0%, #eef2ff 120%);
    padding: 24px;
}

.auth-card {
    width: min(380px, 95vw);
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
}

.auth-logo img {
    max-width: 180px;
    display: block;
    margin: 0 auto;
}

.auth-title {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-dark);
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form .form-group input {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #d9e1f5;
    background: #f9fbff;
}

.auth-submit {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}


.flash-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1200;
    pointer-events: none;
}

.flash {
    background: #fff;
    padding: 16px 20px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 280px;
    max-width: 360px;
    color: var(--text);
    pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.flash.success {
    border-left-color: var(--success);
}

.flash.error {
    border-left-color: var(--danger);
}

.flash.warning {
    border-left-color: #f1c40f;
}

.flash .flash-body strong {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.flash .flash-body p {
    margin-top: 4px;
    font-size: 0.9rem;
}

.flash .flash-close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
}

.flash.closing {
    opacity: 0;
    transform: translateY(-8px);
}

.finance-parcel-section .finance-parcel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.finance-credit-banner {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(47, 73, 208, 0.08), rgba(47, 73, 208, 0.18));
    border-radius: 16px;
    margin-bottom: 18px;
}

.finance-credit-banner .credit-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text);
}

.finance-credit-banner .credit-info .credit-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}

.finance-credit-banner .credit-info .credit-line .label {
    font-weight: 600;
}

.finance-credit-banner .credit-info .credit-line .value {
    font-weight: 600;
}

.finance-credit-banner .credit-info .credit-line .meta {
    color: var(--muted);
    font-size: 12px;
}

.finance-credit-banner .credit-info p {
    margin: 0;
    line-height: 1.4;
}

.finance-credit-banner .btn {
    white-space: nowrap;
    align-self: center;
    box-shadow: none;
}

.finance-history-details {
    display: block;
    margin-bottom: 18px;
}

.finance-history-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f3ff;
    padding: 10px 16px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.finance-history-details summary::-webkit-details-marker {
    display: none;
}

.finance-history-details summary::after {
    content: '?';
    font-size: 12px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.finance-history-details[open] summary::after {
    transform: rotate(180deg);
}

.finance-credit-details {
    display: block;
    margin-top: 12px;
}

.finance-credit-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f3ff;
    padding: 10px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: background 0.2s ease;
}

.finance-credit-details summary::before {
    content: '??';
}

.finance-credit-details[open] summary {
    background: rgba(47, 73, 208, 0.12);
}

.credit-detailed-table {
    border-top: 1px dashed #dfe4fb;
    padding-top: 12px;
}

.finance-parcel-table .finance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.finance-parcel-table .finance-actions .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(47, 73, 208, 0.12);
    color: var(--primary);
}

.status-badge.agendado {
    background: rgba(46, 204, 113, 0.18);
    color: #1b7d49;
}

.status-badge.aberto {
    background: rgba(41, 128, 185, 0.16);
    color: #1f5f85;
}

.status-badge.pago_parcial {
    background: rgba(243, 156, 18, 0.2);
    color: #b06e0d;
}

.status-badge.vencido {
    background: rgba(245, 26, 1, 0.18);
    color: var(--danger);
}

.status-badge.pago {
    background: rgba(47, 73, 208, 0.18);
    color: var(--primary);
}

.status-badge.cancelado {
    background: rgba(127, 140, 141, 0.2);
    color: #536062;
}

.finance-parcel-table .value {
    font-weight: 600;
}

.finance-parcel-table .status-cell {
    text-align: center;
    vertical-align: middle;
}

.finance-parcel-table .actions-column {
    width: 260px;
}

.finance-parcel-table .actions-cell {
    text-align: right;
    white-space: nowrap;
}

.finance-parcel-table .actions-cell .btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    margin-left: 4px;
}

.finance-parcel-table .badge.neutral {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
}

.finance-parcel-table details {
    background: rgba(15, 23, 42, 0.04);
    padding: 12px;
    border-radius: 12px;
}

.finance-parcel-table details summary {
    cursor: pointer;
    font-weight: 600;
}

.finance-parcel-table .inner-table {
    margin-top: 12px;
}

.finance-parcel-table .inner-table td,
.finance-parcel-table .inner-table th {
    font-size: 0.8rem;
}

.modal .small {
    max-width: 420px;
}

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


.finance-parcel-table .parcela-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.finance-parcel-table .parcela-extra {
    font-size: 0.75rem;
    margin-top: 2px;
}

.finance-parcel-table .parcela-label .parcela-kind {
    font-weight: 600;
}

.finance-parcel-table .actions-cell .btn-sm:hover {
    transform: translateY(-1px);
}

.pagination-bar {
    display: flex;
    justify-content: flex-end;
    margin: 12px 0;
}

.pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #ccd4f6;
    color: #2f49d0;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    background: #fff;
}

.page-link:hover {
    border-color: #2f49d0;
    color: #1f2f7a;
}

.page-link.active {
    background: #2f49d0;
    color: #fff;
    border-color: #2f49d0;
}

.page-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-link.ellipsis {
    border: none;
    background: transparent;
    color: #98a2d1;
    cursor: default;
}

.client-name-line {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.client-phone-line {
    font-size: 13px;
    color: var(--muted);
}
