:root {
    --navy: #071B33;
    --navy2: #0B2545;
    --orange: #F2622E;
    --offwhite: #F7F5F0;
    --offwhite2: #F6F8FC;
    --slate: #5B6B82;
    --slate-light: #8A96A8;
}

* { box-sizing: border-box; }
body {
    font-family: 'Inter', Arial, sans-serif;
    margin: 0;
    background: var(--offwhite2);
    color: #1a1a1a;
}
h1, h2, h3 { font-family: 'Space Grotesk', Arial, sans-serif; color: var(--navy); }
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--slate); }
.small { font-size: 0.85em; }

/* ---- Auth pages (login) ---- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.auth-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(7,27,51,0.08);
    padding: 36px;
    width: 100%;
    max-width: 400px;
}
.auth-logo a { font-family: 'Space Grotesk', Arial, sans-serif; font-weight: 700; font-size: 1.3em; color: var(--navy); text-decoration: none; }
.back-link { margin-top: 20px; text-align: center; }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.9em; color: var(--navy); }
input[type=text], input[type=password], input[type=email], input[type=url], input[type=date], textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dde3ea;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
}
textarea { font-family: 'Courier New', monospace; font-size: 0.9em; }

button, .btn-primary, .btn-secondary, .btn-link {
    display: inline-block;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
}
button[type=submit], .btn-primary {
    background: var(--orange);
    color: #fff;
    padding: 12px 20px;
    width: 100%;
    margin-top: 18px;
    font-size: 1em;
}
.btn-primary:hover { background: #d94f1e; color: #fff; text-decoration: none; }
.btn-secondary {
    background: var(--navy);
    color: #fff;
    padding: 8px 16px;
    margin-right: 8px;
}
.btn-secondary:hover { background: var(--navy2); color: #fff; text-decoration: none; }
.btn-link { background: none; color: var(--orange); padding: 4px 8px; font-size: 0.85em; }

.alert { background: #fdecea; border-left: 4px solid #d94f1e; padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.alert-success { background: #eaf7ee; border-left-color: #2e8b57; }

/* ---- Admin ---- */
.admin-header, .portal-header {
    background: var(--navy);
    color: #fff;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-header h1, .portal-header .portal-logo { color: #fff; margin: 0; font-size: 1.2em; }
.admin-header a, .portal-header a { color: #fff; }
.admin-content, .portal-content { max-width: 1000px; margin: 0 auto; padding: 24px 32px 60px; }
.admin-toolbar { margin: 16px 0; display: flex; align-items: center; gap: 12px; }
.admin-form { max-width: 640px; }
.admin-form .row { display: flex; gap: 16px; }
.admin-form .row > div { flex: 1; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 16px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #eee; font-size: 0.9em; }
.admin-table th { background: var(--offwhite); color: var(--navy); font-family: 'Space Grotesk', Arial, sans-serif; }
.admin-table code { background: var(--offwhite); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

.badge { padding: 3px 10px; border-radius: 12px; font-size: 0.8em; font-weight: 600; }
.badge-active { background: #eaf7ee; color: #2e8b57; }
.badge-inactive { background: #f0f0f0; color: var(--slate); }

/* ---- Portal (attendee-facing) ---- */
.materials-card, .explore-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 1px 6px rgba(7,27,51,0.06);
}
.explore-card { background: var(--offwhite); }
.explore-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.explore-links .btn-secondary { width: auto; }

.resource-list { list-style: none; padding: 0; margin: 16px 0 0; }
.resource-list li { border-bottom: 1px solid #eee; }
.resource-list li:last-child { border-bottom: none; }
.resource-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    color: var(--navy);
    font-weight: 600;
}
.resource-list a:hover { color: var(--orange); text-decoration: none; background: var(--offwhite); }
.resource-icon { font-size: 1.3em; }

.resource-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.resource-row a { flex: 1; }
.viewed-toggle { font-size: 0.85em; color: var(--slate); font-weight: normal; display: flex; align-items: center; gap: 4px; white-space: nowrap; padding-right: 8px; }
.viewed-toggle input { width: auto; margin: 0; }

.highlight-card { border-left: 4px solid var(--orange); }
.cert-banner { background: #eaf7ee; border-left: 4px solid #2e8b57; padding: 14px 18px; border-radius: 6px; margin: 16px 0; }

.agenda-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.agenda-table td { padding: 8px 10px; border-bottom: 1px solid #eee; vertical-align: top; }
.agenda-day { font-weight: 700; color: var(--navy); white-space: nowrap; }
.agenda-time { color: var(--slate); white-space: nowrap; }

.trainer-card { display: flex; align-items: center; gap: 16px; }
.trainer-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }

/* ---- Admin: analytics ---- */
.stats-grid { display: flex; gap: 16px; flex-wrap: wrap; margin: 20px 0; }
.stat-card { background: #fff; border-radius: 10px; padding: 20px 24px; box-shadow: 0 1px 6px rgba(7,27,51,0.06); min-width: 160px; }
.stat-num { font-family: 'Space Grotesk', Arial, sans-serif; font-size: 2em; color: var(--orange); font-weight: 700; }
.stat-label { color: var(--slate); font-size: 0.9em; margin-top: 4px; }

details summary { cursor: pointer; margin: 16px 0 8px; }
.admin-form h4 { margin: 18px 0 4px; color: var(--navy); }

/* ---- Certificate ---- */
.cert-page { background: #e9edf2; }
.cert-toolbar { display: flex; justify-content: space-between; align-items: center; max-width: 800px; margin: 20px auto; padding: 0 20px; }
.cert-toolbar .btn-primary { padding: 10px 20px; }
.certificate { max-width: 800px; margin: 0 auto 60px; padding: 0 20px; }
.cert-border { background: #fff; border: 10px solid var(--navy); padding: 50px 40px; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.1); }
.cert-header { font-family: 'Space Grotesk', Arial, sans-serif; font-size: 1.4em; font-weight: 700; color: var(--navy); }
.cert-subheader { font-size: 1.1em; color: var(--orange); letter-spacing: 2px; text-transform: uppercase; margin: 8px 0 30px; }
.cert-body p { color: var(--slate); margin: 4px 0; }
.cert-name { font-family: 'Space Grotesk', Arial, sans-serif; font-size: 2em; color: var(--navy); margin: 10px 0; font-weight: 700; }
.cert-course { font-size: 1.3em; color: var(--orange); font-weight: 600; margin: 10px 0; }
.cert-date { margin-top: 20px; }
.cert-footer { margin-top: 40px; border-top: 1px solid #ddd; padding-top: 16px; }
.cert-sig { font-family: 'Space Grotesk', Arial, sans-serif; color: var(--navy); font-weight: 700; }

@media print {
    .no-print { display: none !important; }
    .cert-page { background: #fff; }
    .cert-border { box-shadow: none; }
}
