:root {
    --navy: #0d3039;
    --navy-soft: #123f4a;
    --green: #16865f;
    --green-soft: #dff3eb;
    --yellow: #f3ad3f;
    --red: #df4f5e;
    --blue: #2563eb;
    --background: #f3f6f8;
    --surface: #ffffff;
    --text: #142f36;
    --muted: #60747a;
    --border: #dce5e8;
    --shadow: 0 12px 35px rgba(13, 48, 57, .08);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    background: var(--background);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.55;
}
img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .35);
    outline-offset: 2px;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 6px 0 12px; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.08; }
h2 { margin: 0 0 14px; font-size: clamp(1.35rem, 2vw, 1.8rem); }
h3 { margin: 0; font-size: 1.05rem; }
p { margin: 0 0 14px; }

.topbar {
    position: sticky;
    z-index: 50;
    top: 0;
    min-height: 76px;
    padding: 10px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--navy);
    color: #fff;
    box-shadow: 0 3px 14px rgba(8, 32, 38, .18);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
.brand img { width: 55px; height: 55px; padding: 2px; border-radius: 50%; background: #fff; object-fit: contain; }
.brand span, .account-menu span { display: flex; flex-direction: column; line-height: 1.2; }
.brand strong { font-size: 1.18rem; }
.brand small, .account-menu small { margin-top: 3px; color: #cfe0e4; font-size: .72rem; }
.public-nav, .account-menu { display: flex; align-items: center; gap: 18px; }
.public-nav a { color: #fff; text-decoration: none; font-size: .9rem; font-weight: 600; }
.account-menu { font-size: .85rem; }
.account-menu span { text-align: right; }
.logout-button { padding: 9px 15px; border-radius: 8px; background: var(--red); color: #fff; text-decoration: none; font-weight: 700; }
.mobile-menu-button { display: none; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; background: transparent; color: #fff; padding: 8px 12px; font-weight: 700; }

.public-content { width: min(1180px, 92%); min-height: calc(100vh - 150px); margin: 0 auto; padding: 44px 0 64px; }
.app-layout { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { position: sticky; top: 76px; align-self: start; height: calc(100vh - 76px); overflow-y: auto; padding: 25px 16px; border-right: 1px solid var(--border); background: #fff; }
.sidebar-label { margin: 0 11px 10px; color: #8b9ba0; font-size: .66rem; font-weight: 800; letter-spacing: .13em; }
.sidebar-label-spaced { margin-top: 30px; }
.sidebar a { display: block; margin: 3px 0; padding: 10px 12px; border-radius: 9px; color: #27464e; text-decoration: none; font-size: .88rem; }
.sidebar a:hover, .sidebar a.is-active { background: var(--green-soft); color: var(--navy); font-weight: 700; }
.app-content { min-width: 0; padding: 36px clamp(22px, 3vw, 46px) 60px; }

.eyebrow { margin: 0 0 6px; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .13em; }
.muted { color: var(--muted); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { font-size: clamp(2rem, 3vw, 2.7rem); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 9px; cursor: pointer; text-decoration: none; font-weight: 750; font-size: .88rem; }
.button-primary { background: var(--yellow); color: var(--navy); }
.button-secondary { background: var(--green-soft); color: var(--navy); }
.button-danger { background: #fee5e7; color: #9b2632; }
.button-light { background: #fff; color: var(--navy) !important; }
.button-small { min-height: 34px; padding: 7px 11px; font-size: .78rem; }
.button-full { width: 100%; margin-top: 10px; }
.button:hover { filter: brightness(.97); transform: translateY(-1px); }

.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.35fr .65fr; align-items: center; gap: 35px; padding: clamp(34px, 6vw, 74px); border-radius: 24px; background: linear-gradient(125deg, #0b2c35, #155463); color: #fff; box-shadow: var(--shadow); }
.hero::after { position: absolute; right: -100px; bottom: -170px; width: 380px; height: 380px; border: 70px solid rgba(243,173,63,.12); border-radius: 50%; content: ""; }
.hero-copy { position: relative; z-index: 1; }
.hero .eyebrow { color: #ffd381; }
.hero-description { max-width: 650px; color: #dcecef; font-size: 1.08rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 26px; }
.hero-logo { position: relative; z-index: 1; justify-self: end; width: min(235px, 27vw); aspect-ratio: 1; padding: 8px; border-radius: 50%; background: #fff; box-shadow: 0 16px 45px rgba(0,0,0,.2); }
.hero-logo img { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; }
.section { margin-top: 50px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading p { color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 15px; }
.card { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 25px rgba(13,48,57,.04); }
.card-number { width: 38px; height: 38px; margin-bottom: 14px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--navy); font-weight: 800; }
.card p { margin: 7px 0 0; color: var(--muted); font-size: .88rem; }
.feature-band { padding: 30px; border: 1px solid #cfe8de; border-radius: var(--radius); background: linear-gradient(120deg, #e8f7f1, #f7fbf9); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step { position: relative; padding: 18px; border-radius: 12px; background: #fff; }
.step strong { display: block; margin-bottom: 5px; color: var(--green); }
.step span { color: var(--muted); font-size: .86rem; }

.auth-card { width: min(470px, 100%); margin: 10px auto; padding: 32px; border: 1px solid var(--border); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.auth-logo { display: block; width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 50%; object-fit: contain; }
.auth-card .eyebrow, .auth-card h1, .auth-card > p { text-align: center; }
.auth-card h1 { font-size: 2rem; }
.form-panel { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.form-panel-small { max-width: 620px; }
form label { display: block; margin: 14px 0 5px; font-size: .86rem; font-weight: 750; }
input, select, textarea { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid #b9c9ce; border-radius: 8px; background: #fff; color: var(--text); }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
.field-help { margin: 5px 0 0; color: var(--muted); font-size: .75rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.alert { margin-bottom: 18px; padding: 13px 16px; border-radius: 10px; font-size: .9rem; }
.alert-success { background: #dcf5e7; color: #175e37; }
.alert-error { background: #fee5e7; color: #8b2430; }
.alert-warning { background: #fff1cc; color: #6e4d00; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0; }
.stat { padding: 20px; border: 1px solid var(--border); border-radius: 13px; background: #fff; box-shadow: 0 7px 20px rgba(13,48,57,.04); }
.stat span { display: block; color: var(--muted); font-size: .78rem; }
.stat strong { display: block; margin-top: 7px; font-size: 1.65rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-top: 18px; }
.panel { padding: 23px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.panel-link { text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.panel-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.panel p { margin-top: 7px; color: var(--muted); }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.action-row form { margin: 0; }

.course-section { margin-top: 20px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.course-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.course-heading h2 { margin: 2px 0 0; font-size: 1.25rem; }
.course-heading strong { color: var(--green); font-size: .85rem; }
.lesson-list { display: grid; gap: 10px; margin-top: 14px; }
.lesson-item { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: #fbfdfc; }
.lesson-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.lesson-number { flex: 0 0 35px; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--navy); font-weight: 800; }
.lesson-item.is-complete { border-color: #8ac9af; background: #f5fcf8; }
.lesson-item.is-locked { opacity: .62; }
.lesson-info p { margin: 3px 0 0; color: var(--muted); font-size: .8rem; }
.progress { width: 100%; height: 9px; overflow: hidden; border: 0; border-radius: 10px; background: #e2ebee; }
.progress::-webkit-progress-bar { background: #e2ebee; }
.progress::-webkit-progress-value { background: linear-gradient(90deg, var(--green), #4ebf94); border-radius: 10px; }
.progress::-moz-progress-bar { background: var(--green); border-radius: 10px; }

.slides { overflow: hidden; margin: 20px 0; border-radius: 18px; background: linear-gradient(125deg, #0b2d36, #155463); color: #fff; box-shadow: var(--shadow); }
.slide { display: none; min-height: 325px; padding: clamp(30px, 6vw, 58px); }
.slide.is-active { display: block; }
.slide small { color: #ffd381; font-weight: 800; letter-spacing: .1em; }
.slide h2 { max-width: 680px; margin-top: 18px; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.slide p { max-width: 720px; color: #e2f0f2; font-size: 1.03rem; white-space: pre-line; }
.slide-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; background: rgba(0,0,0,.2); }
.lesson-content { max-width: 880px; margin: auto; }
.lesson-block { margin-top: 18px; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.lesson-block-practice { border-color: #b9e1d1; background: #ecf8f3; }
.answer { display: flex; align-items: flex-start; gap: 10px; margin: 9px 0; padding: 12px; border: 1px solid var(--border); border-radius: 9px; font-weight: 500; }
.answer input { width: auto; margin: 4px 0 0; }

.filters { display: flex; align-items: end; gap: 12px; margin-bottom: 16px; }
.filters label { min-width: 210px; margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; font-size: .84rem; }
th { background: #f7f9fa; color: #536a71; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.status-active, .status-approved, .status-complete { background: #daf3e7; color: #17603d; }
.status-inactive, .status-redo { background: #fee5e7; color: #8b2430; }
.status-pending { background: #fff0ca; color: #725000; }
.empty-state { padding: 35px 20px; text-align: center; color: var(--muted); }
.two-columns { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; }

.privacy { max-width: 850px; margin: auto; }
.privacy section { margin-top: 16px; padding: 22px; border: 1px solid var(--border); border-radius: 13px; background: #fff; }
.privacy h2 { font-size: 1.2rem; }
.privacy ul { margin-bottom: 0; }
.certificate { max-width: 1050px; margin: 30px auto; padding: 70px; border: 14px double var(--navy); background: #fff; text-align: center; }
.certificate-logo { width: 120px; }
.certificate h1 { color: var(--navy); }
.certificate-name { margin: 25px 0; color: var(--green); font-family: Georgia, serif; font-size: 2.2rem; }

.footer { min-height: 62px; padding: 19px 28px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--border); background: #fff; color: var(--muted); font-size: .76rem; }
.footer a { color: var(--green); }

@media print {
    .topbar, .sidebar, .footer, .no-print { display: none !important; }
    .app-layout { display: block; }
    .app-content { padding: 0; }
    .certificate { margin: 0; min-height: 95vh; box-shadow: none; }
}

@media (max-width: 980px) {
    .steps, .stats { grid-template-columns: repeat(2, 1fr); }
    .two-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .topbar { padding: 9px 14px; }
    .brand img { width: 48px; height: 48px; }
    .brand small, .account-menu { display: none; }
    .public-nav a:not(.button) { display: none; }
    .mobile-menu-button { display: inline-flex; }
    .app-layout { display: block; }
    .sidebar { position: fixed; z-index: 45; top: 68px; left: 0; width: min(285px, 88vw); height: calc(100vh - 68px); transform: translateX(-105%); box-shadow: var(--shadow); transition: transform .2s ease; }
    .sidebar.is-open { transform: translateX(0); }
    .app-content { padding: 25px 5% 45px; }
    .public-content { width: 90%; padding-top: 28px; }
    .hero { grid-template-columns: 1fr; padding: 32px 25px; }
    .hero-logo { justify-self: start; width: 145px; }
    .section-heading, .page-heading, .course-heading { align-items: flex-start; flex-direction: column; }
    .dashboard-grid, .form-row { grid-template-columns: 1fr; }
    .lesson-item { align-items: flex-start; flex-direction: column; }
    .filters { align-items: stretch; flex-direction: column; }
    .filters label { min-width: 0; }
    .footer { align-items: flex-start; flex-direction: column; padding: 18px 5%; }
    .certificate { padding: 35px 20px; border-width: 8px; }
}

@media (max-width: 500px) {
    .steps, .stats { grid-template-columns: 1fr; }
    .auth-card { padding: 25px 20px; }
    .slide { min-height: 360px; padding: 30px 23px; }
    .slide-controls { flex-wrap: wrap; }
}
