/* =============================================================
   Student Biodata System - simple stylesheet
   ============================================================= */

:root {
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --whatsapp: #16a34a;
    --danger: #dc2626;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", system-ui, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}

.container { max-width: 860px; margin: 0 auto; padding: 0 16px; }

a { color: var(--primary); }

/* Header / footer */
.site-header {
    background: var(--card); border-bottom: 1px solid var(--border);
    padding: 10px 0; font-size: 1.05rem;
}
.header-inner { display: flex; align-items: center; gap: 14px; }
.logo { height: 52px; width: auto; display: block; }
.topbar .logo { height: 34px; }
.site-footer {
    background: var(--card); border-top: 1px solid var(--border);
    padding: 18px 0; margin-top: 40px; text-align: center;
    color: var(--muted); font-size: .85rem;
}

/* Titles */
.page-title { text-align: center; margin: 32px 0 22px; }
.page-title h1 { font-size: 1.7rem; }
.page-title p { color: var(--muted); margin-top: 6px; }

/* Card + form */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 26px; margin-bottom: 26px;
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.card h2 {
    font-size: 1.05rem; margin: 22px 0 14px;
    padding-bottom: 8px; border-bottom: 2px solid var(--border);
}
.card h2:first-child { margin-top: 0; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.field label, .field .label { font-weight: 600; font-size: .9rem; }

input[type="text"], input[type="tel"], input[type="password"],
select, textarea {
    width: 100%; padding: 11px 13px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: .95rem; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}

.radio-row { display: flex; gap: 22px; padding-top: 4px; }
.radio-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-row { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 18px; }
.consent-text { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 18px; border: none; border-radius: 8px;
    font-size: .92rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn-lg { padding: 13px 28px; font-size: 1rem; width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: .82rem; }

/* Alerts */
.alert { padding: 13px 17px; border-radius: 10px; margin-bottom: 18px; font-size: .92rem; border: 1px solid transparent; }
.alert ul { margin: 8px 0 0 18px; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

/* Success page */
.success-card { text-align: center; max-width: 580px; margin: 40px auto; }
.success-icon {
    width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 50%;
    background: var(--whatsapp); color: #fff; font-size: 2.1rem;
    display: flex; align-items: center; justify-content: center;
}
.summary-list { text-align: left; margin: 24px 0; display: grid; gap: 10px; }
.summary-list div {
    display: flex; justify-content: space-between; gap: 14px;
    padding: 10px 14px; background: var(--bg); border-radius: 8px;
}
.summary-list dt { color: var(--muted); font-weight: 600; }
.summary-list dd { font-weight: 600; }

/* ---------- Admin ---------- */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--card); border-bottom: 1px solid var(--border);
    padding: 12px 20px; margin-bottom: 22px;
}
.topbar .links { display: flex; gap: 14px; align-items: center; font-size: .88rem; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { max-width: 400px; width: 100%; }
.login-card h1 { font-size: 1.3rem; text-align: center; margin-bottom: 20px; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
    background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 18px; min-width: 150px;
}
.stat .n { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat .l { font-size: .8rem; color: var(--muted); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar input[type="text"] { max-width: 320px; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #f8fafc; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tbody tr:hover { background: #f8fafc; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-grey { background: #e2e8f0; color: #475569; }

.pagination { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--card); text-decoration: none; color: var(--text); font-size: .85rem; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Responsive */
@media (max-width: 700px) {
    .grid { grid-template-columns: 1fr; }
    .page-title h1 { font-size: 1.35rem; }
    .card { padding: 18px 14px; }
}
