html[data-sidenav-size=condensed] .content-page {
    margin-left: var(--ins-sidenav-width-sm);
    min-height: 100%;
}

/* KPI / cards */
.kpi-card{
    border: 1px solid rgba(var(--brand-primary-rgb, 11, 32, 49), .08);
    border-radius: 16px;
    background: #fff;
    height: 100%;
    box-shadow: 0 6px 18px rgba(var(--brand-primary-rgb, 11, 32, 49), .06);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.kpi-card:hover{
    box-shadow: 0 10px 24px rgba(var(--brand-primary-rgb, 11, 32, 49), .10);
    border-color: rgba(var(--brand-secondary-rgb, 244, 180, 0), .20);
    transform: translateY(-1px);
}

.kpi-card__body{ padding: 16px; }
.kpi-label{
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6f7c88;
    margin-bottom: 6px;
    font-weight: 700;
}
.kpi-value{
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-primary-hex, #0B2031);
    line-height: 1.1;
}
.kpi-sub{
    font-size: 12px;
    color: #6f7c88;
    margin-top: 6px;
}

.kpi-progress{
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(var(--brand-primary-rgb, 11, 32, 49), .06);
    overflow: hidden;
    margin-top: 12px;
}

.kpi-progress__bar{
    height: 100%;
    border-radius: 999px;
    transition: width .25s ease;
    background: linear-gradient(
        90deg,
        var(--brand-secondary-hex, #F4B400),
        var(--brand-accent-hex, #F9672D)
    );
}

/* toolbar / filtros */
.toolbar-card{
    border: 1px solid rgba(var(--brand-primary-rgb, 11, 32, 49), .08);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(var(--brand-primary-rgb, 11, 32, 49), .05);
}

.quick-filter-btn{
    border-radius: 999px !important;
    padding: 6px 14px;
    font-weight: 600;
    transition: all .2s ease;
}

.quick-filter-btn.btn-light{
    border-color: rgba(var(--brand-primary-rgb, 11, 32, 49), .08);
}

.quick-filter-btn.btn-light:hover{
    background-color: rgba(var(--brand-secondary-rgb, 244, 180, 0), .12);
    border-color: rgba(var(--brand-secondary-rgb, 244, 180, 0), .28);
    color: var(--brand-primary-hex, #0B2031) !important;
}

.stat-chip{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(var(--brand-primary-rgb, 11, 32, 49), .04);
    border: 1px solid rgba(var(--brand-primary-rgb, 11, 32, 49), .08);
    color: var(--brand-primary-hex, #0B2031);
}

.filter-summary-box{
    padding: 10px 12px;
    border: 1px solid rgba(var(--brand-secondary-rgb, 244, 180, 0), .24);
    border-radius: 12px;
    background: rgba(var(--brand-secondary-rgb, 244, 180, 0), .10);
}

.modal-filter-label{
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-primary-hex, #0B2031);
    margin-bottom: 6px;
}

.table-actions-nowrap{ white-space: nowrap; }
.empty-state{ padding: 32px 16px; }

.empty-state i{
    width: 38px;
    height: 38px;
    color: var(--brand-secondary-hex, #F4B400);
    margin-bottom: 10px;
}

.entity-title{
    font-weight: 600;
    color: var(--brand-primary-hex, #0B2031);
}

.entity-subtitle{
    font-size: 12px;
    color: #6f7c88;
}

.app-search .form-control{
    min-width: 320px;
    border-color: #d9e0e6;
    border-radius: 10px;
    box-shadow: none;
}

.app-search .form-control:focus{
    border-color: rgba(var(--brand-secondary-rgb, 244, 180, 0), .60);
    box-shadow: 0 0 0 .2rem rgba(var(--brand-secondary-rgb, 244, 180, 0), .16);
}

@media (max-width: 991.98px){
    .app-search .form-control{
        min-width: unset;
    }
}

/* loading do content */
#content-loader {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

#content-loader.show {
    opacity: 1;
    pointer-events: all;
}

#content-loader .spinner {
    width: 55px;
    height: 55px;
    border: 6px solid rgba(var(--brand-primary-rgb, 11, 32, 49), 0.12);
    border-top-color: var(--brand-secondary-hex, #F4B400);
    border-right-color: var(--brand-accent-hex, #F9672D);
    border-radius: 50%;
    animation: spin .9s linear infinite;
    box-shadow: 0 4px 16px rgba(var(--brand-primary-rgb, 11, 32, 49), .08);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Guia de configuração inicial do CRM */
.crm-setup-guide {
    background: linear-gradient(135deg, #fff 0%, rgba(var(--brand-primary-rgb, 11, 32, 49), .025) 100%);
    box-shadow: 0 10px 28px rgba(var(--brand-primary-rgb, 11, 32, 49), .08);
    border-left: 4px solid var(--brand-secondary-hex, #F4B400) !important;
}

.crm-setup-guide__icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 14px;
    color: var(--brand-primary-hex, #0B2031);
    background: rgba(var(--brand-secondary-rgb, 244, 180, 0), .18);
}

.crm-setup-guide__icon svg { width: 23px; height: 23px; }

.crm-setup-guide__progress-summary {
    display: flex;
    flex-direction: column;
    font-size: 13px;
}

.crm-setup-guide__progress {
    height: 7px;
    background: rgba(var(--brand-primary-rgb, 11, 32, 49), .08);
}

.crm-setup-guide__progress .progress-bar {
    background: linear-gradient(90deg, var(--brand-secondary-hex, #F4B400), var(--brand-accent-hex, #F9672D));
}

.crm-setup-guide__steps {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.crm-setup-guide__step {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid #e6ebef;
    color: #71808d;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
}

.crm-setup-guide__step-number {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #eef1f4;
    font-size: 11px;
}

.crm-setup-guide__step-number svg { width: 14px; height: 14px; }

.crm-setup-guide__step.is-complete {
    color: #177447;
    border-color: rgba(25, 135, 84, .22);
    background: rgba(25, 135, 84, .06);
}

.crm-setup-guide__step.is-complete .crm-setup-guide__step-number {
    color: #fff;
    background: #198754;
}

.crm-setup-guide__step.is-current {
    color: var(--brand-primary-hex, #0B2031);
    border-color: rgba(var(--brand-secondary-rgb, 244, 180, 0), .55);
    background: rgba(var(--brand-secondary-rgb, 244, 180, 0), .09);
}

.crm-setup-guide__next {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(var(--brand-primary-rgb, 11, 32, 49), .09);
    background: #fff;
}

.crm-setup-guide__next.is-critical {
    border-color: rgba(220, 53, 69, .25);
    background: rgba(220, 53, 69, .035);
}

.crm-setup-content-blocked {
    pointer-events: none;
    opacity: .45;
    user-select: none;
    filter: grayscale(.2);
}

@media (max-width: 1199.98px) {
    .crm-setup-guide__steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .crm-setup-guide__steps { grid-template-columns: 1fr; }

    .crm-setup-guide__next {
        align-items: stretch;
        flex-direction: column;
    }

    .crm-setup-guide__next .btn { width: 100%; }
}
