:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafd;
    --border: #e2e8f3;
    --text: #16233b;
    --muted: #5f6f8b;
    --accent: #1f6b42;
    --accent-soft: #e7f4ec;
    --shadow-sm: 0 8px 20px rgba(17, 37, 78, 0.08);
    --shadow-md: 0 16px 34px rgba(17, 37, 78, 0.1);
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--text);
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    font-size: 14px;
    background:
        radial-gradient(1200px 700px at -10% -15%, #e3f0e8 0%, transparent 65%),
        radial-gradient(1000px 650px at 105% 15%, #e8f4ee 0%, transparent 66%),
        linear-gradient(145deg, #f4f8f5 0%, #edf4ef 100%);
    min-height: 100vh;
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 14px;
    top: 14px;
    z-index: 1000;
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    padding: 24px 16px;
    border-right: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.brand-logo-mark {
    width: 34px;
    height: 34px;
    display: block;
    flex-shrink: 0;
}

.brand-name {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 800;
    color: #1d3f2d;
}

.brand-tag {
    margin: 2px 0 0;
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #5f7566;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #30425e;
    font-weight: 600;
    font-size: 0.9rem;
}

.nav-link:hover,
.nav-link:focus-visible {
    outline: none;
    background: #f1f5fd;
}

.nav-link.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    margin-left: auto;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.75rem;
    line-height: 1;
    font-weight: 800;
    box-shadow: 0 0 0 2px #fff, 0 6px 14px rgba(220, 38, 38, 0.28);
    flex-shrink: 0;
}

.nav-link.is-active .nav-badge {
    box-shadow: 0 0 0 2px var(--accent-soft), 0 6px 14px rgba(220, 38, 38, 0.28);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #edf3ef;
    color: #395146;
    font-size: 0.62rem;
    letter-spacing: 0.02em;
    font-weight: 800;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.nav-link.is-active .nav-icon {
    background: #d6ebde;
    color: #1f6b42;
}

.shell-main {
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 700;
}

.topbar-title {
    margin: 6px 0 0;
    font-size: 1.28rem;
    font-weight: 800;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
    background: var(--accent);
    box-shadow: var(--shadow-sm);
}

.content {
    display: grid;
    gap: 16px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.panel h1,
.panel h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.panel h3 {
    margin: 0;
    font-size: 0.95rem;
}

.meta {
    margin: 4px 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    text-transform: capitalize;
    white-space: nowrap;
}

.btn {
    display: inline-block;
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    font-size: 0.84rem;
    line-height: 1.2;
    min-height: 36px;
    width: fit-content;
    max-width: 100%;
}

.btn.secondary {
    background: #5b6b86;
}

.btn.success {
    background: #1f6b42;
}

.btn.success .btn-mark {
    background: rgba(255, 255, 255, 0.2);
}

.btn.danger {
    background: #c53939;
}

.btn.secondary.danger {
    background: #c53939;
}

.btn.danger .btn-mark {
    background: rgba(255, 255, 255, 0.2);
}

.btn.subtle {
    background: #eef4ef;
    color: #2f4a3a;
    border: 1px solid #d5e3d9;
    box-shadow: none;
}

.btn.subtle.secondary {
    background: #f2f5f7;
    color: #43556f;
    border-color: #dbe2ea;
}

.btn.subtle .btn-mark {
    background: rgba(31, 107, 66, 0.1);
    color: #1f6b42;
}

.btn.subtle.secondary .btn-mark {
    background: rgba(91, 107, 134, 0.14);
    color: #4f607d;
}

.btn.icon {
    padding: 9px 12px;
    font-size: 0.84rem;
}

.master-password-send-email-btn {
    min-width: 12.2rem;
    justify-content: center;
    white-space: normal;
}


.btn .btn-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    margin-right: 7px;
    font-size: 0.62rem;
    font-weight: 800;
    vertical-align: middle;
}

.btn .btn-mark svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn.is-loading {
    opacity: 0.9;
}

.btn .spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    animation: btn-spin 0.8s linear infinite;
}

@keyframes btn-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.toast,
.toast-action {
    --toast-label: "Notice";
    --toast-track: #dde5eb;
    --toast-fill-start: #9fb8d5;
    --toast-fill-end: #789cc8;
    position: fixed;
    overflow: hidden;
    padding-bottom: 14px;
    background-image: linear-gradient(var(--toast-track), var(--toast-track));
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: 100% 4px;
}

.toast.success,
.toast-action.success {
    --toast-label: "Success";
    --toast-fill-start: #d9f0de;
    --toast-fill-end: #38a169;
}

.toast.danger,
.toast-action.danger {
    --toast-label: "Error";
    --toast-fill-start: #f9d6d3;
    --toast-fill-end: #dc2626;
}

.toast.warning,
.toast-action.warning {
    --toast-label: "Warning";
    --toast-fill-start: #fde7bc;
    --toast-fill-end: #d97706;
}

.toast::before,
.toast-action::before {
    content: var(--toast-label);
    display: block;
    margin-bottom: 4px;
    font-weight: 800;
    line-height: 1.15;
}

.toast::after,
.toast-action::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 0;
    background: linear-gradient(90deg, var(--toast-fill-start), var(--toast-fill-end));
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
    animation: toast-progress-fill 5s linear forwards;
}

@keyframes toast-progress-fill {
    from { width: 0; }
    to { width: 100%; }
}
    to { background-size: 100% 100%, 100% 100%; }
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.section-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.panel-form {
    display: grid;
    gap: 10px;
}

.panel-form .btn,
.form-grid .btn {
    justify-self: start;
}

.stack-sm { display: grid; gap: 8px; }
.stack-md { display: grid; gap: 10px; }
.stack-lg { display: grid; gap: 12px; }
.row-wrap { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }

.field-sm { max-width: 240px; }
.field-md { max-width: 420px; }
.field-lg { max-width: 720px; }
.field-min-220 { min-width: 220px; }
.field-min-240 { min-width: 240px; }
.field-min-260 { min-width: 260px; }
.field-min-320 { min-width: 320px; }
.field-min-340 { min-width: 340px; }

.form-inline {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-inline > div {
    min-width: 220px;
}

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

.form-grid .full {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.84rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cfd9ea;
    border-radius: 10px;
    background: var(--surface-2);
    padding: 10px 11px;
    font: inherit;
    font-size: 0.88rem;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 2px solid #2f6fca;
    outline-offset: 2px;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6f8b' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.4;
}

.checkbox-select {
    position: relative;
}

.checkbox-select-toggle {
    width: 100%;
    border: 1px solid #cfd9ea;
    border-radius: 10px;
    background: var(--surface-2);
    padding: 10px 38px 10px 11px;
    font: inherit;
    font-size: 0.88rem;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    position: relative;
}

.checkbox-select-toggle::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6f8b' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 12px 12px;
    background-position: center;
    transform: translateY(-50%);
    pointer-events: none;
}

.checkbox-select.is-open .checkbox-select-toggle::after {
    transform: translateY(-50%) rotate(180deg);
}

.checkbox-select-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 60;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-md);
    max-height: 220px;
    overflow: auto;
    padding: 6px;
}

.checkbox-select.is-open .checkbox-select-menu {
    display: block;
}

.checkbox-select-option {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: start;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    margin: 1px 0;
    cursor: pointer;
}

.checkbox-select-option:hover {
    background: #f4f7fc;
}

 .checkbox-select-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    accent-color: #1f6b42;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1f6b42;
    cursor: pointer;
}

.role-radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #cfd9ea;
    background: var(--surface-2);
    border-radius: 10px;
    padding: 9px 11px;
    min-width: 110px;
    font-size: 0.86rem;
    color: #2f4a3a;
}

.radio-option input[type="radio"] {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
}

.toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.toggle-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.toggle-slider {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #cfd9ea;
    border: 1px solid #bfcde3;
    transition: background-color .18s ease;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(20, 35, 60, 0.2);
    transition: transform .18s ease;
}

.toggle-input:checked + .toggle-slider {
    background: #1f6b42;
    border-color: #1f6b42;
}

.toggle-input:checked + .toggle-slider::after {
    transform: translateX(18px);
}

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

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #d5deeb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.table.sticky-head thead th {
    position: sticky;
    top: 0;
    background: #eaf4ee;
    z-index: 2;
}

.table th,
.table td {
    text-align: left;
    padding: 10px 9px;
    border-bottom: 1px solid #e2e8f3;
    border-right: 1px solid #e2e8f3;
    font-size: 0.84rem;
}

.table th {
    color: #2f4a3a;
    background: #eaf4ee;
    font-size: 0.84rem;
    white-space: normal;
    border-bottom: 1px solid #cfe0d4;
}

.msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 13px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    border-left-width: 4px;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
    line-height: 1.45;
    font-size: 0.86rem;
}

.msg::before {
    content: 'i';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    flex: 0 0 18px;
    margin-top: 1px;
}

.msg.error {
    background: #fff2f1;
    color: #7f1d1d;
    border-color: #f5c2c2;
}

.msg.error::before {
    content: '!';
    background: #b42318;
    color: #fff;
}

.msg.success {
    background: #edfaf2;
    color: #14532d;
    border-color: #b7e4c7;
}

.msg.success::before {
    content: '✓';
    background: #136a35;
    color: #fff;
}

.msg.warning {
    background: #fffaeb;
    color: #7a4b00;
    border-color: #f3d28b;
}

.msg.warning::before {
    content: '!';
    background: #8a5a00;
    color: #fff;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.question-material-linked-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 180px;
    width: 180px;
    max-width: 180px;
    min-width: 180px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    background: #edfdf3;
    color: #166534;
    border: 1px solid #b7e4c7;
}

.question-material-linked-cell {
    vertical-align: middle;
}

.question-material-linked-cell-body {
    padding-top: 0;
    padding-bottom: 0;
}

.question-material-linked-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.question-material-linked-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    width: 100%;
    min-height: 40px;
}

.question-material-linked-item > .question-material-linked-pill {
    flex: 0 0 180px;
}

.question-material-linked-item > .btn {
    margin-left: auto;
    align-self: center;
}

.question-material-linked-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    flex-wrap: wrap;
}

.js-question-material-form {
    align-items: flex-start;
}

.question-material-bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 20px;
    align-items: stretch;
}

.question-material-bulk-summary {
    flex: 1 1 320px;
    min-width: 260px;
    padding: 12px 14px;
    border: 1px solid #d6deeb;
    border-radius: 10px;
    background: #f8fbff;
}

.question-material-bulk-summary strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.92rem;
}

.question-material-bulk-summary .meta {
    margin: 0;
}

.question-material-bulk-controls {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.question-material-bulk-controls .field-lg {
    margin: 0;
    flex: 1 1 260px;
    min-width: 260px;
}

.question-material-bulk-controls .btn {
    align-self: flex-end;
}

.js-question-material-checkbox:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


.empty-state {
    display: grid;
    gap: 4px;
    padding: 12px 10px;
    border: 1px dashed #ced9ea;
    border-radius: 10px;
    background: #f7fbff;
}

.empty-state-title {
    margin: 0;
    font-weight: 700;
    color: #2f415f;
}

.empty-state-note {
    margin: 0;
    color: #5f6f8b;
    font-size: 0.82rem;
}

.inline-error {
    margin-top: 6px;
    color: #8f1d1d;
    font-size: 0.8rem;
    font-weight: 700;
    background: #fff3f2;
    border-left: 3px solid #d92d20;
    padding: 6px 8px;
    border-radius: 8px;
}

.table-search {
    margin: 0 0 10px;
    max-width: 360px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.actions-inline {
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    white-space: normal;
}

.actions-inline form {
    margin: 0;
}

.action-link {
    border: 0;
    background: transparent;
    color: #30425e;
    padding: 4px 2px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.action-link:hover,
.action-link:focus-visible {
    color: #1f6b42;
    outline: none;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.icon-link .btn-mark {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-link .btn-mark svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}


@media (max-width: 1200px) {
    .actions-inline {
        flex-wrap: wrap;
        white-space: normal;
    }
}

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

.dashboard-card {
    display: block;
}

.card-kicker {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 960px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .shell-main {
        padding: 16px;
    }

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

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

    .cards-2 {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

}

.table tr > *:last-child {
    border-right: 0;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table.table-compact th,
.table.table-compact td {
    padding: 8px 7px;
    font-size: 0.8rem;
}

.table.table-compact .btn {
    padding: 9px 12px;
    font-size: 0.84rem;
}

.table.table-compact .btn .btn-mark {
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

.table.table-compact .meta {
    font-size: 0.78rem;
}


.question-material-attach {
    flex-wrap: nowrap;
    align-items: flex-end;
}

.question-material-attach > .field-min-240 {
    min-width: 0;
    flex: 1 1 auto;
}

.question-material-attach .btn {
    flex: 0 0 auto;
    white-space: normal;
}

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

.dashboard-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
}

.dashboard-summary-card {
    min-height: 120px;
}

.dashboard-summary-card-alert {
    border-left: 4px solid #dc2626;
    background: linear-gradient(135deg, #fff8f8 0%, #fffdfd 100%);
}

.analytics-kpi {
    border: 1px solid #d8e4f0;
    background: #f8fcfa;
    border-radius: 12px;
    padding: 12px;
}

.analytics-kpi-label {
    margin: 0;
    color: #5f6f8b;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.analytics-kpi-value {
    margin: 8px 0 0;
    color: #183454;
    font-size: 1.35rem;
    font-weight: 800;
}

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

.analytics-span-2 {
    grid-column: 1 / -1;
}

.trend-chart {
    margin-top: 10px;
    border: 1px solid #d7e3ef;
    border-radius: 12px;
    background: linear-gradient(180deg, #fcfeff 0%, #f7fbff 100%);
    padding: 10px;
    height: 210px;
}

.trend-chart svg,
.trend-chart canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.chart-grid-line {
    stroke: #e3eaf3;
    stroke-width: 1;
}

.chart-trend-line {
    fill: none;
    stroke: #1f6b42;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.trend-legend {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.trend-legend span {
    font-size: 0.74rem;
    color: #4b5d79;
    border: 1px solid #d8e3ef;
    background: #f7fbff;
    border-radius: 999px;
    padding: 3px 8px;
}

.category-highlight-grid {
    margin-top: 8px;
    display: grid;
    gap: 10px;
}

.category-highlight-card {
    border: 1px solid #d7e2ef;
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(26, 54, 93, 0.06);
}

.category-highlight-rank {
    margin: 0 0 6px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4b5d79;
}

.category-highlight-card.strong {
    border-left: 4px solid #1f6b42;
    background: linear-gradient(90deg, rgba(31,107,66,0.07) 0%, #ffffff 26%);
}

.category-highlight-card.weak {
    border-left: 4px solid #b42318;
    background: linear-gradient(90deg, rgba(180,35,24,0.07) 0%, #ffffff 26%);
}

.category-highlight-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1b304f;
}

.category-highlight-metric {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: #4b5d79;
    font-weight: 600;
}

.bar-list {
    display: grid;
    gap: 8px;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(120px, 2fr) 48px;
    gap: 8px;
    align-items: center;
}

.bar-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #30425e;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    height: 9px;
    border-radius: 999px;
    background: #e7edf5;
    overflow: hidden;
}

.bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3f81d7 0%, #1f6b42 100%);
}

.bar-fill.strong {
    background: linear-gradient(90deg, #24915a 0%, #1f6b42 100%);
}

.bar-fill.weak {
    background: linear-gradient(90deg, #d97706 0%, #b42318 100%);
}

.bar-value {
    text-align: right;
    font-size: 0.8rem;
    color: #4b5d79;
    font-weight: 700;
}

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

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

.assignment-insight-card {
    border: 1px solid #d7e2ef;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
}

.assignment-insight-row {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin: 8px 0 8px;
}

.assignment-insight-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.assignment-insight-chip.readiness.ready { background:#eaf8ef; color:#196f3a; border-color:#bfe3cc; }
.assignment-insight-chip.readiness.upcoming { background:#eef5ff; color:#2457a8; border-color:#cfe0fa; }
.assignment-insight-chip.readiness.completed { background:#eef7ed; color:#21653d; border-color:#cfe3d0; }
.assignment-insight-chip.readiness.aborted { background:#fff2f1; color:#912018; border-color:#f5c2c2; }

.assignment-insight-chip.urgency.low { background:#edf8f1; color:#1d6b3f; border-color:#cce9d6; }
.assignment-insight-chip.urgency.medium { background:#fff8eb; color:#895500; border-color:#f0d79f; }
.assignment-insight-chip.urgency.high { background:#fff1ef; color:#9a231b; border-color:#f3c4c1; }
.assignment-insight-chip.urgency.closed { background:#f3f5f9; color:#4a5d79; border-color:#dae2ec; }

.assignment-insight-chip.trajectory.up { background:#e8f8ee; color:#1f6b42; border-color:#c5e5d2; }
.assignment-insight-chip.trajectory.down { background:#fff2ef; color:#9b221b; border-color:#f3c5c2; }
.assignment-insight-chip.trajectory.flat { background:#eef4ff; color:#2d5da7; border-color:#d2e0fb; }
.assignment-insight-chip.trajectory.none { background:#f3f5f9; color:#4a5d79; border-color:#dae2ec; }

.test-card {
    border: 1px solid #d7e2ef;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
}

.test-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.test-card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #213b58;
}

.test-card-meta {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
}

.test-filters {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

@media (max-width: 960px) {
    .analytics-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .test-card-meta {
        grid-template-columns: 1fr;
    }

    .test-filters {
        grid-template-columns: 1fr;
    }

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

.dashboard-empty-state {
    display: grid;
    gap: 6px;
    padding: 14px 12px;
    margin-top: 8px;
    border: 1px dashed #b8cde5;
    border-left: 5px solid #2f6fca;
    border-radius: 10px;
    background: linear-gradient(135deg, #f4f9ff 0%, #edf5ff 100%);
}

.dashboard-empty-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 800;
    color: #1d3f71;
}

.dashboard-empty-note {
    margin: 0;
    font-size: 0.83rem;
    color: #456084;
    line-height: 1.45;
}

.mytests-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 12px;
}

.mytests-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d5dfec;
    border-radius: 999px;
    padding: 5px 10px;
    background: #f5f9ff;
    color: #365077;
    font-size: 0.8rem;
    font-weight: 600;
}

.mytests-summary-chip strong {
    color: #1e385c;
    font-size: 0.84rem;
}

.test-filters-enhanced {
    padding: 10px;
    border: 1px solid #d8e3ef;
    border-radius: 12px;
    background: #f9fcff;
}

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

.mytests-card {
    box-shadow: 0 6px 14px rgba(17, 37, 78, 0.06);
}

.mytests-meta-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.mytests-meta-chip {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    border: 1px solid #dde5f1;
    border-radius: 9px;
    background: #fbfdff;
    color: #425671;
    font-size: 0.78rem;
    line-height: 1.35;
    padding: 6px 8px;
}

.mytests-meta-chip strong {
    color: #294567;
    font-weight: 700;
}

@media (max-width: 960px) {
    .mytests-grid {
        grid-template-columns: 1fr;
    }

    .mytests-meta-grid {
        grid-template-columns: 1fr;
    }
}

.active-tests-panel {
    border-left: 4px solid #dc2626;
    border-color: #f1c8c8;
    background: linear-gradient(135deg, #fff9f9 0%, #fffdfd 100%);
}

.active-tests-panel .section-head h2 {
    color: #dc2626;
}

.mytests-active-grid {
    margin-top: 6px;
}

.mytests-active-card {
    border-color: #efb4b4;
    background: #ffffff;
}

.admin-analytics-detail-row td {
    background: #f8fbff;
}

.admin-analytics-detail-wrap {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 12px;
    padding: 6px 2px;
}

@media (max-width: 960px) {
    .admin-analytics-detail-wrap {
        grid-template-columns: 1fr;
    }
}

.monthly-pass-fail-graph {
    display: grid;
    gap: 8px;
}

.monthly-pass-fail-row {
    display: grid;
    grid-template-columns: 44px 1fr 96px;
    gap: 10px;
    align-items: center;
}

.monthly-pass-fail-month {
    font-size: 0.8rem;
    font-weight: 700;
    color: #415671;
}

.monthly-pass-fail-bars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.monthly-pass-fail-track {
    background: #edf2f9;
    border: 1px solid #d8e1ee;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.monthly-pass-fail-fill {
    display: block;
    height: 100%;
}

.monthly-pass-fail-fill.pass {
    background: linear-gradient(90deg, #1b7f4b 0%, #2fa164 100%);
}

.monthly-pass-fail-fill.fail {
    background: linear-gradient(90deg, #b8322d 0%, #d14f42 100%);
}

.monthly-pass-fail-values {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    font-weight: 700;
}

.monthly-pass-fail-values .pass-text {
    color: #1f6f44;
}

.monthly-pass-fail-values .fail-text {
    color: #a12620;
}

@media (max-width: 760px) {
    .monthly-pass-fail-row {
        grid-template-columns: 38px 1fr;
    }

    .monthly-pass-fail-values {
        grid-column: 1 / -1;
        margin-left: 48px;
    }
}

/* Analytics spacing refinements */
.toast,
.toast-action {
    --toast-label: "Notice";
    --toast-track: #dde5eb;
    --toast-fill-start: #9fb8d5;
    --toast-fill-end: #789cc8;
    position: fixed;
    overflow: hidden;
    padding-bottom: 14px;
    background-image: linear-gradient(var(--toast-track), var(--toast-track));
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: 100% 4px;
}

.toast.success,
.toast-action.success {
    --toast-label: "Success";
    --toast-fill-start: #d9f0de;
    --toast-fill-end: #38a169;
}

.toast.danger,
.toast-action.danger {
    --toast-label: "Error";
    --toast-fill-start: #f9d6d3;
    --toast-fill-end: #dc2626;
}

.toast.warning,
.toast-action.warning {
    --toast-label: "Warning";
    --toast-fill-start: #fde7bc;
    --toast-fill-end: #d97706;
}

.toast::before,
.toast-action::before {
    content: var(--toast-label);
    display: block;
    margin-bottom: 4px;
    font-weight: 800;
    line-height: 1.15;
}

.toast::after,
.toast-action::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 0;
    background: linear-gradient(90deg, var(--toast-fill-start), var(--toast-fill-end));
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
    animation: toast-progress-fill 5s linear forwards;
}

@keyframes toast-progress-fill {
    from { width: 0; }
    to { width: 100%; }
}
    to { background-size: 100% 100%, 100% 100%; }
}

.section-head {
    margin-bottom: 14px;
}

.section-head .meta {
    margin-top: 6px;
    margin-bottom: 0;
}

section.panel > h3 {
    margin-bottom: 8px;
}

section.panel > h3 + .meta {
    margin-top: 0;
    margin-bottom: 14px;
}

.analytics-kpis {
    margin-top: 14px;
}

.analytics-grid {
    margin-top: 2px;
}

.panel .table-wrap {
    margin-top: 12px;
}

.panel .bar-list {
    margin-top: 10px;
}

.monthly-pass-fail-graph {
    margin-top: 12px;
    gap: 10px;
}

.monthly-pass-fail-row {
    padding: 2px 0;
}

.monthly-pass-fail-header {
    padding-bottom: 4px;
    border-bottom: 1px solid #dfe7f2;
}

.monthly-pass-fail-header .monthly-pass-fail-month,
.monthly-pass-fail-col-title,
.monthly-pass-fail-header .monthly-pass-fail-values span {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.monthly-pass-fail-col-title {
    text-align: left;
}

.monthly-pass-fail-header .monthly-pass-fail-values {
    justify-content: space-between;
}

.monthly-pass-fail-row:not(.monthly-pass-fail-header) .monthly-pass-fail-values {
    font-size: 0.8rem;
}

.monthly-line-chart-wrap {
    margin-top: 16px;
    border: 1px solid #d9e3ef;
    border-radius: 12px;
    background: #fbfdff;
    padding: 10px 10px 8px;
}

.monthly-line-chart-legend {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.line-key {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #4b5d79;
}

.line-key::before {
    content: '';
    width: 18px;
    height: 3px;
    border-radius: 999px;
}

.line-key.pass::before {
    background: #1f7f4a;
}

.line-key.fail::before {
    background: #c23d34;
}

.monthly-line-chart {
    width: 100%;
    height: auto;
    display: block;
}

.monthly-line-chart .line-grid {
    stroke: #e5ecf5;
    stroke-width: 1;
}

.monthly-line-chart .line-y-label,
.monthly-line-chart .line-x-label {
    fill: #5f6f8b;
    font-size: 11px;
    font-weight: 600;
}

.monthly-line-chart .line-y-label {
    text-anchor: end;
}

.monthly-line-chart .line-x-label {
    text-anchor: middle;
}

.monthly-line-chart .line-series {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.monthly-line-chart .line-series.pass {
    stroke: #1f7f4a;
}

.monthly-line-chart .line-series.fail {
    stroke: #c23d34;
}

.monthly-line-chart .line-dot {
    stroke: #ffffff;
    stroke-width: 1.5;
}

.monthly-line-chart .line-dot.pass {
    fill: #1f7f4a;
}

.monthly-line-chart .line-dot.fail {
    fill: #c23d34;
}

.monthly-line-chart-wrap {
    height: 320px;
}

#monthly-pass-fail-chart {
    width: 100%;
    height: 100%;
}

.subchart-wrap {
    margin-top: 14px;
    height: 280px;
    border: 1px solid #d9e3ef;
    border-radius: 12px;
    background: #fbfdff;
    padding: 10px;
}

.subchart-wrap canvas {
    width: 100%;
    height: 100%;
}

.category-accuracy-panel .bar-list,
.category-accuracy-panel .meta {
    margin-top: 14px;
}

.analytics-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border: 1px solid #dbe5f1;
    border-radius: 12px;
    background: #f7fbff;
    margin-bottom: 12px;
}

.sticky-toolbar {
    position: sticky;
    top: 8px;
    z-index: 20;
}

.user-analytics-kpis {
    grid-template-columns: repeat(5, minmax(170px, 1fr));
    overflow-x: visible;
    padding-bottom: 2px;
}

.kpi-delta {
    margin-top: 6px;
    font-size: 0.74rem;
}

.chart-tools {
    margin-top: 10px;
    margin-bottom: 10px;
}

.chart-summary {
    margin-top: 10px;
}

.detail-toggle summary {
    cursor: pointer;
    color: #2d4d73;
    font-weight: 700;
    font-size: 0.82rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 10px;
    border: 1px solid #d6e1ef;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    background: #f3f7fc;
    color: #36506f;
}

.status-chip.completed {
    background: #eaf8ef;
    color: #1f6f44;
    border-color: #c9e7d4;
}

.status-chip.assigned {
    background: #eef4ff;
    color: #2956a3;
    border-color: #d4e1fa;
}

.status-chip.aborted {
    background: #fff2ef;
    color: #9a241c;
    border-color: #f3cbc7;
}

@media (max-width: 1100px) {
    .user-analytics-kpis {
        grid-template-columns: repeat(5, minmax(190px, 1fr));
    }
}

@media (max-width: 860px) {
    .analytics-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

.period-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.period-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d7e2ef;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #36506f;
    background: #f4f8fd;
    text-decoration: none;
}

.period-chip.is-active {
    color: #ffffff;
    background: #2b6cb0;
    border-color: #2b6cb0;
}

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

.insight-card {
    border: 1px solid #d8e3ef;
    border-radius: 12px;
    background: #f9fcff;
    padding: 10px;
}

.insight-label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5b6f8d;
}

.insight-value {
    margin: 8px 0 0;
    font-size: 0.86rem;
    font-weight: 800;
    color: #223f62;
}

.sort-indicator {
    display: inline-block;
    min-width: 10px;
    margin-left: 4px;
    color: #5f6f8b;
    font-size: 0.7rem;
}

.ml-8 {
    margin-left: 8px;
}

@media (max-width: 960px) {
    .insights-strip {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .insights-strip {
        grid-template-columns: 1fr;
    }
}

.compare-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    color: #2f4a68;
    cursor: pointer;
}

.compare-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #1f6b42;
}

/* Admin analytics filter alignment refinements */
#analytics-filter-form {
    align-items: flex-start;
}

#analytics-filter-form > div {
    display: grid;
    gap: 4px;
    align-items: start;
}

/* Align compare + apply to the select control row (not the label row) */
#analytics-filter-form .compare-toggle,
#analytics-filter-form .btn {
    align-self: flex-start;
    margin-top: 24px;
}

/* Exact row alignment: compare/apply aligned to select control row, not label row */
#analytics-filter-form {
    display: grid;
    grid-template-columns: auto auto auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 4px;
    align-items: center;
}

#analytics-filter-form .year-filter-field {
    grid-column: 1;
    grid-row: 1 / 3;
    display: grid;
    grid-template-rows: auto auto;
    row-gap: 4px;
}

#analytics-filter-form .compare-toggle {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    margin-top: 0;
}

#analytics-filter-form .btn {
    grid-column: 3;
    grid-row: 2;
    align-self: center;
    margin-top: 0;
}

@media (max-width: 860px) {
    #analytics-filter-form {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
    }
}

#admin-analytics-users-table .status-chip {
    white-space: normal;
    max-width: 360px;
    line-height: 1.25;
}

#analytics-filter-form input[type="number"] {
    width: 98px;
}

/* Admin analytics top-section cleanup overrides */
.analytics-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 12px;
}

#analytics-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

#analytics-filter-form > div,
#analytics-filter-form .year-filter-field {
    display: grid;
    gap: 4px;
}

#analytics-filter-form .compare-toggle,
#analytics-filter-form .btn {
    align-self: flex-end;
    margin-top: 0;
}

#analytics-filter-form select,
#analytics-filter-form input[type="number"] {
    height: 34px;
}

#analytics-filter-form input[type="number"] {
    width: 98px;
}

.analytics-toolbar > div:last-child {
    text-align: right;
}

.period-chips {
    margin-top: 12px;
}

.insights-strip {
    margin-top: 12px;
}

@media (max-width: 1024px) {
    .analytics-toolbar {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .analytics-toolbar > div:last-child {
        text-align: left;
    }
}

@media (max-width: 860px) {
    #analytics-filter-form {
        align-items: flex-start;
    }

    #analytics-filter-form .compare-toggle,
    #analytics-filter-form .btn {
        align-self: flex-start;
    }
}

/* Final admin analytics top alignment overrides */
section.panel .section-head {
    margin-bottom: 16px;
}

section.panel .section-head .meta {
    margin-top: 8px;
    margin-bottom: 0;
}

section.panel .admin-ai-section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
}

section.panel .admin-ai-section-head .admin-ai-action {
    justify-self: end;
}

section.panel .admin-ai-section-head .admin-ai-action .btn {
    margin: 0;
}

@media (max-width: 960px) {
    section.panel .admin-ai-section-head {
        grid-template-columns: 1fr;
    }

    section.panel .admin-ai-section-head .admin-ai-action {
        justify-self: start;
    }
}

.analytics-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

#analytics-filter-form,
#analytics-filter-form.analytics-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin: 0;
}

#analytics-filter-form > div,
#analytics-filter-form .year-filter-field {
    display: grid;
    gap: 5px;
    align-items: start;
}

#analytics-filter-form > div label,
#analytics-filter-form .year-filter-field label {
    margin: 0;
    line-height: 1.2;
}

#analytics-filter-form select,
#analytics-filter-form input[type="number"] {
    height: 36px;
}

#analytics-filter-form .compare-toggle {
    display: inline-flex;
    align-items: center;
    align-self: flex-end;
    height: 36px;
    margin: 0;
    padding-bottom: 0;
}

#analytics-filter-form .btn {
    align-self: flex-end;
    height: 36px;
    margin: 0;
}

.analytics-toolbar > div:last-child {
    text-align: right;
    align-self: end;
}

.period-chips {
    margin-top: 14px;
}

.insights-strip {
    margin-top: 14px;
}

@media (max-width: 1024px) {
    .analytics-toolbar {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .analytics-toolbar > div:last-child {
        text-align: left;
    }
}

@media (max-width: 860px) {
    #analytics-filter-form,
    #analytics-filter-form.analytics-filter-form {
        align-items: flex-start;
    }

    #analytics-filter-form .compare-toggle,
    #analytics-filter-form .btn {
        align-self: flex-start;
    }
}

/* Sidebar navigation section labels */
.nav-section-label {
    margin: 12px 8px 2px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7d97;
}

.nav-section-label:first-child {
    margin-top: 2px;
}

/* Analytics year filter fit fix */
#analytics-filter-form .year-filter-field {
    min-width: 112px;
}

#analytics-filter-form #analytics_year {
    min-width: 112px;
    width: 112px;
    padding-right: 28px;
}

/* Analytics year select text clipping fix */
#analytics-filter-form #analytics_year {
    min-width: 120px;
    width: 120px;
    height: 36px;
    padding: 6px 34px 6px 10px;
    line-height: 1.2;
}

#analytics-filter-form #analytics_year option {
    line-height: 1.2;
}

/* Needs Attention threshold callout */
.needs-attention-note {
    margin: 12px 0 14px;
    padding: 12px 14px;
    border: 1px solid #f3cbc7;
    border-left: 4px solid #c53939;
    border-radius: 10px;
    background: #fff5f3;
}

.needs-attention-note-title {
    margin: 0 0 6px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8f241d;
}

.needs-attention-note-text {
    margin: 0;
    color: #6f2d27;
    font-size: 0.88rem;
}

.needs-attention-note-text + .needs-attention-note-text {
    margin-top: 6px;
}

/* Export buttons spacing */
.chart-tools .analytics-filter-form {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.dashboard-insights-table th {
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-insights-table td {
    vertical-align: middle;
    padding-top: 8px;
    padding-bottom: 8px;
}

.dashboard-insights-table td strong {
    color: #1f3556;
}

.active-tests-table {
    table-layout: fixed;
}

.active-tests-table th:nth-child(1),
.active-tests-table td:nth-child(1) {
    width: 56%;
}

.active-tests-table th:nth-child(2),
.active-tests-table td:nth-child(2) {
    width: 18%;
    white-space: nowrap;
}

.active-tests-table th:nth-child(3),
.active-tests-table td:nth-child(3) {
    width: 26%;
}

.active-tests-table td:nth-child(3) .btn {
    width: 100%;
    justify-content: center;
}

@media (max-width: 960px) {
    .trend-chart {
        height: 185px;
    }

    .category-highlight-grid {
        gap: 8px;
    }

    .category-highlight-card {
        padding: 10px;
    }
}

@media (max-width: 960px) {
    .dashboard-insights-table thead {
        display: none;
    }

    .dashboard-insights-table,
    .dashboard-insights-table tbody,
    .dashboard-insights-table tr,
    .dashboard-insights-table td {
        display: block;
        width: 100%;
    }

    .dashboard-insights-table tr {
        border: 1px solid #d7e2ef;
        border-radius: 12px;
        background: #fff;
        padding: 10px;
        margin-bottom: 10px;
    }

    .dashboard-insights-table td {
        border: 0;
        padding: 6px 0;
    }

    .dashboard-insights-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #5f6f8b;
    }

    .dashboard-insights-table td[data-label="Action"] .btn {
        min-height: 36px;
        padding: 9px 12px;
    }

    .dashboard-insights-table td[data-label="Action"]::before {
        margin-bottom: 6px;
    }
}


/* Admin analytics UX pass */
.admin-analytics-shell {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.admin-analytics-shell .section-head h2,
.admin-analytics-shell .section-head h3 {
    letter-spacing: 0.01em;
}

.admin-insights-strip {
    gap: 10px;
}

.admin-insights-strip .insight-card {
    border: 1px solid #d7e2ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(26, 54, 93, 0.06);
}

.admin-insights-strip .insight-value {
    font-weight: 700;
    color: #1f3556;
}

.admin-analytics-kpis {
    margin-top: 14px;
    gap: 10px;
}

.admin-analytics-kpis .analytics-kpi {
    border: 1px solid #d8e4f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(26, 54, 93, 0.06);
    min-height: 112px;
}

.admin-analytics-kpis .kpi-delta {
    margin-top: 8px;
    font-size: 0.76rem;
}

.admin-analytics-grid .panel {
    border: 1px solid #dce6f2;
}

.admin-analytics-grid .chart-tools {
    margin-top: 8px;
}

.admin-analytics-table-wrap {
    margin-top: 12px;
}

.admin-analytics-users-table thead th {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-analytics-users-table tbody tr:hover {
    background: #f8fbff;
}

.admin-analytics-users-table td {
    vertical-align: middle;
}

.admin-analytics-users-table .status-chip.aborted {
    margin-top: 6px;
    display: inline-flex;
}

@media (max-width: 960px) {
    .admin-analytics-shell .analytics-toolbar {
        gap: 12px;
    }

    .admin-analytics-shell #analytics-filter-form,
    .admin-analytics-shell #analytics-filter-form.analytics-filter-form {
        gap: 8px;
        padding: 10px;
    }

    .admin-insights-strip {
        grid-template-columns: 1fr;
    }

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

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

    .admin-analytics-users-table .btn {
        min-height: 36px;
    }
}

.analytics-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #cfe0fa;
    background: #eef5ff;
    color: #2457a8;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    white-space: normal;
}

/* My Tests UI/UX pass */
.mytests-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

.test-filters-enhanced {
    padding: 12px;
    border: 1px solid #d9e3ef;
    border-radius: 10px;
    background: #fdfefe;
}

.mytests-summary {
    gap: 6px;
    margin: 2px 0 10px;
}

.mytests-summary-chip {
    padding: 4px 9px;
    font-size: 0.76rem;
    background: #f7fafc;
    color: #3f5676;
}

.mytests-card {
    border: 1px solid #dce6f1;
    box-shadow: none;
    padding: 14px;
}

.mytests-active-card {
    border-color: #cddfef;
    background: #fff;
}

.mytests-compact-row {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mytests-compact-row span {
    border: 1px solid #e3eaf3;
    background: #fafcff;
    border-radius: 8px;
    padding: 7px 8px;
    font-size: 0.8rem;
    color: #334a67;
}

.mytests-compact-row strong {
    color: #223c5b;
}

.mytests-outcome {
    margin: 8px 0 0;
    font-size: 0.82rem;
    color: #2f4868;
}

.mytests-details {
    margin-top: 8px;
    border-top: 1px solid #e4ebf4;
    padding-top: 8px;
}

.mytests-details summary {
    cursor: pointer;
    color: #2f5f95;
    font-weight: 700;
    font-size: 0.8rem;
}

.mytests-detail-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mytests-detail-grid span {
    font-size: 0.8rem;
    color: #3f5676;
}

.active-tests-panel .section-head {
    margin-bottom: 8px;
}

@media (max-width: 960px) {
    .mytests-compact-row,
    .mytests-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* My Tests mobile pass */
.mytests-filter-actions {
    display: flex;
    align-items: flex-end;
}

.mytests-filter-actions .btn {
    min-height: 36px;
}

@media (max-width: 960px) {
    #mytests_filters {
        position: sticky;
        top: 8px;
        z-index: 30;
        box-shadow: 0 6px 16px rgba(16, 24, 40, 0.08);
    }

    #mytests_filters input,
    #mytests_filters select {
        min-height: 44px;
        font-size: 0.9rem;
    }

    .mytests-card .btn {
        min-height: 36px;
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .mytests-card .actions {
        display: block;
    }

    .mytests-details summary {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }
}

/* My Tests simplification pass */
.active-tests-panel,
.panel {
    border-color: #dfe7f0;
}

.active-tests-panel {
    background: #ffffff;
}

.mytests-summary {
    margin: 0 0 10px;
    gap: 6px;
}

.mytests-summary-chip {
    background: #ffffff;
    border-color: #dfe7f0;
    color: #4a5f7b;
    font-weight: 600;
}

.test-filters-enhanced {
    background: #ffffff;
    border-color: #dfe7f0;
    padding: 10px;
}

#mytests_filters {
    grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(160px, 1fr)) auto;
    gap: 8px;
    align-items: end;
}

.mytests-filter-actions .btn {
    min-height: 36px;
}

.mytests-grid {
    gap: 8px;
}

.mytests-card {
    border: 1px solid #dfe7f0;
    border-radius: 10px;
    background: #ffffff;
    padding: 12px;
}

.mytests-active-card {
    border-color: #cfe0f0;
}

.mytests-card--compact {
    grid-column: 1 / -1;
    padding: 10px;
}

.mytests-card--compact .test-card-head {
    gap: 6px;
}

.mytests-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.mytests-card--compact .test-card-title {
    font-size: 0.9rem;
}

.mytests-card--compact .meta {
    font-size: 0.78rem;
}

.mytests-history-layout {
    display: grid;
    grid-template-columns: minmax(160px, 0.9fr) minmax(0, 1.15fr) minmax(120px, 0.7fr);
    gap: 8px 14px;
    align-items: start;
    margin-top: 4px;
}

.mytests-history-action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.mytests-history-action .btn {
    min-height: 36px;
}

.mytests-history-btn {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.mytests-history-btn .btn-mark {
    align-self: center;
    margin-top: 0;
    margin-bottom: 0;
}

.mytests-history-score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
}

.mytests-score-value {
    font-size: 1.9rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: #1f3552;
}

.mytests-score-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5f6f8b;
}

.mytests-history-dates {
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: flex-start;
    text-align: left;
}

.mytests-history-dates span {
    border: 0;
    background: transparent;
    padding: 0;
    color: #445a76;
    font-size: 0.8rem;
}

.mytests-history-dates strong {
    color: #2e4665;
}

.mytests-card--compact .mytests-outcome {
    margin-top: 6px;
}

.mytests-card--compact .actions.mt-10 {
    margin-top: 8px;
}

.mytests-card .test-card-head {
    gap: 8px;
}

.mytests-card .test-card-title {
    font-size: 0.92rem;
    color: #1f3552;
}

.mytests-card .meta {
    font-size: 0.8rem;
    color: #5f6f8b;
}

.mytests-compact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
}

.mytests-compact-row span {
    border: 0;
    background: transparent;
    padding: 0;
    color: #445a76;
    font-size: 0.8rem;
}

.mytests-compact-row strong {
    color: #2e4665;
}

.mytests-outcome {
    margin: 7px 0 0;
    font-size: 0.8rem;
}

.mytests-details {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid #e7edf4;
}

.mytests-details summary {
    color: #2f5f95;
    font-size: 0.78rem;
    font-weight: 700;
}

.mytests-detail-grid {
    margin-top: 7px;
    gap: 6px 10px;
}

.mytests-detail-grid span {
    font-size: 0.78rem;
    color: #4d637e;
}

@media (max-width: 960px) {
    #mytests_filters {
        grid-template-columns: 1fr;
    }

    .mytests-compact-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .mytests-history-layout {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .mytests-history-score {
        align-items: flex-start;
        text-align: left;
    }
}

/* My Tests assignment age badge */
.mytests-head-badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.status-pill.status-pending {
    background: #fff7df;
    color: #8a6800;
    border: 1px solid #f0dc9f;
}

.status-pill.status-active {
    background: #e7f7ee;
    color: #1f6b42;
    border: 1px solid #b9e2c9;
}

.status-pill.status-inactive {
    background: #fdecec;
    color: #b12c2c;
    border: 1px solid #f2bcbc;
}

.actions-insights-cell .actions-inline {
    width: 100%;
    align-items: center;
}

.actions-insights-cell .insights-attempts-btn {
    margin-left: auto;
}

.table td.created-cell {
    font-size: 0.84rem;
    font-weight: 400;
    line-height: 1.35;
}

/* Admin users: keep created date visually lighter/smaller than action-heavy cells */
.table td.created-cell {
    font-size: 0.78rem !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    color: var(--muted);
}

/* Consistent table date typography across the app */
.table td.date-cell {
    font-size: 0.78rem !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    color: var(--muted);
}

/* Test workspace: ensure Recent Assignments matches standard table density */
#recent-assignments .table th,
#recent-assignments .table td {
    font-size: 0.84rem !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

#recent-assignments .table td.date-cell {
    font-size: 0.84rem !important;
    line-height: 1.35 !important;
    color: inherit;
}

#recent-assignments .table .btn {
    font-size: 0.84rem;
    padding: 9px 12px;
}

/* CPD bulk assign: disabled targeting controls */
.checkbox-select.is-disabled .checkbox-select-toggle {
    background: #f1f4f8;
    color: #8b97aa;
    border-color: #d9e0ea;
    cursor: not-allowed;
}

.checkbox-select-toggle:disabled::after {
    opacity: 0.45;
}

.checkbox-select.is-disabled .checkbox-select-option {
    color: #8b97aa;
}

.empty-inline-state {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1400;
}

.modal-backdrop.is-open {
    display: flex;
}

.modal-card {
    width: min(520px, 100%);
    background: #fff;
    border: 1px solid #d6deeb;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
    padding: 16px;
}

.modal-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.groups-list-full {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

#groups-members form[action="/public/admin_group_member_add.php"] .checkbox-select {
    flex: 0 0 40%;
    max-width: 40%;
    min-width: 320px;
}

@media (max-width: 960px) {
    #groups-members form[action="/public/admin_group_member_add.php"] .checkbox-select {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 220px;
    }
}

.category-setup-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.category-setup-forms {
    min-width: 0;
}

.category-setup-info {
    border: 1px solid #d6deeb;
    background: #f8fbff;
    border-radius: 10px;
    padding: 12px;
}

.category-setup-info h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.category-setup-info p {
    margin: 0 0 8px;
}

@media (max-width: 900px) {
    .category-setup-layout {
        grid-template-columns: 1fr;
    }
}

.reading-materials-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ai-indicator-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border: 1px solid #b8c9e4;
    border-radius: 999px;
    background: #f1f6ff;
    color: #1f4f8f;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    vertical-align: middle;
}

.ai-indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1f6b42;
    box-shadow: 0 0 0 3px rgba(31, 107, 66, 0.15);
}

#groups-members form[action="/public/admin_group_create.php"] #group_name {
    min-width: min(520px, 100%);
}

#groups-members .group-create-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

#groups-members .group-create-form .group-name-field {
    min-width: 360px;
    max-width: 360px;
}

#groups-members .group-create-form #group_name {
    min-width: 0;
}

@media (max-width: 900px) {
    #groups-members .group-create-form .group-name-field {
        min-width: 220px;
        max-width: 100%;
    }
}


.category-warning-inline {
    white-space: normal;
}


.reading-materials-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

@media (max-width: 900px) {
    .reading-materials-layout {
        grid-template-columns: 1fr;
    }
}


.info-box-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: -2px;
    color: #1f4f8f;
}

.info-box-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.cpd-log-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

@media (max-width: 900px) {
    .cpd-log-layout {
        grid-template-columns: 1fr;
    }
}

#company-cpd-logs .cpd-row-invalid {
    background: #fffaf9;
}

#company-cpd-logs .cpd-validation-cell {
    min-width: 160px;
}

#company-cpd-logs .cpd-validation-cell .btn-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #34598e;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#company-cpd-logs .cpd-action-cell,
#company-cpd-logs .cpd-action-cell form {
    white-space: normal;
}

#company-cpd-logs .cpd-action-cell .btn {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    white-space: normal;
}

#my-cpd-entries .cpd-validation-cell .btn-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #34598e;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#company-cpd-logs .cpd-invalidated-badge,
#my-cpd-entries .cpd-invalidated-badge {
    display: inline-flex;
    align-items: center;
    gap: 0;
    white-space: normal;
}

#company-cpd-logs .cpd-invalidated-badge .pill,
#my-cpd-entries .cpd-invalidated-badge .pill {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

#company-cpd-logs .cpd-invalidated-badge .btn-link,
#my-cpd-entries .cpd-invalidated-badge .btn-link {
    display: inline-block;
    margin-top: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #922424;
    background: #fff1f1;
    border: 1px solid #efb7b7;
    border-left: 0;
    border-radius: 0 999px 999px 0;
    padding: 4px 10px;
    cursor: pointer;
    line-height: 1.2;
    text-decoration: none;
}

#company-cpd-logs .cpd-invalidated-badge .btn-link:hover,
#my-cpd-entries .cpd-invalidated-badge .btn-link:hover {
    background: #ffe6e6;
}

/* Final polish: unified invalidated badge + details trigger */
#company-cpd-logs .cpd-invalidated-badge,
#my-cpd-entries .cpd-invalidated-badge {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #efb7b7;
    border-radius: 999px;
    overflow: hidden;
    background: #fff1f1;
    white-space: normal;
}

#company-cpd-logs .cpd-invalidated-badge .pill,
#my-cpd-entries .cpd-invalidated-badge .pill {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 4px 10px;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    color: #922424 !important;
    font-size: 0.78rem;
    line-height: 1.2;
}

#company-cpd-logs .cpd-invalidated-badge .btn-link,
#my-cpd-entries .cpd-invalidated-badge .btn-link {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 4px 10px;
    border: 0;
    border-left: 1px solid #efb7b7;
    border-radius: 0;
    background: transparent;
    color: #7f1d1d;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

#company-cpd-logs .cpd-invalidated-badge .btn-link:hover,
#my-cpd-entries .cpd-invalidated-badge .btn-link:hover {
    background: #ffe9e9;
}

.admin-ai-modal-card {
    position: relative;
    width: min(920px, 100%);
    max-height: 90vh;
    overflow: auto;
}

.admin-ai-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
}

.admin-ai-modal-header {
    padding-right: 120px;
}

@media (max-width: 640px) {
    .admin-ai-modal-close {
        top: 12px;
        right: 12px;
    }

    .admin-ai-modal-header {
        padding-right: 104px;
    }
}

#admin-ai-answer .dashboard-empty-note {
    white-space: pre-wrap;
}

.admin-ai-answer-wrap {
    display: block;
}

.admin-ai-answer-card {
    border: 1px solid #d6deeb;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    padding: 14px;
    box-shadow: 0 6px 18px rgba(24, 43, 73, 0.08);
}

.admin-ai-answer-card.is-loading {
    border-color: #bfd2ef;
    background: #f4f8ff;
}

.admin-ai-answer-card.is-error {
    border-color: #efb7b7;
    background: #fff4f4;
}

.admin-ai-answer-kicker {
    margin: 0 0 6px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1f4f8f;
}

.admin-ai-answer-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 750;
    color: #182f52;
}

.admin-ai-answer-title-sm {
    margin-top: 12px;
    font-size: 0.9rem;
}

.admin-ai-answer-body {
    margin: 8px 0 0;
    color: #2b415f;
    line-height: 1.45;
    white-space: pre-wrap;
}

.admin-ai-actions {
    margin-top: 10px;
}

.admin-ai-actions-list {
    margin: 8px 0 0;
    padding: 0 0 0 18px;
    color: #223a5c;
}

.admin-ai-actions-list li {
    margin: 0 0 6px;
    line-height: 1.38;
}

.admin-ai-quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 2px;
}

.admin-ai-quick-prompts .btn {
    font-size: 0.84rem;
    padding: 9px 12px;
}

.admin-ai-quick-prompts.is-busy {
    opacity: 0.65;
    pointer-events: none;
}

.admin-ai-answer-card.is-loading .admin-ai-answer-body {
    color: #4b6389;
}

.admin-ai-debug {
    margin-top: 12px;
    border-top: 1px dashed #c8d5ea;
    padding-top: 10px;
}

.admin-ai-debug-line {
    margin: 4px 0 0;
    color: #334d73;
    font-size: 0.85rem;
}

.modal-card-wide {
    width: min(620px, 100%);
}

.modal-title {
    margin: 0 0 8px;
}

.modal-body-text {
    margin: 0;
    color: #4b5d79;
}

.modal-msg {
    margin: 0 0 10px;
}

.modal-field-label {
    display: block;
    margin: 0 0 6px;
    font-weight: 600;
}

.auth-page {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    background:
        radial-gradient(1000px 620px at -10% -18%, #e3f0e8 0%, transparent 68%),
        radial-gradient(920px 640px at 108% 12%, #e8f4ee 0%, transparent 69%),
        linear-gradient(145deg, #f4f8f5 0%, #edf4ef 100%);
    padding: 24px;
}

.auth-card {
    width: min(420px, 100%);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #d8e6dc;
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 18px 34px rgba(20, 56, 36, 0.12);
    font-size: 14px;
}

.auth-card.auth-card-wide {
    width: min(440px, 100%);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.auth-brand-logo {
    width: 34px;
    height: 34px;
}

.auth-brand-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1d3f2d;
}

.auth-brand-tag {
    margin: 2px 0 0;
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #5f7566;
}

.auth-title {
    margin: 0 0 8px;
    font-size: 1.14rem;
}

.auth-sub {
    margin: 0 0 16px;
    color: #5f7566;
    font-size: 0.84rem;
}

.auth-label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
    color: #2f4a3a;
    font-size: 0.83rem;
}

.auth-input {
    width: 100%;
    border: 1px solid #cfe0d4;
    background: #f7fbf8;
    border-radius: 10px;
    padding: 11px;
    font: inherit;
    font-size: 0.88rem;
}

.auth-submit {
    margin-top: 16px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    background: #1f6b42;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.84rem;
    line-height: 1.2;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-submit .btn-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    flex: 0 0 18px;
}

.auth-submit .btn-mark svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.auth-link-row {
    margin-top: 8px;
    margin-bottom: 14px;
    text-align: right;
}

.auth-link-row.auth-back-row {
    margin-top: 12px;
    margin-bottom: 0;
}

.auth-link-row a {
    color: #1f6b42;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-link-row a:hover {
    text-decoration: underline;
}

.section-head-tight {
    margin-bottom: 4px;
}

.meta-top-6 {
    margin-top: 6px;
}

.chart-wrap-280 {
    height: 280px;
    margin-top: 12px;
}

.is-hidden {
    display: none;
}

.pill-rsvp-attending {
    background: #eef8ee;
    color: #25683b;
    border-color: #cde8d2;
}

.pill-rsvp-not-attending {
    background: #fff1f1;
    color: #922424;
    border-color: #efb7b7;
}

.pill-rsvp-pending {
    background: #f2f5f8;
    color: #445a77;
    border-color: #d5ddea;
}

@media (max-width: 760px) {
    .users-mobile-cards thead,
    .group-members-mobile-cards thead,
    .analytics-users-mobile-cards thead,
    .companies-mobile-cards thead,
    .failed-materials-mobile-cards thead {
        display: none;
    }

    .users-mobile-cards,
    .group-members-mobile-cards,
    .analytics-users-mobile-cards,
    .companies-mobile-cards,
    .failed-materials-mobile-cards {
        border: 0;
        background: transparent;
    }

    .users-mobile-cards tbody tr.js-user-row,
    .group-members-mobile-cards tbody tr,
    .analytics-users-mobile-cards tbody tr,
    .companies-mobile-cards tbody tr,
    .failed-materials-mobile-cards tbody tr {
        display: block;
        margin: 0 0 10px;
        border: 1px solid #d5deeb;
        border-radius: 12px;
        background: #fff;
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }

    .users-mobile-cards tbody tr.js-attempts-row {
        display: none !important;
    }

    .users-mobile-cards td,
    .group-members-mobile-cards td,
    .analytics-users-mobile-cards td,
    .companies-mobile-cards td,
    .failed-materials-mobile-cards td {
        display: grid;
        grid-template-columns: 124px 1fr;
        gap: 8px;
        align-items: start;
        border-right: 0;
        border-bottom: 1px solid #eef2f7;
        padding: 9px 10px;
        min-height: 36px;
    }

    .users-mobile-cards td:last-child,
    .group-members-mobile-cards td:last-child,
    .analytics-users-mobile-cards td:last-child,
    .companies-mobile-cards td:last-child,
    .failed-materials-mobile-cards td:last-child {
        border-bottom: 0;
    }

    .users-mobile-cards td::before,
    .group-members-mobile-cards td::before,
    .analytics-users-mobile-cards td::before,
    .companies-mobile-cards td::before,
    .failed-materials-mobile-cards td::before {
        font-size: 0.76rem;
        font-weight: 700;
        color: #53637d;
        content: "";
    }

    .users-mobile-cards tr.js-user-row td:nth-child(1)::before { content: "Name"; }
    .users-mobile-cards tr.js-user-row td:nth-child(2)::before { content: "Email"; }
    .users-mobile-cards tr.js-user-row td:nth-child(3)::before { content: "Role"; }
    .users-mobile-cards tr.js-user-row td:nth-child(4)::before { content: "Status"; }
    .users-mobile-cards tr.js-user-row td:nth-child(5)::before { content: "Created"; }
    .users-mobile-cards tr.js-user-row td:nth-child(6)::before { content: "Actions"; }
    .users-mobile-cards tr.js-user-row td:nth-child(7)::before { content: "Insights"; }
    .users-mobile-cards tr.js-user-row td:nth-child(8)::before { content: "CPD"; }

    .group-members-mobile-cards td:nth-child(1)::before { content: "Name"; }
    .group-members-mobile-cards td:nth-child(2)::before { content: "Email"; }
    .group-members-mobile-cards td:nth-child(3)::before { content: "Action"; }

    .analytics-users-mobile-cards td:nth-child(1)::before { content: "Learner"; }
    .analytics-users-mobile-cards td:nth-child(2)::before { content: "Assigned"; }
    .analytics-users-mobile-cards td:nth-child(3)::before { content: "Completed"; }
    .analytics-users-mobile-cards td:nth-child(4)::before { content: "Completion"; }
    .analytics-users-mobile-cards td:nth-child(5)::before { content: "Avg Score"; }
    .analytics-users-mobile-cards td:nth-child(6)::before { content: "Best"; }
    .analytics-users-mobile-cards td:nth-child(7)::before { content: "Last Completed"; }
    .analytics-users-mobile-cards td:nth-child(8)::before { content: "Action"; }

    .companies-mobile-cards td:nth-child(1)::before { content: "Company"; }
    .companies-mobile-cards td:nth-child(2)::before { content: "Status"; }
    .companies-mobile-cards td:nth-child(3)::before { content: "Users"; }
    .companies-mobile-cards td:nth-child(4)::before { content: "Created"; }
    .companies-mobile-cards td:nth-child(5)::before { content: "Action"; }

    .failed-materials-mobile-cards td:nth-child(1)::before { content: "Company"; }
    .failed-materials-mobile-cards td:nth-child(2)::before { content: "Title"; }
    .failed-materials-mobile-cards td:nth-child(3)::before { content: "File"; }
    .failed-materials-mobile-cards td:nth-child(4)::before { content: "Error"; }
    .failed-materials-mobile-cards td:nth-child(5)::before { content: "Uploaded"; }

    .users-mobile-cards .actions,
    .users-mobile-cards .actions-inline,
    .group-members-mobile-cards .actions,
    .analytics-users-mobile-cards .actions,
    .companies-mobile-cards .actions {
        white-space: normal;
        flex-wrap: wrap;
    }

    .users-mobile-cards .btn,
    .group-members-mobile-cards .btn,
    .analytics-users-mobile-cards .btn,
    .companies-mobile-cards .btn {
        width: auto;
        max-width: 100%;
    }
}

@media (max-width: 760px) {
    .users-mobile-cards tbody tr.js-user-row,
    .group-members-mobile-cards tbody tr,
    .analytics-users-mobile-cards tbody tr,
    .companies-mobile-cards tbody tr,
    .failed-materials-mobile-cards tbody tr {
        margin: 0 0 12px;
        border-radius: 14px;
    }

    .users-mobile-cards td,
    .group-members-mobile-cards td,
    .analytics-users-mobile-cards td,
    .companies-mobile-cards td,
    .failed-materials-mobile-cards td {
        grid-template-columns: 108px minmax(0, 1fr);
        gap: 10px;
        padding: 10px 11px;
    }

    .users-mobile-cards td::before,
    .group-members-mobile-cards td::before,
    .analytics-users-mobile-cards td::before,
    .companies-mobile-cards td::before,
    .failed-materials-mobile-cards td::before {
        font-size: 0.74rem;
        letter-spacing: 0.01em;
        text-transform: uppercase;
    }

    .users-mobile-cards td > *,
    .group-members-mobile-cards td > *,
    .analytics-users-mobile-cards td > *,
    .companies-mobile-cards td > *,
    .failed-materials-mobile-cards td > * {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .users-mobile-cards .pill,
    .group-members-mobile-cards .pill,
    .analytics-users-mobile-cards .pill,
    .companies-mobile-cards .pill {
        width: fit-content;
        max-width: 100%;
    }

    .users-mobile-cards .actions .btn,
    .users-mobile-cards .actions-inline .btn,
    .group-members-mobile-cards .actions .btn,
    .analytics-users-mobile-cards .actions .btn,
    .companies-mobile-cards .actions .btn {
        min-height: 36px;
    }
}

@media (max-width: 560px) {
    .users-mobile-cards td,
    .group-members-mobile-cards td,
    .analytics-users-mobile-cards td,
    .companies-mobile-cards td,
    .failed-materials-mobile-cards td {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 10px;
    }

    .users-mobile-cards td::before,
    .group-members-mobile-cards td::before,
    .analytics-users-mobile-cards td::before,
    .companies-mobile-cards td::before,
    .failed-materials-mobile-cards td::before {
        font-size: 0.72rem;
    }

    .users-mobile-cards .actions,
    .users-mobile-cards .actions-inline,
    .group-members-mobile-cards .actions,
    .analytics-users-mobile-cards .actions,
    .companies-mobile-cards .actions {
        width: 100%;
    }

    .users-mobile-cards .actions .btn,
    .users-mobile-cards .actions-inline .btn,
    .group-members-mobile-cards .actions .btn,
    .analytics-users-mobile-cards .actions .btn,
    .companies-mobile-cards .actions .btn {
        width: 100%;
        justify-content: center;
    }
}

.chart-wrap-300 {
    height: 300px;
    margin-top: 12px;
}

.question-pill-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 8px;
    white-space: normal;
    overflow-x: visible;
    padding-bottom: 4px;
}

.reading-upload-form {
    max-width: 640px;
}

.reading-upload-form input[type="file"] {
    width: 100%;
    color: #4b5d79;
}

.reading-upload-form input[type="file"]::file-selector-button {
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #2a8653 0%, #1f6b42 100%);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
    padding: 10px 14px;
    margin-right: 12px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(31, 107, 66, 0.22);
    transition: transform .14s ease, box-shadow .18s ease, opacity .2s ease;
}

.reading-upload-form input[type="file"]::-webkit-file-upload-button {
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #2a8653 0%, #1f6b42 100%);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
    padding: 10px 14px;
    margin-right: 12px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(31, 107, 66, 0.22);
    transition: transform .14s ease, box-shadow .18s ease, opacity .2s ease;
}

.reading-upload-form input[type="file"]:hover::file-selector-button,
.reading-upload-form input[type="file"]:hover::-webkit-file-upload-button {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(31, 107, 66, 0.26);
}

.reading-upload-form input[type="file"]:active::file-selector-button,
.reading-upload-form input[type="file"]:active::-webkit-file-upload-button {
    transform: translateY(0);
}

.reading-upload-form input[type="file"]:focus-visible::file-selector-button,
.reading-upload-form input[type="file"]:focus-visible::-webkit-file-upload-button {
    outline: 2px solid #1f6b42;
    outline-offset: 2px;
}

.reminders-toggle-row {
    margin: 0;
    min-height: 42px;
}

.reminders-select-col {
    width: 80px;
}

.reminders-select-label {
    margin: 0;
}

.reminders-actions-row {
    margin-top: 12px;
    justify-content: space-between;
    align-items: center;
}

.event-attendance-card {
    margin-bottom: 12px;
}

@media (max-width: 960px) {
    #create-event-alert .table-wrap,
    #event-invite-watch .table-wrap {
        max-height: none !important;
    }

    .reminders-actions-row,
    #manual-reminder-form .actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .reminders-actions-row .btn,
    #manual-reminder-form .actions .btn {
        width: 100%;
        justify-content: center;
    }

    #assign-test .panel-form,
    #recent-assignments .panel-form,
    #cpd-bulk-assign .panel-form {
        max-width: 100%;
    }

    #assign-test .panel-form .btn,
    #cpd-bulk-assign .panel-form .btn {
        width: 100%;
        justify-content: center;
    }

    #create-event-alert .form-grid,
    #event-invite-watch .form-inline,
    #cpd-bulk-assign .form-grid,
    #cpd-required-hours .form-inline,
    #learner-cpd-progress .form-inline,
    #monthly-cpd-matrix .form-inline {
        grid-template-columns: 1fr;
    }

    #event-invite-watch .form-inline > div,
    #cpd-required-hours .form-inline > div,
    #learner-cpd-progress .form-inline > div,
    #monthly-cpd-matrix .form-inline > div,
    #cpd-bulk-assign .checkbox-select,
    #cpd-bulk-assign .field-min-320,
    #cpd-bulk-assign .field-min-260,
    #create-event-alert .field-min-260,
    #event-invite-watch .field-min-260,
    #event-invite-watch .field-min-180 {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    #event-invite-watch .btn,
    #cpd-required-hours .btn,
    #learner-cpd-progress .btn,
    #monthly-cpd-matrix .btn {
        width: 100%;
        justify-content: center;
    }

    #company-question-bank .form-inline > div,
    #company-question-bank .field-min-220,
    #company-question-bank .field-min-260,
    #reading-materials .field-min-260,
    #reading-materials .field-md {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    #company-question-bank .form-inline .btn,
    #reading-materials .btn {
        width: 100%;
        justify-content: center;
    }

    .tests-overview-filters .field-min-220,
    .tests-overview-filters .field-sm,
    .tests-overview-filters .btn {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .tests-overview-filters .btn {
        justify-content: center;
    }

    #assign-test .form-grid .btn,
    #recent-assignments .actions .btn,
    .workspace-available-mobile-cards .btn,
    .workspace-attached-mobile-cards .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .qb-company-mobile-cards thead,
    .qb-materials-mobile-cards thead,
    .qb-suggestions-mobile-cards thead,
    .tests-current-mobile-cards thead,
    .tests-previous-mobile-cards thead,
    .workspace-available-mobile-cards thead,
    .workspace-attached-mobile-cards thead,
    .workspace-assignments-mobile-cards thead,
    .events-target-mobile-cards thead,
    .events-watch-mobile-cards thead,
    .events-attendance-mobile-cards thead,
    .reminders-mobile-cards thead,
    .cpd-matrix-mobile-cards thead,
    .cpd-logs-mobile-cards thead {
        display: none;
    }

    .qb-company-mobile-cards,
    .qb-materials-mobile-cards,
    .qb-suggestions-mobile-cards,
    .tests-current-mobile-cards,
    .tests-previous-mobile-cards,
    .workspace-available-mobile-cards,
    .workspace-attached-mobile-cards,
    .workspace-assignments-mobile-cards,
    .events-target-mobile-cards,
    .events-watch-mobile-cards,
    .events-attendance-mobile-cards,
    .reminders-mobile-cards,
    .cpd-matrix-mobile-cards,
    .cpd-logs-mobile-cards {
        border: 0;
        background: transparent;
    }

    .qb-company-mobile-cards tbody tr,
    .qb-materials-mobile-cards tbody tr,
    .qb-suggestions-mobile-cards tbody tr,
    .tests-current-mobile-cards tbody tr,
    .tests-previous-mobile-cards tbody tr,
    .workspace-available-mobile-cards tbody tr,
    .workspace-attached-mobile-cards tbody tr,
    .workspace-assignments-mobile-cards tbody tr,
    .events-target-mobile-cards tbody tr,
    .events-watch-mobile-cards tbody tr,
    .events-attendance-mobile-cards tbody tr,
    .reminders-mobile-cards tbody tr,
    .cpd-matrix-mobile-cards tbody tr,
    .cpd-logs-mobile-cards tbody tr {
        display: block;
        margin: 0 0 10px;
        border: 1px solid #d5deeb;
        border-radius: 12px;
        background: #fff;
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }

    .qb-company-mobile-cards td,
    .qb-materials-mobile-cards td,
    .qb-suggestions-mobile-cards td,
    .tests-current-mobile-cards td,
    .tests-previous-mobile-cards td,
    .workspace-available-mobile-cards td,
    .workspace-attached-mobile-cards td,
    .workspace-assignments-mobile-cards td,
    .events-target-mobile-cards td,
    .events-watch-mobile-cards td,
    .events-attendance-mobile-cards td,
    .reminders-mobile-cards td,
    .cpd-matrix-mobile-cards td,
    .cpd-logs-mobile-cards td {
        display: grid;
        grid-template-columns: 108px minmax(0, 1fr);
        gap: 8px;
        align-items: start;
        border-right: 0;
        border-bottom: 1px solid #eef2f7;
        padding: 9px 10px;
    }

    .qb-company-mobile-cards td:last-child,
    .qb-materials-mobile-cards td:last-child,
    .qb-suggestions-mobile-cards td:last-child,
    .tests-current-mobile-cards td:last-child,
    .tests-previous-mobile-cards td:last-child,
    .workspace-available-mobile-cards td:last-child,
    .workspace-attached-mobile-cards td:last-child,
    .workspace-assignments-mobile-cards td:last-child,
    .events-target-mobile-cards td:last-child,
    .events-watch-mobile-cards td:last-child,
    .events-attendance-mobile-cards td:last-child,
    .reminders-mobile-cards td:last-child,
    .cpd-matrix-mobile-cards td:last-child,
    .cpd-logs-mobile-cards td:last-child {
        border-bottom: 0;
    }

    .qb-company-mobile-cards td::before,
    .qb-materials-mobile-cards td::before,
    .qb-suggestions-mobile-cards td::before,
    .tests-current-mobile-cards td::before,
    .tests-previous-mobile-cards td::before,
    .workspace-available-mobile-cards td::before,
    .workspace-attached-mobile-cards td::before,
    .workspace-assignments-mobile-cards td::before,
    .events-target-mobile-cards td::before,
    .events-watch-mobile-cards td::before,
    .events-attendance-mobile-cards td::before,
    .reminders-mobile-cards td::before,
    .cpd-matrix-mobile-cards td::before,
    .cpd-logs-mobile-cards td::before {
        font-size: 0.74rem;
        font-weight: 700;
        color: #53637d;
        text-transform: uppercase;
        content: "";
    }

    .tests-current-mobile-cards td:nth-child(1)::before,
    .tests-previous-mobile-cards td:nth-child(1)::before { content: "Test"; }
    .tests-current-mobile-cards td:nth-child(2)::before,
    .tests-previous-mobile-cards td:nth-child(2)::before { content: "Status"; }
    .tests-current-mobile-cards td:nth-child(3)::before,
    .tests-previous-mobile-cards td:nth-child(3)::before { content: "Questions"; }
    .tests-current-mobile-cards td:nth-child(4)::before,
    .tests-previous-mobile-cards td:nth-child(4)::before { content: "Assignees"; }
    .tests-current-mobile-cards td:nth-child(5)::before,
    .tests-previous-mobile-cards td:nth-child(5)::before { content: "Activation"; }
    .tests-current-mobile-cards td:nth-child(6)::before,
    .tests-previous-mobile-cards td:nth-child(6)::before { content: "Action"; }

    .workspace-available-mobile-cards td:nth-child(1)::before { content: "Select"; }
    .workspace-available-mobile-cards td:nth-child(2)::before { content: "Question"; }
    .workspace-available-mobile-cards td:nth-child(3)::before { content: "Subcategory"; }

    .workspace-attached-mobile-cards td:nth-child(1)::before { content: "Question"; }
    .workspace-attached-mobile-cards td:nth-child(2)::before { content: "Action"; }

    .workspace-assignments-mobile-cards td:nth-child(1)::before { content: "User"; }
    .workspace-assignments-mobile-cards td:nth-child(2)::before { content: "Status"; }
    .workspace-assignments-mobile-cards td:nth-child(3)::before { content: "Assigned"; }
    .workspace-assignments-mobile-cards td:nth-child(4)::before { content: "Started"; }
    .workspace-assignments-mobile-cards td:nth-child(5)::before { content: "Completed"; }
    .workspace-assignments-mobile-cards td:nth-child(6)::before { content: "Score"; }
    .workspace-assignments-mobile-cards td:nth-child(7)::before { content: "Actions"; }

    .events-target-mobile-cards td:nth-child(1)::before { content: "Select"; }
    .events-target-mobile-cards td:nth-child(2)::before { content: "Name"; }
    .events-target-mobile-cards td:nth-child(3)::before { content: "Members"; }

    .events-watch-mobile-cards td:nth-child(1)::before { content: "Run Time"; }
    .events-watch-mobile-cards td:nth-child(2)::before { content: "Status"; }
    .events-watch-mobile-cards td:nth-child(3)::before { content: "Source"; }
    .events-watch-mobile-cards td:nth-child(4)::before { content: "Expected"; }
    .events-watch-mobile-cards td:nth-child(5)::before { content: "Invite By"; }
    .events-watch-mobile-cards td:nth-child(6)::before { content: "Confidence"; }
    .events-watch-mobile-cards td:nth-child(7)::before { content: "Email"; }
    .events-watch-mobile-cards td:nth-child(8)::before { content: "Notes"; }

    .events-attendance-mobile-cards td:nth-child(1)::before { content: "Name"; }
    .events-attendance-mobile-cards td:nth-child(2)::before { content: "Email"; }
    .events-attendance-mobile-cards td:nth-child(3)::before { content: "RSVP"; }
    .events-attendance-mobile-cards td:nth-child(4)::before { content: "Updated"; }

    .reminders-mobile-cards td:nth-child(1)::before { content: "Select"; }
    .reminders-mobile-cards td:nth-child(2)::before { content: "Learner"; }
    .reminders-mobile-cards td:nth-child(3)::before { content: "Outstanding"; }
    .reminders-mobile-cards td:nth-child(4)::before { content: "Oldest"; }
    .reminders-mobile-cards td:nth-child(5)::before { content: "Manual"; }
    .reminders-mobile-cards td:nth-child(6)::before { content: "Auto"; }

    .cpd-matrix-mobile-cards td:nth-child(1)::before { content: "Learner"; }
    .cpd-matrix-mobile-cards td:nth-child(n+2)::before { content: "Hours"; }

    .cpd-logs-mobile-cards td:nth-child(1)::before { content: "Date"; }
    .cpd-logs-mobile-cards td:nth-child(2)::before { content: "Learner"; }
    .cpd-logs-mobile-cards td:nth-child(3)::before { content: "Trainer"; }
    .cpd-logs-mobile-cards td:nth-child(4)::before { content: "Hours"; }
    .cpd-logs-mobile-cards td:nth-child(5)::before { content: "Source"; }
    .cpd-logs-mobile-cards td:nth-child(6)::before { content: "Status"; }
    .cpd-logs-mobile-cards td:nth-child(7)::before { content: "Action"; }

    .tests-current-mobile-cards .actions,
    .tests-previous-mobile-cards .actions,
    .workspace-assignments-mobile-cards .actions,
    .events-attendance-mobile-cards .actions,
    .cpd-logs-mobile-cards .actions {
        flex-wrap: wrap;
        white-space: normal;
    }

    .tests-current-mobile-cards .btn,
    .tests-previous-mobile-cards .btn,
    .workspace-assignments-mobile-cards .btn,
    .events-attendance-mobile-cards .btn,
    .cpd-logs-mobile-cards .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Final mobile spacing consistency pass */
@media (max-width: 960px) {
    .content {
        gap: 14px;
    }

    .panel {
        padding: 16px;
    }

    .section-head {
        margin-bottom: 8px;
        gap: 8px;
    }

    .section-head .meta,
    .panel .meta {
        margin-top: 3px;
    }

    .panel-form,
    .form-inline,
    .row-wrap,
    .stack-sm,
    .stack-md,
    .stack-lg {
        gap: 8px;
    }

    .form-inline > div,
    .field-sm,
    .field-md,
    .field-lg,
    .field-min-180,
    .field-min-200,
    .field-min-220,
    .field-min-240,
    .field-min-260,
    .field-min-320,
    .field-min-340 {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .table-search {
        max-width: 100%;
        margin-bottom: 8px;
    }

    .actions {
        gap: 8px;
    }

    .actions .btn,
    .actions-inline .btn,
    .form-inline .btn,
    .panel-form .btn,
    .form-grid .btn {
        min-height: 36px;
    }

    .checkbox-select-menu {
        max-height: 260px;
    }
}

@media (max-width: 760px) {
    .panel {
        padding: 14px;
    }

    .table-wrap {
        margin-top: 2px;
    }

    .qb-company-mobile-cards tbody tr,
    .qb-materials-mobile-cards tbody tr,
    .qb-suggestions-mobile-cards tbody tr,
    .tests-current-mobile-cards tbody tr,
    .tests-previous-mobile-cards tbody tr,
    .workspace-available-mobile-cards tbody tr,
    .workspace-attached-mobile-cards tbody tr,
    .workspace-assignments-mobile-cards tbody tr,
    .events-target-mobile-cards tbody tr,
    .events-watch-mobile-cards tbody tr,
    .events-attendance-mobile-cards tbody tr,
    .reminders-mobile-cards tbody tr,
    .cpd-matrix-mobile-cards tbody tr,
    .cpd-logs-mobile-cards tbody tr {
        margin-bottom: 8px;
        border-radius: 10px;
    }

    .qb-company-mobile-cards td,
    .qb-materials-mobile-cards td,
    .qb-suggestions-mobile-cards td,
    .tests-current-mobile-cards td,
    .tests-previous-mobile-cards td,
    .workspace-available-mobile-cards td,
    .workspace-attached-mobile-cards td,
    .workspace-assignments-mobile-cards td,
    .events-target-mobile-cards td,
    .events-watch-mobile-cards td,
    .events-attendance-mobile-cards td,
    .reminders-mobile-cards td,
    .cpd-matrix-mobile-cards td,
    .cpd-logs-mobile-cards td {
        padding: 8px 9px;
        gap: 7px;
    }

    .qb-company-mobile-cards td::before,
    .qb-materials-mobile-cards td::before,
    .qb-suggestions-mobile-cards td::before,
    .tests-current-mobile-cards td::before,
    .tests-previous-mobile-cards td::before,
    .workspace-available-mobile-cards td::before,
    .workspace-attached-mobile-cards td::before,
    .workspace-assignments-mobile-cards td::before,
    .events-target-mobile-cards td::before,
    .events-watch-mobile-cards td::before,
    .events-attendance-mobile-cards td::before,
    .reminders-mobile-cards td::before,
    .cpd-matrix-mobile-cards td::before,
    .cpd-logs-mobile-cards td::before {
        line-height: 1.25;
    }

    .question-pill-row .pill {
        margin-bottom: 4px;
    }
}

@media (max-width: 560px) {
    .content {
        gap: 12px;
    }

    .panel {
        padding: 12px;
    }

    .section-head {
        margin-bottom: 6px;
    }

    .panel .btn,
    .actions .btn,
    .actions-inline .btn {
        min-height: 36px;
    }
}

/* Small-screen typography density pass */
@media (max-width: 560px) {
    .panel {
        font-size: 13.5px;
    }

    .panel h2,
    .panel h3 {
        line-height: 1.25;
    }

    .panel .meta {
        font-size: 0.82rem;
        line-height: 1.4;
    }

    .table,
    .table td,
    .table th {
        font-size: 0.8rem;
        line-height: 1.35;
    }

    .qb-company-mobile-cards td,
    .qb-materials-mobile-cards td,
    .qb-suggestions-mobile-cards td,
    .tests-current-mobile-cards td,
    .tests-previous-mobile-cards td,
    .workspace-available-mobile-cards td,
    .workspace-attached-mobile-cards td,
    .workspace-assignments-mobile-cards td,
    .events-target-mobile-cards td,
    .events-watch-mobile-cards td,
    .events-attendance-mobile-cards td,
    .reminders-mobile-cards td,
    .cpd-matrix-mobile-cards td,
    .cpd-logs-mobile-cards td {
        font-size: 0.81rem;
        line-height: 1.35;
    }

    .qb-company-mobile-cards td::before,
    .qb-materials-mobile-cards td::before,
    .qb-suggestions-mobile-cards td::before,
    .tests-current-mobile-cards td::before,
    .tests-previous-mobile-cards td::before,
    .workspace-available-mobile-cards td::before,
    .workspace-attached-mobile-cards td::before,
    .workspace-assignments-mobile-cards td::before,
    .events-target-mobile-cards td::before,
    .events-watch-mobile-cards td::before,
    .events-attendance-mobile-cards td::before,
    .reminders-mobile-cards td::before,
    .cpd-matrix-mobile-cards td::before,
    .cpd-logs-mobile-cards td::before {
        font-size: 0.69rem;
        letter-spacing: 0.015em;
        line-height: 1.2;
    }

    .btn,
    .actions .btn,
    .actions-inline .btn {
        font-size: 0.84rem;
        line-height: 1.2;
    }

    .btn .btn-mark {
        width: 18px;
        height: 18px;
        margin-right: 7px;
    }

    .btn .btn-mark svg {
        width: 11px;
        height: 11px;
    }

    input,
    select,
    textarea {
        font-size: 0.86rem;
        line-height: 1.35;
    }

    .pill,
    .status-chip {
        font-size: 0.74rem;
    }
}

.sidebar-toggle {
    display: none;
    width: 38px;
    height: 34px;
    border: 1px solid #d1dbea;
    border-radius: 10px;
    background: #fff;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-direction: column;
    padding: 0;
    cursor: pointer;
}

.sidebar-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: #2f4a3a;
}

.topbar-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 960px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar-toggle {
        display: inline-flex;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(300px, 84vw);
        z-index: 1200;
        border-right: 1px solid var(--border);
        border-bottom: 0;
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
        transform: translateX(-102%);
        transition: transform 0.22s ease;
        overflow-y: auto;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1150;
        border: 0;
        padding: 0;
        margin: 0;
        background: rgba(15, 23, 42, 0.4);
        display: none;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }
}
@media (max-width: 960px) {
    #reading-materials .category-setup-forms .question-material-attach {
        flex-wrap: wrap;
        align-items: stretch;
    }

    #reading-materials .category-setup-forms .question-material-attach > .field-min-260 {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
}

