:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --primary: #164e63;
    --primary-dark: #083344;
    --muted: #64748b;
    --border: #dbe3ee;
    --success: #15803d;
    --danger: #b91c1c;
    --warning: #b45309;
    --text: #0f172a;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 270px;
    background: var(--primary-dark);
    color: #fff;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    position: fixed;
    min-height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; }
.brand-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: #fff; color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
}
.brand span { display: block; color: #cbd5e1; font-size: 12px; margin-top: 3px; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav a {
    padding: 11px 12px;
    border-radius: 10px;
    color: #dbeafe;
    font-size: 14px;
}
.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(255,255,255,.14);
    color: #fff;
}
.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.15);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: #cbd5e1;
}
.sidebar-footer a { color: #fff; font-weight: 700; }
.content {
    margin-left: 270px;
    padding: 26px;
    width: calc(100% - 270px);
}
.page-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}
.page-title h1 { margin: 0 0 6px; font-size: 28px; }
.page-title p { margin: 0; color: var(--muted); }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
    margin-bottom: 18px;
}
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat h3 { margin: 0 0 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.stat .value { font-size: 25px; font-weight: 800; }
.stat.success .value { color: var(--success); }
.stat.danger .value { color: var(--danger); }
.stat.primary .value { color: var(--primary); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-group { margin-bottom: 14px; }
label { display: block; margin-bottom: 7px; font-weight: 700; font-size: 14px; }
input, select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
}
textarea { min-height: 90px; resize: vertical; }
.btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    border: 0;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #e2e8f0; color: #0f172a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 7px 10px; font-size: 12px; border-radius: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    text-align: left;
    font-size: 14px;
}
th { background: #f8fafc; color: #334155; font-size: 13px; }
tfoot th, tfoot td { font-weight: 800; background: #f8fafc; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.badge {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-muted { background: #e2e8f0; color: #334155; }
.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 600;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-box {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #083344, #164e63);
}
.login-card { width: 100%; max-width: 420px; }
.login-card .card { padding: 28px; }
.login-title { margin: 0 0 8px; }
.muted { color: var(--muted); }
.report-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
@media (max-width: 980px) {
    .sidebar { position: static; width: 100%; min-height: auto; }
    .app { display: block; }
    .content { margin-left: 0; width: 100%; }
    .grid-3, .grid-2, .form-row, .filter-box { grid-template-columns: 1fr; }
}
@media print {
    .sidebar, .no-print, .btn { display: none !important; }
    .content { margin: 0; width: 100%; padding: 0; }
    .card { box-shadow: none; border: none; }
    body { background: #fff; }
}
