:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    display: flex; 
    min-height: 100vh;
}

/* Sidebar para Desktop */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    position: fixed;
    left: 0; top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1001;
}

.sidebar-header { padding: 25px 20px; font-weight: bold; font-size: 1.3rem; color: var(--primary); border-bottom: 1px solid #f1f5f9; }
.sidebar-menu { flex: 1; padding: 15px 10px; }
.menu-item { display: flex; align-items: center; padding: 12px 15px; color: var(--text); text-decoration: none; border-radius: 10px; margin-bottom: 8px; font-weight: 500; }
.menu-item.active { background: var(--primary); color: #fff; }

/* Barra de Topo exclusiva para Mobile */
.mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
}

/* Conteúdo Principal */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .mobile-header { display: flex; }
    .main-content { margin-left: 0; padding: 20px; padding-top: 80px; } /* Respiro para a barra de topo */
    
    .row { flex-direction: column !important; gap: 10px !important; }
}

/* Botões e UI */
.btn { padding: 12px 20px; border-radius: 12px; border: none; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.btn-primary { background: var(--primary); color: white; }
.card { background: #fff; border-radius: 16px; padding: 20px; margin-bottom: 16px; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

/* Modais (Blindagem contra exibição indevida) */
.modal-custom { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.6); display: none !important; /* Força sumir */
    align-items: center; justify-content: center; z-index: 2000; 
}
.modal-custom.active { display: flex !important; } /* Só aparece com a classe active */

.modal-content-custom { background: white; padding: 25px; border-radius: 20px; width: 95%; max-width: 450px; }

.hidden { display: none !important; }