@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0b1116;             /* Fundo ultra-escuro para inputs e base */
    --bg-main: #101920;             /* Fundo do painel/conteúdo principal */
    --bg-card: #16222f;             /* Fundo dos cartões e barra lateral */
    --primary-purple: #8b5cf6;      /* Cor institucional - Roxo */
    --primary-purple-hover: #7c3aed;
    --primary-blue: #2563eb;        /* Cor institucional - Azul */
    --text-light: #ffffff;          /* Texto principal em branco puro */
    --text-muted: #94a3b8;          /* Cinza claro de alto contraste para rótulos */
    --border-color: #243342;        /* Bordas discretas e elegantes */
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ==========================================================================
   SOBREPOSIÇÃO GLOBAL (Correção de contraste do Bootstrap)
   ========================================================================== */
h1, h2, h3, h4, h5, h6, 
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-light) !important;
    font-weight: 600;
}

p, span, label {
    color: var(--text-light);
}

.text-muted {
    color: var(--text-muted) !important;
}

/* ==========================================================================
   TELA DE LOGIN
   ========================================================================== */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
}

.login-card {
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 420px;
}

.login-logo {
    width: 160px;
    margin: 0 auto 1.5rem auto;
    display: block;
}

/* ==========================================================================
   ELEMENTOS DE FORMULÁRIO (Inputs, Selects e Variantes)
   ========================================================================== */
.form-control, .form-select {
    background-color: var(--bg-dark) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-light) !important;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-purple) !important;
    box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.25) !important;
}

.form-control::placeholder {
    color: #4b5563 !important;
}

/* Ajuste específico para garantir legibilidade das opções nativas do select */
.form-select option {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

/* ==========================================================================
   BOTÕES E COMPONENTES INTERATIVOS
   ========================================================================== */
.btn-primary {
    background-color: var(--primary-purple) !important;
    border-color: var(--primary-purple) !important;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--primary-purple-hover) !important;
    border-color: var(--primary-purple-hover) !important;
}

.btn-outline-light {
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}

.btn-outline-light:hover {
    background-color: var(--border-color) !important;
    color: var(--text-light) !important;
}

/* ==========================================================================
   ESTRUTURA DO LAYOUT (Sidebar & Painel Principal)
   ========================================================================== */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    min-height: 100vh;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar .logo-area {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.sidebar .logo-area img {
    max-width: 140px;
    height: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-menu li a i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-menu li a:hover, 
.sidebar-menu li a.active {
    background-color: var(--bg-dark);
    color: var(--text-light);
    border-left-color: var(--primary-purple);
}

.sidebar-menu li a.text-danger:hover {
    border-left-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

.main-content {
    flex: 1;
    padding: 2.5rem;
    background-color: var(--bg-main);
    min-width: 0; 
}

/* ==========================================================================
   CARDS INFORMATIVOS (Métricas do Dashboard)
   ========================================================================== */
.card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    color: var(--text-light) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Cores das bordas laterais destacadas */
.border-primary {
    border-left: 4px solid var(--primary-blue) !important;
}

.border-danger {
    border-left: 4px solid #ef4444 !important;
}

.border-warning {
    border-left: 4px solid #f59e0b !important;
}

/* Alinhamento e visualização das métricas nos cards */
.card h3, .card .h3 {
    color: var(--text-light) !important;
    font-size: 2.2rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.card h6, .card .h6 {
    color: var(--text-muted) !important;
    margin: 0;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   TABELAS DE DADOS (Listagens)
   ========================================================================== */
.table {
    color: var(--text-light) !important;
}

.table-dark {
    background-color: transparent !important;
}

.table th {
    color: var(--text-muted) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color) !important;
    padding: 1rem;
}

.table td {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1rem;
    vertical-align: middle;
    color: #e2e8f0;
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* ==========================================================================
   BADGES DE STATUS (Pendente, Em Manutenção, Resolvido)
   ========================================================================== */
.badge {
    padding: 0.55em 0.8em;
    font-weight: 600;
    border-radius: 6px;
    text-transform: capitalize;
}

.bg-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.bg-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.bg-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.bg-secondary {
    background-color: rgba(148, 163, 184, 0.15) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* ==========================================================================
   RESPONSIVIDADE (Ajustes para dispositivos móveis)
   ========================================================================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1040;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
        width: 100%;
        padding: 1.5rem;
    }
}