/* ============================================================
   BackOffice — Estilos globais
   ============================================================ */

/* --- Variáveis --- */
:root {
    --bo-primary:  var(--ideal-petroleo);
    --bo-hover:    var(--ideal-petroleo-escuro);
    --bo-silver:   var(--ideal-turquesa);
    --bo-bg:       #f8f9fa;
    --bo-radius:   6px;
}

/* --- Body / Layout --- */
body { background: var(--bo-bg); font-size: 14px; }

/* --- Sidebar --- */
.sidebar { background: var(--bo-primary) !important; }
.sidebar .nav-link { color: rgba(255,255,255,.72); font-size: .9rem; border-radius: 0; transition: all .15s; }
.sidebar .nav-link:hover,
.sidebar .nav-link.active { color: #fff; background: rgba(8,170,164,.28); }
.sidebar .nav-link.active { box-shadow: inset 3px 0 0 var(--ideal-turquesa); }

/* Bloco branco do topo: o logo só aparece sobre fundo branco */
.sidebar .brand { background: #fff; text-align: center; padding: 14px 16px 10px !important; border-bottom: 0 !important; }
.sidebar .brand img { max-width: 100%; height: 44px; width: auto; }
.sidebar .brand .brand-rotulo { color: var(--ideal-petroleo); font-weight: 800; font-size: .7rem; letter-spacing: .14em; margin-top: 2px; }

/* --- Topbar --- */
.topbar { background: #fff; border-bottom: 1px solid #e0e5ef; }

/* --- Títulos de página --- */
.page-content h4.fw-bold,
.page-content h4.mb-0 {
    color: var(--bo-primary);
    border-bottom: 2px solid var(--bo-silver);
    padding-bottom: 8px;
    margin-bottom: 1rem;
}

/* --- Cards --- */
.card {
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.08) !important;
    border: none !important;
}
.card-body { padding: 24px; }
.card-header {
    background: #fff !important;
    border-bottom: 1px solid #e9ecef !important;
    font-weight: 600;
    color: var(--bo-primary);
    padding: 16px 24px 12px !important;
    border-radius: 8px 8px 0 0 !important;
}

/* --- Inputs e Selects --- */
.form-control,
.form-select {
    border: 1px solid #dee2e6;
    border-radius: var(--bo-radius) !important;
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--bo-primary) !important;
    box-shadow: 0 0 0 3px rgba(8,170,164,.2) !important;
    outline: none;
}

/* --- Labels --- */
label, .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 4px;
    display: block;
    font-size: 13px;
}

/* --- Form groups --- */
.mb-3 { margin-bottom: 16px !important; }

/* --- Botões primários --- */
.btn-primary {
    background: var(--bo-primary) !important;
    border-color: var(--bo-primary) !important;
    color: #fff !important;
    border-radius: var(--bo-radius) !important;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--bo-hover) !important;
    border-color: var(--bo-hover) !important;
}

/* --- Botões secundários --- */
.btn-outline-secondary {
    background: #fff !important;
    border-color: #ced4da !important;
    color: #495057 !important;
    border-radius: var(--bo-radius) !important;
    font-size: 14px;
}
.btn-outline-secondary:hover {
    background: #f8f9fa !important;
    border-color: var(--bo-primary) !important;
    color: var(--bo-primary) !important;
}

/* --- Botões outline-primary --- */
.btn-outline-primary {
    border-color: var(--bo-primary) !important;
    color: var(--bo-primary) !important;
    background: #fff !important;
    border-radius: var(--bo-radius) !important;
    font-size: 14px;
}
.btn-outline-primary:hover {
    background: var(--bo-primary) !important;
    color: #fff !important;
}

/* --- Botões perigo --- */
.btn-danger, .btn-outline-danger {
    border-radius: var(--bo-radius) !important;
    font-size: 14px;
}
.btn-danger { background: #dc3545 !important; border-color: #dc3545 !important; }

/* --- Botões sucesso --- */
.btn-success, .btn-outline-success {
    border-radius: var(--bo-radius) !important;
    font-size: 14px;
}

/* --- Botões warning --- */
.btn-warning, .btn-outline-warning {
    border-radius: var(--bo-radius) !important;
    font-size: 14px;
}

/* --- Tabelas --- */
.table-responsive { border-radius: 8px; overflow: hidden; }
.table { font-size: 13.5px; margin-bottom: 0; }
.table thead th {
    background: var(--bo-primary) !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border: none !important;
    padding: 12px 16px;
}
.table tbody tr:nth-child(even) { background: #f8f9fa; }
.table tbody tr:hover { background: #eef1f8; }
.table tbody td { border-color: #f0f0f0; padding: 10px 16px; vertical-align: middle; }
.ps-4 { padding-left: 20px !important; }
.pe-4 { padding-right: 20px !important; }

/* --- Badges --- */
.badge { font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 4px; }

/* --- Alertas --- */
.alert { font-size: 14px; border-radius: 8px !important; }
.alert-success { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.alert-danger  { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

/* --- Modal --- */
.modal-content { border-radius: 10px !important; border: none !important; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.modal-header { border-bottom: 1px solid #e9ecef !important; padding: 20px 24px 16px; }
.modal-footer { border-top: 1px solid #e9ecef !important; padding: 16px 24px 20px; }
.modal-body   { padding: 20px 24px; }

/* --- Login --- */
.login-card { max-width: 400px; }
.login-card .card { border-radius: 12px !important; }

/* --- Contraste (≥ 4,5:1) dos botões outline --- */
.btn-outline-success { color: #146c43 !important; border-color: #146c43 !important; background: #fff !important; }
.btn-outline-success:hover { background: #146c43 !important; color: #fff !important; }
.btn-outline-warning { color: #664d03 !important; border-color: #b78103 !important; background: #fff !important; }
.btn-outline-warning:hover { background: #ffc107 !important; color: #3d2e02 !important; }
.btn-outline-secondary { color: #566069 !important; }
