:root {
    --isna-green-mid: #388e3c;
    --isna-green-dark: #2e7d32;
    --isna-bg: #f8faf8;
    --isna-card-bg: #ffffff;
    --isna-text: #2c3e50;
    --isna-muted: #6c757d;
    --isna-border: #e3e8e3;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body { position: relative; min-height: 100vh; margin: 0; overflow-x: hidden; font-family: Arial, sans-serif; background: var(--isna-bg); color: var(--isna-text); line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding-left: 12px; padding-right: 12px; }
.pb-5 { padding-bottom: 3rem !important; }
.p-0 { padding: 0 !important; }
.p-4 { padding: 1.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.py-2 { padding-top: .5rem !important; padding-bottom: .5rem !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: .5rem !important; } .mb-3 { margin-bottom: 1rem !important; } .mb-4 { margin-bottom: 1.5rem !important; }
.mt-3 { margin-top: 1rem !important; } .me-2 { margin-right: .5rem !important; } .me-3 { margin-right: 1rem !important; } .me-4 { margin-right: 1.5rem !important; }
.ms-2 { margin-left: .5rem !important; } .m-0 { margin: 0 !important; }
.d-flex { display: flex !important; } .d-grid { display: grid !important; } .d-none { display: none !important; }
.bg-light { background: #f8f9fa !important; } .border-0 { border: 0 !important; } .rounded-4 { border-radius: 1rem !important; }
.gap-3 { gap: 1rem !important; } .py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.justify-content-center { justify-content: center !important; } .justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; } .align-items-end { align-items: flex-end !important; }
.text-center { text-align: center !important; } .text-end { text-align: right !important; }
.text-secondary, .text-muted { color: var(--isna-muted) !important; } .text-dark { color: #212529 !important; } .text-success { color: var(--isna-green-mid) !important; }
.small { font-size: .875em; } .fw-bold { font-weight: 700 !important; } .fw-semibold { font-weight: 600 !important; }
.w-100 { width: 100% !important; } .shadow-sm { box-shadow: 0 2px 8px rgba(0,0,0,.06) !important; }
.row { display: flex; flex-wrap: wrap; margin-left: -12px; margin-right: -12px; } .row > * { padding-left: 12px; padding-right: 12px; width: 100%; }
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9 { width: 100%; }
.top-nav {
    background: #fff;
    border-bottom: 1px solid var(--isna-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
    margin-bottom: 1.5rem;
}

.top-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: .8rem;
    padding-bottom: .8rem;
    position: relative;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: .4rem;
    text-decoration: none;
    white-space: nowrap;
}

.brand-main {
    color: var(--isna-green-mid);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: .04em;
}

.brand-sub {
    color: #3f4a57;
    font-weight: 300;
    font-size: .96rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .3rem;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #4a5868;
    font-size: 1.02rem;
    font-weight: 600;
    padding: .7rem .9rem;
    cursor: pointer;
    transition: all .2s ease;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle[aria-expanded="true"] {
    color: var(--isna-green-mid);
    background: #edf8ef;
    border-color: #dfeee1;
}

.nav-dropdown-toggle i {
    font-size: .8rem;
    transition: transform .2s ease;
}

.nav-dropdown-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.nav-dropdown-panel {
    position: absolute;
    top: calc(100% + .55rem);
    left: 0;
    min-width: 190px;
    display: none;
    flex-direction: column;
    gap: .2rem;
    padding: .45rem;
    background: #fff;
    border: 1px solid var(--isna-border);
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(31, 48, 57, .12);
    z-index: 50;
}

.nav-dropdown.is-open .nav-dropdown-panel,
.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel {
    display: flex;
}

.nav-link,
.nav-logout {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: .6rem .8rem;
    border-radius: 8px;
    color: #48576a;
    text-decoration: none;
    font-weight: 600;
    transition: all .2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--isna-green-mid);
    background: #edf8ef;
}

.nav-account {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-left: .6rem;
    padding-left: .8rem;
    border-left: 1px solid #e6edf2;
}

.nav-user {
    color: #5a6573;
    font-size: .88rem;
    white-space: nowrap;
}

.nav-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 1px solid #d9e2ea;
    color: #475467;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
    padding: .56rem .9rem;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
    transition: all .2s ease;
}

.nav-logout:hover {
    background: linear-gradient(180deg, #fff7f8 0%, #fff1f2 100%);
    color: #a12233;
    border-color: #efc9cf;
    box-shadow: 0 4px 12px rgba(161, 34, 51, .08);
}

.nav-logout i {
    font-size: 1rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 9px 8px;
    border: 1px solid #dfe7ea;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #364152;
    border-radius: 2px;
}

@media (max-width: 860px) {
    .top-nav-inner {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: .6rem;
        padding-top: .35rem;
    }

    .nav-menu.is-open {
        display: flex;
    }

    .nav-dropdown,
    .nav-account {
        width: 100%;
    }

    .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        padding: .75rem .85rem;
        border-color: #e8edf2;
        background: #f9fafb;
    }

    .nav-dropdown-panel {
        position: static;
        display: none;
        width: 100%;
        margin-top: .45rem;
        box-shadow: none;
    }

    .nav-dropdown.is-open .nav-dropdown-panel {
        display: flex;
    }

    .nav-account {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        border-left: 0;
        margin: 0;
        padding: 0;
    }

    .nav-user {
        display: block;
        padding: .7rem .9rem;
        border-radius: 8px;
        background: #f7f9fb;
        white-space: normal;
    }

    .nav-logout {
        width: 100%;
        justify-content: center;
    }
}

.navbar { background: #fff; border-bottom: 1px solid var(--isna-border); padding: 1rem 0; margin-bottom: 1.5rem; }
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.navbar-brand { text-decoration: none; font-weight: 700; color: var(--isna-green-mid); font-size: 0; }
.navbar-brand::before { content: 'ISNA'; font-size: 1rem; }
.navbar-brand::after { content: 'Corretores de Seguros'; margin-left: .35rem; color: #000; font-size: 1rem; font-weight: 300; }
.navbar-brand span { display: none; }
.navbar-nav { display: flex; align-items: center; gap: 1rem; }
.navbar-nav { gap: .65rem; }
.navbar-nav .me-3, .navbar-nav .me-4 { margin-right: 0 !important; }
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { display: inline-flex; align-items: center; gap: .35rem; border: 0; background: transparent; color: #555; font-weight: 500; cursor: pointer; }
.nav-dropdown-toggle:hover, .nav-dropdown:focus-within .nav-dropdown-toggle { color: var(--isna-green-mid); }
.nav-dropdown-menu { position: absolute; top: calc(100% + .55rem); right: 0; z-index: 20; display: none; min-width: 190px; padding: .4rem; border: 1px solid var(--isna-border); border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(25,45,75,.12); }
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu { display: grid; gap: .1rem; }
.nav-dropdown-menu .nav-link { display: block; padding: .55rem .7rem; border-radius: 5px; white-space: nowrap; }
.nav-dropdown-menu .nav-link:hover, .nav-dropdown-menu .nav-link.active { background: #f0faf3; color: var(--isna-green-mid); }
.nav-link { color: #555; text-decoration: none; font-weight: 500; } .nav-link:hover, .nav-link.active { color: var(--isna-green-mid); }
.card, .kpi-card { background: var(--isna-card-bg); border: 1px solid var(--isna-border); border-radius: 12px; }
.card-header-isna { padding: 18px 20px; font-weight: 600; border-bottom: 1px solid var(--isna-border); }
.card-body { padding: 1rem; } .btn { display: inline-block; border: 1px solid transparent; border-radius: 8px; padding: .5rem 1rem; text-decoration: none; cursor: pointer; text-align: center; }
.btn-isna, .btn-success { background: var(--isna-green-mid); color: #fff; font-weight: 600; } .btn-isna:hover, .btn-success:hover { background: var(--isna-green-dark); color: #fff; }
.btn-outline-danger { color: #dc3545; border-color: #dc3545; background: transparent; } .btn-outline-danger:hover { background: #dc3545; color: #fff; }
.btn-outline-success { color: var(--isna-green-mid); border-color: var(--isna-green-mid); background: transparent; }
.btn-outline-warning { color: #996c00; border-color: #d99a00; background: transparent; }
.btn-renovar { color: var(--isna-green-mid); border-color: var(--isna-green-mid); background: #fff; box-shadow: 0 3px 10px rgba(56, 142, 60, .22); }
.btn-renovar:hover { color: #fff; border-color: var(--isna-green-dark); background: var(--isna-green-mid); box-shadow: 0 5px 14px rgba(46, 125, 50, .3); }
.password-field { position: relative; }
.password-field .form-control { padding-right: 2.8rem; }
.password-toggle { position: absolute; top: 50%; right: .55rem; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: #687587; cursor: pointer; transform: translateY(-50%); }
.password-toggle:hover { color: var(--isna-green-mid); }
.btn-secondary { color: #fff; background: #6c757d; } .btn-dark { color: #fff; background: #212529; }
.btn-sm { padding: .25rem .5rem; font-size: .875rem; } .form-label { display: inline-block; margin-bottom: .5rem; }
.form-control, .form-select { display: block; width: 100%; padding: .65rem .8rem; border: 1px solid #ced4da; border-radius: 8px; background: #fff; color: #212529; }
.form-control:focus, .form-select:focus { outline: 0; border-color: var(--isna-green-mid); box-shadow: 0 0 0 .2rem rgba(56,142,60,.15); }
.form-text { color: var(--isna-muted); font-size: .875em; } .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-panel { overflow: hidden; border: 1px solid #e6eaf0; border-radius: 8px; background: #fff; box-shadow: 0 2px 7px rgba(25, 45, 75, .04); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 14px 16px; border-bottom: 1px solid #e9edf2; background: #fff; }
.table-toolbar .form-control { max-width: 310px; padding: .55rem .8rem; border-color: #d9dfe8; font-size: .85rem; }
.table-search-form { width: min(100%, 310px); } .table-search-form .form-control { max-width: none; }
.table-filter-form { width: min(100%, 230px); } .table-filter-form .form-select { padding: .55rem .8rem; border-color: #d9dfe8; font-size: .85rem; }
.table-filter-icon-form { display: flex; align-items: center; gap: .5rem; } .table-filter-icon-form .bi { color: #687587; font-size: 1rem; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; min-width: 640px; border-collapse: collapse; } .table th, .table td { padding: .72rem .85rem; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: middle; } .table th { color: #536174; background: #f7f9fc; font-size: .67rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.table tbody tr:nth-child(even) { background: #fbfcfe; } .table-hover tbody tr:hover { background: #f1f7f2; } .align-middle { vertical-align: middle !important; }
.table td { color: #4e5b6b; font-size: .84rem; } .table td strong { color: #202b3a; font-weight: 600; } .table .text-end { text-align: right; }
.table-actions { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; white-space: nowrap; } .table-actions form { display: inline; }
.table-actions .btn { min-width: 32px; min-height: 30px; padding: .25rem .5rem; font-size: .75rem; }
.icon-action { display: inline-flex; align-items: center; justify-content: center; width: 32px; min-width: 32px; height: 30px; padding: .25rem !important; }
.badge { display: inline-block; padding: .3em .75em; border-radius: 999px; font-size: .7em; font-weight: 700; } .bg-dark { background: #212529; color: #fff; } .bg-secondary { background: #6c757d; color: #fff; } .bg-success { background: #d9f7e7; color: #12824b; } .bg-danger { background: #ffe1e5; color: #bd2638; } .bg-warning { background: #fff0c7; color: #8e6500; }
.periodicity-badge { padding: .4em .8em; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; }
.state-indicator { display: inline-block; width: 12px; height: 12px; min-width: 12px; min-height: 12px; aspect-ratio: 1 / 1; border-radius: 50%; vertical-align: middle; }
.state-active { background: #28a745; box-shadow: 0 0 0 3px #d9f7e7; }
.state-inactive { background: #dc3545; box-shadow: 0 0 0 3px #ffe1e5; }
.state-pending { background: #f0a000; box-shadow: 0 0 0 3px #fff0c7; }
.status-cell { text-align: center !important; }
.table-empty { padding: 2rem 1rem !important; color: #8792a2 !important; text-align: center !important; }
.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; color: #7b8797; font-size: .75rem; border-top: 1px solid #edf0f4; }
.table-pagination { display: inline-flex; align-items: center; gap: .55rem; } .table-pagination a { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid #d8dee8; border-radius: 6px; color: #687587; text-decoration: none; font-size: 1rem; line-height: 1; } .table-pagination a:hover { color: var(--isna-green-mid); border-color: var(--isna-green-mid); }
.table-panel > .table-wrap > .table { margin: 0; }
.performance-panel { overflow: hidden; border: 1px solid #e6eaf0; border-radius: 10px; background: #fff; box-shadow: 0 2px 7px rgba(25,45,75,.04); }
.performance-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid #e9edf2; }
.performance-header small { display: block; margin-top: 3px; color: #7b8797; font-size: .75rem; }
.performance-row { display: grid; grid-template-columns: minmax(160px,1.2fr) .65fr .9fr; align-items: center; gap: .7rem; padding: 13px 16px; border-bottom: 1px solid #edf0f4; }
.performance-row:last-child { border-bottom: 0; }
.performance-client { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.performance-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: #e7f4ea; color: #26733a; font-weight: 700; }
.performance-client strong { display: block; overflow: hidden; color: #243447; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.performance-client small, .performance-stat small { display: block; color: #8792a2; font-size: .68rem; }
.performance-stat strong { color: #243447; font-size: .82rem; }
.performance-renewal { color: #a86a00; font-size: .73rem; font-weight: 600; }
.performance-renewal.clear { color: #218447; }
.performance-commission { display: block; margin-top: 3px; color: #315b8a; font-size: .68rem; font-weight: 500; }
.link-button { padding: 0; border: 0; background: transparent; color: #236b3a; font-weight: 600; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: #b8d9c0; text-underline-offset: 3px; }
.link-button:hover { color: var(--isna-green-dark); text-decoration-color: currentColor; }
.details-modal { position: fixed; inset: 0; z-index: 1050; display: grid; place-items: center; padding: 1rem; background: rgba(23, 37, 28, .48); }
.details-modal[hidden] { display: none; }
.details-dialog { position: relative; width: min(100%, 620px); max-height: min(90vh, 680px); overflow-y: auto; padding: 2rem; border-radius: 12px; background: #fff; box-shadow: 0 24px 70px rgba(24, 54, 39, .24); }
.details-dialog h2 { margin: 0 2.5rem 1.5rem 0; color: #17251c; font-size: 1.35rem; }
.details-dialog h3 { margin: 1.5rem 0 .7rem; color: #243447; font-size: 1rem; }
.details-close { position: absolute; top: .75rem; right: .9rem; border: 0; background: transparent; color: #687587; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.details-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.details-grid div { padding: .75rem; border: 1px solid #edf0f4; border-radius: 6px; background: #fbfcfe; }
.details-grid span, .details-list span { display: block; color: #7b8797; font-size: .72rem; }
.details-grid strong { display: block; margin-top: .2rem; color: #243447; font-size: .88rem; overflow-wrap: anywhere; }
.details-wide { grid-column: 1 / -1; }
.details-list { display: grid; gap: .5rem; }
.details-list div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem .8rem; border-left: 3px solid var(--isna-green-mid); background: #f7faf8; }
.details-list strong { color: #243447; font-size: .85rem; } .details-muted { color: var(--isna-muted); font-size: .9rem; }
.iva-actions a, .iva-form form[enctype="multipart/form-data"] { display: none !important; }
.iva-heading > div > p { display: none; }
.report, .report * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
.report-brand { display: flex; flex-direction: column; gap: 5px; }
.report-brand img { max-width: 180px; max-height: 60px; object-fit: contain; object-position: left center; }
.report-brand strong { color: #00682b; font-size: 10px; }
.report-palette { display: flex; height: 6px; margin-bottom: 18px; }
.report-palette i:nth-child(1) { flex: 4; background: #003816; }
.report-palette i:nth-child(2) { flex: 2; background: #00682b; }
.report-palette i:nth-child(3) { flex: 1.5; background: #388e3c; }
.report-palette i:nth-child(4) { flex: 1.5; background: #a5d6a7; }
.report-palette i:nth-child(5) { flex: 1; background: #ffcb05; }
.report-company { margin-left: auto; margin-right: 1rem; text-align: right; color: #000; font-size: 10px; line-height: 1.3; }
.iva-heading .btn-outline-success:hover { color: #fff !important; background: var(--isna-green-mid) !important; border-color: var(--isna-green-mid) !important; }
.sheet, .sheet * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
.sheet { overflow: hidden; }
.invoice-table { table-layout: fixed; }
.invoice-table th, .invoice-table td { overflow-wrap: anywhere; }
.report { overflow: hidden; }
.report-table { table-layout: fixed; }
.report-table th, .report-table td { overflow-wrap: anywhere; word-break: normal; }
.report-table th:nth-child(1), .report-table td:nth-child(1) { width: 12%; }
.report-table th:nth-child(2), .report-table td:nth-child(2) { width: 13%; }
.report-table th:nth-child(3), .report-table td:nth-child(3) { width: 8%; }
.report-table th:nth-child(4), .report-table td:nth-child(4) { width: 11%; }
.report-table th:nth-child(5), .report-table td:nth-child(5) { width: 9%; }
.report-table th:nth-child(6), .report-table td:nth-child(6) { width: 14%; }
.report-table th:nth-child(n+7), .report-table td:nth-child(n+7) { width: 11%; }
@media print {
    @page { size: A4 portrait; margin: 12mm; }
    .report { width: 100% !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important; }
    .report-head, .report-summary, .report-section, .report-result { break-inside: avoid; }
    .report-table { font-size: 8px !important; }
    .report-table th, .report-table td { padding: 3px !important; line-height: 1.15 !important; }
    .report-section h2 { background-color: #00682b !important; color: #fff !important; }
    .report-card { background-color: #f0f7ec !important; border-color: #00682b !important; }
}
.iva-heading { margin-bottom: 1rem !important; }
.iva-heading h2 { font-size: 1.45rem !important; }
.iva-period { display: flex !important; width: fit-content; max-width: 100%; padding: .55rem .7rem !important; align-items: end; gap: .45rem !important; }
.iva-period > div { flex: 0 0 125px !important; }
.iva-period .btn { height: 36px !important; padding: .35rem .75rem !important; white-space: nowrap; }
.iva-period .form-label { margin-bottom: .3rem !important; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: #687587; }
.iva-summary { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: .7rem !important; margin-bottom: .8rem !important; }
.iva-card { padding: .85rem 1rem !important; }
.iva-card strong { font-size: 1.1rem !important; }
.iva-layout { display: block !important; }
.iva-form { padding: 1rem !important; }
.iva-form h3, .iva-table > h3 { padding-bottom: .7rem !important; margin-bottom: .75rem !important; border-bottom: 1px solid #edf0f4; }
.iva-form .form-label { margin-bottom: .25rem !important; font-size: .76rem; font-weight: 700; color: #536174; }
.iva-form .form-control, .iva-form .form-select { padding: .55rem .7rem !important; margin-bottom: .55rem !important; min-height: 40px; }
.iva-form textarea.form-control { min-height: 62px; }
.iva-form > form:first-of-type { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem; }
.iva-form > form:first-of-type > label { margin: 0 !important; font-size: .7rem; white-space: nowrap; }
.iva-form > form:first-of-type > input,
.iva-form > form:first-of-type > select { margin: 0 !important; }
.iva-form > form:first-of-type > input:not([type="hidden"]),
.iva-form > form:first-of-type > select { width: 135px; min-width: 90px; flex: 1 1 110px; }
.iva-form > form:first-of-type > input[name="csrf_token"],
.iva-form > form:first-of-type > input[name="acao"] { display: none; }
.iva-form > form:first-of-type > textarea { width: 170px; min-width: 120px; flex: 1 1 150px; margin: 0 !important; }
.iva-form > form:first-of-type > button { align-self: end; white-space: nowrap; }
.iva-form > form:first-of-type + hr,
.iva-form > form:first-of-type ~ form { display: none; }
.iva-form > form:first-of-type { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem .65rem; align-items: end; }
.iva-form > form:first-of-type > label[for="descricao"] { grid-column: 1; grid-row: 1; }
.iva-form > form:first-of-type > input[name="descricao"] { grid-column: 1; grid-row: 2; }
.iva-form > form:first-of-type > label[for="fornecedor"] { grid-column: 2; grid-row: 1; }
.iva-form > form:first-of-type > input[name="fornecedor"] { grid-column: 2; grid-row: 2; }
.iva-form > form:first-of-type > label[for="nuit_fornecedor"] { grid-column: 3; grid-row: 1; }
.iva-form > form:first-of-type > input[name="nuit_fornecedor"] { grid-column: 3; grid-row: 2; }
.iva-form > form:first-of-type > label[for="numero_fatura"] { grid-column: 4; grid-row: 1; }
.iva-form > form:first-of-type > input[name="numero_fatura"] { grid-column: 4; grid-row: 2; }
.iva-form > form:first-of-type > label[for="data_documento"] { grid-column: 1; grid-row: 3; }
.iva-form > form:first-of-type > input[name="data_documento"] { grid-column: 1; grid-row: 4; }
.iva-form > form:first-of-type > label[for="valor_total"] { grid-column: 2; grid-row: 3; }
.iva-form > form:first-of-type > input[name="valor_total"] { grid-column: 2; grid-row: 4; }
.iva-form > form:first-of-type > label[for="iva_suportado"] { grid-column: 3; grid-row: 3; }
.iva-form > form:first-of-type > input[name="iva_suportado"] { grid-column: 3; grid-row: 4; }
.iva-form > form:first-of-type > label[for="categoria_iva"] { grid-column: 4; grid-row: 3; }
.iva-form > form:first-of-type > select[name="categoria_iva"] { grid-column: 4; grid-row: 4; }
.iva-form > form:first-of-type > label[for="iva_dedutivel"] { grid-column: 4; grid-row: 3; }
.iva-form > form:first-of-type > input[name="iva_dedutivel"] { grid-column: 4; grid-row: 4; }
.iva-form > form:first-of-type > label[for="categoria_iva"] { grid-column: 1; grid-row: 5; }
.iva-form > form:first-of-type > select[name="categoria_iva"] { grid-column: 1; grid-row: 6; }
.iva-form > form:first-of-type > label[for="observacoes"] { grid-column: 1; grid-row: 5; }
.iva-form > form:first-of-type > label[for="observacoes"] { grid-column: 2; grid-row: 5; }
.iva-form > form:first-of-type > textarea[name="observacoes"] { grid-column: 2 / span 2; grid-row: 6; }
.iva-form > form:first-of-type > button { grid-column: 4; grid-row: 6; width: 100%; }
.iva-form > hr + h3, .iva-form > hr + h3 + p, .iva-form > hr + h3 + p + form { display: none !important; }
.iva-form > form:first-of-type { gap: .35rem .8rem; }
.iva-form > form:first-of-type > label { font-size: .8rem; line-height: 1.2; color: #344054; font-weight: 700; }
.iva-form > form:first-of-type > input:not([type="hidden"]),
.iva-form > form:first-of-type > select,
.iva-form > form:first-of-type > textarea { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: .6rem .75rem !important; border: 1px solid #cbd5df; border-radius: 8px; color: #243447; font-size: .9rem; line-height: 1.3; }
.iva-form > form:first-of-type > textarea { height: 44px; min-height: 44px; resize: vertical; }
.iva-form > form:first-of-type > button { min-height: 44px; align-self: end; padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; }
.iva-form > form:first-of-type > label[for="observacoes"] { align-self: end; }
.iva-form > form:first-of-type > textarea[name="observacoes"] { align-self: end; }
.iva-table { margin-top: .8rem; }
.iva-table { min-width: 0; }
.iva-table > .table-wrap { margin: 0 .8rem .6rem; border: 1px solid #edf0f4; border-radius: 6px; }
.iva-table > h3:not(:first-child) { margin-top: .4rem; padding-top: .8rem; border-top: 5px solid #f4f7f5; }
.iva-table .card-body { margin-top: .6rem; border-top: 5px solid #f4f7f5; padding: 1rem !important; }
@media (max-width: 850px) {
    .iva-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .iva-layout { display: block !important; }
    .iva-form > form:first-of-type > * { grid-column: auto !important; grid-row: auto !important; }
    .iva-form > form:first-of-type > input:not([type="hidden"]),
    .iva-form > form:first-of-type > select,
    .iva-form > form:first-of-type > textarea { flex-basis: 145px; }
}
@media (max-width: 520px) {
    .iva-period { width: 100%; }
    .iva-period > div { flex: 1 1 0 !important; }
    .iva-period .btn { width: auto !important; }
    .iva-form > form:first-of-type { display: flex; flex-direction: column; align-items: stretch; gap: .25rem; }
    .iva-form > form:first-of-type > label { margin-top: .35rem !important; }
    .iva-form > form:first-of-type > input:not([type="hidden"]),
    .iva-form > form:first-of-type > select,
    .iva-form > form:first-of-type > textarea { flex-basis: 100%; }
}
@media (max-width: 520px) { .details-dialog { padding: 1.3rem; } .details-grid { grid-template-columns: 1fr; } .details-wide { grid-column: auto; } .details-list div { display: block; } }
.policy-row { padding: 1rem; margin-bottom: 1rem; border: 1px solid #e3e8e3; border-radius: 8px; background: #fbfcfe; }
.policy-row-heading, .bulk-policy-actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.bulk-policy-actions { margin-top: 1rem; }
.invoice-policy-numbers { margin-top: 1rem; padding: 1rem; border: 1px solid #f2dfb7; border-radius: 8px; background: #fffaf0; }
.alert { padding: .75rem 1rem; border-radius: 8px; } .alert-danger { color: #842029; background: #f8d7da; }
.text-decoration-none { text-decoration: none; } .nav-tabs { display: flex; gap: .25rem; padding-left: 0; list-style: none; border-bottom: 1px solid var(--isna-border); } .nav-tabs .nav-link { padding: .6rem 1rem; }
.nav-tabs .nav-link.active { border-bottom: 2px solid var(--isna-green-mid); }
.kpi-card { padding: 20px; } .kpi-label { font-size: .85rem; color: #687587; font-weight: 600; text-transform: uppercase; } .kpi-value { font-size: 1.8rem; font-weight: 700; margin: 10px 0 0; }
.kpi-active { background: #f0faf3 !important; border-color: #ccebd5 !important; } .kpi-active .kpi-value { color: #218447 !important; }
.kpi-pending { background: #fff8eb !important; border-color: #f2dfb7 !important; } .kpi-pending .kpi-value { color: #a86a00 !important; }
.kpi-expiring { background: #fff3f3 !important; border-color: #f2d2d5 !important; } .kpi-expiring .kpi-value { color: #c33b49 !important; }
.kpi-clients { background: #fff !important; border-color: #e1e6ed !important; } .kpi-clients .kpi-value { color: #263548 !important; }
@media (min-width: 768px) {
    .col-md-1 { width: 8.333333%; } .col-md-2 { width: 16.666667%; } .col-md-3 { width: 25%; } .col-md-4 { width: 33.333333%; } .col-md-6 { width: 50%; } .col-md-8 { width: 66.666667%; } .col-md-9 { width: 75%; }
    .text-md-end { text-align: right !important; } .mt-md-0 { margin-top: 0 !important; }
}
@media (max-width: 767px) {
    .container { max-width: 100%; padding-left: 16px; padding-right: 16px; }
    .navbar { padding: .8rem 0; }
    .navbar .container { display: block; }
    .navbar-brand { display: block; margin-bottom: .75rem; }
    .navbar-brand span { display: block; font-size: .85rem; }
    .navbar-nav { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: .35rem .75rem; }
    .nav-dropdown-menu { position: static; min-width: 100%; margin-top: .25rem; box-shadow: none; }
    .nav-dropdown:focus-within .nav-dropdown-menu { display: grid; }
    .navbar-nav .nav-link { padding: .35rem 0; }
    .navbar-nav .btn { margin-top: .25rem; }
    .row { margin-left: -8px; margin-right: -8px; }
    .row > * { padding-left: 8px; padding-right: 8px; }
    .card-header-isna { padding: 14px 16px; }
    .card-body { padding: 1rem; }
    .kpi-card { padding: 14px; }
    .kpi-label { font-size: .72rem; }
    .kpi-value { font-size: 1.5rem; }
    .row.g-3 > .col-sm-6 { width: 50%; }
    .row.g-3 { margin-left: -6px; margin-right: -6px; }
    .row.g-3 > * { padding-left: 6px; padding-right: 6px; }
    h1, h2, h3, h4 { overflow-wrap: anywhere; }
    .text-end { text-align: left !important; }
    .table th, .table td { padding: .65rem; white-space: nowrap; }
    .table-toolbar { align-items: stretch; flex-direction: column; gap: .65rem; }
    .table-toolbar .form-control { max-width: none; }
    .table-filter-form { width: 100%; }
    .table-filter-icon-form { width: 100%; }
    .table-footer { align-items: flex-start; flex-direction: column; gap: .35rem; }
}
