/* OLPC-SMI Student Grade Portal — shared styles */

:root {
    --navy: #0b2545;
    --navy-light: #13315c;
    --gold: #c8a24a;
    --bg: #f4f6fa;
    --card-bg: #ffffff;
    --text: #1b2430;
    --text-muted: #5b6674;
    --border: #dfe4ec;
    --success-bg: #e5f6ea; --success-text: #1e7a3d;
    --error-bg: #fdecec;   --error-text: #b3261e;
    --warn-bg: #fff6e0;    --warn-text: #8a6100;
    --info-bg: #e7f0fd;    --info-text: #1a4f9c;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--navy-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top navigation ---------- */
.topbar {
    background: var(--navy);
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 10px;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; line-height: 1.1; }
.brand-logo { width: 34px; height: 34px; flex-shrink: 0; }
.brand-mark { font-weight: 700; letter-spacing: 0.5px; color: var(--gold); display: block; }
.brand-sub { font-size: 12px; color: #cbd6e8; display: block; }
.topnav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.topnav a { color: #e7edf7; font-size: 14px; }
.topnav a:hover { color: var(--gold); text-decoration: none; }
.topbar-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #cbd6e8; }
.topbar-user a { color: #fff; background: rgba(255,255,255,0.12); padding: 5px 10px; border-radius: 6px; font-size: 13px; }
.topbar-user a:hover { background: rgba(255,255,255,0.22); text-decoration: none; }

/* ---------- Layout ---------- */
.page-container { max-width: 1100px; margin: 24px auto; padding: 0 20px 40px; }
.page-footer { text-align: center; color: var(--text-muted); font-size: 12px; padding: 20px; }

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(15, 30, 60, 0.05);
}
.card h2, .card h3 { margin-top: 0; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: flex-start; }
}

.stat-tile { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 18px; }
.stat-tile .stat-value { font-size: 28px; font-weight: 700; color: var(--gold); }
.stat-tile .stat-label { font-size: 13px; color: #cbd6e8; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; color: var(--text-muted); }
input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 14px; margin-bottom: 14px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-light); outline-offset: 1px; }
.btn {
    display: inline-block; padding: 9px 18px; border-radius: 6px; border: none;
    background: var(--navy); color: #fff; font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--navy-light); }
.btn-secondary { background: #eef1f6; color: var(--text); }
.btn-secondary:hover { background: #dfe4ec; }
.btn-danger { background: var(--error-text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 180px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: #f0f3f8; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
tr:hover td { background: #fafbfd; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-passed, .badge-active, .badge-regular { background: var(--success-bg); color: var(--success-text); }
.badge-failed, .badge-inactive, .badge-dropped { background: var(--error-bg); color: var(--error-text); }
.badge-progress, .badge-incomplete { background: var(--warn-bg); color: var(--warn-text); }
.badge-admin, .badge-teacher, .badge-student { background: var(--info-bg); color: var(--info-text); }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error   { background: var(--error-bg);   color: var(--error-text); }
.alert-warning { background: var(--warn-bg);    color: var(--warn-text); }
.alert-info    { background: var(--info-bg);    color: var(--info-text); }

/* ---------- Auth pages ---------- */
.auth-wrap { max-width: 400px; margin: 60px auto; }
.auth-wrap .card { text-align: center; }
.auth-seal { width: 72px; height: 72px; margin: 0 auto 12px; }
.auth-logo { font-weight: 700; color: var(--navy); font-size: 20px; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.auth-wrap form { text-align: left; }

.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---------- Transcript / print ---------- */
.tor-header { text-align: center; margin-bottom: 20px; }
.tor-header h1 { margin: 0; font-size: 20px; color: var(--navy); }
.tor-header p { margin: 2px 0; color: var(--text-muted); font-size: 13px; }
.tor-term-title { background: #f0f3f8; padding: 8px 12px; font-weight: 700; margin-top: 20px; }
.tor-summary { display: flex; justify-content: flex-end; gap: 24px; margin-top: 10px; font-size: 14px; }

@media print {
    .no-print, .topbar, .page-footer { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: none; padding: 0; }
    .page-container { max-width: 100%; margin: 0; }
}
