:root {
    --navy: #1a2e4a;
    --navy-light: #243550;
    --red: #c0392b;
    --blue: #2980b9;
    --orange: #e67e22;
    --green: #27865f;
    --ink: #25313d;
    --muted: #6d7782;
    --paper: #f5f6f7;
    --white: #fff;
    --line: #d9dee3;
    --line-soft: #e7eaed;
    --danger: #a83a35;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
a { color: var(--blue); font-weight: 500; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 24px; line-height: 1.2; font-weight: 500; letter-spacing: 0; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: 0; }
h3 { font-size: 14px; line-height: 1.4; font-weight: 600; letter-spacing: 0; }
button, input, select, textarea { font: inherit; }

.site-header {
    min-height: 56px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
    gap: 24px; background: var(--navy);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--white); text-decoration: none; }
.brand-mark {
    width: 36px; height: 36px; display: grid; place-items: center; border-radius: 3px;
    color: var(--white); background: var(--red); font-size: 11px; font-weight: 700; letter-spacing: .05em;
}
.brand-copy { display: grid; line-height: 1.02; }
.brand-copy small { color: rgba(255,255,255,.62); font-size: 9px; }
.brand-copy strong, .brand-copy span { color: var(--white); font-size: 12px; font-weight: 600; }
.brand-copy span { color: rgba(255,255,255,.82); font-weight: 400; }
nav { display: flex; align-items: stretch; min-height: 56px; }
nav a, .link-button {
    display: flex; align-items: center; min-height: 56px; padding: 0 14px; border: 0;
    border-bottom: 2px solid transparent; color: rgba(255,255,255,.7); background: none;
    font-size: 13px; font-weight: 400; text-decoration: none; cursor: pointer;
}
nav a:hover, .link-button:hover { color: var(--white); }
nav a.active { color: var(--white); border-bottom-color: var(--orange); }
nav form { margin: 0; }

.shell { width: min(1240px, 100%); margin: 0 auto; padding: 28px 24px 64px; }
.eyebrow {
    margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 400;
    letter-spacing: .08em; text-transform: uppercase;
}
.muted { color: var(--muted); }
.lead { max-width: 760px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.page-heading {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px;
}
.page-heading .button-row { padding-top: 18px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading a { color: var(--muted); font-size: 13px; text-decoration: none; }
.section-heading a:hover { color: var(--blue); text-decoration: underline; }

.button {
    display: inline-flex; min-height: 34px; align-items: center; justify-content: center; padding: 7px 14px;
    border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--white);
    font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer;
}
.button:hover { background: #eef1f3; }
.button.primary { color: var(--white); background: var(--blue); border-color: var(--blue); }
.button.primary:hover { background: #2471a3; }
.button.danger { color: var(--danger); border-color: #d9aaa7; }
.button.compact { min-height: 30px; padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

.notice { margin-bottom: 20px; padding: 12px 15px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 0 4px 4px 0; background: var(--white); font-size: 13px; }
.notice.error { border-left-color: var(--danger); }
.notice.success { border-left-color: var(--green); }
.notice.info { border-left-color: var(--orange); }
.status-band {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px;
    padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--blue);
    border-radius: 0 4px 4px 0; background: #f0f2f4;
}
.membership-left { display: flex; align-items: center; gap: 10px; }
.status-band strong { font-size: 14px; font-weight: 600; }
.status-band > a { font-size: 13px; text-decoration: none; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }
.status-dot.active { background: #27ae60; }
.status-note { color: var(--muted); font-size: 12px; }

.resource-grid, .course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.resource-card, .course-card {
    min-height: 150px; padding: 14px 16px; display: flex; flex-direction: column; gap: 5px;
    position: relative; border: 1px solid var(--line-soft); border-top: 2px solid var(--red);
    border-radius: 4px; background: var(--white);
}
.course-card { border-top-color: var(--blue); }
.resource-card:hover { border-top-color: var(--blue); }
.course-card:hover { border-color: var(--line); border-top-color: var(--blue); }
.resource-card h2, .resource-card h3, .course-card h2, .course-card h3 { margin: 0; }
.resource-card > p:not(.eyebrow):not(.resource-category), .course-card > p:not(.eyebrow) { color: var(--muted); font-size: 12px; line-height: 1.45; }
.resource-card > a, .course-card > a {
    margin-top: auto; padding-top: 10px; color: var(--blue); font-size: 13px; text-decoration: none;
}
.resource-card > a:hover, .course-card > a:hover { text-decoration: underline; }
.resource-type {
    color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase;
}
.resource-category { margin: 0; color: var(--muted); font-size: 12px; }
.course-module-count { color: var(--muted); font-size: 12px; }
.dashboard-section { margin-top: 32px; }
.dashboard-course-card { min-height: 150px; }
.empty-slot, .empty {
    min-height: 130px; display: flex; align-items: center; justify-content: center; padding: 20px;
    border: 1px dashed var(--line); border-radius: 4px; color: #939ba3; font-size: 13px; text-align: center;
}

.library-tabs { display: flex; border-bottom: 1px solid var(--line); }
.library-tabs a { padding: 9px 13px; color: var(--muted); font-size: 13px; text-decoration: none; }
.library-tabs a.active { color: var(--blue); border-bottom: 2px solid var(--blue); }

.auth-panel, .form-panel, .billing-panel {
    width: min(520px, 100%); margin: 4vh auto; padding: 28px; background: var(--white);
    border: 1px solid var(--line); border-radius: 4px;
}
.auth-panel h1, .form-panel h1 { font-size: 24px; }
.auth-panel form, .form-panel form { display: grid; gap: 16px; margin-top: 24px; }
label { display: grid; gap: 6px; color: #46515c; font-size: 13px; font-weight: 600; }
input, select, textarea {
    width: 100%; padding: 9px 10px; border: 1px solid #c8ced4; border-radius: 3px;
    color: var(--ink); background: var(--white);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #b9d9ed; border-color: var(--blue); }
.form-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-foot { margin: 20px 0 0; font-size: 13px; }
.field-note, .file-meta { margin: -7px 0 0; color: var(--muted); font-size: 12px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkbox input { width: auto; }

.billing-panel { width: 100%; margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.metric-grid article { padding: 18px; background: var(--white); border: 1px solid var(--line-soft); border-top: 2px solid var(--blue); border-radius: 4px; }
.metric-grid strong, .metric-grid span { display: block; }
.metric-grid strong { margin-bottom: 5px; font-size: 27px; font-weight: 500; }
.metric-grid span { color: var(--muted); font-size: 12px; }

.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.admin-layout .form-panel { width: auto; margin: 0; }
.admin-edit-panel { margin: 18px 0 0; }
.admin-edit-panel h1 { font-size: 24px; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 13px; vertical-align: middle; }
th { color: var(--muted); background: #f1f3f4; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.table-secondary, small { color: var(--muted); font-size: 11px; font-weight: 400; }
.membership-status { display: inline-block; padding: 3px 6px; color: #765713; background: #fbefcf; font-size: 11px; font-weight: 600; }
.membership-status.active { color: #14543f; background: #dcefe6; }
.membership-action { min-width: 420px; }
.assignment-form { display: grid; grid-template-columns: minmax(130px, 1fr) 140px minmax(120px, 1fr) auto; gap: 7px; align-items: center; }
.assignment-form input, .assignment-form select { min-width: 0; padding: 6px 7px; font-size: 12px; }
.access-levels { display: grid; gap: 9px; margin: 0; padding: 13px; border: 1px solid var(--line); }
.access-levels legend { padding: 0 5px; color: #46515c; font-size: 13px; font-weight: 600; }

.resource-detail, .lesson { max-width: 960px; padding-top: 18px; }
.back-link { display: inline-block; margin-bottom: 10px; font-size: 13px; text-decoration: none; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; margin-top: 24px; background: #101923; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-content { margin: 28px 0; font-size: 14px; line-height: 1.75; }
.lesson-actions { margin: 28px 0; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lesson-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; font-size: 13px; }
.lesson-navigation span:last-child { text-align: right; }

.progress-row { margin-top: auto; padding-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: center; color: var(--muted); font-size: 11px; }
.progress-track { height: 6px; overflow: hidden; background: #dce1e5; border-radius: 2px; }
.progress-track span { display: block; height: 100%; background: var(--blue); }
.course-heading { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 36px; align-items: end; margin: 18px 0 34px; }
.course-progress-summary { padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 4px; }
.course-progress-summary strong, .course-progress-summary span { display: block; }
.course-progress-summary strong { font-size: 28px; font-weight: 500; }
.course-progress-summary span { margin: 4px 0 12px; color: var(--muted); font-size: 12px; }
.module-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.module-list li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 14px 11px; border-bottom: 1px solid var(--line); background: var(--white); }
.module-list li.complete { background: #eff6f2; }
.module-list li div span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.module-number { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.module-list li.complete .module-number { color: var(--white); background: var(--green); border-color: var(--green); }
.table-progress { width: 100px; display: inline-block; margin-right: 7px; vertical-align: middle; }

.event-list { display: grid; gap: 10px; }
.event-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 17px; background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 0 4px 4px 0; }
.event-item.locked { color: #7c858d; background: #eceff1; border-left-color: #aab2b8; }
.event-item.past { opacity: .72; }
.event-date { width: 54px; min-height: 58px; display: grid; place-content: center; text-align: center; border: 1px solid var(--line); background: var(--paper); }
.event-date strong { font-size: 24px; font-weight: 500; line-height: 1; }
.event-date span { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.event-details h2 { margin-bottom: 6px; }
.event-details > p:not(.eyebrow) { margin-bottom: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.event-access, .locked-label, .registration-confirmation { color: var(--muted); font-size: 11px; }
.registration-confirmation { display: block; margin-bottom: 6px; color: var(--green); font-weight: 700; }
.event-action { text-align: right; }
.event-action form { margin: 0; }

.email-wizard { display: grid; gap: 18px; }
.email-stepper { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.email-step { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #f3f5f7; color: var(--muted); font-size: 12px; font-weight: 600; }
.email-step.current { color: var(--blue); border-color: #b9d9ed; background: #eef7fc; }
.email-form { display: grid; gap: 16px; }
.email-panel { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 6px; background: #fcfcfd; }
.member-list { display: grid; gap: 8px; max-height: 22rem; overflow: auto; padding: 10px; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--white); }
.member-option { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 4px; background: #f8fafc; }
.member-option:hover { background: #f0f4f8; }
.member-option input { width: auto; margin: 0; }

.error-page { padding: 10vh 0; text-align: center; }

@media (max-width: 850px) {
    .site-header { align-items: flex-start; padding: 10px 16px; }
    nav { min-height: auto; flex-wrap: wrap; justify-content: flex-end; }
    nav a, .link-button { min-height: 36px; padding: 0 9px; }
    .brand-copy { display: none; }
    .shell { padding: 24px 16px 48px; }
    .admin-layout, .course-heading { grid-template-columns: 1fr; }
    .assignment-form { grid-template-columns: 1fr; }
    .membership-action { min-width: 240px; }
}

@media (max-width: 620px) {
    .site-header { display: block; }
    .brand { margin-bottom: 8px; }
    nav { justify-content: flex-start; }
    .page-heading, .status-band, .billing-panel { align-items: flex-start; flex-direction: column; }
    .page-heading .button-row { padding-top: 0; }
    .resource-grid, .course-grid, .metric-grid { grid-template-columns: 1fr; }
    .event-item { grid-template-columns: 54px minmax(0, 1fr); }
    .event-action { grid-column: 1 / -1; text-align: left; }
    .form-split { grid-template-columns: 1fr; }
    .lesson-navigation { grid-template-columns: 1fr; }
    .lesson-navigation span:last-child { text-align: left; }
}
