/* =========================================
   ESTRUTURA GLOBAL DO VAND'S APP
   ========================================= */
:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg: #F3F4F6;
    --card-bg: #FFFFFF;
    --text: #1F2937;
    --text-light: #6B7280;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* --- CABEÇALHO FIXO --- */
.main-header {
    background: var(--primary);
    color: white;
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    padding: 0 1rem;
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.main-header .logo {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
    color: white;
    text-align: center;
    justify-self: center;
}

.content-wrapper {
    margin-top: 70px; /* Descola do cabeçalho */
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
}

/* MENU LATERAL */
.side-menu {
    height: 100%;
    width: 280px;
    transform: translateX(-100%) !important;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    background-color: #1f2937;
    overflow-x: hidden;
    transition: transform 0.3s ease !important;
    padding-top: 60px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.5);
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 20px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid #374151;
    margin-bottom: 10px;
}

.menu-links a {
    padding: 15px 20px;
    text-decoration: none;
    font-size: 1.2rem;
    color: #e5e7eb;
    display: block;
    transition: 0.2s;
}

.menu-links a:hover {
    background-color: #374151;
    color: #ffffff;
}

/* ANIMAÇÃO PUSH DO BOTÃO E MENU */
body.menu-open .main-header,
body.menu-open .content-wrapper {
    transform: none !important;
}

body.menu-open .side-menu {
    transform: translateX(0) !important;
}

.menu-icon {
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    padding: 0;
    justify-self: start;
    position: relative !important;
    z-index: 10000 !important;
    transition: transform 0.3s ease !important;
}

body.menu-open .menu-icon {
    transform: translateX(280px) !important; 
}


/* =========================================
   ESTILOS ESPECÍFICOS DO ACADÊMICO
   ========================================= */
.container {
    max-width: 1250px;
    width: 100%;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
h1, h2 { color: #1a365d; margin-top: 0; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    align-items: end;
}
.form-group { display: flex; flex-direction: column; }
label { font-weight: bold; margin-bottom: 5px; font-size: 0.85em; color: var(--text); }
input { padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; outline: none; transition: 0.2s; }
input:focus { border-color: var(--primary); }

.btn-add {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    height: 42px;
    transition: background 0.3s;
}
.btn-add:hover { background-color: var(--primary-hover); }

/* Estilos Tabela */
table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 0.95em; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #e2e8f0; }
th { background-color: #2b6cb0; color: white; }
.mobile-summary { display: none !important; }

/* Cores */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    display: inline-block;
    min-width: 75px;
}
.color-verde { background-color: #c6f6d5; color: #22543d; }
.color-amarelo { background-color: #fefcbf; color: #744210; }
.color-laranja { background-color: #feebc8; color: #7b341e; }
.color-vermelho { background-color: #fed7d7; color: #822727; }

.action-buttons-cell { display: flex; gap: 5px; }
.action-btn { padding: 6px 12px; border: none; border-radius: 4px; color: white; cursor: pointer; font-size: 0.9em;}
.btn-edit { background-color: #48bb78; }
.btn-remove { background-color: #e53e3e; }
.btn-cancel { background-color: #a0aec0; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; }

/* Modal */
dialog { border: none; border-radius: 8px; padding: 25px; width: 600px; max-width: 90%; box-shadow: 0 5px 25px rgba(0,0,0,0.5); }
dialog::backdrop { background: rgba(0,0,0,0.6); }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.modal-buttons { margin-top: 25px; display: flex; justify-content: flex-end; gap: 10px; }

/* Mobile */
@media (max-width: 768px) {
    .container { padding: 15px; box-shadow: none; border-radius: 0; background: transparent; }
    h1 { font-size: 1.5em; }
    h2 { font-size: 1.2em; }
    
    .form-grid { background: #fff; padding: 15px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
    .btn-add { width: 100%; height: 50px; font-size: 1.1em; margin-top: 10px; }
    
    table { border: 0; }
    table thead { display: none; }
    table tr { 
        display: flex; 
        flex-direction: column;
        margin-bottom: 12px; 
        background: #fff; 
        border-radius: 8px; 
        box-shadow: 0 2px 6px rgba(0,0,0,0.08); 
        cursor: pointer;
        overflow: hidden;
    }
    
    table td.desktop-cell { display: none !important; }
    table td.detail-cell { 
        display: none; 
        justify-content: space-between; 
        align-items: center; 
        border-bottom: 1px solid #f0f2f5; 
        padding: 10px 15px; 
        text-align: right; 
        font-size: 0.9em;
    }
    table td.detail-cell::before { content: attr(data-label); font-weight: bold; color: #718096; }
    table tr.expanded td.detail-cell { display: flex; }

    table td.mobile-summary {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        border-bottom: none;
    }
    table tr.expanded td.mobile-summary { border-bottom: 1px solid #e2e8f0; background-color: #f7fafc; }
    .m-info { display: flex; align-items: center; gap: 10px; flex: 1; overflow: hidden; }
    .m-disc { font-weight: bold; color: #1a365d; font-size: 1.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .m-tipo { font-size: 0.75em; color: #4a5568; background: #edf2f7; padding: 4px 8px; border-radius: 12px; font-weight: bold; }
    
    .action-buttons-cell { justify-content: flex-end; gap: 10px; }
    .action-btn { padding: 10px 15px; font-size: 1em; }
    
    dialog { padding: 15px; max-width: 95%; width: 100%; margin: auto; }
    .modal-grid { grid-template-columns: 1fr; gap: 10px; }
    .modal-buttons { flex-direction: column-reverse; gap: 10px; }
    .modal-buttons button { width: 100%; padding: 12px; font-size: 1.1em; }
}