:root {
    --maroon: #7a1f2b;
    --maroon-dark: #611825;
    --gold: #c9a227;
    --bg: #f2f4f7;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); }

/* ---------- Auth pages ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card {
    background: #fff; width: 380px; padding: 32px; border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.auth-card h1 { font-size: 19px; margin: 0 0 2px; color: var(--maroon); }
.auth-card .subtitle { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* ---------- Forms (shared) ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
}
.btn {
    display: inline-block; background: var(--maroon); color: #fff; border: none;
    padding: 10px 20px; border-radius: 6px; font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--maroon-dark); }
.btn-secondary { background: #fff; color: var(--maroon); border: 1px solid var(--maroon); }
.error-box { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.success-msg { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }

/* ---------- Portal shell ---------- */
.portal-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px; background: var(--maroon); color: #fff; flex-shrink: 0;
    display: flex; flex-direction: column; padding: 20px 0;
}
.sidebar-brand { padding: 0 20px 20px; font-weight: 700; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,0.15); margin-bottom: 10px; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; }
.sidebar nav a { color: #f4e6e8; text-decoration: none; padding: 10px 20px; font-size: 14px; }
.sidebar nav a:hover { background: rgba(255,255,255,0.08); }
.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.15); font-size: 13px; }
.sidebar-footer .user-name { font-weight: 600; }
.sidebar-footer .user-role { opacity: 0.8; font-size: 12px; margin-bottom: 8px; }
.logout-link { color: #ffd7db; font-size: 13px; }

.content { flex: 1; }
.content-header { background: #fff; border-bottom: 1px solid var(--border); padding: 18px 28px; }
.content-header h1 { margin: 0; font-size: 19px; }
.content-body { padding: 24px 28px; }

/* ---------- Dashboard cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: 8px; padding: 18px 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--maroon); }
.stat-card .label { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- Tables ---------- */
table.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
table.data-table th, table.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; text-align: left; }
table.data-table th { background: #faf9f8; font-weight: 600; color: var(--muted); }
table.data-table tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-active, .badge-paid, .badge-present { background: #dcfce7; color: #166534; }
.badge-pending, .badge-partial { background: #fef9c3; color: #854d0e; }
.badge-unpaid, .badge-absent, .badge-suspended { background: #fee2e2; color: #991b1b; }

.panel { background: #fff; border-radius: 8px; padding: 20px 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 20px; }
.panel h2 { font-size: 15px; margin-top: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

/* ---------- Public site ---------- */
.site-header { background: var(--maroon); color: #fff; padding: 16px 40px; display: flex; justify-content: space-between; align-items: center; }
.site-header a { color: #fff; text-decoration: none; margin-left: 22px; font-size: 14px; }
.site-header .brand { font-weight: 700; font-size: 18px; }
.hero { background: linear-gradient(135deg, var(--maroon), var(--maroon-dark)); color: #fff; padding: 70px 40px; text-align: center; }
.hero h1 { font-size: 32px; margin-bottom: 10px; }
.hero p { font-size: 16px; opacity: 0.9; max-width: 640px; margin: 0 auto; }
.section { padding: 50px 40px; max-width: 1000px; margin: 0 auto; }
.programme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.programme-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); border-top: 3px solid var(--gold); }
.programme-card h3 { margin-top: 0; font-size: 16px; color: var(--maroon); }
.site-footer { background: #1f2937; color: #d1d5db; padding: 30px 40px; text-align: center; font-size: 13px; }
