/* =========================
   BASE
   ========================= */
:root {
    --funpar-blue: #2C5686;
    --funpar-blue-dark: #283F59;
    --funpar-green: #9ECB3B;
    --bg-app: #FFF;
    --text-muted: #6b7280;
    --sidebar-w: 320px;
    --shell-x: 15px;
    --shell-y: 16px;
    --topo-h: 170px;
    --bar-h: 0px;
    --header-offset: calc(var(--topo-h) + var(--bar-h));
}

html, body {
    height: 100%;
}

/* ✅ A RÉGUA LATERAL AGORA É NO BODY */
body {
    background: var(--bg-app);
    margin: 0;
    padding: 0;
    /* topo fixo + régua lateral */
    padding-top: var(--header-offset);
    padding-left: var(--shell-x);
    padding-right: var(--shell-x);
    overflow: auto;
}

/* =========================
   TOPO (SEMPRE FIXO / FULL WIDTH)
   ========================= */
.topo {
    background: var(--funpar-blue);
    border-top: 5px solid var(--funpar-green);
    border-bottom: 3px solid var(--funpar-blue-dark);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topo-h);
    z-index: 1040;
}

    .topo img {
        margin-top: 15px;
        margin-bottom: 15px;
        margin-left: 0;
    }

/* Barra branca do layout (somente ela) */
.topbar {
    position: fixed;
    top: var(--topo-h);
    left: 0;
    right: 0;
    height: var(--bar-h);
    z-index: 1039;
}

/* =========================
   APP SHELL
   ✅ sem margem lateral (body já tem padding)
   ========================= */
.app-shell {
    display: flex;
    width: 100%;
    margin: var(--shell-y) 0;
    background: #fff;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(44,86,134,.06);
    height: auto;
    overflow: visible;
    align-items: stretch;
    gap: 0px;
}

/* =========================
   SIDEBAR
   ========================= */
.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: #f6f9fd;
    border: 1px solid #dfe8f2;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(44,86,134,.08);
    position: sticky;
    top: calc(var(--header-offset) + var(--shell-y));
    align-self: flex-start;
    overflow: hidden;
}

    .sidebar .offcanvas-body {
        max-height: calc(100vh - var(--header-offset) - (var(--shell-y) * 2));
        overflow: auto;
    }

    .sidebar .list-group {
        border-radius: 12px;
    }

    .sidebar a[href*="/Login/LogOff"] {
        border-top: 1px solid #e5e7eb;
    }

    .sidebar .list-group-item:first-child {
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }

    .sidebar .list-group-item:last-child {
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
    }

    .sidebar .offcanvas-header {
        display: none;
    }

/* =========================
   CONTEÚDO
   ========================= */
.content {
    flex: 1;
    min-width: 0;
    background: #fff;
    overflow: visible;
}

/* =========================
   FOOTER
   ✅ volta a ser full width (compensa o padding do body)
   ========================= */
footer {
    background: #29344A;
    width: calc(100% + (var(--shell-x) * 2));
    margin-left: calc(-1 * var(--shell-x));
    margin-right: calc(-1 * var(--shell-x));
    padding: 25px 15px;
    position: relative;
    z-index: 1;
}

    footer p {
        color: #7889AA;
        margin-bottom: 6px;
    }

/* =========================
   CONTEÚDO
   ========================= */
.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

.dl-horizontal dt {
    white-space: normal;
}

/* =========================
   FORM / INPUTS
   ========================= */
input, select, textarea {
    background: #fff;
}

    input:not(.form-control):not(.form-check-input):not(.btn),
    select:not(.form-select):not(.form-control),
    textarea:not(.form-control) {
        width: 100%;
        border: 1px solid #dddddd;
        padding: 10px;
        margin-bottom: 15px;
    }

.clear {
    clear: both;
}

/* =========================
   LOGIN
   ========================= */
.login {
    border: 1px solid #D8EBFF;
    margin: 0 auto;
    float: none;
    background: #D8EBFF;
    border-radius: 10px;
    box-shadow: 0 0 100px 1px var(--funpar-blue);
}

.login_titulo {
    text-align: center;
}

.form_login_input {
    width: 100%;
    text-align: center;
}

.form_login p {
    width: 90px;
    float: left;
    font-size: 16px;
    color: #000;
    padding-top: 5px;
    text-align: right;
    padding-right: 10px;
}

.form_login input {
    width: 200px;
}

.lembrar {
    float: right;
}

    .lembrar p {
        font-size: 14px;
        width: auto;
        padding-top: 0;
    }

    .lembrar input {
        margin-top: 5px;
        width: auto;
    }

.bt_logar {
    background: var(--funpar-blue);
    border: 0;
    text-transform: uppercase;
    float: right;
    color: #fff;
    padding: 9px 10px;
    margin-top: 15px;
}

/* =========================
   TABELAS
   ========================= */
table thead tr {
    font-size: 16px;
    font-weight: bold;
    background: #3276B1;
    color: #fff;
    text-align: center;
    border: 1px solid;
}

    table thead tr td {
        border: 1px solid;
    }

table tbody tr {
    font-size: 12pt;
}

/* =========================
   BADGES
   ========================= */
.badge-modulo,
.badge-status {
    font-size: 14px !important;
    padding: 6px 12px !important;
    border-radius: 8px;
}

.status-warning {
    background-color: #fbbf24;
    color: #1f2937;
}

.status-danger {
    background-color: #ef4444;
    color: #fff;
}

.status-info {
    background-color: #0ea5e9;
    color: #fff;
}

.status-primary {
    background-color: #2563eb;
    color: #fff;
}

.btn-action {
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
}

/* =========================
   SELECT2
   ========================= */
.select2-container .select2-selection--single {
    height: 31px;
    padding: 2px 6px;
    font-size: 0.875rem;
}

.select2-selection__rendered {
    line-height: 26px !important;
}

.select2-selection__arrow {
    height: 29px !important;
}

/* =========================
   MENU - NOVO VISUAL
   ========================= */
.menu-surface {
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
}

.menu-wrap {
    padding: 16px;
}

.menu-brand {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    margin-bottom: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #eef4fb 100%);
    border: 1px solid #dce6f2;
    box-shadow: 0 10px 24px rgba(44,86,134,.08);
}

.menu-brand-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2C5686 0%, #3b6ea8 100%);
    color: #fff;
    font-size: 20px;
    box-shadow: 0 8px 18px rgba(44,86,134,.22);
}

.menu-brand-text {
    min-width: 0;
}

.menu-brand-eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #7a8797;
    line-height: 1.2;
    margin-bottom: 2px;
}

.menu-brand-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    color: #24496f;
    margin-bottom: 2px;
}

.menu-brand-subtitle {
    font-size: 12px;
    color: #7b8794;
    line-height: 1.3;
}

.menu-section + .menu-section {
    margin-top: 18px;
}

.menu-section-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #7b8794;
    margin-bottom: 10px;
    padding: 0 4px;
}

.menu-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    border-radius: 14px;
    padding: 12px 14px;
    transition: all .18s ease;
}

    .menu-link + .menu-link {
        margin-top: 6px;
    }

    .menu-link:hover {
        background: #eef4fb;
        text-decoration: none;
        transform: translateX(2px);
    }

.menu-link-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #d9e4f0;
    color: #2C5686;
    font-size: 16px;
    transition: all .18s ease;
}

.menu-link-text {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #314155;
    line-height: 1.25;
}

.menu-link-root.active,
.menu-link-child.active {
    background: linear-gradient(135deg, #edf4ff 0%, #e4efff 100%);
    border: 1px solid #cfe0fb;
    box-shadow: 0 8px 18px rgba(29,78,216,.10);
}

    .menu-link-root.active .menu-link-text,
    .menu-link-child.active .menu-link-text {
        color: #1d4ed8;
        font-weight: 700;
    }

    .menu-link-root.active .menu-link-icon,
    .menu-link-child.active .menu-link-icon {
        background: linear-gradient(135deg, #2f65d9 0%, #1d4ed8 100%);
        border-color: #2b5fd0;
        color: #fff;
        box-shadow: 0 6px 14px rgba(29,78,216,.22);
    }

.menu-link-child {
    padding: 10px 12px 10px 16px;
}

    .menu-link-child .menu-link-text {
        font-size: 13.5px;
        font-weight: 600;
    }

    .menu-link-child .menu-link-icon {
        width: 30px;
        height: 30px;
        min-width: 30px;
        border-radius: 9px;
        font-size: 14px;
    }

.menu-accordion .accordion-item {
    border: 0;
    background: transparent;
    margin-bottom: 10px;
}

.menu-module {
    border-radius: 18px;
    overflow: hidden;
}

.menu-module-toggle {
    border: 0 !important;
    border-radius: 18px !important;
    box-shadow: none !important;
    background: #ffffff !important;
    padding: 14px 16px !important;
    display: flex;
    align-items: center;
    min-height: 62px;
    color: #2f4155 !important;
    border: 1px solid #dce6f2 !important;
    box-shadow: 0 8px 20px rgba(44,86,134,.06) !important;
}

    .menu-module-toggle:hover {
        background: #f8fbff !important;
    }

    .menu-module-toggle::after {
        width: 14px;
        height: 14px;
        background-size: 14px;
        opacity: .65;
    }

    .menu-module.is-open .menu-module-toggle,
    .menu-module-toggle:not(.collapsed) {
        background: linear-gradient(135deg, #f6faff 0%, #edf4fb 100%) !important;
        border-color: #cfddee !important;
    }

.menu-module-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    margin-right: 12px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2C5686 0%, #3b6ea8 100%);
    color: #fff;
    font-size: 18px;
    box-shadow: 0 8px 18px rgba(44,86,134,.18);
}

.menu-module-title {
    font-size: 14px;
    font-weight: 700;
    color: #32485f;
}

.menu-subitems {
    margin-top: 8px;
    padding: 6px 6px 6px 12px;
    border-left: 2px solid #d9e4f0;
    margin-left: 18px;
}

.menu-link-logout:hover {
    background: #fff4f4;
}

    .menu-link-logout:hover .menu-link-icon {
        color: #dc3545;
        border-color: #f0c7cd;
        background: #fff;
    }

.menu-offcanvas-header {
    background: #fff;
}

.sidebar .offcanvas-header {
    display: none;
}

.sidebar .menu-surface,
.offcanvas .menu-surface {
    min-height: 100%;
}

.sidebar .menu-wrap {
    padding: 16px;
}

.offcanvas .menu-wrap {
    padding: 16px;
}

.offcanvas .menu-brand {
    margin-top: 4px;
}

/* limpa estilos antigos que vinham de list-group/accordion */
.offcanvas .list-group-item,
.sidebar .list-group-item {
    border: 0;
    border-radius: 0;
    padding: 0;
    font-size: inherit;
}

.offcanvas .list-group-item-action:hover,
.sidebar .list-group-item-action:hover {
    background: transparent;
}

.offcanvas .accordion-button,
.sidebar .accordion-button {
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
}

/* =========================
   HEADER / CARDS
   ========================= */
.page-header {
    padding: 18px 20px;
    background: #eef2f7;
    border-radius: 10px;
    border: 1px solid #e6ebf2;
    margin-top: -15px;
}

.page-icon {
    width: 46px;
    height: 46px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 22px;
    color: #2C5686;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #2C5686;
}

.breadcrumb {
    font-size: 14px;
}

.breadcrumb-item a {
    text-decoration: none;
    color: #2C5686;
    font-weight: 500;
}

.breadcrumb-item.active {
    color: #6b7280;
}

.card {
    background: #eef2f7 !important;
    border: 1px solid #e9edf3;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(44,86,134,.06);
}

    .card:hover {
        box-shadow: 0 6px 18px rgba(44,86,134,.10);
        transform: translateY(-2px);
        transition: all .15s ease;
    }

.bloco-boas-vindas {
    text-align: right;
    padding-right: 45px;
}

    .bloco-boas-vindas .d-inline-block {
        display: inline-block;
        max-width: 100%;
        color: #fff;
    }

    .bloco-boas-vindas .small {
        font-size: 14px;
        line-height: 1.2;
    }

    .bloco-boas-vindas .fw-bold {
        font-size: 16px;
        line-height: 1.2;
        white-space: normal;
        word-break: break-word;
    }

/* =========================
   MODAL CUSTOM
   ========================= */
.modal-xxl {
    width: 90vw;
    max-width: none;
    margin: 1vh auto;
}

.modal-full-height {
    height: 90vh;
}

    .modal-full-height .modal-content {
        height: 90vh;
        min-height: 90vh;
        border-radius: 12px;
    }

    .modal-full-height .modal-body {
        overflow-y: auto;
    }

.page-context-hero {
    position: relative;
    display: flex;
    background: linear-gradient(135deg, #ffffff 0%, #f7faff 100%);
    border: 1px solid #dfe7f1;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(44, 86, 134, 0.06);
}

.page-context-hero-bar {
    width: 6px;
    background: linear-gradient(180deg, #2C5686 0%, #4d7bb0 100%);
    flex: 0 0 6px;
}

.page-context-hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    width: 100%;
}

.page-context-hero-text {
    min-width: 0;
}

.page-context-kicker {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6b7280;
    margin-bottom: 6px;
}

.page-context-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    color: #243b53;
    margin-bottom: 6px;
}

.page-context-subtitle {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.45;
    max-width: 780px;
}

.page-context-hero-action {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

    .page-context-hero-action .btn {
        min-width: 150px;
        border-radius: 12px;
        box-shadow: 0 8px 18px rgba(25, 135, 84, 0.18);
    }

@media (max-width: 991.98px) {
    .page-context-hero-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-context-title {
        font-size: 17px;
    }

    .page-context-subtitle {
        max-width: 100%;
    }

    .page-context-hero-action {
        width: 100%;
    }

        .page-context-hero-action .btn {
            width: 100%;
        }
}

.page-context {
    background: #f8fafc;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 16px 18px;
}

.page-context-text {
    max-width: 600px;
    line-height: 1.4;
}

.log-scroll {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px 20px;
}

    /* Scroll mais elegante */
    .log-scroll::-webkit-scrollbar {
        width: 8px;
    }

    .log-scroll::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 6px;
    }

        .log-scroll::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }


/* =========================
   CRM - CAP
   ========================= */

.cap-page {
    color: #27313b;
}

.cap-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f4fbfa 100%);
    border: 1px solid #dce5e4;
    border-radius: 14px;
    padding: 1.4rem 1.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cap-hero-kicker {
    color: #2d8f86;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .25rem;
}

.cap-hero-title {
    font-weight: 800;
    color: #1f2a35;
}

.cap-hero-subtitle {
    color: #66737f;
    font-weight: 600;
}

.cap-hero-info {
    background: #ffffff;
    border: 1px solid #d9e5e4;
    color: #2d8f86;
    border-radius: 999px;
    padding: .65rem 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
}

.cap-resumo-card {
    background: #fff;
    border: 1px solid #dce2e7;
    border-radius: 12px;
    padding: 1rem;
    min-height: 112px;
    display: flex;
    align-items: center;
    gap: .9rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
}

    .cap-resumo-card:before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 5px;
        height: 100%;
    }

.cap-line-total:before {
    background: #2d8f86;
}

.cap-line-andamento:before {
    background: #d8a528;
}

.cap-line-pendente:before {
    background: #d95f5f;
}

.cap-line-finalizado:before {
    background: #2fa866;
}

.cap-resumo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f2f7f7;
    color: #2d8f86;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex: 0 0 auto;
}

.cap-resumo-num {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    color: #1f2a35;
}

.cap-resumo-label {
    color: #697783;
    font-weight: 800;
    font-size: .86rem;
    margin-top: .3rem;
}

.cap-painel {
    background: #fff;
    border: 1px solid #dce2e7;
    border-radius: 14px;
    padding: 1.6rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
}

.cap-painel-title {
    font-weight: 900;
    color: #1f2a35;
}

.cap-painel-subtitle {
    color: #66737f;
    font-weight: 600;
}

.cap-search-area {
    width: 100%;
    max-width: 430px;
}

.cap-field-label {
    color: #566472;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .35rem;
}

.cap-toolbar {
    background: #f8fafb;
    border: 1px solid #e2e7eb;
    border-radius: 12px;
    padding: 1rem;
}

.cap-toolbar-filters {
    display: grid;
    grid-template-columns: minmax(390px, 1fr) minmax(190px, 220px) minmax(240px, 300px);
    align-items: end;
    gap: 1rem;
    width: 100%;
}

.cap-filter-status,
.cap-filter-select {
    min-width: 0;
}

.cap-filter-select,
.cap-filter-coordenador {
    width: 100%;
}

.cap-filter-select .form-select {
    min-height: 38px;
    border-color: #cfd9df;
    color: #34424e;
    font-weight: 700;
}

.cap-filter-select .form-select:focus {
    border-color: #2d8f86;
    box-shadow: 0 0 0 .2rem rgba(45, 143, 134, .15);
}

.cap-filtros {
    display: flex;
    gap: .55rem;
    flex-wrap: wrap;
}

.cap-filter {
    border: 1px solid #c7d7d6;
    background: #fff;
    color: #43605d;
    border-radius: 999px;
    padding: .45rem 1.1rem;
    font-size: .83rem;
    font-weight: 800;
    transition: all .15s ease-in-out;
}

    .cap-filter:hover {
        border-color: #2d8f86;
        color: #2d8f86;
    }

    .cap-filter.active {
        background: #2d8f86;
        border-color: #2d8f86;
        color: #fff;
    }

.cap-toolbar-note {
    color: #697783;
    font-weight: 700;
    font-size: .84rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem;
    max-width: none;
    margin-top: .85rem;
    padding-top: .75rem;
    border-top: 1px solid #e2e7eb;
}

.cap-approval-legend {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    padding: .75rem 1rem;
    border: 1px solid #e2e7eb;
    border-radius: 10px;
    background: #fbfcfd;
}

.cap-approval-legend-title {
    color: #566472;
    font-size: .76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-right: .2rem;
}

.cap-approval-legend-item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    padding: .3rem .7rem;
    font-size: .78rem;
    font-weight: 900;
    border: 1px solid currentColor;
    background: #fff;
}

.cap-card {
    border: 1px solid #dce2e7;
    border-radius: 13px;
    padding: 1.35rem 1.45rem;
    margin-bottom: 1rem;
    background: #fff;
    transition: all .15s ease-in-out;
}

    .cap-card:hover {
        border-color: #bdd7d4;
        box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
    }

    .cap-card:nth-child(even) {
        background: #fbfdfd;
    }

    .cap-card:nth-child(odd) {
        background: #ffffff;
    }

.cap-card-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.cap-card-code {
    color: #7a8793;
    font-size: .8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .35rem;
}

.cap-card-title {
    font-size: 1.08rem;
    font-weight: 900;
    color: #1f2a35;
    text-transform: uppercase;
    line-height: 1.35;
}

.cap-card-org {
    color: #60707d;
    font-weight: 800;
    margin-top: .35rem;
}

.cap-card-desc {
    color: #5e6b76;
    font-weight: 600;
    margin-top: .85rem;
    font-size: .92rem;
    line-height: 1.5;
}

.cap-card-context {
    display: flex;
    align-items: stretch;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.cap-context-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 210px;
    padding: .65rem .8rem;
    border: 1px solid #e3e9ed;
    border-radius: 9px;
    background: #f8fafb;
}

.cap-context-item > i {
    color: #2d8f86;
    font-size: 1.05rem;
}

.cap-context-item span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cap-context-item small {
    color: #7a8793;
    font-size: .68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cap-context-item strong {
    color: #2f3b46;
    font-size: .84rem;
    overflow-wrap: anywhere;
}

.cap-badge {
    border-radius: 999px;
    padding: .45rem 1.05rem;
    font-weight: 900;
    color: #fff;
    font-size: .78rem;
    display: inline-block;
    min-width: 125px;
    text-align: center;
    white-space: nowrap;
}

.cap-status-finalizado {
    background: #2fa866;
}

.cap-status-pendente {
    background: #d95f5f;
}

.cap-status-andamento {
    background: #d8a528;
}

.cap-approval-section {
    border-top: 1px solid #edf0f2;
    margin-top: 1.2rem;
    padding-top: 1rem;
}

.cap-approval-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    color: #566472;
    font-size: .75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .7rem;
}

.cap-approval-title i {
    color: #2d8f86;
    font-size: 1rem;
}

.cap-approval-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
}

.cap-approval-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    padding: .7rem .75rem;
    border-radius: 9px;
    border: 1px solid currentColor;
    background: #fff;
}

.cap-approval-item > i {
    font-size: 1.08rem;
    flex: 0 0 auto;
}

.cap-approval-item span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cap-approval-item small {
    color: #66737f;
    font-size: .67rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: 1.25;
}

.cap-approval-item strong {
    font-size: .82rem;
    line-height: 1.25;
}

.cap-approval-approved {
    color: #278f58;
    background: #f1fbf5;
}

.cap-approval-disagreed {
    color: #c84e4e;
    background: #fff5f5;
}

.cap-approval-adjust {
    color: #a97800;
    background: #fffaf0;
}

.cap-approval-pending {
    color: #71808c;
    background: #f6f8fa;
}

.cap-meta-grid {
    border-top: 1px solid #edf0f2;
    margin-top: 1.2rem;
    padding-top: 1rem;
    display: grid;
    grid-template-columns: 1.05fr 1.05fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.cap-meta-action {
    justify-self: end;
    align-self: end;
}

    .cap-meta-action .btn {
        white-space: nowrap;
    }

.cap-meta-label {
    color: #7a8793;
    font-weight: 900;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .25rem;
}

.cap-meta-value {
    color: #2f3b46;
    font-weight: 900;
    font-size: .91rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

    .cap-meta-value i {
        color: #2d8f86;
        font-size: 1.05rem;
    }

.cap-btn-detalhes {
    border-color: #2d8f86;
    color: #2d8f86;
    font-weight: 900;
    padding: .52rem 1.05rem;
    border-radius: 9px;
    white-space: nowrap;
}

    .cap-btn-detalhes:hover {
        background: #2d8f86;
        border-color: #2d8f86;
        color: #fff;
    }

.cap-footer-lista {
    border-top: 1px solid #edf0f2;
    margin-top: 1.5rem;
    padding-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#capPager .page-link {
    color: #2f3b46;
    font-weight: 800;
    border-radius: 8px;
    margin: 0 .12rem;
    border-color: #dce2e7;
}

#capPager .page-item.active .page-link {
    background: #2d8f86;
    border-color: #2d8f86;
    color: #fff;
}

#capPager .page-item.disabled .page-link {
    color: #aab3bb;
}

.cap-btn-limpar {
    font-weight: 800;
    border-color: #d1d9df;
    color: #5f6f7c;
}

    .cap-btn-limpar:hover {
        background: #f1f4f6;
        border-color: #bfc8cf;
        color: #2f3b46;
    }

@media (max-width: 1199.98px) {
    .cap-toolbar-filters {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .cap-filter-status {
        grid-column: 1 / -1;
    }
}

@media (max-width: 991.98px) {
    .cap-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .cap-hero-info {
        width: 100%;
        justify-content: center;
    }

    .cap-toolbar-filters {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .cap-filter-status {
        grid-column: 1 / -1;
    }

    .cap-toolbar-note {
        justify-content: flex-start;
    }

    .cap-approval-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cap-card-top {
        flex-direction: column;
    }

        .cap-card-top .text-lg-end {
            width: 100%;
            text-align: left !important;
        }

    .cap-badge {
        width: 100%;
        min-width: 0;
    }

    .cap-meta-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cap-meta-action {
        grid-column: 1 / -1;
    }

        .cap-meta-action .btn {
            width: 100%;
        }

    .cap-footer-lista {
        flex-direction: column;
        align-items: flex-start;
    }

    #capPager {
        flex-wrap: wrap;
    }
}

@media (max-width: 575.98px) {
    .cap-page {
        padding-left: .5rem !important;
        padding-right: .5rem !important;
    }

    .cap-hero {
        padding: 1rem;
        border-radius: 12px;
    }

    .cap-hero-title {
        font-size: 1.25rem;
    }

    .cap-hero-subtitle {
        font-size: .9rem;
    }

    .cap-painel {
        padding: 1rem;
        border-radius: 12px;
    }

    .cap-search-area {
        max-width: 100%;
    }

        .cap-search-area .input-group {
            display: flex;
            flex-wrap: wrap;
            gap: .5rem;
        }

        .cap-search-area .input-group-text {
            display: none;
        }

        .cap-search-area .form-control {
            width: 100%;
            flex: 0 0 100%;
            border-radius: 8px !important;
        }

    .cap-btn-limpar {
        width: 100%;
        border-radius: 8px !important;
    }

    .cap-toolbar {
        padding: .85rem;
    }

    .cap-filtros {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: .3rem;
        -webkit-overflow-scrolling: touch;
    }

    .cap-filter {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: .42rem .9rem;
    }

    .cap-toolbar-filters {
        grid-template-columns: 1fr;
    }

    .cap-filter-status {
        grid-column: auto;
    }

    .cap-card-context {
        flex-direction: column;
        align-items: stretch;
    }

    .cap-filter-select,
    .cap-filter-coordenador,
    .cap-context-item {
        min-width: 0;
        width: 100%;
    }

    .cap-approval-grid {
        grid-template-columns: 1fr;
    }

    .cap-approval-legend {
        align-items: flex-start;
    }

    .cap-approval-legend-title {
        width: 100%;
    }

    .cap-resumo-card {
        min-height: 98px;
        padding: .85rem;
    }

    .cap-resumo-icon {
        width: 38px;
        height: 38px;
        font-size: 1.15rem;
    }

    .cap-resumo-num {
        font-size: 1.55rem;
    }

    .cap-resumo-label {
        font-size: .78rem;
    }

    .cap-card {
        padding: 1rem;
        border-radius: 12px;
    }

    .cap-card-code {
        font-size: .72rem;
    }

    .cap-card-title {
        font-size: .98rem;
    }

    .cap-card-org {
        font-size: .86rem;
    }

    .cap-card-desc {
        font-size: .86rem;
    }

    .cap-meta-grid {
        grid-template-columns: 1fr;
        gap: .85rem;
    }

    .cap-meta-value {
        font-size: .88rem;
    }

    .cap-btn-detalhes {
        width: 100%;
        padding: .65rem 1rem;
    }

    .cap-footer-lista {
        align-items: stretch;
    }

    #capInfo {
        text-align: center;
        width: 100%;
    }

    #capPager {
        justify-content: center;
    }

        #capPager .page-link {
            padding: .35rem .58rem;
        }
}

/* =========================
   CRM - CAP - MODAL DETALHES
   ========================= */

#modalDetalhesCAP .modal-dialog {
    max-width: 1180px;
}

#modalDetalhesCAP .modal-content {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 22px 70px rgba(15, 23, 42, .28);
}

.cap-modal-header {
    background: linear-gradient(135deg, #ffffff 0%, #f6faf9 100%);
    border-bottom: 1px solid #dde7e6;
    padding: 1.25rem 1.5rem;
}

.cap-modal-kicker {
    color: #2d8f86;
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .09em;
    margin-bottom: .35rem;
}

.cap-modal-title {
    color: #1f2a35;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.35;
    text-transform: uppercase;
    margin: 0;
}

.cap-modal-subtitle {
    color: #66737f;
    font-weight: 800;
    font-size: .84rem;
    line-height: 1.45;
}

.cap-modal-header .btn-close {
    opacity: .65;
    margin-top: .2rem;
}

    .cap-modal-header .btn-close:hover {
        opacity: 1;
    }

.cap-modal-body {
    background: #ffffff;
    padding: 1.4rem 1.5rem;
}

.cap-modal-footer {
    background: #f8fafb;
    border-top: 1px solid #edf0f2;
    padding: 1rem 1.25rem;
}

/* KPI SUPERIOR */

.cap-detail-kpi {
    background: #fff;
    border: 1px solid #dce2e7;
    border-radius: 14px;
    padding: .95rem 1rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 88px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
}

.cap-detail-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f0f7f6;
    color: #2d8f86;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex: 0 0 auto;
}

.cap-detail-kpi-label {
    color: #71808d;
    font-size: .7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .055em;
    margin-bottom: .25rem;
}

.cap-detail-kpi-value {
    color: #1f2a35;
    font-weight: 900;
    font-size: .95rem;
    line-height: 1.25;
    white-space: nowrap;
}

/* ABAS */

.cap-modal-tabs {
    background: #f8fafb;
    border: 1px solid #e2e7eb;
    border-radius: 14px;
    padding: .45rem;
    gap: .4rem;
}

    .cap-modal-tabs .nav-link {
        border-radius: 10px;
        color: #43605d;
        font-weight: 900;
        font-size: .86rem;
        padding: .55rem 1rem;
    }

        .cap-modal-tabs .nav-link.active {
            background: #2d8f86;
            color: #fff;
        }

    .cap-modal-tabs .badge {
        font-size: .7rem;
        padding: .25rem .45rem;
    }

/* TÍTULOS DE SEÇÃO */

.cap-section-title {
    color: #1f2a35;
    font-size: .98rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.cap-section-subtitle {
    color: #7a8793;
    font-size: .82rem;
    font-weight: 700;
}

/* INFORMAÇÕES PRINCIPAIS - COMPATÍVEL COM O HTML ATUAL */

#conteudo-detalhes .row.g-3.mb-4 {
    align-items: stretch;
}

.cap-detail-field {
    background: linear-gradient(135deg, #ffffff 0%, #fbfdfd 100%);
    border: 1px solid #dce2e7;
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    height: 100%;
    min-height: 104px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .035);
}

    .cap-detail-field:hover {
        border-color: #bfd9d6;
        box-shadow: 0 7px 18px rgba(15, 23, 42, .06);
    }

.cap-detail-field-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #eef8f6;
    color: #2d8f86;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.cap-detail-field-content {
    min-width: 0;
    width: 100%;
}

.cap-detail-field-label {
    color: #71808d;
    font-size: .7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .055em;
    margin-bottom: .4rem;
}

.cap-detail-field-value {
    color: #1f2a35;
    font-weight: 800;
    font-size: .9rem;
    line-height: 1.55;
    word-break: normal;
    overflow-wrap: anywhere;
}

/* VERSÃO NOVA, CASO USE CAMPOS SEPARADOS */

.cap-detail-section {
    background: #ffffff;
}

.cap-detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cap-detail-mini-card {
    background: #ffffff;
    border: 1px solid #dce2e7;
    border-radius: 14px;
    padding: .95rem 1rem;
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 86px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .035);
}

    .cap-detail-mini-card:hover {
        border-color: #bfd9d6;
        box-shadow: 0 7px 18px rgba(15, 23, 42, .06);
    }

.cap-detail-mini-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #eef8f6;
    color: #2d8f86;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex: 0 0 auto;
}

.cap-detail-mini-content {
    min-width: 0;
}

.cap-detail-mini-label {
    color: #71808d;
    font-size: .7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .055em;
    margin-bottom: .3rem;
}

.cap-detail-mini-value {
    color: #1f2a35;
    font-size: .92rem;
    font-weight: 900;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.cap-detail-text-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbfb 100%);
    border: 1px solid #dce2e7;
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
    height: 100%;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .035);
}

    .cap-detail-text-card:hover {
        border-color: #bfd9d6;
        box-shadow: 0 7px 18px rgba(15, 23, 42, .06);
    }

.cap-detail-text-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding-bottom: .85rem;
    margin-bottom: .85rem;
    border-bottom: 1px solid #edf0f2;
}

.cap-detail-text-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #eef8f6;
    color: #2d8f86;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex: 0 0 auto;
}

.cap-detail-text-label {
    color: #1f2a35;
    font-size: .82rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .055em;
}

.cap-detail-text-hint {
    color: #7a8793;
    font-size: .74rem;
    font-weight: 700;
    margin-top: .12rem;
}

.cap-detail-text-value {
    color: #2f3b46;
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.65;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* DEMAIS INFORMAÇÕES */

.cap-detail-extra {
    border: 1px solid #dce2e7;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.cap-detail-extra-row {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid #edf0f2;
}

    .cap-detail-extra-row:nth-child(even) {
        background: #f8fafb;
    }

    .cap-detail-extra-row:last-child {
        border-bottom: 0;
    }

.cap-detail-extra-label {
    color: #566472;
    font-weight: 900;
    font-size: .8rem;
}

.cap-detail-extra-value {
    color: #2f3b46;
    font-weight: 700;
    font-size: .88rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* RUBRICAS */

.cap-total-rubricas {
    background: #f2f7f7;
    border: 1px solid #dce5e4;
    border-radius: 12px;
    padding: .8rem 1rem;
    min-width: 210px;
}

.cap-total-rubricas-label {
    color: #7a8793;
    font-size: .7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .055em;
}

.cap-total-rubricas-value {
    color: #1f2a35;
    font-weight: 900;
    font-size: 1.05rem;
}

.cap-rubricas-table-wrap {
    border: 1px solid #dce2e7;
    border-radius: 14px;
    overflow: auto;
    background: #fff;
}

.cap-rubricas-table {
    margin-bottom: 0;
}

    .cap-rubricas-table thead th {
        background: #2C5686;
        color: #fff;
        font-size: .76rem;
        font-weight: 900;
        white-space: nowrap;
        vertical-align: middle;
        padding: .75rem .85rem;
        border-color: #24496f;
    }

    .cap-rubricas-table tbody td {
        color: #2f3b46;
        font-size: .82rem;
        font-weight: 700;
        white-space: nowrap;
        padding: .7rem .85rem;
    }

    .cap-rubricas-table tbody tr:nth-child(even) td {
        background: #f8fafb;
    }

/* AÇÕES */

.cap-action-box {
    background: #ffffff;
    border: 1px solid #e2e7eb;
    border-radius: 14px;
    padding: 1rem;
}

.cap-action-label {
    color: #566472;
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .055em;
    margin-bottom: .45rem;
}

.cap-action-box textarea {
    resize: vertical;
    min-height: 86px;
    border-radius: 10px;
    font-size: .9rem;
    padding: .8rem .9rem;
}

.cap-modal-footer .btn {
    border-radius: 9px;
    font-weight: 800;
    padding: .5rem .95rem;
}

/* RESPONSIVO */

@media (max-width: 991.98px) {
    #modalDetalhesCAP .modal-dialog {
        max-width: calc(100% - 1rem);
        margin: .5rem auto;
    }

    .cap-modal-header {
        padding: 1rem;
    }

    .cap-modal-body {
        padding: 1rem;
    }

    .cap-modal-title {
        font-size: 1rem;
    }

    .cap-detail-kpi-value {
        white-space: normal;
    }

    .cap-detail-extra-row {
        grid-template-columns: 1fr;
        gap: .35rem;
    }

    .cap-total-rubricas {
        width: 100%;
    }

    .cap-modal-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

        .cap-modal-tabs .nav-item {
            flex: 0 0 auto;
        }
}

@media (max-width: 767.98px) {
    .cap-detail-kpi {
        min-height: auto;
    }

    .cap-detail-field {
        min-height: auto;
    }

    .cap-detail-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cap-modal-footer .btn {
        width: 100%;
    }
}

/* =========================
   CRM - CAP - DETALHES - TEXTO LIMPO
   ========================= */

.cap-info-clean {
    background: #ffffff;
}

.cap-info-clean-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cap-info-clean-title {
    color: #1f2a35;
    font-size: 1rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: .45rem;
}

    .cap-info-clean-title i {
        color: #2d8f86;
    }

.cap-info-clean-subtitle {
    color: #7a8793;
    font-size: .84rem;
    font-weight: 700;
    margin-top: .15rem;
}

.cap-info-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1.1rem;
}

.cap-info-summary-item {
    background: #f8fafb;
    border: 1px solid #e3e9ee;
    border-radius: 12px;
    padding: .85rem .95rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 78px;
}

.cap-info-summary-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eef8f6;
    color: #2d8f86;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.cap-info-summary-label {
    color: #71808d;
    font-size: .68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .055em;
    margin-bottom: .22rem;
}

.cap-info-summary-value {
    color: #1f2a35;
    font-size: .9rem;
    font-weight: 900;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.cap-text-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cap-text-panel {
    background: #ffffff;
    border: 1px solid #dce5e4;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .035);
}

.cap-text-panel-header {
    background: #f6faf9;
    border-bottom: 1px solid #e2e9e8;
    padding: .9rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.cap-text-panel-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #dce5e4;
    color: #2d8f86;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.cap-text-panel-title {
    color: #1f2a35;
    font-size: .86rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.cap-text-panel-subtitle {
    color: #7a8793;
    font-size: .75rem;
    font-weight: 700;
    margin-top: .1rem;
}

.cap-text-panel-body {
    padding: 1rem 1.1rem;
    color: #2f3b46;
    font-size: .94rem;
    font-weight: 650;
    line-height: 1.75;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.cap-extra-clean-title {
    color: #1f2a35;
    font-size: .95rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .75rem;
}

    .cap-extra-clean-title i {
        color: #2d8f86;
    }

.cap-extra-clean-list {
    border: 1px solid #e3e9ee;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.cap-extra-clean-row {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid #edf0f2;
}

    .cap-extra-clean-row:nth-child(even) {
        background: #f8fafb;
    }

    .cap-extra-clean-row:last-child {
        border-bottom: 0;
    }

.cap-extra-clean-label {
    color: #566472;
    font-size: .8rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: .4rem;
}

    .cap-extra-clean-label i {
        color: #2d8f86;
    }

.cap-extra-clean-value {
    color: #2f3b46;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
    .cap-info-summary-grid {
        grid-template-columns: 1fr;
    }

    .cap-extra-clean-row {
        grid-template-columns: 1fr;
        gap: .35rem;
    }
}

@media (max-width: 767.98px) {
    .cap-text-panel-body {
        font-size: .9rem;
        line-height: 1.65;
        padding: .9rem;
    }

    .cap-text-panel-header {
        padding: .85rem;
    }
}

.cap-action-readonly {
    background: #ffffff;
    border: 1px solid #e2e7eb;
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: .9rem;
}

.cap-action-readonly-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f2f7f7;
    color: #2d8f86;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex: 0 0 auto;
}

.cap-action-readonly-content {
    flex: 1;
    min-width: 0;
}

.cap-action-readonly-title {
    color: #1f2a35;
    font-size: .9rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .15rem;
}

.cap-action-readonly-text {
    color: #66737f;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.45;
}

.cap-action-readonly-button {
    flex: 0 0 auto;
}

.cap-modal-status {
    flex: 0 0 auto;
    min-width: 160px;
}

.cap-modal-status-label {
    color: #71808d;
    font-size: .7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .055em;
    margin-bottom: .35rem;
}

@media (max-width: 991.98px) {
    .cap-modal-status {
        width: 100%;
        text-align: left !important;
    }

    .cap-modal-status .cap-badge {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .cap-action-readonly {
        flex-direction: column;
        align-items: flex-start;
    }

    .cap-action-readonly-button {
        width: 100%;
    }

    .cap-action-readonly-button .btn {
        width: 100%;
    }
}


/* =========================
   CRM - CAP - HISTORICO
   ========================= */

.cap-historico-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cap-historico-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: .85rem;
    align-items: flex-start;
}

.cap-historico-marker {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #eef8f6;
    border: 1px solid #dce5e4;
    color: #2d8f86;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: .15rem;
}

.cap-historico-card {
    background: #ffffff;
    border: 1px solid #dce5e4;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .035);
}

.cap-historico-top {
    background: #f6faf9;
    border-bottom: 1px solid #e2e9e8;
    padding: .9rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.cap-historico-main {
    min-width: 0;
}

.cap-historico-title {
    color: #1f2a35;
    font-size: .88rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cap-historico-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    color: #66737f;
    font-size: .78rem;
    font-weight: 800;
    margin-top: .35rem;
}

.cap-historico-meta span {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
}

.cap-historico-meta i {
    color: #2d8f86;
}

.cap-historico-status {
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #dce5e4;
    color: #2d8f86;
    padding: .32rem .75rem;
    font-size: .72rem;
    font-weight: 900;
    white-space: nowrap;
}

.cap-historico-desc {
    padding: 1rem 1.1rem;
    color: #2f3b46;
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.6;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .cap-historico-item {
        grid-template-columns: 1fr;
        gap: .45rem;
    }

    .cap-historico-marker {
        display: none;
    }

    .cap-historico-top {
        flex-direction: column;
    }

    .cap-historico-status {
        width: 100%;
        text-align: center;
    }
}


/* =========================
   CRM - CAP - AJUSTES MOBILE
   Modal em tela cheia para celulares e tablets em orientação estreita
   ========================= */

@media (max-width: 767.98px) {
    body.modal-open {
        padding-right: 0 !important;
    }

    #modalDetalhesCAP {
        padding: 0 !important;
    }

    #modalDetalhesCAP .modal-dialog {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        margin: 0 !important;
        display: flex;
        align-items: stretch;
    }

    #modalDetalhesCAP .modal-content {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-shadow: none;
    }

    .cap-modal-header {
        flex: 0 0 auto;
        padding: .9rem 1rem .75rem;
        position: relative;
    }

    .cap-modal-header .btn-close {
        position: absolute;
        top: 1.05rem;
        right: 1rem;
        margin: 0;
        transform: scale(.86);
    }

    .cap-modal-kicker {
        font-size: .72rem;
        letter-spacing: .08em;
        padding-right: 2.3rem;
    }

    .cap-modal-title {
        font-size: 1.03rem;
        line-height: 1.26;
        padding-right: 2.3rem;
    }

    .cap-modal-subtitle {
        font-size: .82rem;
        line-height: 1.35;
        padding-right: 2.3rem;
    }

    .cap-modal-status {
        width: 100%;
        min-width: 0;
        margin-top: .65rem;
        padding-right: 2.3rem;
    }

    .cap-modal-status-label {
        display: none;
    }

    .cap-modal-status .cap-badge {
        width: 100%;
        min-width: 0;
        padding: .52rem .75rem;
        font-size: .8rem;
    }

    .cap-modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: .75rem .9rem;
    }

    .cap-modal-footer {
        flex: 0 0 auto;
        max-height: 42vh;
        max-height: 42dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: .7rem .9rem calc(.7rem + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 18px rgba(15, 23, 42, .08);
    }

    .cap-modal-body > .row.g-3.mb-4 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem !important;
        margin-bottom: .75rem !important;
    }

    .cap-modal-body > .row.g-3.mb-4 > [class*="col-"] {
        width: auto;
        max-width: none;
        flex: none;
        padding: 0;
    }

    .cap-detail-kpi {
        min-height: 64px;
        padding: .58rem .55rem;
        gap: .5rem;
        border-radius: 11px;
        box-shadow: none;
    }

    .cap-detail-kpi-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        font-size: .95rem;
    }

    .cap-detail-kpi-label {
        font-size: .61rem;
        letter-spacing: .045em;
        margin-bottom: .12rem;
    }

    .cap-detail-kpi-value {
        font-size: .82rem;
        line-height: 1.2;
        white-space: normal;
    }

    .cap-modal-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .35rem;
        padding: .35rem;
        margin-bottom: .8rem !important;
        overflow: visible;
    }

    .cap-modal-tabs .nav-item {
        min-width: 0;
    }

    .cap-modal-tabs .nav-link {
        width: 100%;
        min-width: 0;
        padding: .48rem .28rem;
        font-size: .7rem;
        line-height: 1.15;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .2rem;
    }

    .cap-modal-tabs .nav-link i {
        margin-right: 0 !important;
    }

    .cap-modal-tabs .badge {
        font-size: .58rem;
        padding: .15rem .28rem;
        margin-left: .08rem !important;
    }

    .cap-info-clean-header {
        margin-bottom: .7rem;
    }

    .cap-info-clean-title,
    .cap-section-title {
        font-size: .92rem;
    }

    .cap-info-clean-subtitle,
    .cap-section-subtitle {
        font-size: .76rem;
    }

    .cap-info-summary-grid {
        gap: .55rem;
        margin-bottom: .75rem;
    }

    .cap-info-summary-item {
        min-height: auto;
        padding: .65rem .7rem;
    }

    .cap-text-list {
        gap: .75rem;
    }

    .cap-text-panel {
        border-radius: 12px;
    }

    .cap-text-panel-header {
        padding: .65rem .75rem;
        gap: .55rem;
    }

    .cap-text-panel-icon {
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

    .cap-text-panel-title {
        font-size: .76rem;
    }

    .cap-text-panel-subtitle {
        font-size: .68rem;
    }

    .cap-text-panel-body {
        padding: .78rem .75rem;
        font-size: .86rem;
        line-height: 1.55;
    }

    .cap-extra-clean-row {
        padding: .65rem .75rem;
    }

    .cap-rubricas-table-wrap {
        border-radius: 12px;
    }

    .cap-rubricas-table thead th,
    .cap-rubricas-table tbody td {
        font-size: .72rem;
        padding: .55rem .6rem;
    }

    .cap-historico-timeline {
        gap: .75rem;
    }

    .cap-historico-card {
        border-radius: 12px;
    }

    .cap-historico-top {
        padding: .7rem .75rem;
        gap: .5rem;
    }

    .cap-historico-title {
        font-size: .78rem;
    }

    .cap-historico-meta {
        font-size: .7rem;
        gap: .45rem;
    }

    .cap-historico-desc {
        padding: .75rem;
        font-size: .84rem;
        line-height: 1.5;
    }

    .cap-action-box {
        padding: .7rem;
        margin-bottom: .65rem !important;
        border-radius: 12px;
    }

    .cap-action-label {
        font-size: .68rem;
        margin-bottom: .35rem;
    }

    .cap-action-box textarea {
        min-height: 60px;
        max-height: 95px;
        font-size: .85rem;
        padding: .62rem .7rem;
    }

    .cap-modal-footer form > .d-flex {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: .5rem !important;
    }

    .cap-modal-footer form > .d-flex > .btn {
        width: 100%;
        padding: .52rem .7rem;
        font-size: .9rem;
    }

    .cap-modal-footer form > .d-flex > div.d-flex {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem !important;
    }

    .cap-modal-footer form > .d-flex > div.d-flex .btn {
        width: 100%;
        padding: .58rem .45rem;
        font-size: .88rem;
    }

    .cap-modal-footer form > .d-flex > div.d-flex .btn[data-acao="discordar"] {
        grid-column: 1 / -1;
    }

    .cap-action-readonly {
        padding: .75rem;
        gap: .6rem;
    }

    .cap-action-readonly-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .cap-action-readonly-text {
        font-size: .8rem;
    }

    .cap-toolbar {
        align-items: stretch;
    }

    .cap-toolbar > div:first-child {
        width: 100%;
        min-width: 0;
    }

    .cap-filtros {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: .5rem;
        overflow: visible;
        flex-wrap: unset;
        padding-bottom: 0;
    }

    .cap-filter {
        width: 100%;
        white-space: normal;
        text-align: center;
        padding: .48rem .38rem;
        line-height: 1.15;
    }
}

@media (max-width: 380px) {
    .cap-modal-tabs .nav-link {
        font-size: .64rem;
        padding: .45rem .2rem;
    }

    .cap-detail-kpi-label {
        font-size: .58rem;
    }

    .cap-detail-kpi-value {
        font-size: .76rem;
    }

    .cap-modal-footer form > .d-flex > div.d-flex .btn {
        font-size: .82rem;
    }
}
