:root {
    --primary: #001e40;
    --primary-soft: #d5e3ff;
    --secondary: #005db6;
    --secondary-soft: #d6e3ff;
    --surface: #f8f9ff;
    --surface-low: #eff4ff;
    --surface-high: #dce9ff;
    --text: #0b1c30;
    --muted: #43474f;
    --outline: #c3c6d1;
    --white: #fff;
    --success: #146c43;
    --warning: #8a5a00;
    --danger: #ba1a1a;
    --shadow: 0 16px 40px rgba(11, 28, 48, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--surface);
    color: var(--text);
    font-family: Montserrat, system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }

input, select, textarea, button {
    font: inherit;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    padding: 11px 12px;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 93, 182, .12);
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th {
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
}

th, td {
    border-bottom: 1px solid var(--outline);
    padding: 16px 18px;
    vertical-align: middle;
}

td small {
    display: block;
    margin-top: 4px;
    color: #737780;
    font-size: 12px;
}

tbody tr:hover {
    background: var(--surface-low);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 420, 'GRAD' 0, 'opsz' 24;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    display: flex;
    width: 280px;
    flex-direction: column;
    background: var(--primary);
    color: var(--white);
    padding: 32px 0;
}

.brand {
    padding: 0 32px 36px;
}

.brand h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
}

.brand span {
    display: block;
    margin-top: 6px;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    font-weight: 600;
}

.nav {
    display: grid;
    gap: 4px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    border-left: 4px solid transparent;
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
    font-weight: 700;
    padding: 15px 24px 15px 28px;
    transition: .2s ease;
}

.nav a:hover, .nav a.active {
    border-left-color: var(--secondary-soft);
    background: rgba(255, 255, 255, .10);
    color: var(--secondary-soft);
}

.nav.bottom {
    border-top: 1px solid rgba(255, 255, 255, .12);
    margin-top: auto;
    padding-top: 16px;
}

.sidebar-action {
    margin-top: auto;
    padding: 24px;
}

.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 280px;
    z-index: 15;
    display: flex;
    height: 64px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--outline);
    background: rgba(248, 249, 255, .92);
    padding: 0 40px;
    backdrop-filter: blur(12px);
}

.topbar h2 {
    margin: 0;
    color: var(--primary);
    font-size: 24px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
}

.search {
    width: 250px;
    border-radius: 999px;
    background: var(--surface-low);
    color: #737780;
    font-size: 13px;
    padding: 10px 16px;
}

.avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 999px;
    background: var(--secondary-soft);
    color: var(--primary);
    font-weight: 800;
}

.logout {
    font-size: 13px;
    font-weight: 700;
}

.main {
    margin-left: 280px;
    min-height: 100vh;
    padding: 104px 40px 40px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: stretch;
    margin-bottom: 28px;
}

.hero-grid h1, .page-head h1 {
    margin: 0;
    color: var(--primary);
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.18;
}

.hero-grid p, .page-head p {
    max-width: 760px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}

.score-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--primary);
    color: var(--white);
    padding: 28px;
}

.score-card span, .score-card small {
    color: #a9c7ff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.score-card strong {
    display: block;
    margin: 18px 0;
    font-size: 52px;
    line-height: 1;
}

.stats-grid, .content-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    grid-column: span 4;
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background: var(--white);
    padding: 24px;
    box-shadow: var(--shadow);
}

.stat-card.dark {
    background: var(--primary);
    color: var(--white);
}

.stat-card .material-symbols-outlined {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 8px;
    background: var(--surface-high);
    color: var(--secondary);
    font-size: 28px;
}

.stat-card.dark .material-symbols-outlined {
    background: rgba(255, 255, 255, .12);
    color: var(--secondary-soft);
}

.stat-card p {
    margin: 0 0 6px;
    color: var(--muted);
    font-weight: 700;
}

.stat-card.dark p { color: #a9c7ff; }

.stat-card strong {
    font-size: 34px;
}

.panel {
    grid-column: span 5;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background: var(--white);
    padding: 24px;
    box-shadow: var(--shadow);
}

.panel.wide {
    grid-column: span 7;
}

.panel h2 {
    margin: 0 0 18px;
    color: var(--primary);
    font-size: 22px;
}

.panel-head, .page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.page-head {
    margin-bottom: 24px;
}

.panel-head {
    border-bottom: 1px solid var(--outline);
    margin: -4px -4px 18px;
    padding: 0 0 18px;
}

.panel-head a {
    color: var(--secondary);
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
}

.bars {
    display: flex;
    min-height: 240px;
    align-items: end;
    gap: 12px;
}

.bars div {
    display: grid;
    flex: 1;
    gap: 8px;
    justify-items: center;
}

.bars span, .bars strong {
    color: var(--muted);
    font-size: 11px;
}

.bars i {
    display: block;
    width: 100%;
    max-width: 38px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #63a1ff, #005db6);
}

.form-grid {
    display: grid;
    gap: 16px;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    padding: 10px 16px;
    transition: .2s ease;
}

.button.full { width: 100%; }
.button.primary { background: var(--primary); color: var(--white); }
.button.secondary { background: var(--secondary-soft); color: var(--primary); }
.button.ghost { border-color: var(--outline); background: var(--white); color: var(--primary); }
.button.danger { background: #ffdad6; color: var(--danger); }
.button:hover { transform: translateY(-1px); filter: brightness(.98); }

.icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background: var(--white);
    color: var(--primary);
    cursor: pointer;
}

.icon-button.danger { color: var(--danger); }

.badge {
    display: inline-flex;
    border-radius: 999px;
    background: var(--surface-high);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    padding: 6px 10px;
}

.badge.blue {
    background: var(--secondary-soft);
    color: var(--secondary);
}

.alert {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
}

.alert.success { background: #d8f3dc; color: var(--success); }
.alert.error { background: #ffdad6; color: var(--danger); }

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

.training-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 18px;
    align-items: center;
    border: 1px solid var(--outline);
    border-radius: 8px;
    padding: 18px;
}

.training-item h3 {
    margin: 0 0 8px;
    color: var(--primary);
}

.training-item p {
    margin: 0 0 8px;
    color: var(--muted);
}

.training-item small {
    color: #737780;
    font-weight: 600;
}

.qr {
    width: 170px;
    height: 170px;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background: var(--white);
}

.row-actions, .actions-cell, .filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.row-actions {
    margin-top: 14px;
}

.ranking-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.ranking-list li {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--outline);
    border-radius: 8px;
    padding: 14px;
}

.ranking-list li > span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 999px;
    background: var(--primary);
    color: var(--white);
    font-weight: 800;
}

.ranking-list strong, .ranking-list small {
    display: block;
}

.ranking-list small {
    margin-top: 4px;
    color: #737780;
}

.ranking-list b {
    color: var(--secondary);
    font-size: 22px;
}

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

.topic-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--outline);
    border-radius: 8px;
    padding: 14px;
}

.diploma-workspace {
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    gap: 24px;
}

.diploma-queue,
.diploma-detail {
    min-width: 0;
}

.diploma-queue {
    align-self: start;
    display: grid;
    gap: 12px;
}

.queue-item {
    display: grid;
    gap: 7px;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background: var(--white);
    padding: 14px;
    transition: .2s ease;
}

.queue-item:hover,
.queue-item.active {
    border-color: var(--secondary);
    background: var(--surface-low);
}

.queue-item strong {
    color: var(--primary);
    font-size: 14px;
    line-height: 1.35;
}

.queue-item span,
.queue-item small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.queue-item i {
    justify-self: start;
    border-radius: 999px;
    background: var(--secondary-soft);
    color: var(--secondary);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    padding: 5px 9px;
}

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

.participant-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background: var(--white);
    padding: 16px;
}

.participant-avatar {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 999px;
    background: var(--primary);
    color: var(--white);
    font-weight: 800;
}

.participant-card h3 {
    margin: 0 0 7px;
    color: var(--primary);
    font-size: 15px;
}

.participant-card p,
.participant-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    margin: 0 0 4px;
}

.participant-status {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.participant-status a {
    color: var(--secondary);
    font-size: 12px;
    font-weight: 800;
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 10px;
    border: 1px dashed var(--outline);
    border-radius: 8px;
    color: var(--muted);
    padding: 28px;
    text-align: center;
}

.empty-state .material-symbols-outlined {
    color: var(--secondary);
    font-size: 42px;
}

.empty-state strong {
    color: var(--primary);
}

.empty-state p {
    margin: 0;
    max-width: 420px;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.role-permissions {
    display: grid;
    gap: 12px;
}

.role-permissions h3 {
    border-bottom: 1px solid var(--outline);
    color: var(--primary);
    font-size: 13px;
    letter-spacing: .04em;
    margin: 10px 0 4px;
    padding-bottom: 8px;
    text-transform: uppercase;
}

.permission-row {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: start;
    border: 1px solid var(--outline);
    border-radius: 8px;
    cursor: pointer;
    gap: 10px;
    padding: 12px;
}

.permission-row input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.permission-row strong,
.permission-row small {
    display: block;
}

.permission-row strong {
    color: var(--text);
    font-size: 13px;
}

.permission-row small {
    color: #737780;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    margin-top: 3px;
}

.filters {
    margin-bottom: 20px;
}

.filters label {
    min-width: 180px;
}

.diploma-preview {
    position: relative;
    aspect-ratio: 1200 / 850;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background-color: var(--surface-low);
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
}

.diploma-preview::before {
    content: "ANAM GUATEMALA";
    position: absolute;
    inset: 0 0 auto;
    background: var(--primary);
    color: var(--white);
    font-size: 18px;
    font-weight: 800;
    padding: 22px 30px;
}

.diploma-preview span {
    position: absolute;
    left: 50%;
    color: var(--primary);
    font-weight: 800;
    text-align: center;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.login-body {
    min-height: 100vh;
    background: var(--surface);
}

.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 320px minmax(0, 1fr);
}

.login-copy {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    background: var(--primary);
    color: var(--white);
    padding: 42px 32px;
}

.login-copy strong, .public-head strong {
    color: #a9c7ff;
    font-size: 14px;
    letter-spacing: .06em;
}

.login-copy strong {
    display: block;
    color: var(--white);
    font-size: 36px;
    letter-spacing: 0;
}

.login-copy h1 {
    margin: 48px 0 18px;
    color: var(--white);
    font-size: 34px;
    line-height: 1.18;
}

.login-copy p, .public-head p {
    color: rgba(255, 255, 255, .72);
    line-height: 1.65;
}

.login-card {
    display: grid;
    gap: 16px;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background: var(--white);
    padding: 30px;
    box-shadow: var(--shadow);
}

.login-card h2 {
    margin: 0;
    color: var(--primary);
    font-size: 30px;
}

.hint {
    margin: 0;
    color: #737780;
    font-size: 12px;
}

.login-shell .login-card {
    align-self: center;
    justify-self: center;
    width: min(430px, calc(100% - 40px));
}

.login-copy::after {
    content: "QR · Participantes · Diplomas · Reportería";
    display: block;
    border-top: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
    padding-top: 24px;
}

.public-form {
    width: min(720px, 100%);
}

.public-head {
    border-radius: 8px;
    background: var(--primary);
    color: var(--white);
    margin-bottom: 16px;
    padding: 30px;
}

.public-head h1 {
    margin: 12px 0 8px;
}

.login-card.public {
    width: 100%;
}

.qr-stage-body {
    min-height: 100vh;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(0, 30, 64, .98) 0%, rgba(0, 51, 102, .96) 46%, rgba(248, 249, 255, 1) 46%),
        var(--surface);
}

.qr-stage {
    display: grid;
    min-height: 100vh;
    grid-template-rows: auto 1fr;
    padding: clamp(20px, 3vw, 42px);
}

.qr-presentation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.qr-presentation-header strong,
.qr-presentation-header span {
    display: block;
}

.qr-presentation-header strong {
    color: var(--white);
    font-size: clamp(26px, 3vw, 42px);
    line-height: 1;
}

.qr-presentation-header span {
    color: #a9c7ff;
    font-size: clamp(13px, 1.2vw, 18px);
    font-weight: 800;
    margin-top: 8px;
}

.qr-presentation {
    display: grid;
    grid-template-columns: minmax(0, .82fr) minmax(520px, 1fr);
    align-items: center;
    gap: clamp(28px, 5vw, 78px);
    min-height: 0;
}

.qr-presentation-copy {
    color: var(--white);
    padding-left: clamp(0px, 2vw, 36px);
}

.qr-presentation-copy span {
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    color: #d6e3ff;
    font-size: clamp(14px, 1.3vw, 20px);
    font-weight: 800;
    margin-bottom: 26px;
    padding: 10px 16px;
}

.qr-presentation-copy h1 {
    max-width: 980px;
    margin: 0 0 28px;
    color: var(--white);
    font-size: clamp(46px, 6.4vw, 104px);
    line-height: 1.02;
}

.qr-presentation-copy p {
    color: rgba(255, 255, 255, .76);
    font-size: clamp(20px, 2vw, 34px);
    font-weight: 700;
    margin: 10px 0;
}

.qr-presentation-code {
    display: grid;
    justify-items: center;
    gap: 18px;
}

.qr-presentation-code img {
    width: min(78vh, 45vw, 760px);
    min-width: 420px;
    height: auto;
    border: clamp(16px, 2vw, 28px) solid var(--white);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 34px 90px rgba(11, 28, 48, .22);
}

.qr-presentation-code small {
    max-width: min(760px, 45vw);
    color: var(--muted);
    font-size: clamp(11px, .9vw, 14px);
    font-weight: 800;
    overflow-wrap: anywhere;
    text-align: center;
}

.qr-stage-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

@media (max-width: 1050px) {
    .sidebar {
        position: static;
        width: 100%;
        padding: 20px 0;
    }

    .brand, .sidebar-action, .nav.bottom {
        padding-left: 20px;
        padding-right: 20px;
    }

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

    .topbar {
        position: static;
        height: auto;
        padding: 18px 20px;
    }

    .search {
        display: none;
    }

    .main {
        margin-left: 0;
        padding: 28px 20px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-copy {
        min-height: auto;
        padding: 28px 24px;
    }

    .login-copy h1 {
        margin-top: 22px;
    }

    .stat-card, .panel, .panel.wide {
        grid-column: 1 / -1;
    }

    .topic-grid {
        grid-template-columns: 1fr;
    }

    .permissions-grid {
        grid-template-columns: 1fr;
    }

    .diploma-workspace {
        grid-template-columns: 1fr;
    }

    .qr-stage-body {
        overflow: auto;
        background: var(--primary);
    }

    .qr-presentation-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .qr-presentation {
        grid-template-columns: 1fr;
        padding-top: 28px;
    }

    .qr-presentation-code {
        border-radius: 8px;
        background: var(--surface);
        padding: 24px;
    }

    .qr-presentation-code img {
        width: min(76vw, 560px);
        min-width: 0;
    }

    .qr-presentation-code small {
        max-width: 100%;
    }
}

@media (min-width: 1060px) {
    .qr-stage-actions {
        opacity: .22;
        transition: opacity .2s ease;
    }

    .qr-stage-actions:hover {
        opacity: 1;
    }
}

@media print {
    .qr-stage-actions {
        display: none;
    }
}

/* Modern dashboard skin inspired by the provided reference */
.app-body {
    background: #d9dee7;
    color: #1c2026;
}

.app-body .sidebar {
    top: 28px;
    bottom: 28px;
    left: 28px;
    width: 272px;
    height: auto;
    border: 1px solid #e3e7ed;
    border-radius: 12px 0 0 12px;
    background: #f7f9fb;
    color: #1f242c;
    padding: 24px 18px;
    box-shadow: 0 24px 70px rgba(29, 38, 54, .08);
}

.app-body .brand {
    display: grid;
    grid-template-columns: 36px 1fr;
    column-gap: 10px;
    align-items: center;
    padding: 0 0 24px;
}

.app-body .brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
}

.app-body .brand h1 {
    color: #263043;
    font-size: 18px;
    font-weight: 800;
}

.app-body .brand span {
    grid-column: 2;
    color: #8a929e;
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

.app-body .nav-label {
    color: #9aa2ad;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 12px 0 8px;
    padding: 0 0 0 2px;
    text-transform: uppercase;
}

.app-body .nav {
    gap: 7px;
}

.app-body .nav a {
    border: 1px solid transparent;
    border-left: 1px solid transparent;
    border-radius: 8px;
    color: #4f5865;
    gap: 12px;
    padding: 11px 12px;
}

.app-body .nav a .material-symbols-outlined {
    color: #6b7280;
    font-size: 22px;
}

.app-body .nav a:hover,
.app-body .nav a.active {
    border-color: #e1e6ee;
    background: #fff;
    color: #111827;
    box-shadow: 0 8px 22px rgba(29, 38, 54, .06);
}

.app-body .nav a:hover .material-symbols-outlined,
.app-body .nav a.active .material-symbols-outlined {
    color: #111827;
}

.app-body .nav.bottom {
    border-top: 1px solid #e3e7ed;
    margin-top: auto;
    padding-top: 14px;
}

.app-body .sidebar-action {
    margin-top: auto;
    padding: 18px 0 0;
}

.app-body .topbar {
    top: 28px;
    right: 28px;
    left: 300px;
    height: 82px;
    border: 1px solid #e3e7ed;
    border-left: 0;
    border-radius: 0 12px 0 0;
    background: #fff;
    padding: 0 26px;
    box-shadow: 0 18px 50px rgba(29, 38, 54, .06);
}

.app-body .topbar h2 {
    color: #111827;
    font-size: 23px;
    font-weight: 800;
}

.app-body .search {
    width: min(330px, 28vw);
    border: 1px solid #e3e7ed;
    border-radius: 8px;
    background: #fff;
    color: #9aa2ad;
    padding: 11px 16px;
}

.app-body .topbar-actions > .material-symbols-outlined {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid #e3e7ed;
    border-radius: 8px;
    background: #fff;
}

.app-body .avatar {
    width: 38px;
    height: 38px;
    border: 2px solid #fff;
    background: #dbeafe;
    box-shadow: 0 4px 14px rgba(29, 38, 54, .1);
}

.app-body .logout {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    border: 1px solid #e3e7ed;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    padding: 0 14px;
}

.app-body .main {
    min-height: calc(100vh - 56px);
    margin: 110px 28px 28px 300px;
    border: 1px solid #e3e7ed;
    border-top: 0;
    border-radius: 0 0 12px 0;
    background: #fff;
    padding: 32px 28px 28px;
    box-shadow: 0 24px 70px rgba(29, 38, 54, .08);
}

.app-body .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 20px;
    margin-bottom: 20px;
}

.app-body .hero-grid h1,
.app-body .page-head h1 {
    color: #161a21;
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 800;
}

.app-body .hero-grid p,
.app-body .page-head p {
    color: #78818d;
    font-size: 15px;
    line-height: 1.55;
}

.app-body .score-card,
.app-body .stat-card,
.app-body .panel,
.app-body .training-item,
.app-body .queue-item,
.app-body .participant-card,
.app-body .topic-card,
.app-body .permission-row {
    border-color: #e3e7ed;
    border-radius: 10px;
    box-shadow: 0 8px 26px rgba(29, 38, 54, .04);
}

.app-body .score-card {
    background: #111827;
    padding: 24px;
}

.app-body .score-card span,
.app-body .score-card small {
    color: #a7b5cc;
}

.app-body .score-card strong {
    font-size: 46px;
}

.app-body .stats-grid,
.app-body .content-grid {
    gap: 18px;
    margin-bottom: 18px;
}

.app-body .stat-card {
    padding: 18px;
}

.app-body .stat-card.dark {
    background: #111827;
}

.app-body .stat-card .material-symbols-outlined {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: #eef4ff;
    color: #6366f1;
}

.app-body .stat-card p {
    color: #7b8490;
    font-size: 13px;
}

.app-body .stat-card strong {
    color: #161a21;
    font-size: 30px;
}

.app-body .stat-card.dark strong {
    color: #fff;
}

.app-body .panel {
    padding: 18px;
}

.app-body .panel h2,
.app-body .panel-head h2 {
    color: #161a21;
    font-size: 18px;
    font-weight: 800;
}

.app-body .panel-head {
    border-bottom-color: #edf0f4;
    margin: -2px 0 16px;
    padding-bottom: 14px;
}

.app-body th {
    background: #f8fafc;
    color: #8b95a1;
    font-size: 12px;
}

.app-body th,
.app-body td {
    border-bottom-color: #edf0f4;
    padding: 13px 16px;
}

.app-body tbody tr:hover {
    background: #fafcff;
}

.app-body .button {
    border-radius: 8px;
    min-height: 40px;
}

.app-body .button.primary {
    background: #5b48e8;
    box-shadow: 0 10px 18px rgba(91, 72, 232, .16);
}

.app-body .button.secondary {
    background: #e9efff;
    color: #263043;
}

.app-body .button.ghost {
    border-color: #e3e7ed;
    color: #263043;
}

.app-body .badge {
    background: #f2f5f8;
    color: #6b7280;
}

.app-body .badge.blue {
    background: #e8fbf5;
    color: #25a07f;
}

.app-body input,
.app-body select,
.app-body textarea {
    border-color: #e3e7ed;
    border-radius: 8px;
    background: #fff;
}

.app-body .bars i {
    background: linear-gradient(180deg, #56c2b2, #5b48e8);
}

@media (max-width: 1050px) {
    .app-body .sidebar {
        position: static;
        width: auto;
        margin: 14px;
        border-radius: 12px;
    }

    .app-body .topbar {
        position: static;
        margin: 0 14px;
        border: 1px solid #e3e7ed;
        border-radius: 12px 12px 0 0;
    }

    .app-body .main {
        margin: 0 14px 14px;
        border-radius: 0 0 12px 12px;
        padding: 22px 16px;
    }
}

@media (max-width: 640px) {
    .topbar h2 {
        font-size: 18px;
    }

    .topbar-actions {
        gap: 10px;
    }

    .hero-grid h1, .page-head h1, .login-copy h1 {
        font-size: 30px;
    }

    .page-head, .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid, .content-grid {
        grid-template-columns: 1fr;
    }

    .training-item {
        grid-template-columns: 1fr;
    }

    .qr {
        width: 150px;
        height: 150px;
    }

    .split {
        grid-template-columns: 1fr;
    }

    .participant-grid {
        grid-template-columns: 1fr;
    }
}

/* Login aligned with the full-screen SaaS product skin */
.login-body {
    min-height: 100vh;
    background: #ffffff !important;
    color: #161a22;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.login-shell {
    display: grid !important;
    min-height: 100vh;
    grid-template-columns: 300px minmax(0, 1fr) !important;
    background: #ffffff;
}

.login-copy {
    min-height: 100vh;
    background: #f7f8fb !important;
    color: #161a22 !important;
    border-right: 1px solid #e5e8ee;
    padding: 34px 28px !important;
}

.login-copy strong {
    display: inline-grid !important;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: #090d14;
    color: transparent !important;
    font-size: 0 !important;
    letter-spacing: 0 !important;
}

.login-copy strong::before {
    content: "A";
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 7px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.login-copy h1 {
    max-width: 250px;
    margin: 64px 0 16px !important;
    color: #121722 !important;
    font-size: 32px !important;
    font-weight: 780;
    letter-spacing: 0;
}

.login-copy p {
    max-width: 245px;
    color: #65707e !important;
    font-size: 14px;
}

.login-copy::after {
    border-top: 1px solid #e5e8ee !important;
    color: #8b94a1 !important;
}

.login-shell .login-card {
    width: min(440px, calc(100% - 48px)) !important;
    border: 1px solid #e5e8ee !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: 0 20px 55px rgba(33, 42, 59, .08) !important;
    padding: 34px !important;
    animation: loginFloat .45s ease both;
}

.login-card h2 {
    color: #121722 !important;
    font-size: 28px !important;
    font-weight: 760;
}

.login-card label {
    color: #252b36;
    font-size: 14px;
    font-weight: 700;
}

.login-card input {
    min-height: 46px;
    border: 1px solid #e5e8ee !important;
    border-radius: 9px !important;
    background: #ffffff !important;
    color: #161a22;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.login-card input:focus {
    border-color: #8176f5 !important;
    box-shadow: 0 0 0 4px rgba(103, 87, 238, .12);
    outline: 0;
}

.login-card .button.primary {
    min-height: 46px;
    border-radius: 9px;
    background: linear-gradient(135deg, #7b68f6, #5d46e8) !important;
    box-shadow: 0 12px 24px rgba(103, 87, 238, .24) !important;
}

@keyframes loginFloat {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 820px) {
    .login-shell {
        grid-template-columns: 1fr !important;
    }

    .login-copy {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid #e5e8ee;
    }

    .login-copy h1 {
        margin-top: 28px !important;
    }
}
