:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --ink: #1b2033;
    --ink-soft: #5b6478;
    --line: #e5e9f2;
    --primary: #3b5bdb;
    --primary-dark: #2f49b0;
    --primary-soft: #eef2ff;
    --focus: #174cc7;
    --green: #18752b;
    --green-soft: #ebfbee;
    --red: #b42323;
    --red-soft: #fff0f0;
    --amber: #8a5200;
    --amber-soft: #fff4e0;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(20, 30, 60, .06), 0 8px 24px rgba(20, 30, 60, .05);
    font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

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

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 14px;
    color: var(--ink); background: var(--surface); border: 2px solid var(--focus);
    border-radius: 8px; transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
:where(a, button, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--focus); outline-offset: 3px;
}

/* ---------- Layout ---------- */
.layout {
    display: grid;
    grid-template-columns: 256px minmax(0, 1fr) clamp(300px, 19vw, 420px);
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 256px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 0;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.mobile-menu-toggle { display: none; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); width: 44px; height: 44px; font-size: 23px; line-height: 1; cursor: pointer; }

.company-badge {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    margin: 0 4px 16px;
}

.company-switch { margin: 0 4px 16px; }
.company-select { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--primary-dark); background: var(--primary-soft); cursor: pointer; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    min-height: 44px; padding: 9px 12px;
    border-radius: 10px;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 500;
}
.nav-item:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.nav-ico { font-size: 15px; width: 20px; text-align: center; }
.nav-counter { margin-left: auto; min-width: 20px; padding: 1px 6px; color: #fff; background: var(--red); border-radius: 20px; font-size: 10px; font-weight: 750; text-align: center; }

.sidebar-footer { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 0 4px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--ink-soft); }
.logout-form { margin: 0; }
.btn-logout {
    width: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--line);
    background: transparent; color: var(--ink-soft);
    border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.btn-logout:hover { background: var(--red-soft); color: var(--red); border-color: var(--red-soft); }

.content { width: auto; max-width: none; min-width: 0; padding: 32px clamp(28px, 2.4vw, 64px); }

/* ---------- Security news rail ---------- */
.news-rail { width: auto; min-width: 0; padding: 32px 24px 32px 0; }
.news-widget { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: thin; padding-right: 3px; }
.news-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 0 0 13px; }
.news-head h2 { margin: 2px 0 0; font-size: 18px; }
.news-kicker { color: var(--primary); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.news-live { color: var(--green); background: var(--green-soft); border-radius: 20px; padding: 4px 7px; font-size: 9px; font-weight: 800; letter-spacing: .05em; white-space: nowrap; }
.news-card { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; padding: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.news-card:hover { text-decoration: none; transform: translateY(-2px); border-color: #cbd3f2; box-shadow: 0 8px 28px rgba(35,49,105,.10); }
.news-card time { color: var(--primary); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.news-card strong { font-size: 13px; line-height: 1.35; }
.news-card span { color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.news-card i { color: var(--primary); font-size: 10px; font-style: normal; font-weight: 650; margin-top: 2px; }
.news-source { display: block; padding: 7px 2px; font-size: 11px; font-weight: 650; text-align: right; }
.news-empty { padding: 18px; color: var(--ink-soft); background: var(--surface); border: 1px dashed var(--line); border-radius: 13px; font-size: 12px; }
.news-loading { display: flex; flex-direction: column; gap: 10px; }
.news-loading span { display: block; height: 92px; border-radius: 13px; background: linear-gradient(90deg, #edf0f7 25%, #f8f9fc 50%, #edf0f7 75%); background-size: 200% 100%; animation: news-shimmer 1.4s infinite; }
@keyframes news-shimmer { to { background-position: -200% 0; } }

/* ---------- Registration approval ---------- */
.registration-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 16px; }
.registration-card { display: flex; flex-direction: column; min-width: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.registration-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.registration-card-head h2 { margin: 0 0 2px; font-size: 17px; }
.registration-card-head a { font-size: 12px; overflow-wrap: anywhere; }
.registration-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.registration-meta div { min-width: 0; }
.registration-meta dt { color: var(--ink-soft); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.registration-meta dd { margin: 3px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.registration-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 2px; border-top: 1px solid var(--line); }
.registration-actions form { margin-top: 14px; }

/* ---------- Typography / headers ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-size: 19px; font-weight: 650; margin: 28px 0 14px; }
.subtitle { color: var(--ink-soft); font-size: 14px; margin: 0; }
.section-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.course-content-actions details > summary { list-style: none; }
.course-content-actions details > summary::-webkit-details-marker { display: none; }
.course-content-actions details[open] { flex: 1 1 100%; }
.course-content-actions details[open] > summary { width: fit-content; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    min-height: 44px; padding: 9px 16px; border-radius: 10px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    border: 1px solid transparent; background: var(--primary); color: #fff;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { background: var(--bg); color: var(--ink); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #c92a2a; }
.btn-sm { min-height: 44px; padding: 6px 12px; font-size: 13px; }
.btn-success { background: var(--green); }
.btn-success:hover { background: #268a3b; }

/* ---------- Cards / stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 12px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.stat-link { color: inherit; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.stat-link:hover { color: inherit; text-decoration: none; transform: translateY(-2px); border-color: #cbd3f2; box-shadow: 0 8px 28px rgba(35,49,105,.10); }
.stat-label { color: var(--ink-soft); font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 750; letter-spacing: -.03em; }
.stat-sub { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

.card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }

/* ---------- Tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
    text-align: left; padding: 13px 16px; background: #fafbfe;
    font-size: 12px; font-weight: 600; color: var(--ink-soft);
    text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--line);
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafbfe; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-newbie { background: #f1f3f5; color: #495057; }
.badge-beginner { background: var(--primary-soft); color: var(--primary-dark); }
.badge-intermediate { background: var(--amber-soft); color: var(--amber); }
.badge-advanced { background: var(--green-soft); color: var(--green); }
.status-not_assigned { background: #f1f3f5; color: #495057; }
.status-in_progress { background: var(--primary-soft); color: var(--primary-dark); }
.status-suspended { background: var(--amber-soft); color: var(--amber); }
.status-completed { background: var(--green-soft); color: var(--green); }
.status-archived { background: #f1f3f5; color: #adb5bd; }

.badge-draft { background: #f1f3f5; color: #495057; }
.badge-scheduled { background: var(--amber-soft); color: var(--amber); }
.badge-running { background: var(--primary-soft); color: var(--primary-dark); }
.badge-finished { background: var(--green-soft); color: var(--green); }

/* ---------- Forms ---------- */
form.stacked { max-width: 560px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field input[type=url],
.field input[type=date], .field input[type=datetime-local], .field input[type=number],
.field input[type=password], .field select, .field textarea, input:not([type=checkbox]):not([type=radio]), select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line);
    border-radius: 10px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input:not([type=checkbox]):not([type=radio]), select { min-height: 44px; }
.field .helptext { font-size: 12px; color: var(--ink-soft); margin-top: 5px; }
.checkbox-list { display: flex; flex-direction: column; gap: 8px; }
.checkbox-list label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkbox-list input { width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.errorlist { color: var(--red); font-size: 13px; list-style: none; padding: 0; margin: 6px 0 0; }
.account-security-card { max-width: 680px; }
.security-card-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.security-card-heading h2 { margin: 0 0 4px; }
.security-card-icon {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); font-size: 20px;
}

img, video, iframe { max-width: 100%; }
pre { max-width: 100%; overflow-x: auto; }
.card, .table-wrap, .lesson-item { min-width: 0; }

/* ---------- Messages ---------- */
.messages { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.message { padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.message-success { background: var(--green-soft); color: var(--green); }
.message-error { background: var(--red-soft); color: var(--red); }
.message-info { background: var(--primary-soft); color: var(--primary-dark); }
.message-warning { background: #fff7e6; color: #8a5a00; border: 1px solid #f5d58b; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; }
.alert-warning { background: #fff7e6; color: #8a5a00; border: 1px solid #f5d58b; }

/* ---------- Progress bars ---------- */
.bar { height: 8px; background: var(--line); border-radius: 20px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 20px; }
.bar-fill.green { background: var(--green); }
.bar-fill.red { background: var(--red); }
.bar-fill.amber { background: var(--amber); }

.risk-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.risk-row .risk-name { width: 110px; font-size: 13px; font-weight: 500; }
.risk-row .bar { flex: 1; }
.risk-row .risk-count { width: 40px; text-align: right; font-weight: 600; font-size: 14px; }
.risk-row .risk-percent { width: 42px; color: var(--ink-soft); font-size: 12px; text-align: right; }

/* ---------- Toolbar ---------- */
.settings-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; flex-wrap: wrap; }
.stab { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.stab:hover { color: var(--ink); text-decoration: none; }
.stab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=text], .toolbar select { max-width: 240px; }
.toolbar .spacer { flex: 1; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.empty .empty-ico { font-size: 42px; margin-bottom: 12px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eef2ff, #f4f6fb); padding: 20px; }
.auth-card { background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(30,40,80,.12); padding: 40px; width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 6px; }
.auth-brand .brand-mark { color: var(--primary); font-size: 26px; }
.auth-brand .brand-name { font-size: 22px; font-weight: 700; }
.auth-title { margin: 10px 0 4px; text-align: center; font-size: 24px; }
.auth-sub { text-align: center; color: var(--ink-soft); font-size: 14px; margin-bottom: 28px; }
.auth-help { margin: 14px 0 0; color: var(--ink-soft); font-size: 12px; text-align: center; }
.choice-field { margin: 0 0 18px; padding: 0; border: 0; }
.choice-field legend { margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.choice-field > div { display: flex; gap: 12px; flex-wrap: wrap; }
.choice-field label { display: inline-flex; align-items: center; min-height: 44px; gap: 7px; cursor: pointer; }

/* ---------- Course cards ---------- */
.course-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.course-format { font-size: 12px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.course-title { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
.course-desc { font-size: 13px; color: var(--ink-soft); flex: 1; margin-bottom: 16px; }
.course-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-soft); }

/* ---------- Lesson list ---------- */
.lesson-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: var(--surface); }
.lesson-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.lesson-check.done { background: var(--green); border-color: var(--green); color: #fff; }
.lesson-title { flex: 1; font-weight: 500; }
.attach-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.attach-form { margin: 12px 0 0; }
.attach-form select { flex: 1 1 320px; max-width: 560px; }

.inline-form { display: inline; margin: 0; }
.confirm-card { max-width: 620px; }
.employee-name { font-weight: 600; }
.employee-secondary { margin-top: 4px; color: var(--ink-soft); font-size: 12px; }
.employee-group-badge { margin-right: 4px; }
.status-text-success { color: var(--green); }
.status-text-warning { color: var(--amber); }
.employee-action-cell { display: flex; justify-content: flex-end; align-items: center; gap: 8px; white-space: nowrap; }
.action-menu { position: relative; }
.action-menu > summary { list-style: none; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu-panel {
    position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 190px;
    padding: 6px; background: var(--surface); border: 1px solid var(--line);
    border-radius: 10px; box-shadow: var(--shadow);
}
.action-menu-panel form { margin: 0; }
.action-menu-item {
    display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 10px;
    color: var(--ink); background: transparent; border: 0; border-radius: 7px;
    font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.action-menu-item:hover { background: var(--bg); text-decoration: none; }
.action-menu-item.action-danger { color: var(--red); }
.test-attempt-card, .test-inline-result { margin-bottom: 18px; }
.test-inline-result h2 { margin-top: 0; }
.test-score { font-size: 40px; font-weight: 700; }
.test-progress {
    position: sticky; z-index: 5; top: 12px; margin-bottom: 16px; padding: 10px 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: var(--shadow); font-size: 14px;
}
.test-question { margin-bottom: 16px; }
.test-question-title { padding: 0 6px; font-size: 16px; font-weight: 700; }
.test-question-content { margin-bottom: 6px; }
.test-answers { display: flex; flex-direction: column; gap: 7px; }
.test-answer {
    display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px;
    border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.test-answer:hover { background: var(--bg); }
.test-answer:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--primary-soft); }
.test-answer:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.test-answer input { flex: 0 0 auto; margin-top: 4px; }
.test-question-error { margin: 10px 0 0; color: var(--red); font-size: 13px; font-weight: 600; }
.test-question-missing { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.test-result { max-width: 680px; margin: auto; text-align: center; }
.test-result-score { font-size: 64px; font-weight: 700; }
.test-result-score.passed { color: var(--green); }
.test-result-score.failed { color: var(--red); }
.test-result-actions { margin-top: 18px; }

@media (max-width: 900px) {
    .layout { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        z-index: 100; width: 100%; height: auto; position: sticky; top: 0;
        display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
        padding: 10px 14px; box-shadow: 0 4px 18px rgba(20, 30, 60, .08);
    }
    .brand { min-width: 0; padding: 0; }
    .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .company-badge, .company-switch { grid-column: 1 / -1; margin: 8px 0 0; }
    .nav { display: none; grid-column: 1 / -1; width: 100%; padding-top: 10px; }
    .sidebar-footer { display: none; grid-column: 1 / -1; width: 100%; }
    .sidebar.sidebar-open .nav { display: flex; }
    .sidebar.sidebar-open .sidebar-footer { display: block; }
    .nav-item { width: 100%; }
    .content { width: 100%; padding: 18px 14px 28px; }
    .news-rail { display: none; }
    .page-head { gap: 12px; margin-bottom: 18px; }
    .page-head > div { min-width: 0; }
    h1 { font-size: 22px; overflow-wrap: anywhere; }
    h2 { font-size: 18px; }
    .card { padding: 16px; margin-bottom: 14px; }
    .card-grid, .stat-grid, .registration-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 12px; }
    .registration-meta { grid-template-columns: 1fr; }
    .section-actions { width: 100%; }
    .section-actions > .btn, .section-actions > form, .section-actions > form .btn { flex: 1 1 100%; width: 100%; justify-content: center; }
    .course-content-actions > details, .course-content-actions > details > summary { width: 100%; }
    .course-content-actions > details > summary { justify-content: center; }
    form.stacked { max-width: none; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; justify-content: center; }
    .toolbar { align-items: stretch; }
    .toolbar > input, .toolbar > select, .toolbar > .btn { flex: 1 1 100%; width: 100%; max-width: none; }
    .lesson-item { align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 12px; }
    .lesson-title { min-width: calc(100% - 42px); overflow-wrap: anywhere; }
    .lesson-item > .btn { margin-left: 36px; }
    table.data { min-width: 680px; font-size: 13px; }
    table.data th, table.data td { padding: 10px 12px; }
    .risk-row .risk-name { width: 86px; }
    .auth-wrap { align-items: flex-start; padding: 16px; }
    .auth-card { padding: 24px 18px; margin-top: 20px; }
    .settings-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
    .stab { flex: 0 0 auto; }
    .employee-table { min-width: 0 !important; }
    .employee-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
    .employee-table, .employee-table tbody, .employee-table tr, .employee-table td { display: block; width: 100%; }
    .employee-table tbody { padding: 8px; }
    .employee-table .employee-row { margin-bottom: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
    .employee-table .employee-row:last-child { margin-bottom: 0; }
    .employee-table td { display: grid; grid-template-columns: minmax(105px, 36%) 1fr; gap: 10px; padding: 9px 8px; border-bottom: 1px solid var(--line); }
    .employee-table td::before { content: attr(data-label); color: var(--ink-soft); font-size: 11px; font-weight: 650; text-transform: uppercase; }
    .employee-table .employee-action-cell { display: flex; justify-content: flex-start; flex-wrap: wrap; white-space: normal; border-bottom: 0; }
    .employee-table .employee-action-cell::before { flex: 0 0 100%; }
    .action-menu-panel { position: fixed; left: 14px; right: 14px; top: auto; bottom: 14px; }
    .security-card-heading { gap: 10px; }
}

@media (min-width: 901px) and (max-width: 1350px) {
    .layout { grid-template-columns: 256px minmax(0, 1fr); }
    .news-rail { display: none; }
    .content { padding: 28px 32px; }
}

@media (min-width: 1800px) {
    .content { padding-left: clamp(48px, 3vw, 88px); padding-right: clamp(48px, 3vw, 88px); }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
