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

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface2: #22263a;
    --border: #2e3250;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --sidebar-w: 220px;
}

body { background: var(--bg); color: var(--text); font-family: system-ui, sans-serif; font-size: 15px; }

/* Sidebar */
.sidebar {
    position: fixed; top: 0; left: 0; width: var(--sidebar-w);
    height: 100vh; background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 1.5rem 0;
}
.sidebar-header { padding: 0 1.25rem 1.5rem; }
.logo { font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.nav-links { list-style: none; flex: 1; }
.nav-links li a {
    display: block; padding: .625rem 1.25rem; color: var(--text-muted);
    text-decoration: none; border-radius: 6px; margin: 2px .5rem;
    transition: background .15s, color .15s;
}
.nav-links li a:hover, .nav-links li a.active {
    background: var(--surface2); color: var(--text);
}
.sidebar-footer { padding: 1rem 1.25rem; }
.sidebar-footer a { color: var(--text-muted); text-decoration: none; font-size: .85rem; }
.sidebar-footer a:hover { color: var(--danger); }

/* Main */
main.with-sidebar { margin-left: var(--sidebar-w); padding: 2rem; max-width: 1100px; }
main:not(.with-sidebar) { padding: 0; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 2.5rem; width: 100%; max-width: 380px;
}
.login-box h1 { margin-bottom: 1.5rem; font-size: 1.4rem; color: var(--accent); }
.login-box input {
    width: 100%; padding: .75rem 1rem; background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 1rem; margin-bottom: .75rem;
}
.login-box input:focus { outline: none; border-color: var(--accent); }
.login-box button {
    width: 100%; padding: .75rem; background: var(--accent); border: none;
    border-radius: 8px; color: #fff; font-size: 1rem; cursor: pointer;
    transition: background .15s;
}
.login-box button:hover { background: var(--accent-hover); }
.erro { color: var(--danger); margin-bottom: 1rem; font-size: .9rem; }

/* Page header */
.page-header { margin-bottom: 2rem; display: flex; align-items: center; justify-content: space-between; }
.page-header h1 { font-size: 1.6rem; }
.subtitulo { color: var(--text-muted); margin-top: .25rem; font-size: .9rem; }

/* Cards */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: .5rem; transition: border-color .15s; }
.card:hover { border-color: var(--accent); }
.card-icone { font-size: 1.8rem; }
.card-nome { font-weight: 600; font-size: .95rem; }
.card-badge { font-size: .8rem; color: var(--text-muted); }

/* Section */
.section { margin-top: 2rem; }
.section h2 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; }

/* Tabs */
.tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.tab { background: none; border: none; color: var(--text-muted); padding: .75rem 1rem; cursor: pointer; font-size: .95rem; border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Email list */
.email-list { list-style: none; }
.email-item { padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: .5rem; }
.email-item.alta { border-left: 3px solid var(--danger); }
.email-remetente { font-weight: 600; font-size: .85rem; color: var(--text-muted); display: block; }
.email-assunto { font-weight: 500; display: block; margin: .25rem 0; }
.email-resumo { font-size: .85rem; color: var(--text-muted); display: block; }

/* Projetos */
.projeto-list { list-style: none; }
.projeto-item { padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: .5rem; display: flex; align-items: center; gap: 1rem; }
.projeto-titulo { flex: 1; font-weight: 500; }
.projeto-area { font-size: .8rem; color: var(--text-muted); }
.projeto-status { font-size: .75rem; padding: .25rem .6rem; border-radius: 99px; background: var(--surface2); }
.status-pronto { background: rgba(34,197,94,.15); color: var(--success); }
.status-em_construcao { background: rgba(99,102,241,.15); color: var(--accent); }
.status-aguardando_aprovacao { background: rgba(245,158,11,.15); color: var(--warning); }

/* Filtros */
.filtros { display: flex; gap: .75rem; margin-bottom: 1.5rem; }
.filtros select { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: .5rem .75rem; border-radius: 8px; cursor: pointer; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal.hidden { display: none; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; width: 100%; max-width: 480px; }
.modal-content h2 { margin-bottom: 1.25rem; }
.modal-content input, .modal-content textarea, .modal-content select {
    width: 100%; padding: .75rem; background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: .95rem; margin-bottom: .75rem; font-family: inherit;
}
.modal-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: .5rem; }
.btn-primary { background: var(--accent); border: none; color: #fff; padding: .6rem 1.25rem; border-radius: 8px; cursor: pointer; font-size: .95rem; }
.btn-primary:hover { background: var(--accent-hover); }
.modal-actions button:first-child { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: .6rem 1.25rem; border-radius: 8px; cursor: pointer; }

.empty { color: var(--text-muted); font-size: .9rem; padding: 1rem 0; }
