:root {
    --primary-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-main);
    margin: 0; padding: 0;
    font-size: 14px;
}

/* --- HEADER --- */
header {
    background: #ffffff; border-bottom: 1px solid var(--border);
    padding: 1rem 0; margin-bottom: 2rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.header-content {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.header-content h1 { margin: 0; font-size: 1.2rem; color: #0f172a; font-weight: 700; }
.admin-link {
    color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.85rem;
    padding: 6px 12px; border-radius: 6px; background: #f8fafc; border: 1px solid var(--border);
    transition: var(--transition);
}
.admin-link:hover { background: #e2e8f0; color: #0f172a; }

/* --- DASHBOARD GRID --- */
.container {
    width: 95%; max-width: 1400px; margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem; padding-bottom: 3rem;
}

/* --- CARD (Accordion via Hover) --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    border-left: 5px solid #ccc; 
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #cbd5e1; }

/* Cores das Bordas */
.card.card-infra { border-left-color: #7c3aed; }    /* Roxo */
.card.card-producao { border-left-color: #dc2626; } /* Vermelho */
.card.card-comp { border-left-color: #2563eb; }     /* Azul */
.card.card-teste { border-left-color: #f59e0b; }    /* Laranja */
.card.card-tools { border-left-color: #475569; }    /* Cinza */

.card-header {
    padding: 15px 20px;
    display: flex; justify-content: space-between; align-items: center;
    background: white;
}
.card-header h3 {
    margin: 0; font-size: 1rem; font-weight: 600; color: #1e293b;
    text-transform: uppercase;
}
.toggle-icon {
    font-size: 1.5rem; color: #94a3b8; font-weight: 300;
    transition: transform 0.3s ease; line-height: 1;
}

/* HOVER EFFECT: Abre a gaveta ao passar o mouse */
.card:hover .toggle-icon { transform: rotate(45deg); color: #ef4444; }

.card-body {
    max-height: 0; opacity: 0;
    background: #f8fafc;
    border-top: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 20px;
    
    display: grid;
    grid-template-columns: 1fr 1fr; /* Lado a lado */
    gap: 10px;
}
/* Quando o mouse está sobre o CARD (pai), abre o BODY (filho) */
.card:hover .card-body {
    max-height: 500px; opacity: 1;
    border-top-color: #e2e8f0;
    padding: 20px;
}

/* Botões do Dashboard */
.dash-btn {
    display: flex; align-items: center; justify-content: center;
    background: white; border: 1px solid #cbd5e1;
    color: #475569; font-weight: 600; font-size: 0.85rem;
    padding: 10px; border-radius: 6px;
    cursor: pointer; transition: all 0.2s;
    text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.dash-btn.btn-monitor { border-bottom: 3px solid #10b981; }
.dash-btn.btn-sistema { border-bottom: 3px solid #2563eb; }
.dash-btn.btn-infra { border-bottom: 3px solid #7c3aed; }
.dash-btn.btn-tst { border-bottom: 3px solid #64748b; }

.dash-btn:hover { background: #ffffff; border-color: #94a3b8; transform: translateY(-1px); color: #0f172a; }

/* --- ADMIN STYLES --- */
.admin-container { max-width: 1000px; margin: 2rem auto; background: white; padding: 2rem; border-radius: 8px; box-shadow: var(--shadow); }
.tabs { display: flex; gap: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn { padding: 0.8rem 1.5rem; cursor: pointer; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid transparent; }
.tab-btn.active { color: #2563eb; border-color: #2563eb; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Botão Contextual (+ Novo Botão no cabeçalho da categoria) */
.btn-context-add {
    font-size: 0.75rem; background: #2563eb; color: white; border: none;
    padding: 4px 10px; border-radius: 4px; cursor: pointer; text-transform: uppercase;
    font-weight: 700; letter-spacing: 0.5px;
}
.btn-context-add:hover { background: #1d4ed8; }

table { width: 100%; border-collapse: collapse; margin-top: 0; }
th { text-align: left; padding: 8px; background: #f8fafc; color: #64748b; font-size: 0.75rem; text-transform: uppercase; }
td { padding: 8px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }

/* Ações */
.btn-mini { padding: 3px 8px; font-size: 0.75rem; color: white; border-radius: 3px; text-decoration: none; margin-left: 2px; }
.btn-edit { background: #f59e0b; }
.btn-del { background: #ef4444; }

/* Botão Flutuante (Apenas para Categoria agora) */
.fab-add { position: fixed; bottom: 30px; right: 30px; width: 56px; height: 56px; background: #2563eb; color: white; border-radius: 50%; border: none; font-size: 24px; cursor: pointer; box-shadow: 0 4px 12px rgba(37,99,235,0.4); z-index: 100; transition: transform 0.2s; }
.fab-add:hover { transform: scale(1.1); background: #1e40af; }

/* Modais */
.modal-overlay { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.5); z-index: 200; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal-content { background: white; padding: 2rem; border-radius: 12px; width: 90%; max-width: 500px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
input, select { width: 100%; padding: 0.6rem; border: 1px solid #cbd5e1; border-radius: 6px; margin-top: 5px; box-sizing: border-box; }
.form-group { margin-bottom: 1rem; }
.btn-save { width: 100%; padding: 0.8rem; background: #2563eb; color: white; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; margin-top: 1rem; }