/* Bootstrap CSS será carregado via CDN */
/* Aqui ficam customizações específicas do projeto */

:root {
    --primary-color: #2a4d7a;
    --secondary-color: #3a5a8a;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f7f9fb;
}

body {
    background-color: var(--light-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: 600;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.btn {
    border-radius: 6px;
    font-weight: 500;
}

.badge {
    font-size: 0.75em;
}

.alert {
    border-radius: 8px;
    border: none;
}

.table {
    background: white;
}

.table th {
    border-top: none;
    font-weight: 600;
    background-color: #f8f9fa;
}

/* Cores específicas do sistema */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.text-primary {
    color: var(--primary-color) !important;
}

/* Status específicos */
.status-online {
    color: var(--success-color);
}

.status-offline {
    color: var(--danger-color);
}

.status-warning {
    color: var(--warning-color);
}

/* Cards de estatísticas */
.stats-card {
    text-align: center;
    padding: 1.5rem;
    max-width: 100%;
}

.stats-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Garantir que imagens e conteúdo não estourem */
img {
    max-width: 100%;
    height: auto;
}

.card-body {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ajustes para tabelas responsivas */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stats-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsividade */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Estilos para o novo dashboard */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.problem-area {
    padding: 12px 0;
}

.problem-area:not(:last-child) {
    border-bottom: 1px solid #f8f9fa;
}

/* Atualização dos cards de stats */
.stats-card {
    border: 1px solid #e9ecef;
    background-color: #fff;
    transition: all 0.2s ease;
    text-align: left;
    padding: 1.5rem;
}

.stats-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #dee2e6;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stats-label {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: none;
    letter-spacing: normal;
}

.stats-change {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Sidebar customizado - Correções */
.sidebar {
    width: 240px;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    background: #fff;
    border-right: 1px solid #f1f1f1;
    transition: width 0.2s;
    display: flex;
    flex-direction: column;
}
.sidebar.collapsed {
    width: 60px;
}
.sidebar-header {
    border-bottom: 1px solid #f1f1f1;
    padding: 16px 12px;
}
.sidebar .navbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: #222;
    text-decoration: none;
}
.sidebar .nav {
    margin-top: 8px;
}
.sidebar .nav-link {
    color: #222;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s, color 0.15s;
}
.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: #f7f9fb;
    color: var(--primary-color);
}
.sidebar .nav-link i {
    font-size: 1.2rem;
    min-width: 22px;
    text-align: center;
}
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .navbar-brand {
    display: none;
}
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding-left: 0.5rem;
}

/* Prevenir scroll horizontal */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    position: relative;
}

/* Garantir que o main-content não cause overflow */
.main-content {
    max-width: 100%;
    overflow-x: hidden;
}

.content-wrapper {
    max-width: 100%;
    overflow-x: hidden;
    padding: 1rem;
}

/* Garantir que cards não ultrapassem a tela */
.card {
    max-width: 100%;
}

/* Garantir que row do Bootstrap não cause overflow */
.row {
    margin-left: 0;
    margin-right: 0;
}

/* Responsividade */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar .nav-link span,
    .sidebar .navbar-brand {
        display: none;
    }
    .sidebar .nav-link {
        justify-content: center;
        padding-left: 0.5rem;
    }
    .main-content {
        margin-left: 60px !important;
    }
    
    /* Ajustes para mobile */
    .content-wrapper {
        padding: 0.5rem;
    }
    
    .stats-number {
        font-size: 1.75rem !important;
    }
    
    .col-lg-3, .col-md-6, .col-md-4, .col-md-8 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

@media (max-width: 576px) {
    .stats-number {
        font-size: 1.5rem !important;
    }
    
    h1.h2 {
        font-size: 1.5rem !important;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}