:root {
    color-scheme: light;
    --ink: #0b2341;
    --muted: #53667c;
    --canvas: #f3f6fc;
    --surface: #ffffff;
    --line: #dce8f6;
    --primary: #1967d2;
    --primary-dark: #0f5fa8;
    --primary-soft: #e8f2ff;
    --success: #168449;
    --success-soft: #eaf8f0;
    --warning: #a85d00;
    --warning-soft: #fff4df;
    --danger: #c9322f;
    --danger-soft: #fff0ef;
    --shadow: 0 10px 26px rgba(11, 42, 77, .06);
    --radius: 8px;
}

* { box-sizing: border-box; }

html { min-width: 1024px; background: var(--canvas); }

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
img, video, iframe { max-width: 100%; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: 32px; line-height: 1.18; }
h2 { margin-bottom: 8px; font-size: 21px; line-height: 1.25; }
h3 { margin-bottom: 6px; font-size: 17px; }
p { color: var(--muted); }

.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    padding: 0 42px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 18px; font-weight: 800; }
.brand:hover { color: var(--ink); }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 7px; color: #fff; background: var(--primary); font-size: 18px; }
.topbar-actions, .account-summary { display: flex; align-items: center; gap: 22px; }
.topbar-actions form, .account-summary form { margin: 0; }
.account-summary > span { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
.account-summary small { color: var(--muted); text-transform: capitalize; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 750;
    line-height: 1;
}
.button:hover { text-decoration: none; }
.button-primary { color: #fff; background: var(--primary); }
.button-primary:hover { color: #fff; background: var(--primary-dark); }
.button-secondary { color: var(--ink); border-color: #b8cbe1; background: #fff; }
.button-secondary:hover { color: var(--primary); border-color: var(--primary); }
.button-muted { min-height: 36px; color: var(--ink); border-color: var(--line); background: #fff; }
.button-danger { color: #fff; background: var(--danger); }
.button-small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.button[disabled] { cursor: not-allowed; opacity: .55; }
.button-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 410px;
    gap: 70px;
    align-items: center;
    min-height: 590px;
    padding: 72px max(54px, calc((100vw - 1200px) / 2));
    background: #fff;
}
.home-copy { max-width: 680px; }
.home-copy h1 { max-width: 660px; font-size: 54px; line-height: 1.08; }
.home-copy p { max-width: 620px; margin-bottom: 28px; font-size: 19px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--primary); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.home-signal { position: relative; display: flex; min-height: 360px; padding: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: #0b2341; color: #fff; flex-direction: column; justify-content: space-between; overflow: hidden; }
.home-signal::after { position: absolute; right: -55px; bottom: -55px; width: 230px; height: 230px; border: 42px solid #26a957; border-radius: 50%; content: ""; }
.home-signal span { color: #a9c9f2; font-size: 13px; font-weight: 800; }
.home-signal strong { position: relative; z-index: 1; font-size: 112px; line-height: 1; }
.home-signal small { position: relative; z-index: 1; max-width: 180px; font-size: 17px; }
.home-band { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 1200px; margin: 0 auto; padding: 44px 0 58px; gap: 30px; }
.home-band div { padding-left: 20px; border-left: 3px solid var(--primary); }
.home-band strong, .home-band span { display: block; }
.home-band span { margin-top: 6px; color: var(--muted); }

.auth-shell { display: grid; grid-template-columns: minmax(390px, 42%) minmax(0, 1fr); min-height: calc(100vh - 75px); background: #fff; }
.auth-context { position: relative; display: flex; padding: 76px max(64px, calc((100vw - 1280px) / 2)); border-right: 1px solid var(--line); color: var(--ink); background: #f5f7fc; flex-direction: column; justify-content: center; overflow: hidden; }
.auth-context::after { position: absolute; right: 0; bottom: 0; width: 8px; height: 32%; background: var(--primary); content: ""; }
.auth-context h2 { max-width: 470px; margin-bottom: 18px; font-size: 44px; line-height: 1.12; }
.auth-context p { max-width: 470px; margin-bottom: 0; color: var(--muted); font-size: 18px; line-height: 1.7; }
.auth-context .eyebrow { margin-bottom: 14px; color: var(--primary); }
.auth-panel { display: flex; width: 100%; padding: 58px 76px; background: #fff; align-items: center; }
.auth-panel-inner { width: 100%; max-width: 480px; margin: 0 auto; }
.auth-panel-header { margin-bottom: 28px; }
.auth-panel-header h1 { margin-bottom: 10px; font-size: 36px; }
.auth-panel-header p { margin-bottom: 0; font-size: 16px; }
.auth-kicker { display: block; margin-bottom: 8px; color: var(--primary); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.auth-form { display: grid; gap: 20px; }
.auth-form .field { gap: 8px; }
.auth-form .field label { font-size: 13px; }
.auth-form .field input { min-height: 58px; padding: 14px 16px; border-color: #d5e1ee; border-radius: 8px; background: #f8fbff; }
.auth-form .field input:hover { border-color: #afc4da; }
.auth-form .field input[aria-invalid="true"] { border-color: var(--danger); background: #fffafa; }
.auth-form .field-error { margin-top: 0; }
.password-field { position: relative; }
.password-field input { padding-right: 68px !important; }
.password-toggle { position: absolute; top: 50%; right: 14px; padding: 5px 2px; border: 0; color: var(--primary); background: transparent; cursor: pointer; font-size: 13px; font-weight: 800; transform: translateY(-50%); }
.password-toggle:hover, .password-toggle:focus-visible { color: var(--primary-dark); text-decoration: underline; }
.auth-options { min-height: 24px; color: #415970; font-size: 14px; }
.auth-submit { width: 100%; min-height: 58px; border-radius: 8px; font-size: 16px; }
.auth-alternate { margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; }
.auth-alternate a { font-weight: 800; }

.workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 75px); }
.sidebar { padding: 24px 18px; border-right: 1px solid var(--line); background: #fff; }
.sidebar nav { position: sticky; top: 98px; display: grid; gap: 4px; }
.sidebar a { display: flex; align-items: center; min-height: 46px; padding: 0 14px; border-radius: 7px; color: #344d68; font-weight: 680; }
.sidebar a:hover { color: var(--primary); background: #f3f7fc; }
.sidebar a.active { color: var(--primary); background: var(--primary-soft); }
.content { width: 100%; max-width: 1540px; padding: 38px 42px 70px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }
.page-header h1 { margin: 0; }
.status-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: 12px; font-weight: 800; text-transform: capitalize; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; gap: 14px; }
.stat-tile { min-height: 118px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.stat-tile span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.stat-tile strong { display: block; margin-top: 8px; color: var(--ink); font-size: 31px; }

.panel { margin-bottom: 20px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 18px; }
.panel-heading h2 { margin: 0; }
.panel > :last-child { margin-bottom: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.toolbar form { display: flex; align-items: center; gap: 10px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { height: 44px; color: #486079; background: #f7f9fc; font-size: 12px; text-transform: uppercase; }
td { height: 56px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdff; }
.table-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; }
.field-full { grid-column: 1 / -1; }
.field label { color: #29445f; font-size: 13px; font-weight: 760; }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #bfd0e2;
    border-radius: 7px;
    color: var(--ink);
    background: #fff;
    outline: none;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(25, 103, 210, .12); }
.field small { color: var(--muted); }
.field-error { color: var(--danger); font-size: 12px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; }
.checkbox input { width: 18px; height: 18px; }

.flash { margin-bottom: 18px; padding: 13px 15px; border: 1px solid; border-radius: 7px; }
.flash ul { margin: 6px 0 0 18px; padding: 0; }
.flash-success { color: #116b3d; border-color: #bce6cf; background: var(--success-soft); }
.flash-error { color: #962522; border-color: #f0c3c1; background: var(--danger-soft); }

.empty-state { padding: 42px; border: 1px dashed #b8cbe1; border-radius: var(--radius); text-align: center; background: #fbfdff; }
.empty-state h2 { margin-bottom: 6px; }
.empty-state p { max-width: 520px; margin-right: auto; margin-left: auto; }
.progress-track { width: 100%; height: 8px; border-radius: 999px; background: #dce8f6; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.pagination { display: flex; margin-top: 18px; gap: 6px; }

.course-grid, .product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.course-card, .product-card { display: flex; min-height: 240px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); flex-direction: column; }
.course-card p, .product-card p { flex: 1; }
.course-card footer, .product-card footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.meta-list { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 13px; }

.learning-shell { display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: calc(100vh - 75px); }
.learning-outline { padding: 24px; border-right: 1px solid var(--line); background: #fff; }
.learning-content { min-width: 0; padding: 34px 42px 70px; }
.outline-session { margin-bottom: 20px; }
.outline-session h3 { margin-bottom: 8px; }
.outline-unit { display: flex; min-height: 42px; padding: 9px 10px; border-radius: 6px; color: #3f566f; align-items: center; justify-content: space-between; gap: 10px; }
.outline-unit.active { color: var(--primary); background: var(--primary-soft); }
.outline-unit.locked { color: #8797a8; pointer-events: none; }
.unit-stage { min-height: 500px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.unit-stage video, .video-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #06182d; }
.pdf-frame { width: 100%; height: 720px; border: 1px solid var(--line); }
.unit-navigation { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }

.guide-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); max-width: 1280px; margin: 0 auto; padding: 38px 32px 70px; gap: 34px; }
.guide-nav { position: sticky; top: 100px; align-self: start; display: grid; gap: 5px; }
.guide-nav a { padding: 10px 12px; border-radius: 6px; color: #405871; }
.guide-nav a.active { color: var(--primary); background: var(--primary-soft); }
.guide-content { min-width: 0; }
.guide-content section { margin-bottom: 22px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.guide-content code { padding: 2px 5px; border-radius: 4px; color: #8a3b08; background: #fff4df; }
.account-table code { white-space: nowrap; }

@media (max-width: 1180px) {
    .content { padding-right: 28px; padding-left: 28px; }
    .course-grid, .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
