:root {
    --navy: #072b61;
    --navy-soft: #0d3a78;
    --blue: #2ea9df;
    --cyan: #6ed3f2;
    --lime: #d4de00;
    --text: #1c2e40;
    --ink: #10243a;
    --muted: #617487;
    --bg: #f4f7fa;
    --light: #f7fafc;
    --border: #d9e4ee;
    --green: #178f55;
    --red: #b83232;
    --warning: #7a5600;
    --status-success-bg: #e7f7ee;
    --status-success-text: #126f43;
    --status-error-bg: #fdecec;
    --status-error-text: #8a1f1f;
    --status-warning-bg: #fff4dc;
    --status-warning-text: #7a4f00;
    --status-info-bg: #e8f1fb;
    --status-info-text: #072b61;
    --status-neutral-bg: #eef3f7;
    --status-neutral-text: #1c2e40;
    --white: #fff;
    --shadow: 0 10px 28px rgba(7, 43, 97, .08);
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}

body.is-loading {
    cursor: progress;
}

a {
    color: var(--navy);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 3px solid rgba(46, 169, 223, .55);
    outline-offset: 3px;
}

.container {
    width: min(1160px, 92%);
    margin: auto;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: 1rem;
    z-index: 20;
    transform: translateY(-160%);
    border-radius: 8px;
    background: var(--lime);
    color: var(--navy);
    font-weight: 700;
    padding: .7rem 1rem;
}

.skip-link:focus {
    transform: translateY(0);
    outline-color: rgba(212, 222, 0, .95);
}

.page-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--lime), var(--blue), var(--cyan));
    opacity: 0;
    pointer-events: none;
    transform: scaleX(0);
    transform-origin: left center;
    transition: opacity .16s ease, transform .28s ease;
}

body.is-loading .page-loading-bar {
    opacity: 1;
    transform: scaleX(.82);
}

main {
    flex: 1 0 auto;
    min-width: 0;
    transition: opacity .16s ease, transform .16s ease;
}

body.is-loading main {
    opacity: .86;
    transform: translateY(2px);
}

@keyframes p1-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes p1-soft-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.page-header,
.next-step-card,
.training-progress-card,
.quiz-shell,
.quiz-result-card,
.certificate-card,
.empty-state,
.app-alert {
    animation: p1-fade-up 360ms ease both;
}

.home-hero .hero-copy > *,
.home-hero-visual,
.home-feature-grid > *,
.home-process-grid > *,
.training-module-grid > *,
.dashboard-kpi-grid > * {
    animation: p1-fade-up 420ms ease both;
}

.home-hero .hero-copy > :nth-child(2),
.home-feature-grid > :nth-child(2),
.home-process-grid > :nth-child(2),
.training-module-grid > :nth-child(2),
.dashboard-kpi-grid > :nth-child(2) { animation-delay: 50ms; }

.home-hero .hero-copy > :nth-child(3),
.home-feature-grid > :nth-child(3),
.home-process-grid > :nth-child(3),
.training-module-grid > :nth-child(3),
.dashboard-kpi-grid > :nth-child(3) { animation-delay: 100ms; }

.home-hero .hero-copy > :nth-child(4),
.home-process-grid > :nth-child(4),
.training-module-grid > :nth-child(4),
.dashboard-kpi-grid > :nth-child(4) { animation-delay: 150ms; }

/* Header and navigation */
.topbar {
    background: var(--navy);
    color: var(--white);
    border-bottom: 4px solid var(--lime);
}

.topbar .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--white);
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    display: block;
    width: auto;
    height: 58px;
}

.brand strong {
    font-size: 1.05rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav a,
.nav button {
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--white);
    cursor: pointer;
    font: inherit;
    padding: .45rem .55rem;
}

.nav form {
    margin: 0;
}

.nav a:hover,
.nav button:hover,
.nav a[aria-current="page"] {
    background: rgba(255, 255, 255, .14);
    text-decoration: none;
}

.nav.is-open {
    animation: p1-soft-in 180ms ease both;
}

.nav a,
.language-switcher summary {
    min-height: 40px;
}

.nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.nav .icon {
    width: 1rem;
    height: 1rem;
}

.topbar--app {
    box-shadow: 0 8px 24px rgba(7, 43, 97, .14);
}

.topbar--app .container {
    width: min(100% - 32px, 1480px);
}

.topbar--app .inner {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: clamp(24px, 3vw, 48px);
    min-height: 78px;
}

.topbar--app .brand {
    width: max-content;
    max-width: 100%;
    padding-right: clamp(10px, 2vw, 28px);
    border-right: 1px solid rgba(255, 255, 255, .18);
}

.topbar--app .brand strong {
    line-height: 1.2;
    white-space: nowrap;
}

.nav--authenticated {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    justify-self: stretch;
    gap: clamp(16px, 2.2vw, 28px);
    width: 100%;
    min-width: 0;
}

.nav--authenticated a,
.nav--authenticated button,
.nav-login,
.nav-cta {
    font-weight: 800;
}

.nav__main,
.nav__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.nav__main {
    justify-content: flex-start;
    flex: none;
    flex-wrap: nowrap;
    overflow: visible;
}

.nav__actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, .18);
}

.nav--authenticated a,
.nav--authenticated button,
.nav--authenticated .language-switcher summary {
    flex: 0 0 auto;
    white-space: nowrap;
}

.nav--authenticated a,
.nav--authenticated button {
    padding: .52rem .62rem;
}

.nav--authenticated a[aria-current="page"] {
    background: rgba(255, 255, 255, .18);
    box-shadow: inset 0 -2px 0 var(--lime);
}

.nav-logout {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

@media (min-width: 1181px) and (max-width: 1450px) {
    .topbar--app .brand__label {
        display: none;
    }

    .topbar--app .brand {
        padding-right: 12px;
    }

    .topbar--app .inner,
    .nav--authenticated {
        column-gap: 14px;
    }

    .nav__main,
    .nav__actions {
        gap: 4px;
    }
}

.topbar--guest {
    box-shadow: 0 6px 22px rgba(7, 43, 97, .12);
}

.nav-cta {
    border: 1px solid rgba(110, 211, 242, .55) !important;
    background: rgba(46, 169, 223, .18) !important;
    font-weight: 800;
}

.nav-login {
    font-weight: 700;
}

.sr-only {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    margin: -1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.language-switcher {
    position: relative;
}

.language-switcher summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    list-style: none;
    padding: .45rem .55rem;
}

.language-switcher summary::-webkit-details-marker {
    display: none;
}

.language-switcher summary::after {
    content: "▾";
    font-size: .75rem;
}

.language-switcher[open] summary,
.language-switcher summary:hover {
    background: rgba(255, 255, 255, .14);
}

.language-switcher__menu {
    position: absolute;
    right: 0;
    z-index: 30;
    display: grid;
    min-width: 190px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 10px;
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 6px;
}

.language-switcher__menu form {
    margin: 0;
}

.language-switcher__menu button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    padding: 9px 10px;
    text-align: left;
}

.language-switcher__menu button:hover,
.language-switcher__menu button:focus-visible,
.language-switcher__menu button[aria-current="true"] {
    background: #e8f1fb;
    color: var(--navy);
}

.admin-subnav {
    border-bottom: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 10px 22px rgba(7, 43, 97, .06);
}

.admin-subnav__inner {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    overflow-x: auto;
    padding-block: 8px;
}

.admin-subnav a {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--navy);
    font-weight: 800;
    padding: 8px 12px;
    text-decoration: none;
}

.admin-subnav a:hover,
.admin-subnav a[aria-current="page"] {
    border-color: rgba(46, 169, 223, .28);
    background: var(--status-info-bg);
}

.admin-subnav .icon {
    width: 1rem;
    height: 1rem;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 9px;
    background: rgba(255, 255, 255, .1);
    color: var(--white);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: .65rem .85rem;
}

/* Layout */
.section {
    min-width: 0;
    padding: 42px 0;
}

.training-visual {
    margin: 1.25rem 0 1.45rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 28px rgba(7, 43, 97, .08);
    overflow: hidden;
}

.training-visual__media {
    overflow: hidden;
    background: #eef7fc;
    aspect-ratio: 16 / 9;
}

.training-visual__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.training-visual__caption {
    border-top: 1px solid var(--border);
    color: var(--text);
    font-size: .95rem;
    line-height: 1.45;
    padding: .85rem 1rem;
}

.stack > * + * {
    margin-top: 20px;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 24px;
}

.section-heading > *:first-child {
    margin-top: 0;
}

.section-heading h1 {
    margin-bottom: .4rem;
}

.muted {
    color: var(--muted);
}

.hero {
    background: linear-gradient(135deg, #0f2038, #0d4b87);
    color: var(--white);
    padding: 70px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 36px;
    align-items: center;
    min-width: 0;
}

.hero-grid > * {
    min-width: 0;
}

.hero h1 {
    margin: 0 0 18px;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.05;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.hero p {
    max-width: 720px;
    font-size: 1.1rem;
}

.hero-copy {
    max-width: 760px;
    min-width: 0;
}

.card.home-hero-visual {
    display: grid;
    overflow: hidden;
    gap: 0;
    align-content: center;
    justify-items: center;
    border-color: rgba(255, 255, 255, .35);
    background: linear-gradient(160deg, #062a5f, #0d3a78);
    padding: 0;
}

.home-hero-visual p {
    margin: 0;
    width: 100%;
    max-width: none;
    border-top: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .08);
    color: var(--white);
    padding: 20px 24px 24px;
    text-align: center;
}

.home-logo-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 0;
    background: #05285b;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
    padding: clamp(12px, 3vw, 22px);
}

.home-logo-panel .logo-large {
    display: block;
    width: min(94%, 340px);
    max-width: none;
    max-height: 92%;
    height: auto;
    object-fit: contain;
}

.home-feature-grid {
    align-items: stretch;
}

.home-feature-card {
    border-top: 4px solid var(--blue);
}

.home-feature-card h2 {
    margin-top: 0;
}

.home-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-color: #082d5e;
    background-image: url("../images/home/paper-production-line.jpg");
    background-position: left center;
    background-repeat: no-repeat;
    background-size: 145% auto;
    padding: 82px 0 74px;
}

.home-hero::before {
    position: absolute;
    inset: 0;
    content: "";
    z-index: 0;
    background: linear-gradient(90deg, rgba(4, 27, 60, .84) 0%, rgba(5, 37, 78, .66) 48%, rgba(6, 70, 123, .38) 100%);
    pointer-events: none;
}

.home-hero .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .92);
    color: var(--navy);
    box-shadow: 0 10px 24px rgba(7, 43, 97, .18);
}

.home-hero .hero-copy > p {
    color: rgba(255, 255, 255, .94);
    font-size: 1.12rem;
    line-height: 1.7;
}

.hero-proof-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 26px;
}

.hero-proof-list span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: var(--white);
    font-size: .92rem;
    font-weight: 800;
    padding: 8px 12px;
}

.btn-lg {
    min-height: 48px;
    padding: 13px 20px;
}

.btn .icon,
.btn-lg .icon {
    margin-right: 3px;
}

.home-hero-summary {
    width: 100%;
    background: rgba(3, 25, 56, .64);
    padding: 22px 24px 24px;
}

.home-hero-summary p {
    border-top: 0;
    background: transparent;
    padding: 0;
    text-align: left;
}

.home-hero-summary ul {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
}

.home-hero-summary li {
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    color: rgba(255, 255, 255, .94);
    font-weight: 800;
}

.home-hero-summary .icon {
    color: var(--lime);
}

.feature-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-height: 176px;
}

.feature-card__icon,
.process-step__icon,
.auth-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--status-info-bg);
    color: var(--navy);
}

.feature-card__icon {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
}

.feature-card h2 {
    margin: .2rem 0 .55rem;
    color: var(--navy);
    font-size: 1.35rem;
}

.feature-card p {
    margin: 0;
    color: var(--text);
}

.home-process-section {
    background: linear-gradient(180deg, #f8fbfd, #eef5fa);
    border-top: 1px solid var(--border);
}

.home-process-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.process-step {
    position: relative;
    min-height: 210px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 22px;
}

.process-step__number {
    position: absolute;
    top: 18px;
    right: 18px;
    color: rgba(7, 43, 97, .16);
    font-size: 2.6rem;
    font-weight: 900;
    line-height: 1;
}

.process-step__icon {
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    color: var(--blue);
}

.process-step h3 {
    margin: 0 0 8px;
    color: var(--navy);
}

.process-step p {
    margin: 0;
    color: var(--muted);
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 34px rgba(7, 43, 97, .11);
}

.card > h2:first-child,
.card > h3:first-child {
    margin-top: 0;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.icon {
    width: 1.15em;
    height: 1.15em;
    flex: 0 0 auto;
    vertical-align: -0.18em;
}

.mt-2 {
    margin-top: 20px;
}

.mt-3 {
    margin-top: 28px;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: var(--blue);
    color: var(--white);
    cursor: pointer;
    font-weight: 700;
    padding: 11px 18px;
    transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(46, 169, 223, .25);
    text-decoration: none;
}

.btn:disabled,
.btn.is-submitting,
button:disabled {
    cursor: progress;
    opacity: .68;
}

.btn-secondary {
    background: #e8eef5;
    color: var(--text);
}

.btn-navy {
    background: var(--navy);
}

.btn-danger {
    background: var(--red);
}

.btn-sm {
    padding: 7px 12px;
    font-size: .9rem;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}

.form-group .help {
    margin: 7px 0 0;
}

.required-note {
    color: var(--muted);
    font-size: .92rem;
    margin: 0 0 18px;
}

.required-marker {
    color: var(--red);
    font-weight: 800;
}

.form-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    font: inherit;
    padding: 11px 12px;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.form-control:focus {
    outline: 3px solid rgba(46, 169, 223, .22);
    border-color: var(--blue);
}

.form-control[readonly] {
    background: #f4f8fb;
    color: var(--ink);
}

.form-control[aria-invalid="true"] {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(177, 45, 45, .12);
}

.help {
    color: var(--muted);
    font-size: .88rem;
}

.dashboard-category-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
}

.dashboard-category-picker label {
    grid-column: 1 / -1;
    font-weight: 700;
}

.field-error {
    margin: 7px 0 0;
    color: var(--red);
    font-size: .9rem;
    font-weight: 700;
}

.empty-state {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
    min-height: 112px;
    padding: 22px;
    color: var(--muted);
    text-align: left;
}

.empty-state__icon {
    display: inline-grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    color: var(--blue);
    border-radius: 50%;
    background: var(--status-info-bg);
    place-items: center;
}

.empty-state__icon .icon {
    width: 21px;
    height: 21px;
}

.empty-state h3,
.empty-state p {
    margin: 0;
}

.empty-state h3 {
    color: var(--navy);
    font-size: 1rem;
}

.empty-state p {
    margin-top: 3px;
    font-size: .92rem;
}

.error-page {
    max-width: 760px;
    margin: 0 auto;
}

.error-code {
    color: var(--muted);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.alert {
    border-radius: 10px;
    margin: 18px auto;
    padding: 13px 16px;
}

.alert-success {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.alert-error {
    background: var(--status-error-bg);
    color: var(--status-error-text);
}

.alert-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.alert-info {
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

.app-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid transparent;
}

.app-alert__icon {
    margin-top: 2px;
    font-size: 1.3rem;
}

.app-alert__content {
    min-width: 0;
}

.app-alert__content p {
    margin: .25rem 0 0;
}

.app-alert--success {
    border-color: rgba(18, 111, 67, .18);
}

.app-alert--error {
    border-color: rgba(138, 31, 31, .18);
}

.app-alert--warning {
    border-color: rgba(122, 79, 0, .18);
}

.app-alert--info {
    border-color: rgba(7, 43, 97, .16);
}

.badge {
    display: inline-block;
    border-radius: 999px;
    background: #e8f1fb;
    color: var(--navy);
    font-size: .82rem;
    font-weight: 700;
    padding: 5px 10px;
}

.badge-green {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.badge-red {
    background: var(--status-error-bg);
    color: var(--status-error-text);
}

.status-badge,
.visual-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.2;
    padding: 6px 10px;
    vertical-align: middle;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.status-badge .icon {
    width: 1rem;
    height: 1rem;
}

.status-badge--success,
.status-badge--completed,
.status-badge--passed,
.status-badge--valid,
.status-badge--used {
    border-color: rgba(18, 111, 67, .18);
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.status-badge--error,
.status-badge--failed,
.status-badge--revoked,
.status-badge--blocked {
    border-color: rgba(138, 31, 31, .18);
    background: var(--status-error-bg);
    color: var(--status-error-text);
}

.status-badge--warning,
.status-badge--expired,
.status-badge--pending,
.status-badge--required {
    border-color: rgba(122, 79, 0, .18);
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.status-badge--info,
.status-badge--in_progress,
.status-badge--optional {
    border-color: rgba(7, 43, 97, .14);
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

.status-badge--neutral,
.status-badge--todo {
    border-color: rgba(28, 46, 64, .1);
    background: var(--status-neutral-bg);
    color: var(--status-neutral-text);
}

.progress {
    overflow: hidden;
    height: 12px;
    border-radius: 99px;
    background: #dce6ee;
}

.progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    transition: width .45s ease;
}

.progress-status--success span,
.progress-status--completed span,
.progress-status--passed span,
.progress-status--valid span {
    background: linear-gradient(90deg, var(--green), #45bf7f);
}

.progress-status--warning span {
    background: linear-gradient(90deg, #c98300, #f2b544);
}

.progress-status--info span,
.progress-status--in_progress span {
    background: linear-gradient(90deg, var(--blue), #6ac5ec);
}

.progress-status--error span {
    background: linear-gradient(90deg, var(--red), #e05959);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 24px;
}

.page-header__main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    max-width: 820px;
}

.page-header__icon,
.kpi-card__icon,
.metric-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--status-info-bg);
    color: var(--navy);
}

.page-header__icon {
    width: 46px;
    height: 46px;
    font-size: 1.35rem;
}

.page-header h1 {
    margin: .45rem 0 .4rem;
}

.page-header p {
    margin: 0;
}

.page-header__aside {
    flex: 0 0 auto;
}

.kpi-card {
    display: grid;
    gap: 10px;
}

.kpi-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 800;
}

.kpi-card__icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
}

.kpi-card--success,
.kpi-card--completed,
.kpi-card--passed,
.kpi-card--valid {
    border-color: rgba(23, 143, 85, .24);
}

.kpi-card--success .kpi-card__icon,
.kpi-card--completed .kpi-card__icon,
.kpi-card--passed .kpi-card__icon,
.kpi-card--valid .kpi-card__icon {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.kpi-card--warning .kpi-card__icon {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.kpi-card--error .kpi-card__icon,
.kpi-card--failed .kpi-card__icon {
    background: var(--status-error-bg);
    color: var(--status-error-text);
}

.kpi-card--neutral .kpi-card__icon {
    background: var(--status-neutral-bg);
    color: var(--status-neutral-text);
}

.kpi strong {
    display: block;
    color: var(--navy);
    font-size: 2rem;
    line-height: 1.15;
}

.kpi span {
    color: var(--muted);
    font-weight: 700;
}

.identity-summary {
    margin-bottom: 24px;
}

.identity-summary h2 {
    margin: 0 0 16px;
    font-size: 1.25rem;
}

.identity-summary__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}

.identity-summary__grid div {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--light);
}

.identity-summary dt {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.identity-summary dd {
    margin: 0;
    color: var(--navy);
    font-size: 1.05rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.footer {
    flex: 0 0 auto;
    border-top: 4px solid var(--lime);
    background: linear-gradient(135deg, var(--navy), #0b3a78);
    color: rgba(255, 255, 255, .78);
    font-size: .9rem;
    padding: 24px 0;
}

.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.footer strong {
    display: block;
    color: var(--white);
    font-size: .95rem;
    letter-spacing: .04em;
}

.footer p {
    margin: 4px 0 0;
}

.footer__brand {
    min-width: 220px;
}

.footer__brand span {
    display: inline-block;
    margin-top: 6px;
    color: rgba(255, 255, 255, .62);
    font-size: .82rem;
}

.footer__steps {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.footer__steps li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    list-style: none;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: var(--white);
    font-size: .82rem;
    font-weight: 800;
    padding: 6px 10px;
}

.footer__steps .icon {
    width: .98rem;
    height: .98rem;
    color: var(--cyan);
}

.footer__copyright {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, .7);
    font-size: .82rem;
    text-align: right;
}

.auth-card {
    width: min(560px, 92%);
    margin: 50px auto;
}

.auth-card__header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.auth-card__icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--status-info-bg), #dff4fb);
    color: var(--navy);
    font-size: 1.3rem;
}

.auth-card__header h1 {
    margin: .35rem 0 .45rem;
    color: var(--navy);
}

.auth-card__header .badge {
    margin-bottom: 4px;
}

.auth-card__header .required-note {
    margin-bottom: 0;
}

.kiosk-home .btn {
    font-size: 1.1rem;
    min-height: 52px;
    min-width: 180px;
}

.kiosk-timeout {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(7, 43, 97, .72);
    padding: 24px;
}

.kiosk-timeout.is-visible {
    display: flex;
}

.kiosk-timeout__panel {
    width: min(520px, 100%);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 20px 50px rgba(7, 43, 97, .28);
    padding: 28px;
}

.kiosk-timeout__panel h2 {
    color: var(--navy);
    margin-top: 0;
}

.kiosk-finish-form {
    margin-top: 18px;
}

.logo-large {
    width: 100%;
    max-width: 230px;
    height: auto;
}

/* Training */
.next-step-card,
.training-progress-card {
    display: grid;
    gap: 14px;
}

.next-step-card__heading,
.module-card__meta,
.lesson-content__meta,
.correction-card__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.next-step-card__heading h2 {
    margin: 0;
}

.next-step-card--primary {
    border-left: 4px solid var(--cyan);
    box-shadow: 0 12px 30px rgba(7, 43, 97, .10);
}

.next-step-card--primary .actions {
    padding-top: 2px;
}

.dashboard-category-card {
    border-top: 3px solid var(--border);
}

.training-category-heading {
    align-items: center;
    display: flex;
    gap: 12px;
}

.training-category-heading .page-header__icon {
    flex: 0 0 auto;
}

.training-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.module-card h3 {
    margin-top: .75rem;
}

.module-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.module-card.is-completed {
    border-color: rgba(23, 143, 85, .38);
    box-shadow: 0 12px 30px rgba(23, 143, 85, .10);
}

.module-card > .btn {
    align-self: flex-start;
    margin-top: auto;
}

.module-completed-badge {
    flex: 0 0 auto;
}

.module-validation-note {
    margin: 16px 0;
}

.training-ready {
    display: grid;
    gap: 10px;
}

.training-ready .app-alert__content {
    display: grid;
    gap: 10px;
}

.lesson-list {
    display: grid;
    gap: 12px;
}

.lesson-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}

.sidebar-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 24px;
}

.sidebar {
    height: max-content;
    border-radius: 12px;
    background: #eef3f7;
    padding: 12px;
}

.sidebar a {
    display: grid;
    gap: 8px;
    border-radius: 8px;
    margin: 4px 0;
    padding: 11px 13px;
}

.sidebar a.active,
.sidebar a[aria-current="page"] {
    background: var(--blue);
    color: var(--white);
}

.lesson-content h2 {
    margin-top: 1.6rem;
    color: var(--navy);
}

.lesson-content li {
    margin: .45rem 0;
}

.lesson-content__meta {
    margin-bottom: 14px;
}

/* Quiz */
.quiz-shell {
    display: grid;
    gap: 22px;
}

.quiz-condition-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quiz-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.question {
    margin-bottom: 26px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
    padding: 22px;
}

.question legend,
.question-title {
    display: block;
    margin-bottom: 14px;
    color: var(--navy);
    font-size: 1.18rem;
    font-weight: 700;
}

.question-legend {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.question-number-pill {
    background: var(--status-info-bg);
    border-radius: 999px;
    color: var(--status-info-text);
    display: inline-flex;
    font-size: .95rem;
    font-weight: 800;
    padding: 7px 12px;
}

.question-title {
    align-items: center;
    display: flex;
    gap: 8px;
}

.option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 8px 0;
    padding: 12px;
    transition: border-color .16s ease, background-color .16s ease;
}

.option:hover,
.option:focus-within {
    border-color: var(--blue);
    background: #f7fbfe;
}

.result-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
}

.quiz-result-card {
    border-top: 5px solid var(--status-info-text);
}

.quiz-result-card--passed {
    border-top-color: var(--status-success-text);
}

.quiz-result-card--failed {
    border-top-color: var(--status-error-text);
}

.score-pill {
    border-radius: 16px;
    background: #eef7fc;
    color: var(--navy);
    font-size: 2rem;
    font-weight: 700;
    padding: 18px 24px;
    text-align: center;
}

.correction-list {
    display: grid;
    gap: 16px;
}

.correction-card {
    border-left-width: 5px;
}

.correction-card--success {
    border-left-color: var(--status-success-text);
}

.correction-card--error {
    border-left-color: var(--status-error-text);
}

.expected-answer {
    background: var(--status-info-bg);
    border-radius: 8px;
    color: var(--status-info-text);
    padding: 10px 12px;
}

/* Certificates and admin */
.certificate-status {
    display: inline-flex;
    border-radius: 999px;
    font-weight: 700;
    padding: 6px 12px;
}

.certificate-status.is-valid {
    background: #e7f7ee;
    color: #126f43;
}

.certificate-status.is-invalid {
    background: #fdecec;
    color: #8a1f1f;
}

.certificate-card {
    max-width: 820px;
    margin: 0 auto;
}

.definition-list {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: 12px 18px;
}

.definition-list dt {
    color: var(--muted);
    font-weight: 700;
}

.definition-list dd {
    margin: 0;
}

.back-link,
.table-action-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 800;
    text-decoration: none;
}

.back-link {
    margin-bottom: 18px;
}

.table-action-link {
    border-radius: 999px;
    background: var(--status-info-bg);
    color: var(--navy);
    padding: 6px 10px;
}

.table-action-link:hover {
    background: #d8edf8;
    text-decoration: none;
}

.admin-filter-card .actions {
    align-items: flex-end;
}

.admin-filter-card label {
    min-width: 90px;
}

.admin-filter-card .form-control {
    flex: 1 1 260px;
}

.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    border: 0;
}

.table-responsive th,
.table-responsive td {
    white-space: nowrap;
}

.table-empty-cell {
    white-space: normal;
}

.table-empty-row td {
    padding: 0;
}

.analytics-filter-card .grid {
    align-items: end;
}

.analytics-page {
    background: #f3f7fa;
}

.analytics-page .page-header {
    margin-bottom: 22px;
}

.analytics-filter-card {
    border-top: 3px solid var(--cyan);
}

.analytics-kpi-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.analytics-kpi-grid .kpi-card {
    min-height: 150px;
}

.analytics-attention {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(8, 53, 111, .06);
    padding: 22px;
}

.analytics-attention__header,
.analytics-card__header {
    align-items: start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.analytics-attention__header .help,
.analytics-card__header .help {
    margin: 0;
    max-width: 360px;
}

.analytics-attention__grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 18px;
}

.analytics-attention__item {
    align-items: center;
    background: #f6f9fb;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: grid;
    gap: 8px;
    grid-template-columns: auto 1fr;
    padding: 14px;
}

.analytics-attention__item .icon {
    color: var(--muted);
    height: 20px;
    width: 20px;
}

.analytics-attention__item span {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 800;
    line-height: 1.3;
}

.analytics-attention__item strong {
    color: var(--navy);
    font-size: 1.55rem;
    grid-column: 2;
    line-height: 1;
}

.analytics-attention__item.is-warning {
    background: #fff9e5;
    border-color: #edcf68;
}

.analytics-attention__item.is-warning .icon,
.analytics-attention__item.is-warning strong {
    color: #8a6900;
}

.analytics-attention__item.is-danger {
    background: #fff2f2;
    border-color: #eaa6a6;
}

.analytics-attention__item.is-danger .icon,
.analytics-attention__item.is-danger strong {
    color: var(--red);
}

.analytics-chart-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-card {
    display: grid;
    gap: 18px;
}

.analytics-card h2 {
    margin-bottom: 4px;
}

.analytics-card__header {
    gap: 14px;
}

.analytics-card--wide {
    grid-column: span 2;
}

.analytics-chart {
    height: 290px;
    position: relative;
}

.analytics-chart--profile {
    height: 260px;
}

.analytics-chart canvas {
    height: 100% !important;
    max-width: 100%;
    width: 100% !important;
}

.analytics-chart__details {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .9rem;
    padding-top: 14px;
}

.analytics-chart__details summary {
    cursor: pointer;
    font-weight: 800;
}

.analytics-chart__details .table-responsive {
    margin-top: 12px;
}

.analytics-doughnut {
    height: 245px;
    margin: 0 auto;
    max-width: 340px;
    position: relative;
}

.analytics-doughnut canvas {
    height: 100% !important;
    width: 100% !important;
}

.analytics-doughnut__center {
    align-items: center;
    display: flex;
    flex-direction: column;
    inset: 0;
    justify-content: center;
    pointer-events: none;
    position: absolute;
}

.analytics-doughnut__center strong {
    color: var(--navy);
    font-size: 1.65rem;
}

.analytics-doughnut__center span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.analytics-metric-list {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

.analytics-metric-list div {
    background: #f6f9fb;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
}

.analytics-metric-list dt {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 800;
}

.analytics-metric-list dd {
    color: var(--navy);
    font-size: 1.15rem;
    font-weight: 900;
    margin: 5px 0 0;
}

.analytics-metric-list--profiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-empty-state {
    align-items: center;
    background: #f6f9fb;
    border: 1px dashed #b6c9d7;
    color: var(--muted);
    display: flex;
    font-weight: 700;
    justify-content: center;
    min-height: 245px;
    padding: 24px;
    text-align: center;
}

.analytics-funnel {
    display: grid;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.analytics-funnel li {
    display: grid;
    gap: 7px;
}

.analytics-funnel__label {
    align-items: baseline;
    color: var(--muted);
    display: flex;
    font-weight: 800;
    justify-content: space-between;
}

.analytics-funnel__label strong {
    color: var(--navy);
    font-size: 1.05rem;
}

.analytics-funnel__bar {
    background: var(--cyan);
    border-radius: 4px;
    height: 15px;
    min-width: 8%;
}

.analytics-funnel li:nth-child(2) .analytics-funnel__bar { background: #2083bf; }
.analytics-funnel li:nth-child(3) .analytics-funnel__bar { background: #176ca1; }
.analytics-funnel li:nth-child(4) .analytics-funnel__bar { background: var(--green); }
.analytics-funnel li:nth-child(5) .analytics-funnel__bar { background: var(--navy); }

.analytics-table-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-status-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.analytics-status-grid div {
    background: #f6f9fb;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}

.analytics-status-grid div.is-attention {
    background: #fff9e5;
    border-color: #edcf68;
}

.analytics-status-grid div.is-attention strong {
    color: #8a6900;
}

.analytics-status-grid span {
    color: var(--muted);
    display: block;
    font-size: .88rem;
    font-weight: 800;
}

.analytics-status-grid strong {
    color: var(--navy);
    display: block;
    font-size: 1.45rem;
    margin-top: 6px;
}

.analytics-table-status {
    border-radius: 999px;
    color: var(--navy);
    display: inline-flex;
    font-weight: 900;
    min-width: 24px;
}

.analytics-table-status.is-danger {
    background: #fff0f0;
    color: var(--red);
    padding: 2px 8px;
}

table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    background: var(--white);
}

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 11px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eef3f7;
    color: var(--navy);
    font-size: .86rem;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.validation-ok {
    color: var(--green);
}

.validation-ko {
    color: var(--red);
}

.validation-ok,
.validation-ko,
.field-error {
    align-items: center;
    display: flex;
    gap: 8px;
}

.invitation-link-field {
    min-width: 260px;
    font-size: .92rem;
}

.invitation-qr {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
    padding: 10px;
}

.invitation-qr svg {
    width: 132px;
    height: 132px;
}

.btn-danger {
    background: var(--red);
    color: var(--white);
}

.btn-danger:hover {
    box-shadow: 0 8px 20px rgba(180, 35, 24, .22);
}

.module-progress-card {
    margin-bottom: 18px;
}

.module-progress-text {
    color: var(--muted);
    font-size: .95rem;
    margin: 10px 0;
}

.progress-compact {
    height: 8px;
    margin: 10px 0 16px;
}

.lesson-state {
    color: var(--green);
    display: block;
    font-size: .78rem;
    font-weight: 700;
    margin-top: 4px;
}

.question.has-error {
    border-color: rgba(180, 35, 24, .65);
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .08);
}

.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-nav a {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--navy);
    font-weight: 700;
    padding: 8px 12px;
    text-decoration: none;
}

.training-category-list {
    display: grid;
    gap: 28px;
}

.training-category-section {
    scroll-margin-top: 90px;
}

.section-heading-compact {
    margin-bottom: 14px;
}

@media (max-width: 1180px) {
    .topbar--app .inner {
        column-gap: 18px;
    }

    .topbar--app .brand {
        gap: 0;
        padding-right: 18px;
    }

    .topbar--app .brand__label {
        display: none;
    }

    .nav--authenticated {
        gap: 12px;
    }

    .nav__main,
    .nav__actions {
        gap: 5px;
    }

    .nav--authenticated a,
    .nav--authenticated button,
    .nav--authenticated .language-switcher summary {
        font-size: .9rem;
        padding-inline: .48rem;
    }

    .topbar--app .inner {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 0;
    }

    .topbar--app .brand {
        max-width: calc(100% - 92px);
        padding-right: 0;
        border-right: 0;
    }

    .topbar--app .nav-toggle {
        display: inline-flex;
        justify-self: end;
    }

    .nav--authenticated {
        grid-column: 1 / -1;
        display: none;
        width: 100%;
        grid-template-columns: 1fr;
        padding: 0 0 14px;
    }

    .nav--authenticated.is-open {
        display: grid;
    }

    .nav__main,
    .nav__actions {
        display: grid;
        width: 100%;
        gap: 8px;
    }

    .nav__actions {
        justify-content: stretch;
        padding-top: 10px;
        padding-left: 0;
        border-top: 1px solid rgba(255, 255, 255, .18);
        border-left: 0;
    }

    .nav--authenticated a,
    .nav--authenticated button,
    .nav--authenticated .language-switcher summary {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }

    .topbar--app .language-switcher,
    .topbar--app .language-switcher summary {
        width: 100%;
    }

    .topbar--app .language-switcher__menu {
        position: static;
        width: 100%;
        box-shadow: none;
    }
}

@media (max-width: 850px) {
    .home-hero {
        background-position: 38% center;
    }

    .hero-grid,
    .grid-2,
    .grid-3,
    .grid-4,
    .quiz-condition-grid,
    .sidebar-layout,
    .result-summary,
    .home-process-grid {
        grid-template-columns: 1fr;
    }

    .identity-summary__grid {
        grid-template-columns: 1fr;
    }

    .topbar .inner {
        min-height: 64px;
    }

    .topbar--app .inner {
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 12px;
        row-gap: 0;
    }

    .topbar--app .brand {
        max-width: calc(100% - 92px);
        padding-right: 0;
        border-right: 0;
    }

    .brand img {
        height: 48px;
    }

    .nav-toggle {
        display: inline-flex;
        justify-self: end;
    }

    .nav {
        grid-column: 1 / -1;
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 0 0 14px;
    }

    .nav.is-open {
        display: flex;
    }

    .nav--authenticated {
        gap: 10px;
    }

    .nav__main,
    .nav__actions {
        display: grid;
        width: 100%;
        gap: 8px;
    }

    .nav__actions {
        padding-top: 10px;
        padding-left: 0;
        border-top: 1px solid rgba(255, 255, 255, .18);
        border-left: 0;
    }

    .nav a,
    .nav button {
        width: 100%;
        text-align: left;
    }

    .nav a,
    .nav button,
    .nav-logout {
        justify-content: flex-start;
    }

    .language-switcher,
    .language-switcher summary {
        width: 100%;
    }

    .language-switcher__menu {
        position: static;
        width: 100%;
        box-shadow: none;
    }

    .admin-subnav__inner {
        width: min(100% - 24px, 1160px);
    }

    .lesson-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-category-picker {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-hero .hero-grid {
        display: flex;
        flex-direction: column;
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        min-width: 0;
    }

    .home-hero .hero-copy,
    .home-hero .home-hero-visual {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-header,
    .page-header__main {
        flex-direction: column;
    }

    .home-process-grid {
        gap: 14px;
    }

    .process-step {
        min-height: auto;
    }
}

@media (max-width: 560px) {
    .hero {
        padding: 48px 0;
    }

    .home-hero {
        background-position: 32% center;
    }

    .home-hero .hero-copy,
    .home-hero .hero-copy > p,
    .home-hero .hero-proof-list,
    .home-hero .actions {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .home-hero .container {
        width: calc(100% - 24px);
        max-width: 1160px;
    }

    .home-hero h1 {
        max-width: 100%;
        width: 100%;
        display: block;
        width: calc(100vw - 24px) !important;
        inline-size: calc(100vw - 24px);
        max-inline-size: min(100%, 280px);
        white-space: normal !important;
        font-size: clamp(1.85rem, 8.4vw, 2.3rem);
        line-height: 1.12;
        overflow-wrap: anywhere;
    }

    .home-hero .hero-copy > p {
        width: min(100%, 280px) !important;
        inline-size: calc(100vw - 24px);
        max-inline-size: min(100%, 280px);
        overflow-wrap: anywhere;
        word-break: break-word;
        white-space: normal !important;
    }

    .home-hero .hero-copy,
    .home-hero h1 {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .home-hero .actions {
        width: 100%;
    }

    .card.home-hero-visual {
        padding: 0;
    }

    .home-logo-panel {
        width: 100%;
        min-height: 220px;
        padding: 14px;
    }

    .home-logo-panel .logo-large {
        width: min(92%, 300px);
    }

    .hero-proof-list {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-proof-list span {
        justify-content: center;
    }

    .feature-card,
    .auth-card__header {
        flex-direction: column;
    }

    .footer__inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .footer__steps {
        justify-content: flex-start;
    }

    .footer__copyright {
        text-align: left;
    }
}

@media (max-width: 520px) {
    .container {
        width: min(100% - 24px, 1160px);
    }

    .card,
    .question {
        padding: 18px;
    }

    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .actions .btn,
    .actions a,
    .actions button {
        width: 100%;
    }

    .definition-list {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }

    .empty-state {
        min-height: 0;
        padding: 18px;
    }
}

.rag-assistant-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 90;
}

.rag-assistant-launcher {
    display: grid;
    width: 48px;
    height: 48px;
    margin-left: auto;
    padding: 0;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--brand-navy, #07346f);
    box-shadow: 0 7px 22px rgba(7, 52, 111, .28);
    cursor: pointer;
    place-items: center;
}

.rag-assistant-launcher:hover {
    background: #0a4c91;
}

.rag-assistant-launcher:focus-visible,
.rag-assistant__close:focus-visible,
.rag-assistant__suggestions button:focus-visible {
    outline: 3px solid rgba(45, 174, 228, .55);
    outline-offset: 3px;
}

.rag-assistant-launcher .icon {
    width: 23px;
    height: 23px;
}

.rag-assistant-panel {
    width: min(430px, calc(100vw - 32px));
    height: min(650px, calc(100vh - 92px));
    max-height: min(650px, calc(100vh - 92px));
    margin-bottom: 12px;
    padding: 18px;
    overflow-y: auto;
    color: var(--text, #102d4f);
    border: 1px solid #bfd0df;
    border-top: 4px solid var(--brand-cyan, #2daee4);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(7, 32, 63, .24);
}

.rag-assistant-panel[hidden] {
    display: none;
}

.rag-assistant__header,
.rag-assistant__title,
.rag-assistant__actions {
    display: flex;
    align-items: center;
}

.rag-assistant__header {
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.rag-assistant__title {
    min-width: 0;
    align-items: flex-start;
    gap: 14px;
}

.rag-assistant__title h2,
.rag-assistant__title p {
    margin: 0;
}

.rag-assistant__title h2 {
    font-size: 1rem;
    white-space: nowrap;
}

.rag-assistant__title p {
    margin-top: 3px;
    color: var(--muted, #52657a);
    font-size: .88rem;
}

.rag-assistant__icon {
    display: inline-grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    color: #fff;
    border-radius: 6px;
    background: var(--brand-navy, #07346f);
    place-items: center;
}

.rag-assistant__icon .icon {
    width: 20px;
    height: 20px;
}

.rag-assistant__close {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #35536f;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    place-items: center;
}

.rag-assistant__close:hover {
    color: #07346f;
    background: #edf5fa;
}

.rag-assistant__close .icon {
    width: 21px;
    height: 21px;
}

.rag-assistant__scope {
    margin: 0 0 8px;
    padding: 8px 10px;
    color: #294861;
    border-left: 3px solid var(--brand-cyan, #2daee4);
    background: #f3f8fb;
    font-size: .8rem;
}

.rag-assistant__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.rag-assistant__suggestions button {
    padding: 6px 9px;
    color: #12466f;
    border: 1px solid #b9d4e5;
    border-radius: 16px;
    background: #f7fbfd;
    cursor: pointer;
    font: inherit;
    font-size: .78rem;
}

.rag-assistant__suggestions button:hover {
    border-color: #2daee4;
    background: #eaf6fb;
}

.rag-assistant__form {
    display: grid;
    gap: 9px;
    margin-top: 12px;
}

.rag-assistant__form label,
.rag-assistant__sources + * {
    font-weight: 700;
}

.rag-assistant__form textarea {
    width: 100%;
    min-height: 82px;
    padding: 12px 14px;
    resize: vertical;
    color: var(--text, #102d4f);
    border: 1px solid #b8c9da;
    border-radius: 6px;
    background: #fff;
    font: inherit;
}

.rag-assistant__form textarea:focus {
    border-color: #1688bd;
    outline: 3px solid rgba(45, 174, 228, .25);
    outline-offset: 1px;
}

.rag-assistant__actions {
    flex-wrap: wrap;
    gap: 14px;
}

.rag-assistant__loading {
    color: #274866;
    font-weight: 600;
}

.rag-assistant__output {
    margin-top: 14px;
}

.rag-assistant__output h3 {
    margin: 16px 0 8px;
    font-size: 1rem;
}

.rag-assistant__sources {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 22px;
}

.rag-assistant__sources a {
    color: #075f91;
    font-weight: 700;
}

.rag-assistant__hse {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 14px 0 0;
    padding-top: 11px;
    color: #294861;
    border-top: 1px solid #d9e3ec;
    font-size: .92rem;
}

.rag-assistant__hse .icon {
    flex: 0 0 auto;
}

.rag-assistant-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rag-assistant__header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rag-assistant__clear {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #35536f;
    cursor: pointer;
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    padding: 7px 8px;
}

.rag-assistant__clear:hover,
.rag-assistant__clear:focus-visible {
    background: #edf5fa;
    color: #07346f;
}

.rag-chat {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    max-height: none;
    margin: 12px -4px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px;
    scroll-behavior: smooth;
    scrollbar-color: #7891a7 #edf3f7;
    scrollbar-width: thin;
}

.rag-chat__message {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    max-width: 92%;
}

.rag-chat__message--user {
    align-self: flex-end;
}

.rag-chat__message--assistant {
    align-self: flex-start;
}

.rag-chat__avatar {
    display: grid;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    color: #fff;
    border-radius: 50%;
    background: var(--brand-navy, #07346f);
    font-size: .75rem;
    font-weight: 800;
    place-items: center;
}

.rag-chat__avatar .icon,
.rag-chat__avatar svg {
    width: 15px;
    height: 15px;
}

.rag-chat__bubble {
    min-width: 0;
    border: 1px solid #d7e3ec;
    border-radius: 11px 11px 11px 3px;
    background: #f4f8fb;
    color: var(--text, #102d4f);
    font-size: .88rem;
    padding: 9px 11px;
}

.rag-chat__message--user .rag-chat__bubble {
    border-color: #0d5e9a;
    border-radius: 11px 11px 3px 11px;
    background: #0d4b87;
    color: #fff;
}

.rag-chat__bubble p {
    margin: 0;
    white-space: pre-wrap;
}

.rag-chat__message--loading {
    max-width: 88%;
}

.rag-chat__bubble--loading {
    display: inline-flex;
    min-width: 46px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 8px 12px;
}

.rag-chat__thinking-label {
    color: #294861;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}

.rag-chat__typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.rag-chat__typing span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #0d4b87;
    opacity: .4;
    animation: rag-typing-dot 1s infinite ease-in-out;
}

.rag-chat__typing span:nth-child(2) {
    animation-delay: .16s;
}

.rag-chat__typing span:nth-child(3) {
    animation-delay: .32s;
}

@keyframes rag-typing-dot {
    0%,
    80%,
    100% {
        opacity: .35;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

.rag-chat__sources {
    display: grid;
    gap: 4px;
    margin: 9px 0 0;
    padding: 8px 0 0 17px;
    border-top: 1px solid #cbddea;
    font-size: .78rem;
}

.rag-chat__sources a {
    color: #075f91;
    font-weight: 700;
}

.rag-assistant__form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    margin-top: 12px;
}

.rag-assistant__form textarea {
    min-height: 48px;
    max-height: 110px;
    padding: 10px 11px;
}

.rag-assistant__actions {
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.rag-assistant__actions .btn {
    min-height: 48px;
    white-space: nowrap;
}

.rag-assistant__loading {
    font-size: .78rem;
}

.rag-assistant__hse {
    margin-top: 8px;
    font-size: .82rem;
}

@media (max-width: 900px) {
    .analytics-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .analytics-attention__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .analytics-card--wide {
        grid-column: span 2;
    }

    .analytics-status-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .analytics-filter-card .grid {
        grid-template-columns: 1fr;
    }

    .analytics-kpi-grid,
    .analytics-chart-grid,
    .analytics-table-grid {
        grid-template-columns: 1fr;
    }

    .analytics-kpi-grid .kpi-card {
        min-height: 132px;
    }

    .analytics-attention,
    .analytics-card {
        padding: 18px;
    }

    .analytics-attention__header,
    .analytics-card__header {
        align-items: stretch;
        flex-direction: column;
    }

    .analytics-attention__grid {
        grid-template-columns: 1fr;
    }

    .analytics-card--wide {
        grid-column: span 1;
    }

    .analytics-chart {
        height: 240px;
    }

    .analytics-chart--profile {
        height: 280px;
    }

    .analytics-doughnut {
        height: 220px;
    }

    .analytics-metric-list,
    .analytics-metric-list--profiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-status-grid {
        grid-template-columns: 1fr 1fr;
    }

    .rag-assistant-widget {
        right: 12px;
        bottom: 12px;
    }

    .rag-assistant-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 82px);
        max-height: calc(100vh - 82px);
        padding: 15px;
    }

    .rag-chat {
        max-height: none;
    }

    .rag-assistant__form {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .rag-assistant__suggestions {
        max-height: 104px;
        overflow-y: auto;
        padding-right: 2px;
    }

    .rag-assistant__actions {
        justify-content: flex-end;
    }

    .rag-assistant__actions .btn {
        width: auto;
    }
}

@media (max-width: 380px) {
    .rag-assistant__title {
        gap: 10px;
    }

    .rag-assistant__title h2 {
        font-size: .92rem;
    }

    .rag-assistant__title p {
        font-size: .78rem;
    }

    .rag-assistant__clear {
        padding-inline: 4px;
    }

    .rag-chat__thinking-label {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rag-chat__typing span {
        animation: none;
        opacity: .75;
    }
}

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