* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: #f4f6f8; color: #1f2933; }

.center-box {
    max-width: 480px; margin: 80px auto; background: #fff; padding: 32px;
    border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); text-align: center;
}

/* ---- Login page ---- */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #14213d; }
.login-box { background: #fff; padding: 40px; border-radius: 12px; width: 360px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.login-box h1 { font-size: 20px; margin-bottom: 4px; }
.login-box p.sub { color: #666; margin-bottom: 24px; font-size: 13px; }
.login-box label { display: block; font-size: 13px; margin: 12px 0 4px; font-weight: 600; }
.login-box input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.login-box button { width: 100%; margin-top: 20px; padding: 11px; background: #14213d; color: #fff; border: none; border-radius: 6px; font-size: 15px; cursor: pointer; }
.login-box button:hover { background: #1f3a63; }

/* ---- App shell ---- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #14213d; color: #cfd8e3; padding: 20px 0; flex-shrink: 0; }
.sidebar-logo { text-align: center; font-weight: 700; font-size: 18px; color: #fff; padding-bottom: 20px; margin-bottom: 10px; border-bottom: 1px solid #2a3b5c; }
.sidebar-logo small { font-weight: 400; font-size: 11px; color: #8fa3c4; }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a { color: #cfd8e3; text-decoration: none; padding: 11px 24px; font-size: 14px; }
.sidebar nav a:hover { background: #1f3a63; color: #fff; }
.sidebar nav hr { border: none; border-top: 1px solid #2a3b5c; margin: 10px 20px; }

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: #fff; padding: 14px 28px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e6ea; }
.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-user { font-size: 13px; color: #555; }
.topbar-user a { color: #b13030; text-decoration: none; }

.content-area { padding: 24px 28px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #e3f7e8; color: #1d7a34; border: 1px solid #b7e6c2; }
.alert-error { background: #fdeaea; color: #b13030; border: 1px solid #f3c1c1; }

.card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-bottom: 20px; }
.card h2 { font-size: 15px; margin-bottom: 14px; color: #333; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-box { background: #fff; border-radius: 8px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.06); border-left: 4px solid #14213d; }
.stat-box .label { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: .5px; }
.stat-box .value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.stat-box.warn { border-left-color: #d9822b; }
.stat-box.danger { border-left-color: #b13030; }
.stat-box.success { border-left-color: #1d7a34; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th, table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; }
table th { background: #f9fafb; font-weight: 600; color: #444; font-size: 12px; text-transform: uppercase; }
table tr:hover { background: #fafbfc; }

.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; text-decoration: none; font-size: 13px; border: none; cursor: pointer; }
.btn-primary { background: #14213d; color: #fff; }
.btn-primary:hover { background: #1f3a63; }
.btn-secondary { background: #eee; color: #333; }
.btn-danger { background: #b13030; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; padding: 9px 10px; border: 1px solid #d0d5db; border-radius: 6px; font-size: 14px;
}
.form-row-inline { display: flex; gap: 16px; }
.form-row-inline .form-row { flex: 1; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-paid { background: #e3f7e8; color: #1d7a34; }
.badge-unpaid { background: #fdeaea; color: #b13030; }
.badge-partial { background: #fff4e0; color: #b3720c; }
.badge-overdue { background: #fdeaea; color: #b13030; }
.badge-active { background: #e3f7e8; color: #1d7a34; }
.badge-inactive { background: #eee; color: #666; }

.page-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.filter-bar select, .filter-bar input { padding: 7px 10px; border: 1px solid #d0d5db; border-radius: 6px; font-size: 13px; }
