* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; background: #f3f5f9; color: #1f2937; font-size: 14px; }
a { color: #1d4ed8; text-decoration: none; }
.topbar { display: flex; align-items: center; gap: 24px; background: #0f3d5e; color: #fff; padding: 0 24px; height: 56px; }
.topbar .brand { font-weight: 700; font-size: 18px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: #cfe3f1; padding: 8px 14px; border-radius: 6px; }
.topbar nav a.active, .topbar nav a:hover { background: #1a5a86; color: #fff; }
.topbar .user, .topbar .user a { color: #cfe3f1; }
main { max-width: 1240px; margin: 24px auto; padding: 0 20px; }
footer { text-align: center; color: #8a94a6; font-size: 12px; padding: 20px; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: #6b7280; }
.title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.card { background: #fff; border-radius: 10px; padding: 18px; border-left: 5px solid #1d4ed8; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card span { display: block; color: #6b7280; font-size: 13px; }
.card strong { font-size: 26px; }
.card.green { border-color: #059669; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 18px; }
table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px; }
th, td { padding: 9px 10px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: middle; }
th { background: #eef2f7; font-size: 12px; text-transform: uppercase; color: #475569; }
.panel table { box-shadow: none; }
.num { text-align: right; white-space: nowrap; }
.red { color: #b91c1c; }
tr.total td { font-weight: 700; background: #f8fafc; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid #cbd5e1; background: #fff; color: #1f2937; cursor: pointer; font-size: 14px; }
.btn.primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.btn.success { background: #059669; border-color: #059669; color: #fff; }
.btn.danger { background: #fff; border-color: #fca5a5; color: #b91c1c; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.full { width: 100%; }
.actions { white-space: nowrap; }
.actions form { display: inline; }
input, select { padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; font-family: inherit; }
input.short { width: 100px; } input.tiny { width: 64px; }
.form label { display: block; flex: 1; font-weight: 600; margin-bottom: 12px; }
.form label input, .form label select { display: block; width: 100%; margin-top: 4px; font-weight: normal; }
.form .row { display: flex; gap: 16px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form label { display: flex; gap: 6px; align-items: center; }
.search { display: flex; gap: 8px; margin-bottom: 14px; } .search input { flex: 1; max-width: 420px; }
.alert { padding: 11px 14px; border-radius: 6px; margin-bottom: 16px; background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert.error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert.warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; vertical-align: middle; }
.badge.active, .badge.finalized { background: #dcfce7; color: #166534; }
.badge.inactive { background: #e5e7eb; color: #4b5563; }
.badge.draft { background: #fef3c7; color: #92400e; }
.buttons { display: flex; gap: 10px; }
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #0f3d5e, #1d4ed8); }
.login-box { background: #fff; padding: 32px; border-radius: 12px; width: 360px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.login-box h1 { margin-bottom: 4px; } .login-box label { display: block; font-weight: 600; margin-bottom: 14px; }
.login-box input { display: block; width: 100%; margin-top: 4px; }
.payslip-page { background: #e5e7eb; }
.payslip-tools { max-width: 780px; margin: 20px auto 0; display: flex; justify-content: space-between; }
.payslip { max-width: 780px; margin: 14px auto 30px; background: #fff; padding: 30px; border-radius: 8px; }
.payslip-head { display: flex; justify-content: space-between; border-bottom: 3px solid #0f3d5e; padding-bottom: 10px; margin-bottom: 16px; }
.payslip-head h2 { margin: 0; font-size: 20px; } .payslip-head p { margin: 2px 0 0; letter-spacing: 2px; color: #6b7280; }
.payslip .right { text-align: right; }
.payslip table { box-shadow: none; border: 1px solid #e5e7eb; }
.payslip table.info th { width: 18%; }
.netpay { background: #0f3d5e; color: #fff; font-size: 22px; font-weight: 700; text-align: right; padding: 14px 18px; border-radius: 6px; }
.signs { display: flex; justify-content: space-between; margin-top: 50px; }
.signs div { width: 40%; border-top: 1px solid #1f2937; text-align: center; padding-top: 6px; color: #6b7280; }
@media print {
  .no-print, .topbar, footer { display: none !important; }
  body, .payslip-page { background: #fff; }
  main { margin: 0; max-width: none; }
  .payslip { margin: 0; padding: 0; }
}
@media (max-width: 800px) { .cards, .grid2 { grid-template-columns: 1fr; } .form .row { flex-direction: column; gap: 0; } }
