@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

:root {
    --primary: #2563eb; /* Azul mais moderno */
    --primary-hover: #1d4ed8;
    --dark: #1f2937;
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --text-main: #374151;
    --text-muted: #6b7280;
    --border: #d1d5db;
    --sidebar-bg: #111827;
    --sidebar-width: 250px;
    --radius: 8px; /* Bordas mais arredondadas */
}

body.dark-mode {
    --primary: #3b82f6;
    --bg-body: #111827;
    --bg-card: #1f2937;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border: #374151;
    --sidebar-bg: #000000;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif; /* Fonte moderna */
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- SIDEBAR --- */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 15px;
    position: fixed;
    height: 100%;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.brand {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #374151;
    color: #fff;
    letter-spacing: -0.5px;
}

.menu-group { margin-bottom: 15px; }
.menu-title {
    cursor: pointer;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #9ca3af;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.menu-title:hover { color: #fff; background: rgba(255,255,255,0.05); }

.submenu { display: none; flex-direction: column; margin-top: 5px; padding-left: 10px; }
.submenu.open { display: flex; }

.menu-item {
    display: block;
    padding: 8px 12px;
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}
.menu-item:hover {
    background-color: var(--primary);
    color: #fff;
    transform: translateX(3px);
}

.theme-toggle {
    margin-top: auto;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: var(--radius);
    font-weight: 600;
    transition: 0.2s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.2); }

/* --- CONTEÚDO --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 25px;
    width: calc(100% - var(--sidebar-width));
}

/* --- CARDS & FORMS --- */
.card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

/* INPUTS MODERNOS */
input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-body); /* Fundo leve */
    color: var(--text-main);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    background: var(--bg-card);
}

.form-row { display: flex; flex-wrap: wrap; gap: 15px; }
.form-group { flex: 1; min-width: 200px; margin-bottom: 10px; }

label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

/* Checkbox estilizado */
.check-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}
.check-group input[type="checkbox"] {
    width: 18px; height: 18px; margin: 0;
    accent-color: var(--primary);
}

/* --- BOTÕES --- */
.btn-save {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 20px;
    width: 100%;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
    margin-top: 10px;
}
.btn-save:hover { background: var(--primary-hover); }

/* Botão de Ver Anexo */
.btn-doc {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e5e7eb;
    color: #374151;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
    margin-right: 5px;
}
.btn-doc:hover { background: #d1d5db; }

/* --- MOBILE --- */
@media (max-width: 768px) {
    .app-container { flex-direction: column; padding-top: 60px; }
    
    .sidebar {
        width: 100%; height: 60px; position: fixed; top: 0; left: 0;
        padding: 0 20px; flex-direction: row; align-items: center; justify-content: space-between;
    }
    .mobile-menu-btn { display: block !important; background: none; border: none; color: #fff; font-size: 1.8rem; }
    
    .sidebar-content {
        display: none; position: fixed; top: 60px; left: 0; width: 100%; height: calc(100vh - 60px);
        background: var(--sidebar-bg); flex-direction: column; padding: 20px; overflow-y: auto;
    }
    .sidebar-content.show { display: flex !important; }
    
    .main-content { margin-left: 0; width: 100%; padding: 15px; }
    
    .header-profile { flex-direction: column; }
    .profile-photo-area { width: 100%; flex-direction: row; gap: 15px; margin-bottom: 15px; }
}

@media (min-width: 769px) {
    .mobile-menu-btn { display: none !important; }
    .sidebar-content { display: flex !important; flex-direction: column; height: 100%; width: 100%; }
}

/* --- IMPRESSÃO --- */
@media print {
    .no-print { display: none !important; }
    body { background: #fff !important; color: #000 !important; font-size: 12px; }
    .sidebar { display: none; }
    .main-content { margin: 0; width: 100%; padding: 0; }
    .card { box-shadow: none; border: none; padding: 0; margin: 0; }
    .btn-doc { display: none; } /* Esconde botões de anexo na impressão */
}