/* ===== VARIÁVEIS GLOBAIS ===== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    --warning-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --danger-gradient: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    
    --primary-color: #6f42c1;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #121212;
    --light-color: #e0e0e0;
}

[data-bs-theme="dark"] {
    --bs-body-bg: var(--dark-color);
    --bs-body-color: var(--light-color);
    --bs-card-bg: #1e1e1e;
    --bs-border-color: #444;
}

/* ===== ESTILOS BASE ===== */
body {
    background: linear-gradient(135deg, #121212 0%, #1a1a2e 100%);
    color: var(--light-color);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

/* ===== UTILITÁRIOS ===== */
.bg-gradient {
    background: linear-gradient(90deg, var(--primary-color), #5a32a3) !important;
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-nav {
        margin-top: 0.5rem;
    }

    /* === Container e Seções === */
    .container-fluid {
        padding-left: 8px;
        padding-right: 8px;
    }

    .preview-section {
        padding: 0.75rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* === Headers === */
    .display-4 {
        font-size: 1.75rem !important;
    }

    .display-5 {
        font-size: 1.5rem !important;
    }

    .lead {
        font-size: 0.95rem;
    }

    /* === Stat Cards === */
    .stat-card {
        margin-bottom: 0.5rem;
    }

    .stat-card p, .stat-card small {
        font-size: 0.8rem;
    }

    .stat-card h2 {
        font-size: 1.5rem;
    }

    .stat-card h6 {
        font-size: 0.7rem;
    }

    /* === Cards === */
    .card-hydra .card-header {
        padding: 0.75rem 1rem;
        flex-direction: column !important;
        gap: 0.5rem;
    }

    .card-hydra .card-header .btn-group {
        flex-wrap: wrap;
        width: 100%;
    }

    .card-hydra .card-header .btn-group .btn {
        flex: 1 1 auto;
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }

    .card-hydra .card-body {
        padding: 0.75rem;
    }

    .card-hydra .card-title {
        font-size: 1rem;
    }

    /* === Tabelas === */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
    }

    .table th, .table td {
        padding: 0.4rem 0.5rem;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .table code {
        font-size: 0.72rem;
    }

    .table .badge {
        font-size: 0.68rem;
        padding: 0.2em 0.45em;
    }

    .table .btn-sm {
        padding: 0.2rem 0.35rem;
        font-size: 0.72rem;
    }

    /* === Formulários === */
    .form-control-hydra {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* === Botões de Ações Rápidas === */
    .d-flex.flex-wrap.justify-content-center.gap-2 {
        gap: 0.35rem !important;
    }

    .d-flex.flex-wrap.justify-content-center.gap-2 .btn {
        font-size: 0.78rem;
        padding: 0.4rem 0.65rem;
    }

    /* === Gráficos (Charts) === */
    canvas {
        max-height: 220px !important;
    }

    /* === Footer === */
    .footer-hydra .card-body {
        padding: 0.75rem;
    }

    .footer-hydra .row {
        text-align: center;
    }

    .footer-hydra .col-md-6.text-md-end {
        text-align: center !important;
        margin-top: 0.5rem;
    }

    /* === Modais === */
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* === Extra-small screens (< 576px) === */
@media (max-width: 575.98px) {
    .stat-card h2 {
        font-size: 1.25rem;
    }

    .stat-card .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .preview-section {
        padding: 0.5rem !important;
        border-radius: 12px !important;
    }

    .card-hydra {
        border-radius: 10px !important;
    }

    /* Ações rápidas em grid móvel */
    .d-flex.flex-wrap.justify-content-center.gap-2 {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.3rem !important;
    }

    .d-flex.flex-wrap.justify-content-center.gap-2 .btn {
        width: 100%;
        text-align: center;
    }

    /* Header compacto */
    header.text-center .d-inline-block {
        padding: 0.75rem !important;
    }

    header.text-center .fs-1 {
        font-size: 1.5rem !important;
    }

    /* Indicador de scroll em tabelas */
    .table-responsive::after {
        content: '← deslize →';
        display: block;
        text-align: center;
        color: rgba(255,255,255,0.3);
        font-size: 0.72rem;
        padding: 0.35rem 0;
    }
}
/* ═══════ Pulse badge — indicador de manutenção ativa ═══════ */
@keyframes pulseBadge {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.15); }
}
.pulse-badge {
    animation: pulseBadge 1.5s ease-in-out infinite;
    display: inline-block;
}
