/* =====================================================================
   CONFIG SHARED — Padrão visual unificado (premium minimal v2)
   Regra de ouro: TODO texto dentro de .cfg-hero ou cabeçalho escuro = branco fixo
   ===================================================================== */

/* ---------- HERO (único ponto escuro da seção) ---------- */
.cfg-hero {
    padding: 26px 30px;
    border-radius: 18px;
    background: linear-gradient(135deg, #111827 0%, #0b1220 100%);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 12px 32px -14px rgba(15, 23, 42, 0.5);
    position: relative;
    overflow: hidden;
    margin-bottom: 26px;
}

.cfg-hero::before {
    content: '';
    position: absolute;
    top: -90px; right: -90px;
    width: 260px; height: 260px;
    background: radial-gradient(circle, var(--cfg-accent-soft, rgba(59,130,246,0.22)) 0%, transparent 65%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.cfg-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.cfg-hero-icon {
    width: 54px; height: 54px;
    background: linear-gradient(135deg, var(--cfg-accent-a, #60a5fa) 0%, var(--cfg-accent-b, #2563eb) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #ffffff !important;
    box-shadow: 0 10px 22px -8px var(--cfg-accent-glow, rgba(59,130,246,0.55));
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.12);
}
.cfg-hero-icon i,
.cfg-hero-icon svg { color: #ffffff !important; fill: #ffffff !important; }

/* ⚠️ FORÇA BRANCO EM TUDO QUE ESTÁ DENTRO DO HERO */
.cfg-hero h1, .cfg-hero h2, .cfg-hero h3, .cfg-hero h4, .cfg-hero h5, .cfg-hero h6,
.cfg-hero p, .cfg-hero span, .cfg-hero div, .cfg-hero small, .cfg-hero label, .cfg-hero strong {
    color: #ffffff;
}

.cfg-hero-title {
    color: #ffffff !important;
    font-weight: 800;
    font-size: 1.32rem;
    letter-spacing: -0.4px;
    margin: 0;
    line-height: 1.2;
}

.cfg-hero-subtitle {
    color: rgba(255,255,255,0.6) !important;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin: 5px 0 0;
}

.cfg-hero-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---------- BOTÕES ---------- */
.cfg-btn {
    border-radius: 50px;
    padding: 11px 22px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.22s ease;
    cursor: pointer;
    border: none;
    letter-spacing: 0.2px;
}
.cfg-btn:hover { transform: translateY(-1px); }

.cfg-btn-main {
    background: linear-gradient(135deg, var(--cfg-accent-a, #60a5fa) 0%, var(--cfg-accent-b, #2563eb) 100%);
    color: #fff !important;
    box-shadow: 0 6px 16px -6px var(--cfg-accent-glow, rgba(59,130,246,0.6));
}
.cfg-btn-main:hover { color: #fff !important; box-shadow: 0 10px 22px -8px var(--cfg-accent-glow, rgba(59,130,246,0.8)); }
.cfg-btn-main i { color: #fff !important; }

.cfg-btn-ghost {
    background: rgba(255,255,255,0.08);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.16);
    backdrop-filter: blur(6px);
}
.cfg-btn-ghost:hover {
    background: rgba(255,255,255,0.14);
    color: #fff !important;
    border-color: rgba(255,255,255,0.28);
}

.cfg-btn-soft {
    background: #f1f5f9;
    color: #334155 !important;
    border: 1px solid #e2e8f0;
}
.cfg-btn-soft:hover { background: #e2e8f0; color: #0f172a !important; }

/* ---------- CARDS ---------- */
.cfg-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #e8edf3;
    box-shadow: 0 2px 10px rgba(15,23,42,0.03);
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    height: 100%;
}
.cfg-card:hover {
    transform: translateY(-2px);
    border-color: #d7e0ea;
    box-shadow: 0 10px 28px -14px rgba(15,23,42,0.15);
}

/* ---------- CABEÇALHO DE CARD (claro, elegante) ---------- */
.cfg-card-head {
    padding: 18px 22px;
    background: #fff;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.cfg-card-head h5 {
    margin: 0;
    font-weight: 800;
    font-size: 0.98rem;
    color: #0f172a !important;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cfg-card-head h5 i {
    color: var(--cfg-accent-a, #3b82f6);
    font-size: 0.95rem;
}

.cfg-card-head-sub {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cfg-card-body { padding: 22px; }

/* =====================================================================
   ⚠️ EXCEÇÃO: CABEÇALHOS ESCUROS INTERNOS (quando usados)
   Força texto BRANCO fixo em qualquer .card-header com fundo escuro
   ===================================================================== */

/* Cabeçalhos escuros comuns (dark, slate, navy, primary escuro, etc.) */
.cfg-dark-head,
.card-header.bg-dark,
.card-header.bg-navy,
.card-header.bg-slate {
    color: #ffffff !important;
}
.cfg-dark-head h1, .cfg-dark-head h2, .cfg-dark-head h3, .cfg-dark-head h4, .cfg-dark-head h5, .cfg-dark-head h6,
.cfg-dark-head p, .cfg-dark-head span, .cfg-dark-head small, .cfg-dark-head i,
.card-header.bg-dark h1, .card-header.bg-dark h2, .card-header.bg-dark h3, .card-header.bg-dark h4, .card-header.bg-dark h5, .card-header.bg-dark h6,
.card-header.bg-dark p, .card-header.bg-dark span, .card-header.bg-dark small, .card-header.bg-dark i {
    color: #ffffff !important;
}

/* Títulos dos cards do "Sistema" (cabeçalhos escuros já existentes lá) */
.card-header.bg-transparent h5.fw-bolder.text-danger { color: #dc2626 !important; }

/* =====================================================================
   FIX GLOBAL — qualquer h4/h5/h6 dentro de painel escuro fica branco
   ===================================================================== */

/* Força branco em qualquer título sobre fundo escuro conhecido */
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6,
.bg-dark p, .bg-dark span, .bg-dark small,
[style*="background: linear-gradient(135deg, #0f172a"] h1,
[style*="background: linear-gradient(135deg, #0f172a"] h2,
[style*="background: linear-gradient(135deg, #0f172a"] h3,
[style*="background: linear-gradient(135deg, #0f172a"] h4,
[style*="background: linear-gradient(135deg, #0f172a"] h5,
[style*="background: linear-gradient(135deg, #0f172a"] h6,
[style*="background: linear-gradient(135deg, #0f172a"] p,
[style*="background: linear-gradient(135deg, #0f172a"] span,
[style*="background: linear-gradient(135deg, #0b1220"] h1,
[style*="background: linear-gradient(135deg, #0b1220"] h2,
[style*="background: linear-gradient(135deg, #0b1220"] h3,
[style*="background: linear-gradient(135deg, #0b1220"] h4,
[style*="background: linear-gradient(135deg, #0b1220"] h5,
[style*="background: linear-gradient(135deg, #0b1220"] h6,
[style*="background: linear-gradient(135deg, #0b1220"] p,
[style*="background: linear-gradient(135deg, #0b1220"] span {
    color: #ffffff !important;
}

/* ---------- INPUTS ---------- */
.cfg-input,
.cfg-select {
    border-radius: 11px;
    border: 1.5px solid #e5eaf0;
    padding: 11px 15px;
    font-weight: 600;
    color: #0f172a;
    background: #fff;
    transition: all 0.18s ease;
    width: 100%;
    font-family: inherit;
    font-size: 0.9rem;
}
.cfg-input:focus,
.cfg-select:focus {
    border-color: var(--cfg-accent-a, #3b82f6);
    box-shadow: 0 0 0 4px var(--cfg-accent-soft, rgba(59,130,246,0.12));
    outline: none;
}
.cfg-input::placeholder { color: #94a3b8; font-weight: 500; }

/* ---------- BUSCA ---------- */
.cfg-search {
    display: flex;
    background: #f8fafc;
    border-radius: 11px;
    overflow: hidden;
    border: 1.5px solid #e5eaf0;
    transition: all 0.18s ease;
}
.cfg-search:focus-within {
    border-color: var(--cfg-accent-a, #3b82f6);
    background: #fff;
    box-shadow: 0 0 0 4px var(--cfg-accent-soft, rgba(59,130,246,0.1));
}
.cfg-search-icon {
    padding: 0 14px;
    display: flex;
    align-items: center;
    color: #94a3b8;
    font-size: 0.9rem;
}
.cfg-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 11px 15px 11px 0;
    font-weight: 600;
    font-size: 0.88rem;
    background: transparent;
    color: #0f172a;
}
.cfg-search input::placeholder { color: #94a3b8; font-weight: 500; }

/* ---------- TABELAS (padrão premium do print) ---------- */
.cfg-table-wrap {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #eef2f7;
}
.cfg-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.cfg-table thead {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 2;
}
.cfg-table thead th {
    padding: 14px 18px;
    font-size: 0.68rem;
    letter-spacing: 1.3px;
    color: #64748b;
    font-weight: 800;
    text-transform: uppercase;
    text-align: left;
    border: none;
    border-bottom: 1px solid #eef2f7;
}
.cfg-table tbody td {
    padding: 16px 18px;
    font-size: 0.9rem;
    color: #334155;
    border-bottom: 1px solid #f5f8fb;
    vertical-align: middle;
}
.cfg-table tbody tr:last-child td { border-bottom: none; }
.cfg-table tbody tr { transition: background 0.15s; }
.cfg-table tbody tr:hover { background: #f8fafc; }

/* Coluna nome em destaque (primeira coluna) */
.cfg-table tbody td:first-child {
    font-weight: 700;
    color: #0f172a;
}

/* ---------- KPIs ---------- */
.cfg-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.cfg-kpi {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}
.cfg-kpi:hover {
    border-color: #d7e0ea;
    box-shadow: 0 6px 16px -10px rgba(15,23,42,0.15);
    transform: translateY(-1px);
}
.cfg-kpi-icon {
    width: 40px; height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
    background: var(--cfg-accent-soft, rgba(59,130,246,0.1));
    color: var(--cfg-accent-a, #3b82f6);
}
.cfg-kpi-label {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #94a3b8;
    text-transform: uppercase;
}
.cfg-kpi-value {
    font-weight: 800;
    font-size: 1.3rem;
    color: #0f172a;
    line-height: 1;
    margin-top: 3px;
}

/* ---------- BADGES ---------- */
.cfg-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.7rem;
    white-space: nowrap;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.cfg-badge-accent {
    background: var(--cfg-accent-soft, rgba(59,130,246,0.1));
    color: var(--cfg-accent-b, #1d4ed8);
    border-color: transparent;
}

/* ---------- EMPTY STATE ---------- */
.cfg-empty {
    text-align: center;
    padding: 56px 20px;
    color: #94a3b8;
}
.cfg-empty-icon {
    width: 72px; height: 72px;
    background: #f8fafc;
    color: #cbd5e1;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 16px;
    border: 1px solid #eef2f7;
}
.cfg-empty-title {
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
    font-size: 1rem;
}
.cfg-empty-desc {
    font-size: 0.85rem;
    margin: 0;
}

/* ---------- DIVISOR ---------- */
.cfg-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 30px 0 18px;
}
.cfg-divider span {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #94a3b8;
    white-space: nowrap;
}
.cfg-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #e8edf3 0%, transparent 100%);
}

/* ---------- BOTÃO ÍCONE ---------- */
.cfg-icon-btn {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: #fff;
    border: 1px solid #e5eaf0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    color: #64748b;
}
.cfg-icon-btn:hover {
    background: #f8fafc;
    border-color: #d7e0ea;
    transform: translateY(-1px);
    color: #0f172a;
    box-shadow: 0 4px 10px -6px rgba(15,23,42,0.15);
}
.cfg-icon-btn.danger:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.cfg-icon-btn.primary:hover { color: var(--cfg-accent-a, #3b82f6); border-color: var(--cfg-accent-soft, #bfdbfe); background: var(--cfg-accent-soft, #eff6ff); }

/* =====================================================================
   FIX DAS TELAS EXISTENTES (USL, TEC, USR)
   Força textos brancos nos cabeçalhos escuros dos cards já existentes
   ===================================================================== */

/* USL — Usuários do Sistema */
.usl-header h5,
.usl-header .usl-header-title,
.usl-header small,
.usl-header .usl-header-subtitle {
    color: #ffffff !important;
}
.usl-header .usl-header-subtitle { color: rgba(255,255,255,0.5) !important; }

/* TEC — Card lista de técnicos */
.tec-card-list-header h5,
.tec-card-list-header .tec-list-title-text,
.tec-card-list-header .tec-list-title-sub,
.tec-card-list-header span,
.tec-card-list-header i {
    color: #ffffff !important;
}
.tec-card-list-header .tec-list-title-sub { color: rgba(255,255,255,0.5) !important; }

/* TEC — Card form (header verde escuro) */
.tec-card-form-header h5,
.tec-card-form-header .tec-form-title,
.tec-card-form-header .tec-form-subtitle,
.tec-card-form-header i {
    color: #ffffff !important;
}
.tec-card-form-header .tec-form-subtitle { color: rgba(255,255,255,0.6) !important; }

/* USR — Modais (hero) */
.usr-hero h1, .usr-hero h2, .usr-hero h3, .usr-hero h4, .usr-hero h5, .usr-hero h6,
.usr-hero p, .usr-hero span, .usr-hero small,
.usr-hero .usr-hero-content,
.usr-hero .usr-hero-badge {
    color: #ffffff !important;
}
.usr-hero .usr-hero-badge {
    background: rgba(96,165,250,0.2);
    color: #93c5fd !important;
}

/* =====================================================================
   BLINDAGEM — Header escuro sempre com fundo escuro e texto branco
   Resolve conflito quando alguma regra anula o .bg-dark do Bootstrap
   ===================================================================== */

.card-header.bg-dark,
.card-header.bg-navy,
.card-header.bg-slate,
.card-header[class*="bg-dark"] {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

.card-header.bg-dark h1, .card-header.bg-dark h2, .card-header.bg-dark h3,
.card-header.bg-dark h4, .card-header.bg-dark h5, .card-header.bg-dark h6,
.card-header.bg-dark p, .card-header.bg-dark span:not(.badge),
.card-header.bg-dark small, .card-header.bg-dark i, .card-header.bg-dark strong,
.card-header.bg-dark label,
.card-header[class*="bg-dark"] h1,
.card-header[class*="bg-dark"] h2,
.card-header[class*="bg-dark"] h3,
.card-header[class*="bg-dark"] h4,
.card-header[class*="bg-dark"] h5,
.card-header[class*="bg-dark"] h6,
.card-header[class*="bg-dark"] p,
.card-header[class*="bg-dark"] span:not(.badge),
.card-header[class*="bg-dark"] small,
.card-header[class*="bg-dark"] i {
    color: #ffffff !important;
}

/* Badge de aviso dentro de header escuro (mantém contraste) */
.card-header.bg-dark .badge.bg-warning,
.card-header[class*="bg-dark"] .badge.bg-warning {
    color: #1e293b !important;
}

/* =====================================================================
   AJUSTE — Tamanhos de texto auxiliar (hints, dicas, legendas)
   Garante legibilidade sem inflar o layout
   ===================================================================== */

/* Textos pequenos com cor muted que servem de apoio */
.config-pane p.text-muted,
.config-pane .small.text-muted,
.config-pane .text-muted.small,
.config-pane small.text-muted,
.config-pane .form-text,
.config-pane .text-muted {
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Hints dentro de formulários (aqueles blocos tipo "Dica: ...") */
.config-pane [style*="font-size: 0.72rem"],
.config-pane [style*="font-size:0.72rem"],
.config-pane [style*="font-size: 0.75rem"],
.config-pane [style*="font-size:0.75rem"] {
    font-size: 0.85rem !important;
    line-height: 1.55 !important;
    color: #64748b !important;
}

/* Destaque <code> dentro de hints */
.config-pane code {
    background: #f1f5f9;
    color: #1d4ed8;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: 700;
}

/* Labels UPPERCASE — manter compactos, mas legíveis */
.config-pane label.small,
.config-pane .small.fw-bold {
    font-size: 0.72rem;
    letter-spacing: 0.4px;
}