:root {
    --bg: #f5f7f3;
    --panel: rgba(255, 255, 252, 0.92);
    --panel-strong: #fffefa;
    --ink: #16211f;
    --muted: #65736f;
    --line: rgba(30, 56, 49, 0.12);
    --accent: #287567;
    --accent-deep: #144f47;
    --accent-soft: rgba(40, 117, 103, 0.12);
    --shadow: 0 18px 44px rgba(22, 39, 36, 0.1);
    --accent-border: rgba(40, 117, 103, 0.24);
    --olive-soft: rgba(40, 117, 103, 0.1);
    --warning-soft: rgba(191, 132, 55, 0.12);
    --shadow-soft: 0 12px 26px rgba(22, 39, 36, 0.07);
    --font-body: "HarmonyOS Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
    --font-display: "STZhongsong", "Songti SC", "Noto Serif SC", serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: var(--font-body);
    background:
        linear-gradient(180deg, rgba(230, 237, 229, 0.72), rgba(245, 247, 243, 0.96) 34%),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    padding: 28px 22px;
    background: #14211e;
    color: #f7fbf5;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    min-height: 100vh;
    backdrop-filter: blur(12px);
}

.brand-kicker,
.eyebrow,
.card-kicker {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.brand .brand-kicker {
    color: rgba(247, 251, 245, 0.68);
}

.brand h1 {
    margin: 8px 0 10px;
    font-size: 30px;
    line-height: 1.05;
    font-family: var(--font-display);
}

.brand p,
.sidebar-note p {
    margin: 0;
    color: rgba(247, 251, 245, 0.7);
    line-height: 1.6;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 30px;
}

.nav a {
    padding: 12px 14px;
    border-radius: 10px;
    color: rgba(247, 251, 245, 0.76);
    border: 1px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav a:hover,
.nav a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
}

.sidebar-note {
    margin-top: 32px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-scope {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    color: rgba(247, 251, 245, 0.7);
    font-size: 13px;
    line-height: 1.45;
}

.logout-form {
    margin: 12px 0 0;
}

.logout-link {
    display: inline-block;
    width: auto;
    margin-top: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: #fff5ec;
    background: transparent;
    box-shadow: none;
    text-align: left;
    text-decoration: underline;
}

.logout-link:hover {
    transform: none;
}

.content {
    padding: 34px 34px 42px;
}

.hero {
    margin-bottom: 20px;
    padding: 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 252, 0.96), rgba(239, 246, 241, 0.9));
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px 24px;
    position: relative;
    overflow: hidden;
}

.hero::after {
    display: none;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero > div:first-child {
    max-width: min(820px, 100%);
}

.hero h2 {
    margin: 10px 0 8px;
    font-size: 34px;
    line-height: 1.12;
    font-family: var(--font-display);
}

.hero p,
.muted,
.subtle,
.empty-state,
.empty-row {
    color: var(--muted);
}

.hero p {
    margin: 0;
    line-height: 1.72;
}

.subtle {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stats-grid.five-up {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-card,
.panel,
.exam-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.stat-card {
    padding: 18px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card::before {
    display: none;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(22, 39, 36, 0.12);
    border-color: var(--accent-border);
}

.stat-card span {
    color: var(--muted);
    display: block;
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 32px;
    font-family: var(--font-display);
}

.panel {
    padding: 22px;
    margin-bottom: 20px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.panel:hover {
    box-shadow: 0 18px 34px rgba(22, 39, 36, 0.11);
    border-color: var(--accent-border);
}

.panel-header,
.exam-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.panel-header h3,
.exam-card h4 {
    margin: 0;
}

.panel-header span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(239, 246, 241, 0.96);
    backdrop-filter: blur(8px);
}

tbody tr {
    transition: background-color 0.18s ease;
}

tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.32);
}

tbody tr:hover {
    background: var(--accent-soft);
}

.exam-form,
.publish-form,
.account-form,
.auth-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.form-grid.three-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.four-up {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.exam-form label,
.form-grid label,
.publish-form label,
.account-form label,
.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exam-form label span,
.form-grid label span,
.publish-form label span,
.account-form label span,
.auth-form label span {
    font-size: 13px;
    color: var(--muted);
}

.full-span {
    grid-column: 1 / -1;
}

input,
textarea,
select,
button {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    font: inherit;
    color: var(--ink);
    background: var(--panel-strong);
    appearance: none;
    -webkit-appearance: none;
    overflow: hidden;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-border);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

textarea {
    resize: vertical;
}

.field-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.typing-source-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 252, 0.72);
}

.typing-source-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-height: 0;
    padding: 9px 12px;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-weight: 700;
}

.typing-source-option input {
    width: auto;
    min-height: 0;
    margin: 0;
    appearance: auto;
    -webkit-appearance: auto;
}

button {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

.primary-button,
.secondary-button,
.danger-button {
    color: #fffefa;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    box-shadow: 0 12px 28px rgba(20, 79, 71, 0.22);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.link-button {
    border-radius: 10px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(84, 77, 68, 0.08);
    color: var(--muted);
    font-size: 13px;
}

.status-pill.is-live {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    background: #8c857c;
}

.status-dot.online {
    background: #2f9b6a;
}

.status-dot.offline {
    background: #b16632;
}

.exam-stack {
    display: grid;
    gap: 16px;
}

.filter-bar,
.publish-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(247, 238, 228, 0.72));
    box-shadow: var(--shadow-soft);
}

.page-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
    align-items: center;
}

.publish-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.publish-scope-panel {
    display: grid;
    gap: 18px;
}

.publish-scope-heading {
    margin-bottom: 0;
}

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

.publish-mode-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 10px;
    align-items: start;
    min-height: 112px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.publish-mode-card:hover,
.publish-mode-card.is-active {
    border-color: var(--accent-border);
    background: linear-gradient(135deg, rgba(255, 249, 244, 0.94), rgba(255, 255, 255, 0.86));
}

.publish-mode-card.is-active {
    box-shadow: 0 16px 28px rgba(52, 34, 19, 0.09);
}

.publish-mode-card input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.publish-mode-card span {
    color: var(--ink);
    font-weight: 800;
}

.publish-mode-card small {
    grid-column: 2;
    color: var(--muted);
    line-height: 1.5;
}

.publish-scope-workspace {
    padding: 16px;
    border: 1px solid rgba(50, 40, 28, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
}

.publish-scope-workspace[hidden] {
    display: none;
}

.publish-auto-card {
    display: grid;
    gap: 8px;
}

.publish-auto-card strong,
.publish-selector-head strong {
    color: var(--ink);
    font-size: 17px;
}

.publish-auto-card p,
.publish-selector-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.publish-scope-stats,
.scope-tool-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.publish-scope-stats span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--muted);
    font-size: 12px;
}

.publish-scope-stats b,
.publish-selector-head b {
    color: var(--accent-deep);
}

.publish-selector-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.scope-tool-row {
    align-items: center;
}

.scope-tool-button {
    width: auto;
    min-height: 32px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--accent-deep);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: none;
    font-size: 13px;
    font-weight: 700;
}

.scope-tool-button:hover {
    border-color: var(--accent-border);
    background: rgba(255, 249, 244, 0.94);
}

.compact-filter-field {
    min-width: 180px;
    margin: 0;
}

.publish-choice-list {
    display: grid;
    gap: 10px;
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}

.publish-class-choice-list {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.publish-device-choice-list {
    grid-template-columns: 1fr;
}

.publish-choice-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.64);
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.publish-choice-item:hover,
.publish-choice-item.is-selected {
    border-color: var(--accent-border);
    background: rgba(255, 249, 244, 0.9);
}

.publish-choice-item.is-selected {
    box-shadow: inset 0 0 0 1px rgba(178, 76, 43, 0.08);
}

.publish-choice-item input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.publish-choice-item span {
    min-width: 0;
}

.publish-choice-item strong {
    display: block;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.publish-choice-item small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.publish-choice-item em {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-style: normal;
    white-space: nowrap;
}

.publish-choice-item em.is-online {
    color: #166534;
    background: rgba(22, 101, 52, 0.09);
}

.publish-choice-item em.is-offline {
    color: var(--muted);
    background: rgba(84, 77, 68, 0.08);
}

.publish-id-field {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.exam-builder {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) 340px;
    gap: 20px;
    align-items: start;
}

.exam-builder-main {
    display: grid;
    gap: 20px;
    grid-column: 1;
}

.exam-builder-side {
    grid-column: 2;
    position: sticky;
    top: 24px;
}

.form-section {
    margin-bottom: 0;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading h3 {
    margin: 8px 0 0;
}

.section-heading p {
    max-width: 320px;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.action-card h3 {
    margin: 8px 0 10px;
}

.sticky-action-card {
    display: grid;
    gap: 16px;
}

.action-card-metrics {
    margin-top: 0;
}

.action-card-note {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px dashed var(--line);
    background: rgba(255, 255, 255, 0.48);
}

.action-card-note strong {
    display: block;
    margin-bottom: 6px;
}

.action-card-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.compact-note {
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
}

.compact-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.publish-scope-details {
    margin: 0;
}

.drawer-list {
    display: grid;
    gap: 16px;
}

.device-drawer {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.device-drawer summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
}

.device-drawer summary::-webkit-details-marker {
    display: none;
}

.device-drawer[open] summary {
    background: rgba(255, 255, 255, 0.5);
}

.device-drawer-copy h3 {
    margin: 8px 0 6px;
}

.device-drawer-copy p {
    margin: 0;
    color: var(--muted);
}

.device-drawer-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.drawer-chevron {
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--accent-deep);
    border-bottom: 2px solid var(--accent-deep);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.device-drawer[open] .drawer-chevron {
    transform: rotate(225deg);
}

.device-drawer-body {
    padding: 0 20px 20px;
    border-top: 1px solid var(--line);
}

.publish-id-field {
    margin-top: 14px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
}

.search-field {
    flex: 1 1 340px;
}

.filter-field span {
    font-size: 13px;
    color: var(--muted);
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: auto;
    align-self: flex-end;
}

.filter-actions-inline {
    align-items: center;
}

.client-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.client-filter-button {
    min-height: 48px;
    white-space: nowrap;
}

.client-filter-button.is-active {
    color: #fffefa;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    border-color: transparent;
    box-shadow: 0 12px 28px rgba(20, 79, 71, 0.22);
}

.segmented-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.segment-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
    color: var(--muted);
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.segment-link strong {
    color: var(--ink);
}

.segment-link span {
    font-size: 14px;
    line-height: 1.5;
}

.segment-link:hover,
.segment-link.active {
    transform: translateY(-1px);
    border-color: rgba(178, 76, 43, 0.28);
    background: rgba(255, 255, 255, 0.84);
}

.segment-link.active {
    box-shadow: 0 14px 32px rgba(127, 45, 22, 0.12);
    background: linear-gradient(135deg, rgba(255, 247, 241, 0.92), rgba(255, 255, 255, 0.9));
}

.ghost-button {
    width: auto;
    color: var(--accent-deep);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: none;
    border: 1px solid var(--line);
}

.ghost-button:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(178, 76, 43, 0.16);
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 16px;
    overflow: hidden;
}

.primary-button.link-button,
.secondary-button.link-button,
.danger-button.link-button {
    border: 1px solid transparent;
}

.compact-button {
    width: auto;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
}

.publish-device-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exam-card {
    padding: 20px;
}

.compact-card-list {
    display: grid;
    gap: 14px;
}

.compact-card {
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.64);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.compact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 38px rgba(52, 34, 19, 0.12);
    border-color: rgba(178, 76, 43, 0.16);
}

.compact-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.compact-card-head h3 {
    margin: 8px 0 0;
}

.compact-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
}

.compact-card-meta span,
.active-exam-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(50, 40, 28, 0.08);
}

.exam-settings {
    margin: 8px 0 18px;
    padding: 12px 14px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.45);
}

.exam-settings summary {
    cursor: pointer;
    color: var(--accent-deep);
    font-weight: 600;
}

.exam-settings pre {
    margin: 12px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--muted);
    font-family: Consolas, "SFMono-Regular", monospace;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.compact-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
}

.summary-card {
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(250, 244, 237, 0.72));
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.summary-card span,
.summary-card small {
    color: var(--muted);
}

.summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
}

.action-row {
    display: flex;
    justify-content: flex-start;
}

.inline-form {
    margin-top: 18px;
}

.danger-button {
    color: #fffaf4;
    background: linear-gradient(135deg, #b73d26, #7f1d1d);
    box-shadow: 0 12px 28px rgba(127, 29, 29, 0.22);
}

.empty-state {
    padding: 26px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
    text-align: center;
}

.error-banner,
.success-banner,
.info-banner {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
}

.error-banner {
    background: rgba(155, 83, 64, 0.14);
    color: #8e3419;
    border-color: rgba(155, 83, 64, 0.2);
}

.success-banner {
    background: rgba(47, 155, 106, 0.14);
    color: #1f6f4a;
    border-color: rgba(47, 155, 106, 0.22);
}

.info-banner {
    background: var(--accent-soft);
    color: var(--accent-deep);
    border-color: var(--accent-border);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: min(520px, 100%);
    padding: 28px;
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.auth-card h1 {
    margin: 10px 0 8px;
    font-size: 36px;
    line-height: 1.05;
    font-family: var(--font-display);
}

.auth-card p {
    color: var(--muted);
    margin-bottom: 18px;
}

.auth-form {
    grid-template-columns: 1fr;
}

.account-school-tools {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 20px;
    align-items: stretch;
}

.account-tool-panel,
.account-create-panel,
.account-list-panel {
    overflow: hidden;
}

.account-tool-head {
    align-items: flex-start;
}

.account-control-form {
    display: grid;
    gap: 14px;
}

.school-create-form.account-control-form {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr) auto;
    align-items: end;
}

.school-filter-form.account-control-form {
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
}

.account-control-form label,
.account-create-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.account-control-form label span,
.account-create-form label span {
    color: var(--muted);
    font-size: 13px;
}

.account-control-form input,
.account-create-form input,
.account-create-form select,
.account-password-form input {
    min-height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
}

.account-control-form input:read-only,
.account-create-form input:read-only {
    color: var(--muted);
    background: rgba(84, 77, 68, 0.06);
}

.account-form-actions,
.account-danger-row,
.account-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.account-form-actions {
    justify-content: flex-end;
}

.account-primary-button,
.account-secondary-button,
.account-ghost-button,
.account-danger-button {
    width: auto;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.account-primary-button {
    color: #fffefa;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    box-shadow: 0 12px 24px rgba(20, 79, 71, 0.18);
}

.account-secondary-button {
    color: var(--accent-deep);
    border: 1px solid rgba(20, 79, 71, 0.15);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: none;
}

.account-ghost-button {
    color: var(--accent-deep);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
    box-shadow: none;
}

.account-danger-button {
    color: #9f3d2e;
    border: 1px solid rgba(183, 61, 38, 0.2);
    background: rgba(183, 61, 38, 0.07);
    box-shadow: none;
}

.account-secondary-button:hover,
.account-ghost-button:hover,
.account-quiet-link:hover {
    color: var(--accent);
    border-color: var(--accent-border);
    background: rgba(255, 249, 244, 0.92);
}

.account-danger-button:hover {
    color: #7f1d1d;
    border-color: rgba(183, 61, 38, 0.32);
    background: rgba(183, 61, 38, 0.11);
}

.account-quiet-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--accent-deep);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.account-create-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    padding: 16px;
    border: 1px solid rgba(50, 40, 28, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.42);
}

.account-create-form .checkbox-field {
    align-self: stretch;
}

.account-create-form > .account-primary-button {
    align-self: end;
}

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

.account-user-card {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: stretch;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: var(--shadow-soft);
}

.account-user-main {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.account-user-title {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: var(--accent-deep);
    background: linear-gradient(135deg, rgba(255, 249, 244, 0.96), rgba(255, 255, 255, 0.78));
    border: 1px solid var(--accent-border);
    font-weight: 900;
}

.account-user-title h4 {
    margin: 0;
    font-size: 20px;
    font-family: var(--font-display);
}

.account-user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.account-user-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.68);
    font-size: 12px;
}

.account-user-scope {
    min-width: 0;
}

.account-user-actions {
    display: grid;
    gap: 10px;
    min-width: 0;
    align-content: start;
    padding: 14px;
    border-left: 1px dashed var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.46);
}

.account-status-row {
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line);
}

.account-password-form {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.account-password-form input {
    min-width: 0;
    padding: 8px 10px;
}

.account-danger-row {
    justify-content: flex-start;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.account-permission-form {
    flex: 1 1 260px;
}

.account-delete-form {
    margin-left: auto;
}

.account-delete-button {
    width: auto;
    min-height: 34px;
    padding: 7px 9px;
    border: 0;
    border-radius: 9px;
    color: #9f3d2e;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.account-delete-button:hover {
    color: #7f1d1d;
    background: rgba(183, 61, 38, 0.08);
    transform: none;
}

.checkbox-field em,
.permission-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-style: normal;
    line-height: 1.5;
}

.checkbox-field input,
.permission-toggle input[type="checkbox"] {
    width: auto;
    min-width: 18px;
    height: 18px;
    padding: 0;
    appearance: auto;
    -webkit-appearance: auto;
}

.table-actions {
    min-width: 340px;
}

.user-action-stack {
    display: grid;
    gap: 10px;
}

.inline-table-form {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.inline-table-form input {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 8px;
}

.permission-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
}

.school-create-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.school-create-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.school-create-form label span {
    font-size: 13px;
    color: var(--muted);
}

.credential-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
    gap: 18px;
    align-items: center;
}

.credential-banner strong {
    display: block;
    margin-top: 6px;
    font-size: 26px;
    font-family: var(--font-display);
}

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

.school-directory-list,
.managed-class-list,
.teacher-assignment-list {
    display: grid;
    gap: 12px;
}

.school-directory-row,
.managed-class-row,
.teacher-assignment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.64);
    text-decoration: none;
    color: inherit;
}

.school-directory-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.school-directory-row:hover,
.managed-class-row:hover,
.teacher-assignment-row:hover {
    border-color: var(--accent-border);
    box-shadow: 0 14px 26px rgba(22, 39, 36, 0.1);
}

.school-directory-row strong,
.managed-class-row strong,
.teacher-assignment-row strong {
    display: block;
    margin: 4px 0;
    font-size: 20px;
    font-family: var(--font-display);
}

.school-directory-row small,
.managed-class-row small,
.teacher-assignment-row small {
    color: var(--muted);
}

.school-directory-metrics,
.school-directory-actions,
.managed-class-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.school-directory-actions form {
    margin: 0;
}

.school-directory-metrics span,
.school-directory-metrics em,
.class-chip-row .status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.76);
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.school-directory-metrics em {
    color: var(--accent);
    border-color: var(--accent-border);
}

.school-directory-action-link {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 32px;
    padding: 6px 8px;
    border: 0;
    border-radius: 9px;
    color: var(--accent-deep);
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    appearance: none;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.school-directory-action-link:hover {
    color: var(--accent);
    background: rgba(178, 76, 43, 0.07);
    transform: none;
}

.school-directory-action-link span {
    font-size: 14px;
    transition: transform 0.18s ease;
}

.school-directory-action-link:hover span {
    transform: translateX(2px);
}

.school-directory-action-link-danger {
    color: #9f3d2e;
}

.school-directory-action-link-danger:hover {
    color: #7f1d1d;
    background: rgba(183, 61, 38, 0.08);
}

.school-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
    gap: 20px;
}

.school-edit-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.school-edit-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.teacher-assignment-row {
    grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr) auto;
}

.teacher-class-checks,
.class-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.teacher-class-checks label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink);
    font-size: 13px;
}

.teacher-class-checks input {
    width: auto;
    min-width: 16px;
    height: 16px;
    padding: 0;
    appearance: auto;
    -webkit-appearance: auto;
}

.credential-grid {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 16px;
    border-radius: 12px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
}

.credential-grid span {
    color: var(--muted);
}

.credential-grid strong {
    margin: 0;
    font-size: 18px;
    font-family: var(--font-body);
    word-break: break-all;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}

.exam-live-summary-grid {
    margin-bottom: 20px;
}

.compact-stat-card {
    padding: 18px;
}

.compact-stat-card strong {
    font-size: 30px;
}

.warning-stat-card {
    background: rgba(255, 247, 240, 0.92);
}

.active-exam-list {
    display: grid;
    gap: 18px;
}

.active-exam-card {
    padding: 22px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(249, 241, 232, 0.58));
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.active-exam-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 40px rgba(52, 34, 19, 0.12);
    border-color: var(--accent-border);
}

.active-exam-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.active-exam-header h3 {
    margin: 8px 0 0;
}

.active-exam-head-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.active-exam-meta {
    margin-bottom: 18px;
}

.exam-progress-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.active-exam-drawers {
    display: grid;
    gap: 14px;
}

.participant-drawer {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.participant-drawer summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.participant-drawer summary::-webkit-details-marker {
    display: none;
}

.participant-drawer[open] summary {
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.participant-list {
    display: grid;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding: 16px 18px 18px;
}

.participant-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(50, 40, 28, 0.08);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow-soft);
}

.participant-card.is-submitted {
    background: rgba(242, 250, 245, 0.9);
    border-color: rgba(47, 155, 106, 0.16);
}

.participant-card.is-warning {
    background: rgba(255, 244, 238, 0.92);
    border-color: rgba(183, 61, 38, 0.14);
}

.participant-card strong {
    display: block;
}

.participant-card span,
.participant-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.participant-side {
    text-align: right;
}

.participant-side strong {
    margin-top: 8px;
    color: var(--accent-deep);
}

.compact-empty-state {
    margin: 16px 18px 18px;
    padding: 18px;
}

.participant-more-tip {
    margin: 0 18px 16px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px dashed rgba(50, 40, 28, 0.18);
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.class-bar-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
    gap: 16px;
    align-items: end;
    min-height: 280px;
}

.class-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.class-bar-frame {
    width: 100%;
    height: 210px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 10px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(234, 223, 211, 0.7));
    border: 1px solid var(--line);
}

.class-bar-fill {
    display: block;
    width: 100%;
    border-radius: 14px 14px 8px 8px;
    background: linear-gradient(180deg, #d97e51 0%, #b24c2b 100%);
    box-shadow: 0 12px 26px rgba(178, 76, 43, 0.22);
}

.class-bar-item strong {
    font-size: 22px;
}

.class-bar-item span {
    font-weight: 600;
}

.class-bar-item small {
    color: var(--muted);
}

.activity-card-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.activity-card {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(249, 241, 232, 0.58));
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.activity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 36px rgba(52, 34, 19, 0.1);
    border-color: rgba(95, 141, 132, 0.22);
}

.activity-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.compact-meta-grid {
    margin: 16px 0;
}

.progress-track {
    height: 14px;
    border-radius: 999px;
    background: rgba(84, 77, 68, 0.1);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.progress-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4a9a86, var(--accent-deep));
}

.overview-hero,
.class-hero,
.exam-score-hero {
    align-items: center;
}

.overview-caption {
    margin-top: 14px;
    font-size: 13px;
    color: var(--muted);
}

.dashboard-shell,
.class-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 20px;
    align-items: start;
}

.dashboard-side-stack {
    display: grid;
    gap: 20px;
}

.shortcut-list {
    display: grid;
    gap: 12px;
}

.shortcut-link {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.6);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.shortcut-link:hover {
    transform: translateY(-1px);
    border-color: rgba(178, 76, 43, 0.18);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow-soft);
}

.shortcut-link strong {
    color: var(--ink);
}

.shortcut-link span {
    color: var(--muted);
}

.static-shortcut:hover {
    transform: none;
}

.exam-overview-card,
.overview-exam-card,
.student-chip {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 239, 228, 0.68));
    box-shadow: var(--shadow-soft);
}

.exam-overview-card:hover,
.overview-exam-card:hover,
.student-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 42px rgba(52, 34, 19, 0.12);
    border-color: rgba(178, 76, 43, 0.2);
}

.class-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 620px), 1fr));
    gap: 16px;
}

.class-card-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 720px), 1fr));
}

.class-entry-card {
    display: grid;
    grid-template-columns: 172px minmax(0, 1.6fr) minmax(220px, 0.95fr) 148px;
    gap: 0;
    padding: 0;
    border-radius: 22px;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at top right, rgba(178, 76, 43, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 239, 228, 0.82));
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.class-entry-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 42px rgba(52, 34, 19, 0.12);
    border-color: rgba(178, 76, 43, 0.22);
}

.class-entry-card > section {
    min-width: 0;
    padding: 18px 18px 16px;
    display: grid;
    align-content: center;
    gap: 12px;
}

.class-entry-card > section + section {
    border-left: 1px solid rgba(50, 40, 28, 0.08);
}

.exam-overview-head,
.overview-exam-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.class-entry-identity {
    background: linear-gradient(180deg, rgba(255, 249, 243, 0.88), rgba(248, 239, 228, 0.76));
}

.class-entry-title,
.class-entry-title-compact {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.class-entry-title h3,
.exam-overview-head h3,
.overview-exam-head h4 {
    margin: 0;
}

.class-entry-title-compact h3 {
    font-size: 32px;
    line-height: 1.05;
    font-family: var(--font-display);
}

.class-entry-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(178, 76, 43, 0.08);
    color: var(--accent-deep);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.class-entry-story {
    background: rgba(255, 255, 255, 0.56);
}

.class-entry-summary {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.7;
    font-weight: 700;
}

.class-entry-facts,
.class-entry-info-list {
    display: grid;
    gap: 10px;
}

.class-entry-fact,
.class-entry-info-row {
    display: grid;
    gap: 4px;
}

.class-entry-fact span,
.class-entry-info-row span {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.class-entry-fact strong,
.class-entry-info-row strong {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    font-weight: 600;
}

.class-entry-metrics-section {
    background: rgba(251, 247, 241, 0.86);
}

.class-entry-metrics,
.exam-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-content: center;
}

.class-entry-metric {
    padding: 12px 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(50, 40, 28, 0.08);
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.class-entry-metric span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.class-entry-metric strong {
    display: block;
    margin-top: 6px;
    font-size: 19px;
    font-family: var(--font-display);
}

.class-entry-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: linear-gradient(180deg, rgba(255, 252, 248, 0.94), rgba(249, 242, 234, 0.84));
}

.class-entry-action-copy {
    display: grid;
    gap: 6px;
}

.class-entry-action-copy small {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.class-entry-action-copy strong {
    color: var(--accent-deep);
    font-size: 15px;
}

.class-entry-action-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(178, 76, 43, 0.1);
    color: var(--accent-deep);
    font-size: 20px;
    font-weight: 700;
}

.home-class-directory {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.home-class-directory-head,
.home-class-directory-row {
    display: grid;
    grid-template-columns: minmax(210px, 0.95fr) minmax(0, 1.4fr) 138px;
    align-items: center;
}

.home-class-directory-head {
    min-height: 58px;
    padding: 0 20px;
    background: rgba(40, 117, 103, 0.07);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-class-directory-head > span:last-child {
    text-align: right;
}

.home-class-directory-metric-heads,
.home-class-directory-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-class-directory-metric-heads {
    gap: 12px;
    padding: 0 18px;
}

.home-class-directory-metric-heads span {
    text-align: center;
}

.home-class-directory-row {
    color: inherit;
    min-height: 104px;
    padding: 0 20px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.home-class-directory-row:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.9);
}

.home-class-directory-class,
.home-class-directory-metrics,
.home-class-directory-action {
    min-width: 0;
    padding: 18px 0;
}

.home-class-directory-metrics,
.home-class-directory-action {
    border-left: 1px solid var(--line);
}

.home-class-directory-class {
    display: grid;
    gap: 5px;
    padding-right: 18px;
}

.home-class-directory-class strong {
    font-size: 30px;
    line-height: 1;
    font-family: var(--font-display);
}

.home-class-directory-class small {
    color: var(--muted);
    line-height: 1.55;
}

.home-class-directory-stat {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 6px;
    min-height: 68px;
    padding: 0 12px;
}

.home-class-directory-stat + .home-class-directory-stat {
    border-left: 1px solid var(--line);
}

.home-class-directory-stat span {
    display: none;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-class-directory-stat strong {
    font-size: 22px;
    line-height: 1.1;
    font-family: var(--font-display);
    color: var(--ink);
}

.home-class-directory-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    color: var(--accent-deep);
    font-weight: 700;
    white-space: nowrap;
    padding-left: 18px;
}

.home-class-directory-action i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--accent-soft);
    font-style: normal;
    font-size: 16px;
}

.class-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 18px;
}

.class-directory-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.96), rgba(241, 247, 242, 0.86));
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.class-directory-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 36px rgba(22, 39, 36, 0.12);
    border-color: var(--accent-border);
}

.class-directory-card-top,
.class-directory-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.class-directory-label {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.class-directory-card-main {
    display: grid;
    gap: 10px;
}

.class-directory-card-main h3 {
    margin: 0;
    font-size: 34px;
    line-height: 1;
    font-family: var(--font-display);
}

.class-directory-summary {
    margin: 0;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.7;
    font-weight: 600;
}

.class-directory-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.class-directory-fact,
.class-directory-metric {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.class-directory-fact span,
.class-directory-metric span {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.class-directory-fact strong,
.class-directory-metric strong {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.55;
}

.class-directory-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.class-directory-metric {
    text-align: center;
    padding: 14px 12px;
}

.class-directory-metric strong {
    font-size: 22px;
    font-family: var(--font-display);
    line-height: 1.1;
}

.class-directory-footer {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.class-directory-footer-copy {
    display: grid;
    gap: 6px;
}

.class-directory-footer-copy small {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.class-directory-footer-copy strong {
    color: var(--accent-deep);
    font-size: 15px;
}

.class-directory-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}

.dashboard-stage-grid {
    align-items: start;
}

.stage-panel {
    display: grid;
    gap: 18px;
}

.stage-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.92), rgba(239, 246, 241, 0.78));
    border: 1px solid var(--line);
}

.stage-banner-soft {
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.92), rgba(236, 243, 238, 0.78));
}

.stage-banner h3 {
    margin: 8px 0 8px;
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 1.05;
}

.stage-banner p {
    margin: 0;
    max-width: 42ch;
    color: var(--muted);
    line-height: 1.7;
}

.stage-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
    color: var(--accent-deep);
    font-weight: 700;
    white-space: nowrap;
}

.live-exam-stack,
.app-activity-stack {
    display: grid;
    gap: 16px;
}

.live-exam-card,
.app-activity-strip {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.live-exam-card:hover,
.app-activity-strip:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(22, 39, 36, 0.1);
    border-color: var(--accent-border);
}

.live-exam-card-head,
.app-activity-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.live-exam-title,
.app-activity-title {
    display: grid;
    gap: 6px;
}

.live-exam-title h4,
.app-activity-title h4 {
    margin: 0;
    font-size: 24px;
    line-height: 1.08;
    font-family: var(--font-display);
}

.live-exam-title p,
.app-activity-title p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.live-exam-timeline {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.live-exam-metrics,
.app-activity-data {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.app-activity-data {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.live-exam-metric,
.app-activity-stat {
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid var(--line);
}

.live-exam-metric span,
.app-activity-stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.live-exam-metric strong,
.app-activity-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 22px;
    font-family: var(--font-display);
}

.overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 20px;
}

.overview-exam-list,
.exam-overview-list {
    display: grid;
    gap: 16px;
}

.overview-exam-card,
.exam-overview-card {
    padding: 22px;
}

.activity-card-list-single {
    grid-template-columns: 1fr;
}

.page-actions-inline {
    margin-top: 16px;
    padding-top: 0;
    border-top: 0;
    justify-content: flex-start;
}

.student-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.student-chip-grid-compact {
    grid-template-columns: 1fr;
}

.student-chip {
    display: grid;
    gap: 6px;
    padding: 18px;
}

.student-chip strong {
    font-size: 16px;
}

.student-chip span,
.student-chip small {
    color: var(--muted);
}

.leaderboard-note {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(241, 247, 242, 0.82);
    border: 1px solid var(--accent-border);
    color: var(--muted);
    line-height: 1.7;
}

.leaderboard-table-wrap table {
    min-width: 980px;
}

.leaderboard-top-row {
    background: rgba(255, 246, 235, 0.84);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(84, 77, 68, 0.08);
    color: var(--muted);
    font-weight: 700;
}

.rank-badge-top {
    background: linear-gradient(135deg, rgba(178, 76, 43, 0.14), rgba(127, 45, 22, 0.22));
    color: var(--accent-deep);
}

.rank-badge-muted {
    background: rgba(84, 77, 68, 0.06);
    color: rgba(108, 98, 88, 0.84);
}

.table-score {
    font-weight: 700;
    color: var(--accent-deep);
}

.table-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(84, 77, 68, 0.08);
    color: var(--muted);
    font-size: 13px;
}

.table-status-ready {
    background: rgba(47, 155, 106, 0.14);
    color: #1f6f4a;
}

@media (max-width: 1500px) {
    .class-entry-card {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .class-entry-metrics-section {
        border-left: 0;
        border-top: 1px solid rgba(50, 40, 28, 0.08);
    }

    .class-entry-action {
        border-top: 1px solid rgba(50, 40, 28, 0.08);
    }
}

@media (max-width: 1100px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        top: auto;
        min-height: auto;
        display: grid;
        gap: 18px;
        padding: 20px 18px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .brand {
        max-width: 76ch;
    }

    .nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
        margin-top: 0;
    }

    .nav a {
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .sidebar-note {
        margin-top: 0;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px 20px;
    }

    .content {
        padding-top: 24px;
    }

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

    .account-school-tools,
    .account-user-card {
        grid-template-columns: 1fr;
    }

    .account-user-actions {
        border-left: 0;
        border-top: 1px dashed var(--line);
    }

    .activity-card-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .class-entry-card {
        grid-template-columns: 1fr;
    }

    .class-card-grid-wide {
        grid-template-columns: 1fr;
    }

    .class-directory-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    }

    .home-class-directory-head,
    .home-class-directory-row {
        grid-template-columns: minmax(170px, 0.9fr) minmax(0, 1fr) 112px;
    }

    .home-class-directory-head,
    .home-class-directory-row {
        padding-left: 16px;
        padding-right: 16px;
    }

    .home-class-directory-metric-heads {
        gap: 6px;
        padding: 0 12px;
    }

    .class-entry-card > section + section {
        border-left: 0;
        border-top: 1px solid rgba(50, 40, 28, 0.08);
    }

    .app-activity-data {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .exam-builder {
        grid-template-columns: 1fr;
    }

    .exam-builder-main,
    .exam-builder-side {
        grid-column: auto;
    }

    .exam-builder-side {
        position: static;
    }

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

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

    .dashboard-shell,
    .class-detail-layout {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 760px) {
    .sidebar {
        gap: 16px;
        padding: 18px;
    }

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

    .nav a {
        justify-content: flex-start;
        text-align: left;
    }

    .sidebar-note {
        display: block;
    }

    .content {
        padding: 18px;
    }

    .hero,
    .panel {
        padding: 18px;
        border-radius: 20px;
    }

    .hero h2 {
        font-size: 30px;
    }

    .stats-grid,
    .form-grid,
    .school-create-form,
    .credential-banner,
    .exam-form,
    .publish-form,
    .inline-table-form,
    .meta-grid,
    .publish-grid,
    .summary-grid,
    .segmented-nav,
    .dashboard-grid,
    .live-exam-metrics,
    .app-activity-data,
    .exam-metric-grid,
    .publish-mode-grid,
    .publish-class-choice-list,
    .class-directory-facts {
        grid-template-columns: 1fr;
    }

    .filter-bar,
    .publish-tools,
    .filter-actions,
    .client-filter-row,
    .page-links,
    .class-entry-chip-row,
    .stage-banner,
    .live-exam-card-head,
    .app-activity-main,
    .exam-overview-head,
    .overview-exam-head,
    .active-exam-header,
    .active-exam-head-actions,
    .participant-card,
    .compact-pill-row,
    .device-drawer summary,
    .device-drawer-meta,
    .class-directory-card-top,
    .publish-selector-head,
    .class-directory-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .publish-scope-workspace {
        padding: 14px;
    }

    .publish-mode-card {
        min-height: 0;
    }

    .account-password-form,
    .account-create-form,
    .school-create-form.account-control-form,
    .school-filter-form.account-control-form {
        grid-template-columns: 1fr;
    }

    .account-danger-row,
    .account-status-row {
        align-items: stretch;
    }

    .account-delete-form {
        margin-left: 0;
    }

    .account-delete-button,
    .account-secondary-button,
    .account-ghost-button,
    .account-primary-button {
        width: 100%;
    }

    .home-class-directory {
        border: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .home-class-directory-head {
        display: none;
    }

    .home-class-directory-row {
        grid-template-columns: 1fr;
        gap: 14px;
        min-height: 0;
        padding: 18px;
        border: 1px solid var(--line);
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.72);
        box-shadow: var(--shadow-soft);
    }

    .home-class-directory-row + .home-class-directory-row {
        margin-top: 12px;
    }

    .home-class-directory-class,
    .home-class-directory-metrics,
    .home-class-directory-action {
        padding: 0;
        border-left: 0;
    }

    .home-class-directory-metrics,
    .home-class-directory-action {
        padding-top: 14px;
        border-top: 1px solid rgba(50, 40, 28, 0.08);
    }

    .home-class-directory-class {
        padding-right: 0;
    }

    .home-class-directory-class strong {
        font-size: 28px;
    }

    .home-class-directory-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .home-class-directory-stat {
        min-height: 74px;
        padding: 12px;
        border: 1px solid rgba(50, 40, 28, 0.08);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.78);
    }

    .home-class-directory-stat + .home-class-directory-stat {
        border-left: 0;
    }

    .home-class-directory-stat span {
        display: block;
    }

    .home-class-directory-action {
        justify-content: space-between;
    }

    .ghost-button,
    .link-button {
        width: 100%;
    }

    .class-entry-card > section {
        padding: 16px;
    }

    .class-entry-title-compact h3 {
        font-size: 28px;
    }

    .class-directory-card {
        padding: 18px;
        gap: 16px;
    }

    .class-directory-card-main h3 {
        font-size: 28px;
    }

    .class-entry-metric {
        padding: 12px 8px;
    }

    table {
        min-width: 760px;
    }
}

@media (max-width: 560px) {
    .class-directory-metrics {
        grid-template-columns: 1fr;
    }

    .school-admin-layout,
    .school-edit-form,
    .school-directory-row,
    .managed-class-row,
    .teacher-assignment-row {
        grid-template-columns: 1fr;
    }

    .school-directory-metrics,
    .school-directory-actions,
    .managed-class-actions {
        justify-content: flex-start;
    }

    .teacher-class-checks label {
        width: 100%;
    }
}

/* Teacher-facing admin pages: keep the final layer quiet and operational. */
.segment-link {
    border-radius: 12px;
}

.segment-link:hover,
.segment-link.active,
.ghost-button:hover,
.compact-card:hover,
.shortcut-link:hover,
.exam-overview-card:hover,
.overview-exam-card:hover,
.student-chip:hover,
.class-entry-card:hover {
    border-color: var(--accent-border);
}

.segment-link.active {
    box-shadow: 0 14px 32px rgba(20, 79, 71, 0.12);
    background: linear-gradient(135deg, rgba(238, 247, 241, 0.92), rgba(255, 255, 255, 0.9));
}

.compact-card,
.exam-overview-card,
.overview-exam-card,
.student-chip,
.class-entry-card {
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.94), rgba(240, 246, 241, 0.78));
}

.compact-card:hover,
.exam-overview-card:hover,
.overview-exam-card:hover,
.student-chip:hover,
.class-entry-card:hover {
    box-shadow: 0 18px 32px rgba(22, 39, 36, 0.11);
}

.class-entry-identity {
    background: rgba(241, 247, 242, 0.72);
}

.class-entry-label,
.rank-badge-top {
    background: var(--accent-soft);
    color: var(--accent-deep);
}
