/* ==========================================================================
   RADAR10 - DESIGN SYSTEM GLOBAL
   ========================================================================== */

/* 1. VARIÁVEIS DE COR E ESTILO (Paleta Oficial) */
:root {
    /* Cores Principais */
    --primary: #24b47e;      /* Ações principais, destaques positivos */
    --secondary: #1e88e5;    /* Links, botões secundários, títulos */
    
    /* Cores de Status */
    --success: #24b47e;      /* Ativo, sucesso */
    --warning: #ff9800;      /* Alertas, pendências */
    --danger: #ff4d4d;       /* Exclusões, erros críticos */
    --info: #1e88e5;         /* Informativo, novo */
    
    /* Backgrounds e Textos */
    --bg-page: #f4f6f8;      /* Fundo geral das páginas */
    --bg-card: #ffffff;      /* Fundo de modais e cards */
    --text-main: #333333;    /* Textos base e títulos */
    --text-muted: #666666;   /* Descrições e metadados */
    --border-color: #dddddd; /* Bordas padrão */
    
    /* Layout */
    --container-max: 1200px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

/* ==========================================================================
   2. RESET E TIPOGRAFIA BASE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1 { font-size: clamp(2rem, 5vw, 2.5rem); font-weight: 800; color: var(--text-main); }
h2 { font-size: clamp(1.4rem, 4vw, 1.8rem); font-weight: 700; color: var(--text-main); margin-bottom: 15px; }
h3 { font-size: clamp(1.1rem, 3vw, 1.4rem); font-weight: 600; color: var(--text-main); }
p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 15px; }

/* ==========================================================================
   3. LAYOUT E ESTRUTURA (Grid e Cards)
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 30px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

/* ==========================================================================
   4. COMPONENTES: BOTÕES
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: bold;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Variantes de Botões */
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: #1e9668; transform: translateY(-1px); }

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover:not(:disabled) { background: #1565c0; transform: translateY(-1px); }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover:not(:disabled) { background: #e68a00; transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #cc0000; transform: translateY(-1px); }

.btn-neutral { background: #eeeeee; color: var(--text-muted); }
.btn-neutral:hover:not(:disabled) { background: #dddddd; color: var(--text-main); }

/* ==========================================================================
   5. COMPONENTES: FORMULÁRIOS
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.full-width {
    grid-column: span 2;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
}

input, select, textarea {
    width: 100%;
    min-height: 44px; /* Acessibilidade: área de toque mínima */
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    background: #ffffff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

input:disabled, select:disabled, textarea:disabled {
    background: #f9f9f9;
    color: #999;
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* ==========================================================================
   6. COMPONENTES: STATUS & BADGES
   ========================================================================== */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge-active { background: #e8f5e9; color: #2e7d32; }
.badge-inactive { background: #ffebee; color: #c62828; }
.badge-pending { background: #fff3e0; color: #e65100; }
.badge-info { background: #e3f2fd; color: #1565c0; }

/* ==========================================================================
   7. COMPONENTES: MODAIS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-in-out;
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #aaa;
    transition: 0.3s;
}

.close-modal:hover {
    color: var(--text-main);
}

/* Animações Base */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ==========================================================================
   8. RESPONSIVIDADE (Mobile First Base)
   ========================================================================== */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 15px;
        gap: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .full-width {
        grid-column: span 1;
    }
}