* { box-sizing: border-box; }
body {
    margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #f4f6f9; color: #222; line-height: 1.5;
}
h1 { margin: 0 0 18px; font-size: 1.6rem; }
h2 { margin: 24px 0 12px; font-size: 1.2rem; }

/* Topbar */
.topbar {
    background: #1e3a8a; color: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; flex-wrap: wrap;
}
.topbar .brand { font-size: 1.15rem; font-weight: 700; }
.topbar nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar nav a {
    color: #dbeafe; text-decoration: none; padding: 6px 10px;
    border-radius: 6px; transition: background .15s;
}
.topbar nav a:hover, .topbar nav a.active { background: #2d4fb0; color: #fff; }
.topbar nav a.logout { background: #dc2626; color: #fff; }
.topbar nav a.logout:hover { background: #b91c1c; }
.user-chip { background: #0f2557; padding: 6px 10px; border-radius: 6px; font-size: .9rem; }
.user-chip em { font-style: normal; color: #93c5fd; }
.menu-toggle {
    display: none; background: transparent; border: 0; color: #fff;
    font-size: 1.5rem; cursor: pointer;
}

/* Container */
.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.card-num { font-size: 2rem; font-weight: 700; color: #1e3a8a; }

/* Table */
.table-wrap { overflow-x: auto; background: #fff; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e5e7eb; font-size: .92rem; }
th { background: #f1f5f9; font-weight: 600; }
tr:hover td { background: #f8fafc; }
.empty { text-align: center; color: #888; padding: 20px; }

/* Buttons */
.btn {
    display: inline-block; padding: 8px 14px; border-radius: 6px; cursor: pointer;
    border: 1px solid #cbd5e1; background: #fff; color: #334155;
    text-decoration: none; font-size: .9rem; margin: 0 4px 4px 0;
}
.btn:hover { background: #f1f5f9; }
.btn-primary { background: #1e3a8a; color: #fff; border-color: #1e3a8a; }
.btn-primary:hover { background: #162c66; }
.btn-success { background: #059669; color: #fff; border-color: #059669; }
.btn-warn    { background: #d97706; color: #fff; border-color: #d97706; }
.btn-danger  { background: #dc2626; color: #fff; border-color: #dc2626; }

/* Forms */
.filter-bar {
    background: #fff; padding: 14px; border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06); margin-bottom: 16px;
    display: flex; flex-wrap: wrap; gap: 10px; align-items: end;
}
label { display: flex; flex-direction: column; font-size: .85rem; gap: 4px; color: #475569; }
input, select, textarea {
    padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px;
    font: inherit; background: #fff; min-width: 150px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: #1e3a8a; }

/* Modal */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: 16px;
}
.modal-content {
    background: #fff; border-radius: 12px; width: 100%; max-width: 720px;
    max-height: 92vh; overflow: auto; box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 { margin: 0; }
.modal-body { padding: 18px 20px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 20px; border-top: 1px solid #e5e7eb;
    margin-top: 10px;
}
.close { background: transparent; border: 0; font-size: 1.6rem; cursor: pointer; color: #64748b; line-height: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 12px; }

/* Alerts */
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: .9rem; }
.alert-info { background: #dbeafe; color: #1e3a8a; border-left: 4px solid #1e3a8a; }
.alert { background: #fee2e2; color: #991b1b; border-left: 4px solid #dc2626; }

/* Login */
.login-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}
.login-card {
    background: #fff; padding: 28px; border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25); width: 100%; max-width: 360px;
    display: flex; flex-direction: column; gap: 14px;
}
.login-card h2 { margin: 0; color: #1e3a8a; text-align: center; }
.login-card .muted { text-align: center; color: #64748b; margin: 0 0 6px; }
.login-card .hint { font-size: .78rem; color: #94a3b8; text-align: center; margin: 0; }

/* Report */
.report { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.report-title { text-align: center; font-size: 1.4rem; margin: 0 0 6px; color: #1e3a8a; }
.report-sub { text-align: center; font-size: .85rem; color: #64748b; margin: 0 0 16px; }

/* Footer */
.site-footer { text-align: center; padding: 20px; color: #94a3b8; font-size: .85rem; }

/* Responsive */
@media (max-width: 720px) {
    .menu-toggle { display: block; }
    .topbar nav { display: none; width: 100%; flex-direction: column; align-items: stretch; margin-top: 10px; }
    body.nav-open .topbar nav { display: flex; }
    .topbar nav a { padding: 10px; background: #2d4fb0; }
    .user-chip { text-align: center; }
}

/* Print */
@media print {
    .no-print, .topbar, .site-footer, .filter-bar, .modal { display: none !important; }
    body { background: #fff; }
    .container { max-width: 100%; margin: 0; padding: 0; }
    .report { box-shadow: none; padding: 0; }
    .report-title { font-size: 1.2rem; }
    table { min-width: 100%; font-size: 11px; }
    th, td { border: 1px solid #000; padding: 6px; }
    thead { display: table-header-group; }
}