* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f6fb;
    color: #1e293b;
    min-height: 100vh;
}

/* ---------- LOGIN ---------- */
.login-body {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
}
.login-box {
    background: #fff; padding: 40px; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 340px;
}
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 20px; }
.login-box input {
    width: 100%; padding: 12px; margin-bottom: 12px;
    border: 1px solid #cbd5e1; border-radius: 8px;
}
.login-box button {
    width: 100%; padding: 12px; background: #6366f1; color: #fff;
    border: none; border-radius: 8px; font-weight: 600; cursor: pointer;
}
.login-box button:hover { background: #4f46e5; }
.erro { color: #dc2626; text-align: center; margin-bottom: 12px; font-size: 14px; }

/* ---------- TOPBAR ---------- */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 32px; background: #1e293b; color: #fff;
    position: sticky; top: 0; z-index: 50;
}
.topbar h1 { font-size: 20px; }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.topbar-right span { color: #cbd5e1; }

/* ---------- CONTAINER ---------- */
.container { max-width: 1400px; margin: 24px auto; padding: 0 24px; }

/* ---------- FILTROS ---------- */
.filtros {
    background: #fff; padding: 20px; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05); margin-bottom: 20px;
}
.filter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-group { flex: 0 0 auto; }
.filter-group.grow { flex: 1 1 300px; }
.filter-group input, .filter-group select {
    width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1;
    border-radius: 8px; font-size: 14px; background: #fff;
}
.filtros-info {
    margin-top: 14px; padding-top: 14px;
    border-top: 1px solid #e2e8f0;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 14px; color: #475569;
}

/* ---------- BOTÕES ---------- */
.btn {
    padding: 10px 16px; border-radius: 8px; border: none;
    font-size: 14px; font-weight: 600; cursor: pointer;
    text-decoration: none; display: inline-flex; align-items: center;
    gap: 6px; transition: all .15s;
}
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger  { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warn    { background: #f59e0b; color: #fff; }
.btn-warn:hover { background: #d97706; }
.btn-ghost   { background: #f1f5f9; color: #475569; }
.btn-ghost:hover { background: #e2e8f0; }

/* ---------- TABELA ---------- */
.tabela-wrap {
    background: #fff; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05); overflow: hidden;
}
.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela thead {
    background: #f8fafc; color: #64748b;
    text-transform: uppercase; font-size: 11px; letter-spacing: .5px;
}
.tabela th, .tabela td {
    padding: 12px 14px; text-align: left; border-bottom: 1px solid #f1f5f9;
}
.tabela tbody tr:hover { background: #f8fafc; }
.tabela code {
    background: #eef2ff; color: #4f46e5; padding: 2px 6px;
    border-radius: 4px; font-size: 12px;
}
.badge {
    background: #e0e7ff; color: #4338ca; padding: 3px 10px;
    border-radius: 999px; font-size: 12px; font-weight: 600;
}
.acoes { display: flex; gap: 6px; }
.vazio { text-align: center; padding: 40px; color: #94a3b8; }

/* ---------- MODAL ---------- */
.modal-bg {
    display: none; position: fixed; inset: 0;
    background: rgba(15,23,42,.6); z-index: 100;
    align-items: flex-start; justify-content: center;
    padding: 40px 20px; overflow-y: auto;
}
.modal-bg.aberto { display: flex; }
.modal {
    background: #fff; border-radius: 16px; width: 100%; max-width: 640px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid #e2e8f0;
}
.modal-header h2 { font-size: 18px; }
.btn-close {
    background: none; border: none; font-size: 20px; cursor: pointer;
    color: #94a3b8; padding: 4px;
}
.btn-close:hover { color: #1e293b; }
.form-servico { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.form-servico label {
    display: flex; flex-direction: column; gap: 6px;
    font-size: 13px; font-weight: 600; color: #475569;
}
.form-servico input, .form-servico textarea, .form-servico select {
    padding: 10px 12px; border: 1px solid #cbd5e1;
    border-radius: 8px; font-size: 14px; font-family: inherit;
    font-weight: 400; color: #1e293b;
}
.form-servico input:focus, .form-servico textarea:focus {
    outline: none; border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding-top: 14px; border-top: 1px solid #e2e8f0;
}

@media (max-width: 640px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .filter-form { flex-direction: column; align-items: stretch; }
    .tabela-wrap { overflow-x: auto; }
}