/* ============================================================================
   CRE360 — Design System "Modern Blue"
   Arquivo: assets/cre360-base.css
   Versão: 1.0
   ============================================================================
   Este arquivo é a fonte única da verdade visual do sistema.
   Toda tela importa este arquivo e usa as classes/tokens daqui.
   Nenhuma cor, espaçamento ou tipografia deve ser inventada nas telas.
   ============================================================================ */

/* ============================================================================
   1. RESET MÍNIMO
   ============================================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--b-bg);
    color: var(--b-ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--b-blue);
    text-decoration: none;
}

    a:hover {
        color: var(--b-blue-hover);
    }

button {
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ============================================================================
   2. DESIGN TOKENS
   ============================================================================ */
:root {
    /* Backgrounds */
    --b-bg: #F8FAFC;
    --b-bg-2: #F1F5F9;
    --b-card: #FFFFFF;
    /* Linhas */
    --b-line: #E5EAF2;
    --b-line-2: #DCE3EC;
    --b-line-soft: #F0F4F9;
    /* Tipografia */
    --b-ink: #0F1729;
    --b-ink-2: #334155;
    --b-ink-3: #64748B;
    --b-ink-4: #94A3B8;
    --b-ink-5: #CBD5E1;
    /* Azul */
    --b-blue: #2563EB;
    --b-blue-hover: #1D4ED8;
    --b-blue-50: #EFF6FF;
    --b-blue-100: #DBEAFE;
    --b-blue-200: #BFDBFE;
    --b-blue-deep: #1E3A8A;
    /* Status */
    --b-success: #16A34A;
    --b-success-50: #F0FDF4;
    --b-success-100: #DCFCE7;
    --b-warn: #D97706;
    --b-warn-50: #FFFBEB;
    --b-warn-100: #FEF3C7;
    --b-danger: #DC2626;
    --b-danger-50: #FEF2F2;
    --b-danger-100: #FEE2E2;
    /* Raios */
    --b-radius: 12px;
    --b-radius-lg: 16px;
    --b-radius-xl: 20px;
    /* Sombras */
    --b-shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.04);
    --b-shadow: 0 1px 3px rgba(15, 23, 41, 0.06), 0 1px 2px rgba(15, 23, 41, 0.04);
    --b-shadow-md: 0 4px 12px rgba(15, 23, 41, 0.06);
    --b-shadow-lg: 0 8px 20px rgba(15, 23, 41, 0.06);
    --b-shadow-xl: 0 20px 60px rgba(15, 23, 41, 0.18);
    --b-shadow-blue: 0 4px 14px rgba(37, 99, 235, 0.25);
}

/* Mono utility */
.b-mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    font-variant-numeric: tabular-nums;
}

.b-tabular {
    font-variant-numeric: tabular-nums;
}

/* ============================================================================
   3. LAYOUT GERAL
   ============================================================================ */
.b-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px 80px;
}

.b-page-narrow {
    max-width: 1024px;
}

.b-page-wide {
    max-width: 1600px;
}

/* Page header (título + ações) */
.b-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

    .b-page-head h1 {
        margin: 0 0 4px 0;
        font-size: 30px;
        font-weight: 700;
        letter-spacing: -0.025em;
        color: var(--b-ink);
        line-height: 1.1;
    }

    .b-page-head .sub {
        color: var(--b-ink-3);
        font-size: 14px;
    }

.b-page-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Two-col grid */
.b-two-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.b-three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ============================================================================
   4. TOPBAR
   ============================================================================ */
/* ============================================================
   TOPBAR
   - Estática: rola junto com a página
   - Fundo branco sólido + borda inferior
   ============================================================ */
.b-topbar {
    background: #FFFFFF;
    border-bottom: 1px solid var(--b-line);
    padding: 12px 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(15, 23, 41, 0.04);
}

.b-topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.b-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Brand */
.b-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: var(--b-ink);
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

.b-brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--b-blue) 0%, var(--b-blue-deep) 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--b-shadow-blue);
}

/* Nav (pill container) */
.b-nav {
    display: flex;
    background: var(--b-bg-2);
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
}

    .b-nav a {
        padding: 7px 14px;
        border-radius: 7px;
        font-size: 13px;
        font-weight: 500;
        color: var(--b-ink-2);
        display: inline-flex;
        align-items: center;
        gap: 6px;
        transition: all 0.15s;
        white-space: nowrap;
    }

        .b-nav a:hover {
            color: var(--b-ink);
            background: rgba(255, 255, 255, 0.6);
        }

        .b-nav a.active {
            background: var(--b-card);
            color: var(--b-blue);
            box-shadow: 0 1px 3px rgba(15, 23, 41, 0.08);
        }

/* Icon button */
.b-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--b-ink-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    position: relative;
    transition: all 0.15s;
}

    .b-icon-btn:hover {
        background: var(--b-bg-2);
        color: var(--b-ink);
    }

    .b-icon-btn .b-badge-dot {
        position: absolute;
        top: 6px;
        right: 6px;
        min-width: 16px;
        height: 16px;
        background: var(--b-danger);
        color: #FFFFFF;
        border-radius: 100px;
        font-size: 9px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        border: 2px solid var(--b-card);
    }

/* User pill */
.b-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 5px;
    background: var(--b-bg-2);
    border: 1px solid var(--b-line);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--b-ink);
    cursor: pointer;
    transition: all 0.15s;
}

    .b-user-pill:hover {
        background: var(--b-bg);
        border-color: var(--b-line-2);
    }

    .b-user-pill .av {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--b-blue) 0%, var(--b-blue-deep) 100%);
        color: #FFFFFF;
        font-size: 11px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .b-user-pill .chev {
        color: var(--b-ink-3);
        font-size: 10px;
    }

/* ============================================================================
   5. CARDS / PAINÉIS
   ============================================================================ */
.b-card {
    background: var(--b-card);
    border: 1px solid var(--b-line);
    border-radius: var(--b-radius-lg);
    box-shadow: var(--b-shadow);
    overflow: hidden;
}

.b-panel {
    background: var(--b-card);
    border: 1px solid var(--b-line);
    border-radius: var(--b-radius-lg);
    box-shadow: var(--b-shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.b-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--b-line-soft);
    gap: 12px;
    flex-wrap: wrap;
}

.b-panel-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--b-ink);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .b-panel-title .accent {
        color: var(--b-ink-3);
        font-weight: 500;
    }

.b-panel-tag {
    background: var(--b-bg-2);
    color: var(--b-ink-3);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.b-panel-body {
    padding: 22px;
}

    .b-panel-body.b-pad-0 {
        padding: 0;
    }

/* ============================================================================
   6. HERO CARD (destaque visual com gradient + grid)
   ============================================================================ */
.b-hero {
    position: relative;
    background: linear-gradient(135deg, var(--b-card) 0%, var(--b-blue-50) 100%);
    border: 1px solid var(--b-line);
    border-radius: var(--b-radius-xl);
    padding: 32px 36px;
    overflow: hidden;
    box-shadow: var(--b-shadow);
}

    .b-hero::before {
        content: '';
        position: absolute;
        top: -40%;
        right: -20%;
        width: 60%;
        height: 180%;
        background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 60%);
        pointer-events: none;
    }

    .b-hero::after {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle at 1px 1px, rgba(37, 99, 235, 0.08) 1px, transparent 0);
        background-size: 32px 32px;
        -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 50%, black 30%, transparent 80%);
        mask-image: radial-gradient(ellipse 100% 80% at 50% 50%, black 30%, transparent 80%);
        pointer-events: none;
    }

    .b-hero > * {
        position: relative;
        z-index: 1;
    }

.b-hero-num {
    font-size: 80px;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--b-ink);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

    .b-hero-num.sm {
        font-size: 48px;
    }

/* ============================================================================
   7. KPI CARDS
   ============================================================================ */
.b-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.b-kpi {
    background: var(--b-card);
    border: 1px solid var(--b-line);
    border-radius: var(--b-radius-lg);
    padding: 20px 22px;
    box-shadow: var(--b-shadow);
    transition: all 0.2s;
    position: relative;
}

    .b-kpi:hover {
        transform: translateY(-2px);
        box-shadow: var(--b-shadow-lg);
        border-color: var(--b-blue-200);
    }

.b-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--b-blue-100);
    color: var(--b-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    margin-bottom: 14px;
}

    .b-kpi-icon.success {
        background: var(--b-success-100);
        color: var(--b-success);
    }

    .b-kpi-icon.warn {
        background: var(--b-warn-100);
        color: var(--b-warn);
    }

    .b-kpi-icon.danger {
        background: var(--b-danger-100);
        color: var(--b-danger);
    }

    .b-kpi-icon.neutral {
        background: var(--b-bg-2);
        color: var(--b-ink-3);
    }

.b-kpi-l {
    font-size: 12px;
    font-weight: 500;
    color: var(--b-ink-3);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.b-kpi-v {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--b-ink);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    margin-bottom: 6px;
}

.b-kpi-s {
    font-size: 12px;
    color: var(--b-ink-3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.b-delta-up {
    color: var(--b-success);
    font-weight: 600;
}

.b-delta-down {
    color: var(--b-danger);
    font-weight: 600;
}

/* ============================================================================
   8. BOTÕES
   ============================================================================ */
.b-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
    user-select: none;
}

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

    .b-btn:active {
        transform: translateY(0);
    }

    .b-btn:disabled, .b-btn.disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

.b-btn-primary {
    background: var(--b-blue);
    color: #FFFFFF;
    box-shadow: var(--b-shadow-blue);
}

    .b-btn-primary:hover {
        background: var(--b-blue-hover);
        color: #FFFFFF;
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    }

.b-btn-secondary {
    background: var(--b-bg-2);
    color: var(--b-ink);
    border-color: var(--b-line);
}

    .b-btn-secondary:hover {
        background: var(--b-bg);
        border-color: var(--b-line-2);
        color: var(--b-ink);
    }

.b-btn-ghost {
    background: transparent;
    color: var(--b-ink-2);
}

    .b-btn-ghost:hover {
        background: var(--b-bg-2);
        color: var(--b-ink);
    }

.b-btn-danger {
    background: var(--b-danger);
    color: #FFFFFF;
}

    .b-btn-danger:hover {
        background: #B91C1C;
        color: #FFFFFF;
    }

.b-btn-success {
    background: var(--b-success);
    color: #FFFFFF;
}

    .b-btn-success:hover {
        background: #15803D;
        color: #FFFFFF;
    }

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

.b-btn-lg {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 12px;
}

.b-btn-icon {
    padding: 9px 11px;
}

/* ============================================================================
   9. BADGES / PILLS
   ============================================================================ */
.b-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 100px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--b-bg-2);
    color: var(--b-ink-2);
    white-space: nowrap;
    line-height: 1.4;
}

.b-pill-success {
    background: var(--b-success-100);
    color: var(--b-success);
}

.b-pill-warn {
    background: var(--b-warn-100);
    color: var(--b-warn);
}

.b-pill-danger {
    background: var(--b-danger-100);
    color: var(--b-danger);
}

.b-pill-blue {
    background: var(--b-blue-100);
    color: var(--b-blue);
}

.b-pill-neutral {
    background: var(--b-bg-2);
    color: var(--b-ink-2);
}

.b-pill-live::before {
    content: '';
    width: 7px;
    height: 7px;
    background: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 0 0 currentColor;
    animation: bPulse 2s infinite;
}

@keyframes bPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(22, 163, 74, 0);
    }
}

.b-pill-sm {
    padding: 2px 8px;
    font-size: 9px;
}

/* ============================================================================
   10. TABELAS
   ----------------------------------------------------------------------------
   IMPORTANTE: A rolagem é da PÁGINA, não da tabela.
   - .b-table-wrap só permite scroll HORIZONTAL (quando a tabela é mais larga
     que o viewport em mobile).
   - NUNCA defina max-height + overflow-y na tabela: isso quebra o scroll
     da página (mouse wheel) e fica horrível em mobile.
   - O thead fica "grudado" quando rola a página, encostando logo abaixo
     da topbar (que ocupa ~80px do topo).
   ============================================================================ */
.b-table-wrap {
    width: 100%;
    overflow-x: auto; /* só horizontal, pra mobile */
    overflow-y: visible; /* nada de scroll vertical interno */
}

.b-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .b-table thead th {
        text-align: left;
        padding: 12px 16px;
        background: var(--b-bg);
        color: var(--b-ink-3);
        font-size: 12px;
        font-weight: 500;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        border-bottom: 1px solid var(--b-line);
        white-space: nowrap;
        /* Sticky relativo à página (topbar rola junto, então thead gruda no topo) */
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .b-table tbody tr {
        border-bottom: 1px solid var(--b-line-soft);
        transition: background 0.15s;
    }

        .b-table tbody tr:hover {
            background: var(--b-blue-50);
        }

        .b-table tbody tr:nth-child(even) {
            background: var(--b-bg);
        }

            .b-table tbody tr:nth-child(even):hover {
                background: var(--b-blue-50);
            }

        .b-table tbody tr:last-child {
            border-bottom: none;
        }

    .b-table td {
        padding: 14px 16px;
        color: var(--b-ink);
        vertical-align: middle;
    }

    .b-table .col-actions {
        text-align: right;
        white-space: nowrap;
    }

    .b-table .col-num {
        text-align: center;
    }

/* ============================================================================
   11. FORMULÁRIOS
   ============================================================================ */
.b-form-group {
    margin-bottom: 18px;
}

.b-form-row {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

    .b-form-row.cols-2 {
        grid-template-columns: 1fr 1fr;
    }

    .b-form-row.cols-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .b-form-row.cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }

.b-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--b-ink-2);
    margin-bottom: 6px;
}

    .b-label .opt {
        color: var(--b-ink-4);
        font-weight: 400;
        margin-left: 4px;
    }

    .b-label .req {
        color: var(--b-danger);
        margin-left: 2px;
    }

.b-input,
.b-select,
.b-textarea {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: var(--b-card);
    border: 1px solid var(--b-line);
    border-radius: 10px;
    color: var(--b-ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    outline: none;
    transition: all 0.15s;
}

    .b-input::placeholder, .b-textarea::placeholder {
        color: var(--b-ink-4);
    }

    .b-input:focus, .b-select:focus, .b-textarea:focus {
        border-color: var(--b-blue);
        box-shadow: 0 0 0 3px var(--b-blue-100);
    }

    .b-input:disabled, .b-input[readonly] {
        background: var(--b-bg-2);
        color: var(--b-ink-3);
        cursor: not-allowed;
    }

.b-textarea {
    height: auto;
    min-height: 90px;
    padding: 10px 14px;
    resize: vertical;
    line-height: 1.5;
}

.b-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2364748B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.b-input-error {
    border-color: var(--b-danger);
}

    .b-input-error:focus {
        box-shadow: 0 0 0 3px var(--b-danger-100);
    }

.b-form-error {
    color: var(--b-danger);
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.b-form-help {
    color: var(--b-ink-3);
    font-size: 12px;
    margin-top: 5px;
}

/* Search input com ícone */
.b-search-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 360px;
}

    .b-search-wrap .ico {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--b-ink-4);
        pointer-events: none;
        font-size: 14px;
    }

    .b-search-wrap .b-input {
        padding-left: 38px;
    }

/* Switch */
.b-switch {
    width: 40px;
    height: 22px;
    background: var(--b-line-2);
    border-radius: 100px;
    border: none;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    flex-shrink: 0;
}

    .b-switch::before {
        content: '';
        position: absolute;
        width: 16px;
        height: 16px;
        background: #FFFFFF;
        border-radius: 50%;
        top: 50%;
        left: 3px;
        transform: translateY(-50%);
        transition: left 0.2s;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    }

    .b-switch:checked {
        background: var(--b-blue);
    }

        .b-switch:checked::before {
            left: 21px;
        }

/* Checkbox */
.b-check {
    width: 18px;
    height: 18px;
    accent-color: var(--b-blue);
    cursor: pointer;
}

/* ============================================================================
   12. ALERTAS
   ============================================================================ */
.b-alert {
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.5;
}

    .b-alert i {
        flex-shrink: 0;
        margin-top: 1px;
        font-size: 16px;
    }

.b-alert-info {
    background: var(--b-blue-50);
    border-color: var(--b-blue-200);
    color: var(--b-blue-deep);
}

    .b-alert-info i {
        color: var(--b-blue);
    }

.b-alert-success {
    background: var(--b-success-50);
    border-color: #BBF7D0;
    color: #14532D;
}

    .b-alert-success i {
        color: var(--b-success);
    }

.b-alert-warn {
    background: var(--b-warn-50);
    border-color: #FDE68A;
    color: #78350F;
}

    .b-alert-warn i {
        color: var(--b-warn);
    }

.b-alert-danger {
    background: var(--b-danger-50);
    border-color: #FECACA;
    color: #7F1D1D;
}

    .b-alert-danger i {
        color: var(--b-danger);
    }

/* ============================================================================
   13. MODAL / DIALOG (Bootstrap-compatible)
   ============================================================================ */
.b-modal-content {
    background: var(--b-card) !important;
    border: 1px solid var(--b-line) !important;
    border-radius: var(--b-radius-xl) !important;
    box-shadow: var(--b-shadow-xl) !important;
    color: var(--b-ink);
}

    .b-modal-content .modal-header {
        padding: 24px 28px;
        border-bottom: 1px solid var(--b-line-soft) !important;
        background: transparent !important;
    }

    .b-modal-content .modal-title {
        font-family: inherit;
        font-weight: 600;
        color: var(--b-ink);
        font-size: 17px;
        letter-spacing: -0.01em;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .b-modal-content .modal-body {
        padding: 24px 28px;
    }

    .b-modal-content .modal-footer {
        padding: 16px 28px 24px;
        border-top: 1px solid var(--b-line-soft) !important;
        gap: 8px;
    }

    .b-modal-content .btn-close {
        filter: none;
    }

/* ============================================================================
   14. AVATAR
   ============================================================================ */
.b-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--b-blue), var(--b-blue-deep));
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.b-avatar-sm {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.b-avatar-lg {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

/* Variações de cor dos avatares (fallback determinístico) */
.b-avatar.c-1 {
    background: linear-gradient(135deg, #2563EB, #1E3A8A);
}

.b-avatar.c-2 {
    background: linear-gradient(135deg, #16A34A, #14532D);
}

.b-avatar.c-3 {
    background: linear-gradient(135deg, #D97706, #7C2D12);
}

.b-avatar.c-4 {
    background: linear-gradient(135deg, #DC2626, #7F1D1D);
}

.b-avatar.c-5 {
    background: linear-gradient(135deg, #7C3AED, #4C1D95);
}

.b-avatar.c-6 {
    background: linear-gradient(135deg, #DB2777, #831843);
}

/* ============================================================================
   15. EMPTY STATE
   ============================================================================ */
.b-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--b-ink-3);
}

    .b-empty i {
        font-size: 36px;
        color: var(--b-ink-4);
        display: block;
        margin-bottom: 12px;
    }

.b-empty-title {
    font-weight: 600;
    color: var(--b-ink-2);
    font-size: 15px;
    margin-bottom: 4px;
}

.b-empty-sub {
    font-size: 13px;
    color: var(--b-ink-3);
}

/* ============================================================================
   16. LOADING (spinner & skeleton)
   ============================================================================ */
.b-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--b-line);
    border-top-color: var(--b-blue);
    border-radius: 50%;
    animation: bSpin 0.8s linear infinite;
    display: inline-block;
}

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

.b-skeleton {
    background: linear-gradient(90deg, var(--b-bg-2) 0%, var(--b-line-soft) 50%, var(--b-bg-2) 100%);
    background-size: 200% 100%;
    animation: bShimmer 1.4s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes bShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================================================
   17. UTILITIES (espaçamento, alinhamento)
   ============================================================================ */
.b-flex {
    display: flex;
}

.b-flex-col {
    display: flex;
    flex-direction: column;
}

.b-items-center {
    align-items: center;
}

.b-justify-between {
    justify-content: space-between;
}

.b-gap-2 {
    gap: 6px;
}

.b-gap-3 {
    gap: 10px;
}

.b-gap-4 {
    gap: 14px;
}

.b-gap-6 {
    gap: 22px;
}

.b-mt-2 {
    margin-top: 6px;
}

.b-mt-3 {
    margin-top: 10px;
}

.b-mt-4 {
    margin-top: 14px;
}

.b-mb-2 {
    margin-bottom: 6px;
}

.b-mb-3 {
    margin-bottom: 10px;
}

.b-mb-4 {
    margin-bottom: 14px;
}

.b-text-ink {
    color: var(--b-ink);
}

.b-text-ink-2 {
    color: var(--b-ink-2);
}

.b-text-ink-3 {
    color: var(--b-ink-3);
}

.b-text-ink-4 {
    color: var(--b-ink-4);
}

.b-text-blue {
    color: var(--b-blue);
}

.b-text-success {
    color: var(--b-success);
}

.b-text-warn {
    color: var(--b-warn);
}

.b-text-danger {
    color: var(--b-danger);
}

.b-text-center {
    text-align: center;
}

.b-text-right {
    text-align: right;
}

.b-text-sm {
    font-size: 12px;
}

.b-text-xs {
    font-size: 11px;
}

.b-text-lg {
    font-size: 16px;
}

.b-fw-500 {
    font-weight: 500;
}

.b-fw-600 {
    font-weight: 600;
}

.b-fw-700 {
    font-weight: 700;
}

.b-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================================
   18. RESPONSIVO
   ============================================================================ */
@media (max-width: 1100px) {
    .b-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .b-three-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .b-page {
        padding: 16px 16px 60px;
    }

    .b-topbar {
        padding: 10px 16px;
        height: 64px;
    }

    .b-nav {
        display: none;
    }

    .b-two-col {
        grid-template-columns: 1fr;
    }

    .b-page-head h1 {
        font-size: 24px;
    }

    .b-form-row.cols-3, .b-form-row.cols-4 {
        grid-template-columns: 1fr 1fr;
    }

    .b-hero {
        padding: 24px;
    }

    .b-hero-num {
        font-size: 56px;
    }
}

@media (max-width: 480px) {
    .b-page {
        padding: 12px 12px 60px;
    }

    .b-kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .b-kpi {
        padding: 16px;
    }

    .b-kpi-v {
        font-size: 26px;
    }

    .b-panel-body {
        padding: 16px;
    }

    .b-panel-head {
        padding: 14px 16px;
    }

    .b-form-row.cols-2, .b-form-row.cols-3, .b-form-row.cols-4 {
        grid-template-columns: 1fr;
    }

    .b-hero-num {
        font-size: 44px;
    }

    .b-user-pill span:not(.av):not(.chev) {
        display: none;
    }

    .b-page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .b-page-head-actions {
        justify-content: flex-end;
    }
}

/* Print */
@media print {
    .b-topbar, .b-page-head-actions, .b-btn {
        display: none !important;
    }

    body {
        background: white;
    }

    .b-panel {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
