* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #16a34a;
    --danger: #dc2626;
    --warn: #d97706;
    --gray: #6b7280;
    --light: #f3f4f6;
    --border: #e5e7eb;
}
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f9fafb;
    color: #111827;
    line-height: 1.5;
}

/* LOGIN */
.login-body {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    min-height: 100vh;
}
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0,0,0,.2);
}
.login-title { color: var(--primary); text-align: center; font-size: 26px; margin-bottom: 8px; }
.login-sub { text-align: center; color: var(--gray); margin-bottom: 24px; font-size: 14px; }

/* TOPBAR */
.topbar {
    background: var(--primary);
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.topbar-brand { font-weight: 700; font-size: 18px; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.topbar-name { font-size: 14px; }
.topbar-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}

/* CONTAINER */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.footer { text-align: center; padding: 20px; color: var(--gray); font-size: 13px; }

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 26px; color: #111827; }
.text-muted { color: var(--gray); font-size: 13px; }

/* CARD */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #111827;
    border-bottom: 2px solid var(--light);
    padding-bottom: 10px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.card-header h2 { margin: 0; border: none; padding: 0; }

/* FORM */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: .15s;
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* BOTÃO */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
    text-decoration: none;
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-light { background: var(--light); color: #374151; }
.btn-light:hover { background: #e5e7eb; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* TABELA */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th,
.table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.table th {
    background: var(--light);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: #374151;
}

/* BADGE */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }

/* ALERT */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid var(--success); }
.alert-danger  { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--primary); }

/* MODAL */
.modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-bg.open { display: flex; }
.modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal h3 { margin-bottom: 12px; color: var(--danger); }
.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ERROR */
.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.error-page h1 { font-size: 72px; color: var(--primary); }

code {
    background: #f1f5f9;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Consolas', monospace;
}