* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #f5f7fa;
    --text-color: #2c3e50;
    --dim-text: #7f8c8d;
    --border-color: #e1e8ed;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #27ae60;
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --accent-color: #3498db;
    --brand-color: #004b87;
    --brand-color-dark: #003c6e;
    --brand-rgb: 0, 75, 135;
    --header-bg: var(--brand-color);
    --header-bg-dark: var(--brand-color-dark);
    --panel-bg: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --app-body-padding: 40px;
}

[data-theme="classic-red"] {
    --bg-color: #faf6f3;
    --text-color: #3d2a28;
    --dim-text: #7a6560;
    --border-color: #ecd9d4;
    --primary-color: #dd4133;
    --primary-dark: #b83429;
    --accent-color: #e9b224;
    --brand-color: #dd4133;
    --brand-color-dark: #b83429;
    --brand-rgb: 221, 65, 51;
    --header-bg: #dd4133;
    --header-bg-dark: #b83429;
}

[data-theme="teal-gold"] {
    --bg-color: #f2f8f9;
    --text-color: #1e3a42;
    --dim-text: #5f7a82;
    --border-color: #d3e4e8;
    --primary-color: #1d7389;
    --primary-dark: #155a6b;
    --accent-color: #e9b224;
    --brand-color: #1d7389;
    --brand-color-dark: #155a6b;
    --brand-rgb: 29, 115, 137;
    --header-bg: #1d7389;
    --header-bg-dark: #155a6b;
}

[data-theme="navy-gold"] {
    --bg-color: #f0f3f9;
    --text-color: #1a2a4a;
    --dim-text: #5c6b82;
    --border-color: #d4dce8;
    --primary-color: #1e468c;
    --primary-dark: #16356a;
    --accent-color: #edb83b;
    --brand-color: #1e468c;
    --brand-color-dark: #16356a;
    --brand-rgb: 30, 70, 140;
    --header-bg: #1e468c;
    --header-bg-dark: #16356a;
}

[data-theme="sunset"] {
    --bg-color: #fdf8f3;
    --text-color: #4a3224;
    --dim-text: #8a6f5c;
    --border-color: #edd9c8;
    --primary-color: #ee7537;
    --primary-dark: #c95f28;
    --accent-color: #edb83b;
    --brand-color: #ee7537;
    --brand-color-dark: #c95f28;
    --brand-rgb: 238, 117, 55;
    --header-bg: #ee7537;
    --header-bg-dark: #c95f28;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.console-container {
    width: 100%;
    max-width: 1200px;
    border-radius: 12px;
    background-color: var(--panel-bg);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--app-body-padding));
    max-height: calc(100vh - var(--app-body-padding));
}

.console-container > .header,
.console-container > .footer {
    flex-shrink: 0;
}

.console-container > .screen:not(.hidden) {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.header {
    background-color: var(--header-bg);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dcps-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 0;
}

.header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    min-width: 0;
    max-width: min(200px, 34vw);
    padding-right: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.header-date {
    font-size: 11px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.68);
    white-space: nowrap;
}

.header-user {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.96);
}

.header-user-button {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: right;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.35);
    text-underline-offset: 2px;
}

.header-user:empty {
    display: none;
}

.header-user-button:hover {
    text-decoration-color: rgba(255, 255, 255, 0.85);
}

.header-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 3px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.header-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 7px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}

.header-tool-btn[hidden] {
    display: none !important;
}

.header-tool-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.45);
}

.header-tool-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 1px;
}

.header-tool-theme {
    width: 30px;
    padding: 0;
}

.header-tool-theme img {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.header-tool-link {
    width: 30px;
    padding: 0;
}

.header-tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.header-tool-signout {
    padding: 0 10px;
}

.header-tool-signout.logout-mode {
    background-color: rgba(192, 57, 43, 0.88);
    border-color: rgba(255, 255, 255, 0.3);
}

.header-tool-signout.logout-mode:hover {
    background-color: rgba(168, 50, 50, 0.95);
    border-color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 640px) {
    .header-tool-signout-label {
        font-size: 0;
    }

    .header-tool-signout-label::after {
        content: "Out";
        font-size: 11px;
    }
}

.header-tool-school-year {
    min-width: 48px;
    padding: 0 8px;
    letter-spacing: 0.02em;
}

.header-tool-school-year-label {
    font-variant-numeric: tabular-nums;
}

.school-year-modal {
    z-index: 1250;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    border: none;
    background: transparent;
    overflow: visible;
    inset: 0;
}

.school-year-modal:not([open]) {
    display: none;
}

.school-year-modal::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.school-year-modal-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: calc(100vh - 32px);
    padding: 18px 18px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.school-year-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.school-year-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.school-year-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--dim-text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.school-year-modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-color);
}

.school-year-modal-intro {
    margin: 0;
    color: var(--dim-text);
    font-size: 0.92rem;
    line-height: 1.45;
}

.school-year-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(320px, 50vh);
    overflow-y: auto;
}

.school-year-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.65);
    color: var(--text-color);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.school-year-option:hover {
    border-color: rgba(var(--brand-rgb), 0.35);
    background: rgba(var(--brand-rgb), 0.06);
}

.school-year-option.is-selected {
    border-color: var(--primary-color);
    background: rgba(var(--brand-rgb), 0.1);
    box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), 0.12);
}

.school-year-option-label {
    font-size: 0.95rem;
    font-weight: 600;
}

.school-year-option-dates {
    font-size: 0.82rem;
    color: var(--dim-text);
}

.school-year-empty {
    margin: 0;
    color: var(--dim-text);
    font-size: 0.92rem;
}

.school-year-modal-actions {
    display: flex;
    justify-content: flex-end;
}

.api-request-log-modal {
    z-index: 1250;
    width: min(1040px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    margin: auto;
    padding: 0;
    border: none;
    background: transparent;
    overflow: visible;
    inset: 0;
}

.api-request-log-modal:not([open]) {
    display: none;
}

.api-request-log-modal::backdrop {
    background: rgba(2, 6, 23, 0.62);
}

.api-request-log-modal-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 24px);
    padding: 16px 16px 14px;
    border-radius: 10px;
    border: 1px solid #334155;
    background: var(--bg-color);
    color: var(--text-color);
    box-shadow: 0 24px 64px rgba(2, 6, 23, 0.35);
}

.api-request-log-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.api-request-log-modal-title-wrap {
    min-width: 0;
}

.api-request-log-modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.api-request-log-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--text-color);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.api-request-log-modal-close:hover {
    background: rgba(15, 23, 42, 0.08);
}

.api-request-log-modal-intro {
    margin: 4px 0 0;
    color: var(--text-muted, #64748b);
    font-size: 0.78rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.api-request-log-modal-intro code {
    font-size: 0.76rem;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.06);
}

.api-request-log-table {
    --log-col-expand: 22px;
    --log-col-index: 26px;
    --log-col-method: 50px;
    --log-col-status: 44px;
    --log-col-flag: 30px;
    --log-gap: 8px;
    --log-row-grid: var(--log-col-expand) var(--log-col-index) var(--log-col-method) minmax(0, 1fr) var(--log-col-status) var(--log-col-flag);
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid #1e293b;
    border-radius: 8px;
    overflow: hidden;
    background: #0b1220;
}

.api-request-log-table-head {
    display: grid;
    grid-template-columns: var(--log-row-grid);
    gap: 0 var(--log-gap);
    align-items: center;
    padding: 7px 10px;
    border-bottom: 1px solid #1e293b;
    background: #111827;
}

.api-request-log-head-cell {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.api-request-log-head-index,
.api-request-log-head-status {
    text-align: center;
}

.api-request-log-list {
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: auto;
    max-height: min(58vh, 480px);
    background: #0b1220;
}

.api-request-log-item {
    display: grid;
    grid-template-areas:
        "row"
        "panel";
    border-bottom: 1px solid rgba(30, 41, 59, 0.85);
}

.api-request-log-item:last-child {
    border-bottom: none;
}

.api-request-log-row {
    grid-area: row;
    display: grid;
    grid-template-columns: var(--log-row-grid);
    gap: 0 var(--log-gap);
    align-items: center;
    padding: 7px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.76rem;
}

.api-request-log-row:hover {
    background: rgba(30, 41, 59, 0.35);
}

.api-request-log-open-tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #111827;
    color: #94a3b8;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.api-request-log-open-tab-btn:hover {
    background: #1e293b;
    border-color: #475569;
    color: #60a5fa;
}

.api-request-log-open-tab-btn:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 1px;
}

.api-request-log-open-tab-icon {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.api-request-log-index {
    color: #64748b;
    font-variant-numeric: tabular-nums;
    text-align: center;
    font-size: 0.72rem;
}

.api-request-log-method,
.api-request-log-status {
    justify-self: stretch;
    margin: 0;
    padding: 2px 0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.api-request-log-method {
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.28);
}

.api-request-log-method:hover,
.api-request-log-method.is-active {
    background: rgba(37, 99, 235, 0.28);
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.api-request-log-method:focus-visible,
.api-request-log-status:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 1px;
}

.api-request-log-url {
    display: block;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    text-align: left;
    font-family: inherit;
    font-size: 0.74rem;
    color: #e2e8f0;
    background: transparent;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.api-request-log-url::-webkit-scrollbar {
    height: 4px;
}

.api-request-log-url::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 999px;
}

.api-request-log-duplicate,
.api-request-log-flag-spacer {
    justify-self: center;
    min-width: 26px;
    text-align: center;
}

.api-request-log-duplicate {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.28);
    padding: 1px 4px;
    border-radius: 3px;
}

.api-request-log-status {
    font-variant-numeric: tabular-nums;
    border: 1px solid transparent;
}

.api-request-log-status:hover,
.api-request-log-status.is-active {
    filter: brightness(1.15);
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.api-request-log-status.is-ok {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.28);
}

.api-request-log-status.is-error {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
}

.api-request-log-status.is-neutral,
.api-request-log-status.is-unknown {
    color: #94a3b8;
    background: rgba(100, 116, 139, 0.14);
    border-color: rgba(100, 116, 139, 0.28);
}

.api-request-log-details-panel {
    grid-area: panel;
    padding: 0 10px 10px calc(10px + var(--log-col-expand) + var(--log-gap));
}

.api-request-log-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.api-request-log-details-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.api-request-log-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #111827;
    color: #cbd5e1;
    padding: 0;
    cursor: pointer;
}

.api-request-log-copy-btn:hover {
    background: #1e293b;
}

.api-request-log-copy-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.api-request-log-details-pre {
    margin: 0;
    padding: 12px;
    max-height: 240px;
    overflow: auto;
    border: 1px solid #334155;
    border-radius: 6px;
    background-color: #020617;
    color: #cbd5e1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.api-request-log-empty {
    padding: 18px 14px;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
}

.api-request-log-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.header-tool-api-log .header-tool-icon {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.theme-modal {
    z-index: 1250;
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    border: none;
    border-radius: 14px;
    background: transparent;
    overflow: visible;
    inset: 0;
}

.theme-modal:not([open]) {
    display: none;
}

.theme-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.45);
}

.theme-modal-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: calc(100vh - 32px);
    padding: 24px;
    border-radius: 14px;
    background-color: var(--panel-bg);
    border-top: 5px solid var(--header-bg);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    overflow: auto;
}

.theme-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.theme-modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 22px;
    font-weight: 700;
}

.theme-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--dim-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.theme-modal-close:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.theme-modal-intro {
    margin: 0;
    color: var(--dim-text);
    font-size: 14px;
    line-height: 1.5;
}

.theme-modal-section h3 {
    margin: 0 0 10px;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

.theme-logo-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 10px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.theme-logo-option:hover {
    border-color: var(--primary-color);
}

.theme-logo-option.is-selected {
    border-color: var(--primary-color);
    background-color: rgba(var(--brand-rgb), 0.08);
    box-shadow: 0 0 0 1px rgba(var(--brand-rgb), 0.18);
}

.theme-logo-option img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.theme-logo-option-label {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

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

.theme-color-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 13px;
    font-weight: 600;
}

.theme-color-field input[type="color"] {
    width: 42px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.theme-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.theme-modal-actions .console-btn.small {
    width: auto;
}

.theme-modal-actions .console-btn.secondary:disabled {
    opacity: 0.65;
    cursor: default;
    transform: none;
}

@media (max-width: 480px) {
    .theme-logo-grid,
    .theme-color-grid {
        grid-template-columns: 1fr;
    }

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

    .theme-modal-actions .console-btn.small {
        width: 100%;
    }
}

.impersonate-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.5);
}

.impersonate-modal-content {
    width: 100%;
    max-width: 420px;
    padding: 28px;
    border-radius: 10px;
    background-color: var(--panel-bg);
    box-shadow: var(--shadow);
}

.impersonate-modal-content h2 {
    margin-bottom: 18px;
    color: var(--text-color);
}

.impersonate-modal-content label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
}

.impersonate-modal-content input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
}

.impersonate-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.console-btn.secondary {
    background-color: var(--dim-text);
}

.window-error-modal {
    z-index: 1260;
    width: min(520px, calc(100vw - 40px));
    max-height: 85vh;
    margin: auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    overflow: visible;
}

.window-error-modal:not([open]) {
    display: none;
}

.window-error-modal::backdrop {
    background-color: rgba(20, 28, 38, 0.55);
    backdrop-filter: blur(2px);
}

.window-error-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 85vh;
    padding: 28px;
    border-radius: 12px;
    background-color: var(--panel-bg);
    border-top: 5px solid var(--error-color);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    color: var(--text-color);
}

.window-error-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--dim-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.window-error-close:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.window-error-card h2 {
    margin: 0 36px 0 0;
    padding-right: 8px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
}

.window-error-summary {
    margin: 16px 0 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-color);
}

.window-error-more-link {
    align-self: flex-start;
    margin-top: 14px;
    padding: 0;
    border: none;
    background: none;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.window-error-more-link:hover {
    color: var(--primary-dark);
}

.window-error-more-link[hidden] {
    display: none;
}

.window-error-details-panel {
    margin-top: 12px;
    min-height: 0;
}

.window-error-details-panel[hidden] {
    display: none;
}

.window-error-details-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
}

.window-error-details-panel pre {
    margin: 0;
    padding: 14px;
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #1e272e;
    color: #dfe6e9;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.window-error-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.08);
    color: #dfe6e9;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.window-error-copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.window-error-copy-btn.is-copied {
    background-color: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.5);
    color: #2ecc71;
}

.window-error-copy-btn .window-error-copy-check[hidden],
.window-error-copy-btn .window-error-copy-icon[hidden] {
    display: none;
}

.window-error-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.window-error-actions .console-btn {
    width: auto;
    min-width: 120px;
}

@media (prefers-color-scheme: dark) {
    .window-error-card {
        background-color: #1f2933;
        color: #ecf0f1;
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    }

    .window-error-card h2,
    .window-error-summary {
        color: #ecf0f1;
    }

    .window-error-close:hover {
        background-color: rgba(255, 255, 255, 0.08);
        color: #ecf0f1;
    }

    .window-error-details-panel pre {
        background-color: #111820;
        border-color: #33404d;
        color: #d7dee3;
    }
}

.book-details-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(20, 28, 38, 0.55);
    backdrop-filter: blur(2px);
}

.book-details-content {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 22px;
    border-radius: 14px;
    background-color: var(--panel-bg);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    animation: apiErrorPop 0.18s ease-out;
}

.book-details-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--dim-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.book-details-close:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.book-details-layout {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 18px;
    align-items: stretch;
}

.book-details-cover-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
}

.book-details-cover,
.book-details-cover-placeholder {
    width: 150px;
    height: 225px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.book-details-cover {
    object-fit: cover;
    background-color: var(--bg-color);
}

.book-details-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: var(--bg-color);
    border: 1px dashed var(--border-color);
    color: var(--dim-text);
    text-align: center;
    font-weight: 600;
}

.console-btn.book-details-start {
    display: block;
    width: 100%;
    margin-top: 0;
    padding: 8px 10px;
    font-size: 13px;
    background-color: #1f7a3a;
    color: #ffffff;
}

.book-details-log-reading {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 150px;
    margin-top: auto;
    padding-top: 10px;
}

.book-details-log-reading.hidden {
    display: none;
}

.book-details-due-date-notice {
    width: 150px;
    margin: auto 0 0;
    padding-top: 10px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--dim-text);
    text-align: left;
}

.book-details-due-date-notice.hidden {
    display: none;
}

.book-details-finish-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-color);
    cursor: pointer;
}

.book-details-finish-label[hidden] {
    display: none;
}

.book-details-finish-label input {
    margin-top: 2px;
    flex-shrink: 0;
}

.book-details-minutes-label {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--dim-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.book-details-minutes-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 13px;
    box-sizing: border-box;
}

.book-details-minutes-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.console-btn.book-details-start:hover {
    background-color: #17612d;
}

.console-btn.book-details-start:focus-visible {
    outline: 3px solid rgba(31, 122, 58, 0.35);
    outline-offset: 3px;
}

.console-btn.book-details-start:disabled {
    background-color: var(--dim-text);
    cursor: not-allowed;
    opacity: 0.85;
}

.console-btn.book-details-start:disabled:hover {
    background-color: var(--dim-text);
}

.book-details-body {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding-right: 20px;
}

.book-details-eyebrow {
    margin: 0 0 12px;
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.book-details-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.book-details-heading h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 20px;
    line-height: 1.25;
    flex: 1;
    min-width: 0;
}

.book-details-menu {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.console-btn.book-details-menu-button,
.console-btn.book-details-delete-button,
.console-btn.book-details-add-button,
.console-btn.book-details-save-button {
    align-self: flex-start;
    margin-left: 0;
}

.console-btn.book-details-save-button {
    min-width: auto;
    margin-top: 2px;
    padding: 8px 12px;
    font-size: 12px;
}

.console-btn.book-details-save-button.hidden {
    display: none;
}

.book-details-field-verify {
    align-items: center;
}

.book-details-verify-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text-color);
    font-size: 12px;
    line-height: 1.35;
    cursor: pointer;
}

.book-details-verify-label input:disabled {
    cursor: not-allowed;
}

.book-details-verify-label input:disabled + span {
    color: var(--dim-text);
}

.console-btn.book-details-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    margin-top: 2px;
    padding: 8px 12px;
    background-color: var(--bg-color);
    color: var(--dim-text);
    border: 1px solid var(--border-color);
    font-size: 16px;
    line-height: 1;
}

.console-btn.book-details-menu-button:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

.console-btn.book-details-delete-button {
    display: none;
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.console-btn.book-details-delete-button:hover {
    background-color: var(--error-color);
    color: #ffffff;
}

.console-btn.book-details-add-button {
    display: none;
}

.book-details-meta {
    margin-top: 6px;
    color: var(--dim-text);
    font-size: 12px;
    line-height: 1.35;
}

.book-details-fields {
    display: grid;
    gap: 1px;
    margin-top: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--border-color);
}

.book-details-field {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 10px;
    padding: 7px 10px;
    background-color: var(--panel-bg);
}

.book-details-label {
    color: var(--dim-text);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.35px;
    text-transform: uppercase;
}

.book-details-value {
    color: var(--text-color);
    font-size: 12px;
    line-height: 1.35;
    word-break: break-word;
}

.book-details-field-with-action {
    grid-template-columns: 82px minmax(0, 1fr);
}

.book-details-value-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.book-details-value-row .book-details-value {
    flex: 1 1 auto;
    min-width: 0;
}

.book-details-assignment-link {
    flex: 0 0 auto;
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    white-space: nowrap;
}

.book-details-assignment-link:hover {
    color: var(--header-bg-dark);
}

.book-details-assignment-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.book-details-reading-summary {
    margin-top: auto;
    padding-top: 12px;
}

.book-details-reading-summary.hidden {
    display: none;
}

.book-details-reading-summary-label {
    margin: 0 0 8px;
    color: var(--dim-text);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.35px;
    text-transform: uppercase;
}

.book-details-reading-summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.book-details-reading-summary-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
}

.book-details-reading-summary-value {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.book-details-reading-summary-caption {
    color: var(--dim-text);
    font-size: 10px;
    font-weight: 600;
}

.book-details-reading-summary-note {
    margin: 8px 0 0;
    color: var(--dim-text);
    font-size: 11px;
    line-height: 1.35;
}

.clickable-entry {
    cursor: pointer;
}

.clickable-entry:hover {
    box-shadow: var(--shadow);
}

.notice-modal {
    position: fixed;
    inset: 0;
    z-index: 1260;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(20, 28, 38, 0.45);
    backdrop-filter: blur(2px);
}

.notice-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 30px 28px 26px;
    border-radius: 14px;
    background-color: var(--panel-bg);
    border-top: 5px solid #1f7a3a;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: apiErrorPop 0.18s ease-out;
}

.notice-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--dim-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.notice-close:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.notice-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background-color: rgba(31, 122, 58, 0.12);
    color: #1f7a3a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
}

.notice-body h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 22px;
    font-weight: 700;
}

.notice-body p {
    margin: 10px 0 0;
    color: var(--dim-text);
    font-size: 14px;
    line-height: 1.5;
}

.console-btn.notice-dismiss {
    width: auto;
    min-width: 110px;
    margin-top: 22px;
    background-color: #1f7a3a;
    color: #ffffff;
}

.console-btn.notice-dismiss:hover {
    background-color: #17612d;
}

.confirm-remove-modal {
    position: fixed;
    inset: 0;
    z-index: 1280;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(20, 28, 38, 0.45);
    backdrop-filter: blur(2px);
}

.confirm-remove-modal.hidden {
    display: none;
}

.confirm-remove-content {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 28px 28px 24px;
    border-radius: 14px;
    background-color: var(--panel-bg);
    border-top: 5px solid var(--error-color);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    text-align: left;
    animation: apiErrorPop 0.18s ease-out;
}

.confirm-remove-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--dim-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.confirm-remove-close:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.confirm-remove-eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dim-text);
}

.confirm-remove-content h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    padding-right: 28px;
}

.confirm-remove-message {
    margin: 12px 0 0;
    color: var(--dim-text);
    font-size: 14px;
    line-height: 1.5;
}

.confirm-remove-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.confirm-remove-actions .console-btn {
    width: auto;
    min-width: 100px;
}

.console-btn.confirm-remove-submit {
    background-color: var(--error-color);
    color: #ffffff;
}

.console-btn.confirm-remove-submit:hover {
    filter: brightness(0.92);
}

.console-btn.confirm-remove-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    filter: none;
}

.reading-log-success-modal {
    position: fixed;
    inset: 0;
    z-index: 1125;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(20, 28, 38, 0.45);
    backdrop-filter: blur(2px);
}

.reading-log-success-modal.hidden {
    display: none;
}

.reading-log-success-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px 28px 24px;
    border-radius: 14px;
    background-color: var(--panel-bg);
    border-top: 5px solid #1f7a3a;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    animation: apiErrorPop 0.18s ease-out;
}

.reading-log-success-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--dim-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.reading-log-success-close:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: var(--text-color);
}

.reading-log-success-body {
    text-align: center;
}

.reading-log-success-body h2 {
    margin: 12px 0 10px;
    color: var(--text-color);
    font-size: 22px;
}

.reading-log-success-message {
    margin: 0 0 18px;
    color: var(--dim-text);
    font-size: 14px;
    line-height: 1.5;
}

.reading-log-review-section {
    text-align: left;
    margin-top: 8px;
}

.reading-log-review-label {
    display: block;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--dim-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.star-rating {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.star-rating-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: #c5ced8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.star-rating-btn.is-active {
    color: #f5b301;
    border-color: #f0c040;
    background-color: rgba(245, 179, 1, 0.08);
}

.star-rating-btn:hover {
    border-color: #f0c040;
    color: #f5b301;
}

.reading-log-review-note {
    width: 100%;
    min-height: 120px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
    resize: vertical;
    box-sizing: border-box;
}

.reading-log-review-note:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.reading-log-review-count {
    margin-top: 6px;
    color: var(--dim-text);
    font-size: 12px;
    text-align: right;
}

.reading-log-success-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.reading-log-success-actions .console-btn {
    min-width: 120px;
}

@media (max-width: 640px) {
    .book-details-layout {
        grid-template-columns: 1fr;
    }

    .book-details-cover-wrap {
        min-height: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }

    .book-details-cover,
    .book-details-cover-placeholder {
        width: 120px;
        height: 180px;
    }

    .book-details-log-reading {
        width: 120px;
        margin-top: auto;
        padding-top: 10px;
    }

    .book-details-due-date-notice {
        width: 120px;
        margin-top: auto;
        text-align: center;
    }

    .console-btn.book-details-start {
        width: 100%;
        max-width: 100%;
        margin-top: 0;
    }

    .book-details-body {
        padding-right: 0;
    }

    .book-details-field {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .book-details-field-with-action {
        grid-template-columns: 1fr;
    }

    .book-details-value-row {
        flex-wrap: wrap;
    }
}

.screen {
    padding: 30px;
}

.hidden {
    display: none;
}

.login-hero-screen:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
    padding: 48px 30px 64px;
}

.login-hero {
    width: 100%;
    max-width: 560px;
    text-align: center;
}

.login-hero-logo {
    display: block;
    width: min(280px, 72vw);
    height: auto;
    margin: 0 auto 24px;
}

.login-hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 240px;
    max-width: 100%;
    margin: 0 auto 28px;
    padding: 14px 28px;
    background-color: var(--header-bg);
    border: none;
    border-radius: 999px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(var(--brand-rgb), 0.22);
}

.login-hero-btn:hover {
    background-color: var(--header-bg-dark);
}

.login-hero-btn:focus-visible {
    outline: 3px solid rgba(var(--brand-rgb), 0.35);
    outline-offset: 3px;
}

.login-hero-btn:disabled {
    opacity: 0.75;
    cursor: wait;
    transform: none;
}

.login-hero-btn[hidden] {
    display: none;
}

.login-hero-eyebrow {
    margin: 0 0 8px;
    color: var(--dim-text);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.login-hero-title {
    margin: 0 0 12px;
    color: var(--text-color);
    font-size: clamp(2.4rem, 6vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.login-hero-tagline {
    margin: 0 auto 16px;
    max-width: 460px;
    color: var(--dim-text);
    font-size: 18px;
    line-height: 1.55;
}

.login-hero-hint {
    margin: 0 auto;
    max-width: 420px;
    color: var(--dim-text);
    font-size: 14px;
    line-height: 1.5;
}

.login-hero-error {
    margin-top: 20px;
}

.header-auth-btn {
    margin-left: 0;
}

.login-box {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px;
    background-color: var(--panel-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.login-box h2 {
    margin-bottom: 30px;
    color: var(--text-color);
    font-weight: 600;
    text-align: center;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.console-btn {
    width: 100%;
    padding: 12px 20px;
    background-color: var(--header-bg);
    border: none;
    border-radius: 6px;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.console-btn:hover {
    background-color: var(--header-bg-dark);
    transform: translateY(-1px);
}

.console-btn:active {
    transform: translateY(0);
}

.console-btn.small {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
}

.error {
    color: var(--error-color);
    margin-top: 15px;
    font-size: 14px;
    min-height: 20px;
}

.test-credentials {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 6px;
    font-size: 13px;
    color: var(--dim-text);
}

.test-credentials p {
    margin: 8px 0;
}

.test-credentials p:first-child {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header h2 {
    color: var(--text-color);
    font-weight: 600;
}

.dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-dashboard-role-switch {
    display: flex;
    align-items: center;
}

.header-dashboard-role-switch[hidden],
.header-dashboard-role-switch.hidden {
    display: none !important;
}

.header-dashboard-role-select {
    display: inline-flex;
    align-items: center;
    min-width: 9.5rem;
    max-width: 12rem;
    height: 30px;
    padding: 0 26px 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 7px;
    background-color: rgba(255, 255, 255, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' aria-hidden='true'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5' fill='none' stroke='%23ffffff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
    background-size: 14px 14px;
    color: #ffffff;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color-scheme: dark;
    accent-color: var(--accent-color);
    transition: background-color 0.15s, border-color 0.15s;
}

.header-dashboard-role-select:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.45);
}

.header-dashboard-role-select:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 1px;
}

.header-dashboard-role-select option {
    background-color: var(--header-bg);
    color: #ffffff;
}

.dashboard-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

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

#studentDashboardMain > .panel {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.console-container > .screen:not(.hidden) > .dashboard-content,
.console-container > .screen:not(.hidden) > .teacher-assign-book-view > .dashboard-content {
    flex: 1 1 auto;
    min-height: 0;
}

#teacherDashboardMain.dashboard-content,
.teacher-assign-book-content.dashboard-content {
    min-height: 0;
}

.teacher-assign-book-content.dashboard-content {
    min-height: 0;
}

#teacherDashboardMain > .panel.panel-scroll,
.teacher-assign-book-content > .panel.panel-scroll {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.teacher-assign-book-content > .panel.panel-scroll {
    min-height: 0;
}

.staff-students-list.data-display,
.panel-scroll .data-display.teacher-assign-book-results,
.panel-scroll .data-display.teacher-assign-book-students {
    flex: 1 1 auto;
    min-height: 0;
}

.dashboard-content.hidden,
.student-metrics-view.hidden,
.teacher-assign-book-view.hidden {
    display: none;
}

.teacher-assign-book-view {
    animation: metricsFadeIn 0.22s ease-out;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

.teacher-assign-book-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 24px;
}

.teacher-assign-book-page-header h2 {
    margin: 0 0 10px;
}

.teacher-assign-book-view .panel-scroll {
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
}

.panel-header.teacher-assign-book-panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 0;
    padding-bottom: 12px;
    flex-shrink: 0;
}

.panel-header.teacher-assign-book-panel-header h3 {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
    font-size: 18px;
}

.teacher-assign-book-students-header h3 {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.panel-scroll .data-display.teacher-assign-book-results,
.panel-scroll .data-display.teacher-assign-book-students {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
}

.panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.panel-scroll {
    flex: 1 1 auto;
    min-height: 320px;
    max-height: none;
    overflow: hidden;
}

.panel-scroll .data-display {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.panel h3 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
    flex-shrink: 0;
}

.panel-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.panel-header-title h3 {
    margin: 0;
}

.panel-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background-color: var(--surface-muted, #f4f6f8);
    flex-shrink: 0;
}

.panel-view-toggle-btn {
    border: none;
    background: transparent;
    color: var(--dim-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.panel-view-toggle-btn:hover {
    color: var(--text-color);
}

.panel-view-toggle-btn.is-active {
    background-color: var(--bg-color);
    color: var(--text-color);
    box-shadow: var(--shadow, 0 1px 2px rgba(0, 0, 0, 0.08));
}

.panel-header-title-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.panel-gear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--dim-text);
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.panel-gear-btn:hover {
    color: var(--text-color);
    border-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.08);
}

.panel-gear-btn:focus-visible {
    outline: 2px solid rgba(52, 152, 219, 0.45);
    outline-offset: 2px;
}

.panel-gear-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 0;
}

.panel-header-action-btn {
    white-space: nowrap;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
}

.panel-header.teacher-students-panel-header {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 12px;
}

.teacher-students-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

.teacher-students-header-row .panel-header-title {
    flex: 0 0 auto;
}

.teacher-students-header-row .panel-header-title-text,
.teacher-students-header-row .panel-header-title h3 {
    text-align: left;
}

.teacher-students-header-row .teacher-class-dropdown {
    flex: 0 1 280px;
    margin-left: auto;
}

.teacher-students-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

.teacher-students-toolbar-search {
    flex: 0 1 280px;
    min-width: 0;
}

.teacher-students-toolbar-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 0 1 520px;
}

.staff-students-grade-select {
    flex: 0 0 auto;
    min-width: 128px;
    max-width: 160px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--panel-bg, var(--bg-color));
    color: var(--text-color);
    font-size: 14px;
}

.staff-students-grade-select:disabled {
    opacity: 0.65;
    cursor: wait;
}

.teacher-students-toolbar-centered {
    justify-content: center;
}

.teacher-students-toolbar-search-row .panel-search-input {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.teacher-students-toolbar-search-row .panel-search-input::placeholder {
    text-align: center;
}

.teacher-students-toolbar-search-row .console-btn.small {
    text-align: center;
}

.teacher-student-dropdown {
    position: relative;
    flex: 0 1 280px;
    min-width: 180px;
    max-width: 100%;
}

.teacher-student-dropdown.is-single-school {
    flex: 0 1 auto;
    min-width: 0;
}

.teacher-student-dropdown.is-single-school .teacher-student-dropdown-trigger,
.teacher-student-dropdown.is-single-school .teacher-student-dropdown-menu {
    display: none !important;
}

.teacher-school-static-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.teacher-student-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.teacher-student-dropdown-trigger:hover:not(:disabled) {
    border-color: var(--primary-color);
}

.teacher-student-dropdown-trigger:focus-visible {
    outline: 2px solid rgba(52, 152, 219, 0.45);
    outline-offset: 2px;
}

.teacher-student-dropdown-trigger:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.teacher-student-dropdown-trigger[aria-expanded="true"] .teacher-student-dropdown-chevron {
    transform: rotate(180deg);
}

#teacherClassDropdownLabel {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teacher-student-dropdown-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.teacher-student-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    max-height: 280px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--panel-bg);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.teacher-student-dropdown-menu.is-floating {
    position: fixed;
    top: auto;
    right: auto;
    left: auto;
    z-index: 1200;
}

.teacher-student-dropdown-menu.hidden {
    display: none;
}

.teacher-student-dropdown-search-wrap {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

.teacher-student-dropdown-options {
    overflow-y: auto;
    padding: 6px;
}

.teacher-student-dropdown-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
}

.teacher-student-dropdown-option:hover {
    background-color: rgba(52, 152, 219, 0.08);
}

.teacher-student-dropdown-option.is-selected {
    background-color: rgba(52, 152, 219, 0.12);
}

.teacher-student-dropdown-option-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.teacher-student-dropdown-option-meta {
    font-size: 11px;
    color: var(--dim-text);
    line-height: 1.35;
}

.teacher-student-dropdown-empty {
    margin: 0;
    padding: 12px 10px;
    color: var(--dim-text);
    font-size: 13px;
    font-style: italic;
    text-align: center;
}

.teacher-student-summary {
    margin-top: 4px;
}

.teacher-student-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--bg-color);
}

.teacher-student-summary-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.3;
}

.teacher-student-summary-meta {
    margin-top: 4px;
    color: var(--dim-text);
    font-size: 11px;
    line-height: 1.35;
}

.teacher-assign-book-content h2,
.teacher-assign-book-page-header h2 {
    margin: 0 0 10px;
    font-size: 22px;
    color: var(--text-color);
}

.teacher-assign-book-lead {
    margin: 0;
    color: var(--dim-text);
    font-size: 14px;
    line-height: 1.5;
}

.assign-book-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1130;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(20, 28, 38, 0.45);
    backdrop-filter: blur(2px);
}

.assign-book-confirm-modal.hidden {
    display: none;
}

.assign-book-confirm-content {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 40px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 28px 28px 24px;
    border-radius: 14px;
    background-color: var(--panel-bg);
    border-top: 5px solid var(--header-bg);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    animation: apiErrorPop 0.18s ease-out;
}

.assign-book-confirm-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--dim-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.assign-book-confirm-close:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.assign-book-confirm-eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dim-text);
}

.assign-book-confirm-content h2 {
    margin: 0 0 18px;
    font-size: 24px;
    color: var(--text-color);
}

.assign-book-confirm-book {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    margin-bottom: 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
}

.assign-book-confirm-book-cover-wrap {
    position: relative;
    flex: 0 0 72px;
    width: 72px;
    height: 108px;
}

.assign-book-confirm-book-cover,
.assign-book-confirm-book-cover-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
}

.assign-book-confirm-book-cover[hidden],
.assign-book-confirm-book-cover-placeholder[hidden] {
    display: none !important;
}

.assign-book-confirm-book-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--dim-text);
    font-size: 11px;
    text-align: center;
    padding: 8px;
}

.assign-book-confirm-book-info {
    min-width: 0;
    flex: 1;
}

.assign-book-confirm-book-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.35;
}

.assign-book-confirm-book-meta {
    margin-top: 6px;
    color: var(--dim-text);
    font-size: 13px;
    line-height: 1.45;
}

.assign-book-confirm-section {
    margin-bottom: 18px;
}

.assign-book-confirm-section-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dim-text);
}

.assign-book-confirm-students-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    max-height: 126px;
    overflow-y: auto;
}

.assign-book-confirm-student-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.assign-book-confirm-student-item:last-child {
    border-bottom: none;
}

.assign-book-confirm-student-item.is-empty {
    color: var(--dim-text);
}

.assign-book-confirm-student-name {
    color: var(--text-color);
    font-weight: 500;
}

.assign-book-confirm-student-id {
    color: var(--dim-text);
    white-space: nowrap;
}

.assign-book-confirm-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.assign-book-confirm-details-dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.assign-book-confirm-date-field input[type="date"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.assign-book-confirm-details-description {
    grid-column: 1 / -1;
}

.assign-book-confirm-verify-required {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    user-select: none;
}

.assign-book-confirm-verify-required input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.assign-book-confirm-date-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.assign-book-confirm-content .input-group {
    margin-bottom: 0;
}

.assign-book-confirm-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.assign-book-confirm-action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
}

.assign-book-confirm-actions .console-btn {
    width: auto;
}

.console-btn.assign-book-confirm-delete {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.console-btn.assign-book-confirm-delete:hover {
    background-color: var(--error-color);
    color: #ffffff;
}

.console-btn.assign-book-confirm-delete.hidden {
    display: none;
}

.assign-book-confirm-modal[data-mode="edit"] .assign-book-confirm-details-grid input[disabled],
.assign-book-confirm-modal[data-mode="edit"] .assign-book-confirm-details-grid textarea[disabled] {
    opacity: 0.85;
    cursor: not-allowed;
}

.field-optional {
    font-weight: 400;
    color: var(--dim-text);
}

.input-group textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.45;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.teacher-assign-book-section {
    margin-bottom: 20px;
}

.teacher-assign-book-section h3 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dim-text);
}

.teacher-assign-book-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.teacher-assign-book-search-row .panel-search-input {
    flex: 1;
    min-width: 0;
}

.teacher-assign-book-results {
    margin-top: 0;
    max-height: none;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
}

.teacher-assign-book-results .book-result-item {
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.teacher-assign-book-results .book-cover,
.teacher-assign-book-results .book-cover-placeholder {
    width: 36px;
    height: 54px;
}

.teacher-assign-book-results .book-cover-placeholder {
    font-size: 9px;
}

.teacher-assign-book-results .book-title {
    font-size: 13px;
    margin-bottom: 2px;
}

.teacher-assign-book-results .book-author,
.teacher-assign-book-results .book-year {
    font-size: 11px;
    margin-bottom: 0;
    line-height: 1.25;
}

.teacher-assign-book-results .teacher-assign-book-select-indicator {
    padding: 4px 8px;
    gap: 6px;
    font-size: 11px;
}

.teacher-assign-book-results .teacher-assign-book-select-radio {
    width: 12px;
    height: 12px;
}

.teacher-assign-book-results .book-result-item:last-child {
    border-bottom: none;
}

.teacher-assign-book-results .book-result-item.selected {
    background-color: rgba(52, 152, 219, 0.1);
    border-left: 3px solid var(--primary-color);
}

.teacher-assign-book-select-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    align-self: center;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background-color: var(--panel-bg);
    color: var(--dim-text);
    font-size: 12px;
    font-weight: 600;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.teacher-assign-book-select-radio {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 50%;
    box-sizing: border-box;
    position: relative;
    flex-shrink: 0;
}

.teacher-assign-book-select-indicator.is-selected {
    border-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.12);
    color: var(--primary-color);
}

.teacher-assign-book-select-indicator.is-selected .teacher-assign-book-select-radio {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    box-shadow: inset 0 0 0 2px var(--panel-bg);
}

.book-result-item.selected .teacher-assign-book-select-text {
    font-weight: 700;
}

.teacher-assign-book-students-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.teacher-assign-book-class-row {
    width: 100%;
}

.teacher-assign-book-class-row .teacher-class-dropdown {
    flex: 0 1 280px;
    margin-left: auto;
}

.teacher-assign-book-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.teacher-assign-book-students-header h3 {
    margin: 0;
}

.teacher-assign-book-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    user-select: none;
}

.teacher-assign-book-select-all input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.teacher-assign-book-student-hint {
    margin: 0 0 10px;
    color: var(--dim-text);
    font-size: 12px;
    line-height: 1.4;
}

.teacher-assign-book-students {
    max-height: none;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
}

.teacher-assign-book-student-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.teacher-assign-book-student-item:last-child {
    border-bottom: none;
}

.teacher-assign-book-student-item:hover {
    background-color: rgba(52, 152, 219, 0.06);
}

.teacher-assign-book-student-checkbox {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    cursor: pointer;
}

.teacher-assign-book-student-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.teacher-assign-book-student-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
}

.teacher-assign-book-student-meta {
    font-size: 11px;
    color: var(--dim-text);
    line-height: 1.35;
}

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

.teacher-assign-book-target-panel {
    min-height: 120px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--bg-color);
}

.teacher-assign-book-target-label {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.teacher-assign-book-empty {
    margin: 0;
    color: var(--dim-text);
    font-size: 13px;
    font-style: italic;
    line-height: 1.5;
}

.teacher-assign-book-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
}

.panel-header h3 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.panel-header-search {
    flex: 0 1 240px;
    min-width: 0;
}

.panel-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
}

.panel-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.panel-search-input::placeholder {
    color: var(--dim-text);
}

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

.data-display {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

#studentHistory,
#teacherVerifications,
#parentVerifications {
    max-height: none;
}

#parentVerifications {
    overflow-x: auto;
}

#parentVerifications table,
#teacherVerifications table {
    width: 100%;
    border-collapse: collapse;
}

#parentVerifications th,
#teacherVerifications th {
    background-color: var(--bg-color);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

#parentVerifications td,
#teacherVerifications td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

#parentVerifications tr:hover,
#teacherVerifications tr:hover {
    background-color: rgba(var(--brand-rgb), 0.05);
}

.data-display::-webkit-scrollbar {
    width: 8px;
}

.data-display::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.data-display::-webkit-scrollbar-thumb {
    background: var(--dim-text);
    border-radius: 4px;
}

.entry-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 12px;
    background-color: var(--bg-color);
    transition: box-shadow 0.3s;
}

.entry-item:hover {
    box-shadow: var(--shadow);
}

.entry-item.verified {
    border-left: 4px solid var(--success-color);
}

.entry-item.pending {
    border-left: 4px solid var(--warning-color);
}

.teacher-panel-section + .teacher-panel-section {
    margin-top: 18px;
}

.teacher-panel-section-label {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dim-text);
}

.assignment-entry {
    border-left: 4px solid var(--accent-color);
}

.entry-title-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 4px;
}

.entry-assigned-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-color) 28%, transparent);
    line-height: 1.4;
}

.entry-verify-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.entry-verify-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.entry-verify-badge-required {
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary-color) 28%, transparent);
}

.entry-verify-badge-optional {
    color: var(--dim-text);
    background: color-mix(in srgb, var(--dim-text) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--dim-text) 22%, transparent);
}

.entry-verify-badge-pending {
    color: #b45309;
    background: color-mix(in srgb, #f59e0b 14%, transparent);
    border: 1px solid color-mix(in srgb, #f59e0b 30%, transparent);
}

.entry-verify-badge-complete {
    color: #047857;
    background: color-mix(in srgb, #10b981 12%, transparent);
    border: 1px solid color-mix(in srgb, #10b981 28%, transparent);
}

.entry-header-aside .entry-date + .entry-date {
    margin-top: 4px;
}

.entry-date-ended {
    color: var(--dim-text);
    font-style: italic;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--dim-text);
    font-weight: 500;
}

.entry-body-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.entry-primary {
    flex: 1;
    min-width: 0;
}

.entry-title {
    font-size: 13px;
    color: var(--dim-text);
    font-weight: 500;
    margin-bottom: 4px;
}

.entry-meta {
    font-size: 14px;
    color: var(--text-color);
}

.entry-sprint-timer-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.entry-header-aside .entry-sprint-timer-wrap {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    margin-top: 4px;
}

.entry-header-aside .entry-sprint-timer {
    font-size: 16px;
}

.entry-sprint-timer-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1f7a3a;
}

.entry-sprint-timer {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 600;
    color: #1f7a3a;
    line-height: 1;
}

.entry-item-active-sprint {
    border-left: 4px solid #1f7a3a;
}

.entry-header-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    text-align: right;
}

.entry-header-aside-with-sprints {
    gap: 0;
    padding-left: 8px;
}

.entry-sprint-hit-area {
    margin-top: 4px;
    padding: 10px;
    margin-right: -10px;
    margin-bottom: -10px;
}

.entry-sprint-tally {
    font-size: 12px;
    color: var(--dim-text);
    font-weight: 400;
}

.entry-sprint-button {
    padding: 6px 12px;
    min-height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background-color: var(--panel-bg);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.entry-sprint-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.08);
}

.sprints-modal {
    position: fixed;
    inset: 0;
    z-index: 1130;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(20, 28, 38, 0.45);
    backdrop-filter: blur(2px);
}

.sprints-modal.hidden {
    display: none;
}

.sprints-modal-content {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: min(80vh, 720px);
    display: flex;
    flex-direction: column;
    padding: 28px 24px 22px;
    border-radius: 14px;
    background-color: var(--panel-bg);
    border-top: 5px solid var(--primary-color);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    animation: apiErrorPop 0.18s ease-out;
}

.sprints-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--dim-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.sprints-modal-close:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.sprints-modal-eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.sprints-modal-content h2 {
    margin: 0;
    padding-right: 28px;
    color: var(--text-color);
    font-size: 22px;
    font-weight: 700;
}

.sprints-modal-meta {
    margin: 8px 0 0;
    color: var(--dim-text);
    font-size: 14px;
}

.sprints-list {
    flex: 1;
    min-height: 0;
    margin: 18px 0 16px;
    overflow-y: auto;
}

.sprints-list .no-data {
    padding: 24px 12px;
}

.sprint-item {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: var(--bg-color);
}

.sprint-item-with-aside {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sprint-item-content {
    flex: 1;
    min-width: 0;
}

.sprint-item-aside {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.sprint-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.sprint-item-id {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.sprint-status {
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.sprint-status.verified {
    color: var(--success-color);
}

.sprint-status.pending {
    color: var(--warning-color);
}

.sprint-verified-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 3px;
    max-width: 160px;
}

.sprint-verified-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--success-color);
    line-height: 1.2;
}

.sprint-verified-date {
    font-size: 11px;
    color: var(--dim-text);
    line-height: 1.3;
}

.sprint-verified-by {
    font-size: 11px;
    font-weight: 500;
    color: var(--dim-text);
    line-height: 1.3;
}

.sprint-item-dates {
    font-size: 12px;
    color: var(--dim-text);
    margin-top: 6px;
    line-height: 1.35;
}

.sprint-duration-wrap {
    position: relative;
    display: inline-block;
    margin-top: 2px;
    cursor: help;
}

.sprint-duration {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px dotted var(--border-color);
}

.sprint-duration-tooltip {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 2;
    display: none;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
    padding: 10px 12px;
    border-radius: 8px;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    font-size: 12px;
    color: var(--dim-text);
    line-height: 1.35;
    pointer-events: none;
}

.sprint-duration-tooltip::after {
    content: "";
    position: absolute;
    left: 16px;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background-color: var(--panel-bg);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.sprint-duration-wrap .sprint-duration-tooltip {
    display: none;
}

.sprint-duration-wrap.is-tooltip-active .sprint-duration-tooltip {
    display: flex;
    position: fixed;
    z-index: 1240;
}

.sprint-duration-wrap.is-tooltip-active .sprint-duration-tooltip::after {
    display: none;
}

.entry-sprint-total-wrap {
    margin-bottom: 2px;
}

.entry-item:has(.entry-sprint-total-wrap:hover),
.entry-item:has(.entry-sprint-total-wrap:focus-within) {
    position: relative;
    z-index: 5;
}

.entry-sprint-total-tooltip {
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    bottom: auto;
    min-width: 180px;
    z-index: 20;
}

.entry-sprint-total-tooltip::after {
    top: -6px;
    right: 16px;
    left: auto;
    bottom: auto;
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
}

.entry-sprint-total-line {
    font-weight: 600;
}

.entry-sprint-total-verified {
    color: var(--success-color);
}

.entry-sprint-total-unverified {
    color: var(--warning-color);
}

.sprints-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.sprints-modal-pending-message {
    flex: 1;
    min-width: 180px;
    margin: 0;
    font-size: 13px;
    color: var(--dim-text);
    text-align: left;
}

.sprints-modal-pending-message.is-error {
    color: var(--danger-color, #c0392b);
}

.sprints-modal-pending-message.is-success {
    color: var(--success-color);
}

.console-btn.sprints-modal-update:disabled {
    opacity: 0.7;
    cursor: wait;
}

.sprints-modal-pending-message.hidden,
.console-btn.sprints-modal-update.hidden {
    display: none;
}

.console-btn.sprints-modal-update {
    width: auto;
}

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

.sprint-verify-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sprint-verify-toggle-switch {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background-color: var(--border-color);
    transition: background-color 0.2s;
    flex-shrink: 0;
    order: 2;
}

.sprint-verify-toggle-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color);
    text-align: right;
    order: 1;
}

.sprint-verify-toggle-input:checked ~ .sprint-verify-toggle-text {
    color: var(--success-color);
}

.sprint-verify-toggle-input:not(:checked) ~ .sprint-verify-toggle-text {
    color: var(--warning-color);
}

.sprint-verify-toggle-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s;
}

.sprint-verify-toggle-input:checked ~ .sprint-verify-toggle-switch {
    background-color: var(--success-color);
}

.sprint-verify-toggle-input:checked ~ .sprint-verify-toggle-switch::after {
    transform: translateX(18px);
}

.sprint-verify-toggle-input:focus-visible + .sprint-verify-toggle-text + .sprint-verify-toggle-switch,
.sprint-verify-toggle-input:focus-visible + .sprint-verify-toggle-switch {
    outline: 2px solid rgba(52, 152, 219, 0.45);
    outline-offset: 2px;
}

.console-btn.sprints-modal-dismiss {
    width: auto;
    align-self: auto;
}

.entry-details {
    font-size: 14px;
    color: var(--text-color);
}

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

.verify-btn {
    padding: 8px 16px;
    background-color: var(--success-color);
    border: none;
    border-radius: 4px;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.verify-btn:hover {
    background-color: #219a52;
    transform: translateY(-1px);
}

.verify-btn:active {
    transform: translateY(0);
}

.verified-status {
    color: var(--success-color);
    font-weight: 600;
    font-size: 13px;
}

.student-item {
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 12px;
    background-color: var(--bg-color);
    transition: box-shadow 0.3s, border-color 0.3s, background-color 0.3s;
}

.student-item-with-aside {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.student-item-main {
    min-width: 0;
    flex: 1;
}

.student-item-with-photo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background-color: var(--border-color);
    border: 1px solid var(--border-color);
}

.student-photo.is-loaded {
    background-color: transparent;
}

.student-item-aside {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}

.student-auto-verify-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background-color: #ffffff;
    color: var(--text-color);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: var(--shadow);
}

.student-auto-verify-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.08);
}

.student-auto-verify-btn:focus-visible {
    outline: 2px solid rgba(52, 152, 219, 0.45);
    outline-offset: 2px;
}

.student-auto-verify-switch {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background-color: #c5cdd6;
    flex-shrink: 0;
}

.student-auto-verify-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.student-auto-verify-label {
    color: var(--text-color);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.student-item-selectable {
    cursor: pointer;
}

.student-item-selectable:hover {
    box-shadow: var(--shadow);
}

.student-item.selected {
    border-color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    background-color: rgba(52, 152, 219, 0.08);
    box-shadow: var(--shadow);
}

.student-item:not(.student-item-selectable):hover {
    box-shadow: var(--shadow);
}

.student-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.student-info {
    font-size: 13px;
    color: var(--dim-text);
    margin: 4px 0;
}

#parentStudents .student-item-with-photo {
    gap: 12px;
}

#parentStudents .student-photo {
    width: 44px;
    height: 44px;
}

.staff-students-list .student-item-compact {
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
}

.staff-students-list .student-item-compact.student-item-with-photo {
    gap: 8px;
}

.staff-students-list .student-item-compact .student-photo {
    width: 36px;
    height: 36px;
}

.staff-students-list .student-item-compact.student-item-with-aside {
    gap: 8px;
    align-items: center;
}

.staff-students-list .student-item-compact.selected {
    border-left-width: 3px;
}

.staff-students-list .student-item-compact .student-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.2;
}

.staff-students-list .student-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    line-height: 1.2;
}

.staff-students-list .student-info-part {
    font-size: 10px;
    color: var(--dim-text);
}

.staff-students-list .student-info-part + .student-info-part::before {
    content: "·";
    margin-right: 8px;
    color: var(--border-color);
}

.staff-students-list .student-auto-verify-btn-compact {
    padding: 3px 6px;
    gap: 4px;
    font-size: 9px;
}

.staff-students-list .student-auto-verify-btn-compact .student-auto-verify-switch {
    width: 28px;
    height: 16px;
}

.staff-students-list .student-auto-verify-btn-compact .student-auto-verify-switch::after {
    width: 12px;
    height: 12px;
}

.staff-students-load-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
}

.staff-students-load-more .loading-spinner {
    width: 24px;
    height: 24px;
}

.staff-students-load-more-sentinel {
    height: 1px;
    flex-shrink: 0;
}

#principalAssignmentsView.dashboard-content,
#mediaSpecialistAssignmentsView.dashboard-content {
    min-height: 0;
}

.staff-assignment-list-item {
    cursor: pointer;
}

.staff-assignment-list-item:hover {
    box-shadow: var(--shadow);
}

.staff-assignment-list-item.selected {
    border-color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    background-color: rgba(52, 152, 219, 0.08);
    box-shadow: var(--shadow);
}

.staff-assignment-details-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0;
}

.staff-assignment-details-book {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.staff-assignment-details-cover {
    width: 72px;
    height: auto;
    border-radius: 4px;
    flex-shrink: 0;
}

.staff-assignment-details-title {
    margin: 0 0 4px;
    font-size: 18px;
    color: var(--text-color);
}

.staff-assignment-details-meta {
    margin: 0;
    color: var(--dim-text);
    font-size: 14px;
}

.staff-assignment-details-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.staff-assignment-details-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dim-text);
}

.staff-assignment-details-value {
    margin: 0;
    color: var(--text-color);
}

.staff-assignment-details-dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.staff-assignment-details-student-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.no-data {
    padding: 30px;
    text-align: center;
    color: var(--dim-text);
    font-style: italic;
    background-color: var(--bg-color);
    border-radius: 6px;
}

.footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 20px 30px;
    text-align: center;
    font-size: 13px;
    color: var(--dim-text);
}

.book-search-results {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    max-width: 100%;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-color);
}

.book-result-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.book-result-item:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.book-result-item:last-child {
    border-bottom: none;
}

.book-cover {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    background-color: var(--dim-text);
    flex-shrink: 0;
}

.book-cover-placeholder {
    width: 50px;
    height: 75px;
    background-color: var(--dim-text);
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    text-align: center;
}

.book-info {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.book-add-btn {
    width: auto;
    align-self: center;
    flex-shrink: 0;
    margin-left: 0;
}

.book-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-author {
    font-size: 12px;
    color: var(--dim-text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-year {
    font-size: 11px;
    color: var(--dim-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-book-cover {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
}

.entry-with-cover {
    display: flex;
    align-items: flex-start;
}

.entry-details-with-cover {
    flex: 1;
}

.selected-book-details {
    margin-top: 8px;
    padding: 10px;
    background-color: var(--bg-color);
    border-radius: 4px;
    font-size: 12px;
    color: var(--dim-text);
}

.selected-book-details div {
    margin: 4px 0;
}

.selected-book-details strong {
    color: var(--text-color);
    font-weight: 500;
}

.timer-section {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--bg-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.timer-section label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
}

.timer-display {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    padding: 15px;
    background-color: var(--panel-bg);
    border-radius: 6px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

.timer-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.timer-controls .console-btn {
    width: auto;
    min-width: 80px;
}

.district-summary {
    padding: 15px;
    background-color: var(--bg-color);
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.district-summary h4 {
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
}

.district-summary div {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text-color);
}

.district-summary strong {
    color: var(--primary-color);
}

.school-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 12px;
    background-color: var(--bg-color);
    transition: box-shadow 0.3s;
}

.school-item:hover {
    box-shadow: var(--shadow);
}

.school-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.school-info {
    font-size: 13px;
    color: var(--dim-text);
    margin: 4px 0;
}

.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.loading-text {
    margin-top: 15px;
    color: var(--dim-text);
    font-size: 14px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1260;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(20, 28, 38, 0.45);
    backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    padding: 32px 36px;
    border-radius: 14px;
    background-color: var(--panel-bg);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.loading-overlay-content .loading-spinner {
    margin: 0;
}

.loading-overlay-content .loading-text {
    margin-top: 18px;
    color: var(--text-color);
    font-size: 15px;
    font-weight: 500;
}

@media (max-width: 768px) {
    :root {
        --app-body-padding: 20px;
    }

    body {
        padding: 10px;
    }
    
    .console-container {
        border-radius: 8px;
    }
    
    .header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 12px;
        padding: 12px 14px;
    }

    .header-left {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-start;
    }
    
    .header h1 {
        font-size: 20px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .dcps-logo {
        height: 48px;
        flex-shrink: 0;
    }
    
    .header-right {
        display: contents;
    }

    .header-meta {
        order: 3;
        flex: 1 1 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        max-width: none;
        padding-right: 0;
        border-right: none;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.22);
    }

    .header-date {
        font-size: 11px;
        flex: 0 0 auto;
    }

    .header-user {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        font-size: 13px;
        text-align: right;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
    }

    .header-user-button {
        display: inline;
        max-width: none;
        text-align: right;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
    }

    .header-toolbar {
        order: 2;
        flex: 0 0 auto;
        margin-left: auto;
        gap: 3px;
        padding: 2px;
    }

    .header-tool-btn {
        min-width: 28px;
        height: 28px;
    }

    .header-dashboard-role-select {
        height: 28px;
        min-width: 8rem;
        max-width: 10rem;
        font-size: 10px;
    }

    .header-tool-theme,
    .header-tool-link {
        width: 28px;
    }

    .login-hero-screen {
        min-height: auto;
        padding-top: 32px;
        padding-bottom: 40px;
    }

    .login-hero-tagline {
        font-size: 16px;
    }
    
    .screen {
        padding: 20px 15px;
    }
    
    .dashboard-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .panel {
        padding: 20px;
        min-height: auto;
        min-width: 0;
        overflow-x: hidden;
    }

    #teacherDashboardMain > .panel.panel-scroll,
    .teacher-assign-book-content > .panel.panel-scroll {
        min-height: 0;
    }

    .teacher-assign-book-content > .panel.panel-scroll {
        min-height: 0;
    }

    .panel-scroll {
        max-height: none;
    }

    .teacher-assign-book-view .panel-scroll {
        max-height: none;
    }
    
    .panel h3 {
        font-size: 16px;
    }

    .panel-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .teacher-students-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .teacher-students-header-row .panel-header-title,
    .teacher-students-header-row .teacher-class-dropdown {
        margin-left: 0;
        margin-right: 0;
    }

    .teacher-assign-book-class-row {
        flex-direction: column;
        align-items: stretch;
    }

    .teacher-assign-book-class-row .teacher-class-dropdown {
        flex: 1 1 auto;
        width: 100%;
        margin-left: 0;
    }

    .teacher-assign-book-actions-row {
        flex-wrap: wrap;
    }

    .teacher-student-dropdown {
        flex: 1 1 auto;
        width: 100%;
    }

    .teacher-students-toolbar {
        flex-wrap: wrap;
        align-items: stretch;
    }

    .teacher-students-toolbar-search {
        flex: 1 1 100%;
        margin-right: 0;
    }

    .teacher-students-toolbar-search-row {
        flex: 1 1 100%;
    }

    .panel-header-search {
        flex: 1 1 100%;
    }

    .teacher-assign-book-target-grid {
        grid-template-columns: 1fr;
    }

    .teacher-assign-book-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .assign-book-confirm-details-grid,
    .assign-book-confirm-details-dates {
        grid-template-columns: 1fr;
    }

    .assign-book-confirm-actions {
        flex-wrap: wrap;
    }

    .assign-book-confirm-action-buttons {
        width: 100%;
        justify-content: flex-end;
    }
    
    .login-box {
        padding: 25px 20px;
        margin: 0;
    }
    
    .login-box h2 {
        font-size: 20px;
    }
    
    .input-group input,
    .input-group select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .console-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .console-btn.small {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Table responsiveness */
    #parentVerifications table,
    #teacherVerifications table {
        font-size: 12px;
    }
    
    #parentVerifications th,
    #teacherVerifications th,
    #parentVerifications td,
    #teacherVerifications td {
        padding: 8px 6px;
    }
    
    #parentVerifications,
    #teacherVerifications {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Timer controls for mobile */
    .timer-display {
        font-size: 28px;
        padding: 12px;
    }
    
    .timer-controls {
        flex-wrap: wrap;
    }
    
    .timer-controls .console-btn {
        flex: 1;
        min-width: 70px;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    /* Book search results */
    .book-search-results {
        max-width: 100%;
    }

    .book-result-item {
        padding: 10px;
        gap: 8px;
    }
    
    .book-cover {
        width: 40px;
        height: 60px;
    }
    
    .book-cover-placeholder {
        width: 40px;
        height: 60px;
        font-size: 9px;
    }

    .console-btn.book-add-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .book-title {
        font-size: 13px;
    }
    
    .book-author,
    .book-year {
        font-size: 11px;
    }
    
    /* Entry items */
    .entry-item {
        padding: 12px;
    }
    
    .entry-book-cover {
        width: 35px;
        height: 52px;
    }
    
    .entry-details {
        font-size: 13px;
    }
    
    /* Student items */
    .student-item {
        padding: 14px;
    }
    
    .student-name {
        font-size: 15px;
    }
    
    .student-info {
        font-size: 12px;
    }
    
    /* District/school overview */
    .district-summary {
        padding: 12px;
    }
    
    .district-summary h4 {
        font-size: 14px;
    }
    
    .district-summary div {
        font-size: 13px;
    }
    
    .school-item {
        padding: 12px;
    }
    
    .school-name {
        font-size: 15px;
    }
    
    .school-info {
        font-size: 12px;
    }
    
    /* Timer section */
    .timer-section {
        padding: 12px;
    }
    
    .timer-section label {
        font-size: 13px;
    }
    
    /* Footer */
    .footer {
        padding: 15px 20px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 17px;
    }
    
    .dcps-logo {
        height: 40px;
    }
    
    .header-meta {
        max-width: none;
    }
    
    .panel {
        padding: 15px;
    }
    
    .panel h3 {
        font-size: 15px;
    }
    
    .timer-display {
        font-size: 24px;
        padding: 10px;
    }
    
    .console-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    #parentVerifications table,
    #teacherVerifications table {
        font-size: 11px;
    }
    
    #parentVerifications th,
    #teacherVerifications th,
    #parentVerifications td,
    #teacherVerifications td {
        padding: 6px 4px;
    }
    
    .verify-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .verified-status {
        font-size: 11px;
    }
}

.logout-mode {
    background-color: #a83232;
    color: white;
}

/* Browser-specific styles */

/* Safari-specific styles */
.safari .header {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.safari .console-btn {
    -webkit-appearance: none;
    border-radius: 6px;
}

.safari .input-group input,
.safari .input-group select {
    -webkit-appearance: none;
    border-radius: 6px;
}

.safari .data-display::-webkit-scrollbar {
    width: 8px;
}

.safari .data-display::-webkit-scrollbar-thumb {
    -webkit-border-radius: 4px;
    border-radius: 4px;
}

/* Chrome-specific styles */
.chrome .console-btn {
    -webkit-font-smoothing: antialiased;
}

.chrome .header {
    -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chrome .panel {
    -webkit-box-shadow: var(--shadow);
    box-shadow: var(--shadow);
}

/* Firefox-specific styles */
.firefox .console-btn {
    scrollbar-width: thin;
}

.firefox .data-display {
    scrollbar-width: thin;
    scrollbar-color: var(--dim-text) var(--bg-color);
}

.firefox .header {
    -moz-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Edge-specific styles */
.edge .console-btn {
    -webkit-font-smoothing: antialiased;
}

.edge .header {
    -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.edge .input-group input,
.edge .input-group select {
    -webkit-appearance: none;
    appearance: none;
}

/* Opera-specific styles */
.opera .console-btn {
    -webkit-font-smoothing: antialiased;
}

.opera .data-display::-webkit-scrollbar {
    width: 8px;
}

.student-metrics-view {
    animation: metricsFadeIn 0.22s ease-out;
    flex: 0 1 auto;
}

.console-container > .screen:not(.hidden):has(.student-metrics-view:not(.hidden)) {
    flex: 0 1 auto;
}

.console-container:has(.student-metrics-view:not(.hidden)),
.console-container:has(#teacherMetricsView:not(.hidden)),
.console-container:has(#parentMetricsView:not(.hidden)) {
    min-height: auto;
    max-height: none;
}

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

.student-metrics-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.metrics-stat-card {
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: linear-gradient(145deg, rgba(52, 152, 219, 0.1), rgba(255, 255, 255, 0.9));
    box-shadow: var(--shadow);
}

.metrics-stat-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dim-text);
    margin-bottom: 8px;
}

.metrics-stat-value {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

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

.metrics-panel {
    padding: 22px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-bg);
    box-shadow: var(--shadow);
}

.metrics-panel-wide {
    grid-column: 1 / -1;
}

.metrics-panel h3,
.metrics-empty h3 {
    margin: 0 0 18px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-color);
}

.metrics-empty {
    padding: 28px;
    text-align: center;
}

.metrics-empty p {
    margin: 0;
    color: var(--dim-text);
    line-height: 1.5;
}

.metrics-subtitle {
    margin: 0 0 10px;
    color: var(--dim-text);
    font-size: 14px;
}

.metrics-chart-empty {
    margin: 0;
    color: var(--dim-text);
    font-size: 14px;
}

.metrics-donut-wrap {
    position: relative;
    width: 150px;
    margin: 0 auto 16px;
}

.metrics-donut {
    display: block;
    width: 150px;
    height: 150px;
}

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

.metrics-donut-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

.metrics-donut-caption {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dim-text);
}

.metrics-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metrics-legend-item {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.metrics-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.metrics-legend-label {
    color: var(--dim-text);
}

.metrics-legend-value {
    font-weight: 600;
    color: var(--text-color);
}

.metrics-bar-chart {
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
    min-height: 180px;
    padding-top: 8px;
}

.metrics-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.metrics-bar-value {
    min-height: 14px;
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-color);
}

.metrics-bar-track {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: flex-end;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, rgba(52, 152, 219, 0.06), rgba(52, 152, 219, 0.02));
}

.metrics-bar-fill {
    width: 100%;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, #5dade2, var(--primary-color));
    transition: height 0.3s ease;
}

.metrics-bar-label {
    font-size: 10px;
    color: var(--dim-text);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.metrics-book-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.metrics-book-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) auto;
    gap: 12px;
    align-items: center;
}

.metrics-book-meta {
    min-width: 0;
}

.metrics-book-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metrics-book-author {
    display: block;
    font-size: 12px;
    color: var(--dim-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metrics-book-bar-track {
    height: 10px;
    border-radius: 999px;
    background-color: rgba(52, 152, 219, 0.12);
    overflow: hidden;
}

.metrics-book-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #85c1e9, var(--primary-color));
}

.metrics-book-minutes {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

.metrics-session-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metrics-session-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
}

.metrics-session-main {
    min-width: 0;
}

.metrics-session-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.metrics-session-date {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--dim-text);
}

.metrics-session-source {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-color);
}

.metrics-source-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.metrics-stat-meta {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--dim-text);
}

.metrics-session-aside {
    text-align: right;
    flex-shrink: 0;
}

.metrics-session-duration {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.metrics-session-status {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.metrics-session-status.verified {
    color: var(--success-color);
}

.metrics-session-status.pending {
    color: var(--warning-color);
}

.student-metrics-content.metrics-layout-compact {
    gap: 10px;
}

.metrics-layout-compact .metrics-stat-grid {
    gap: 8px;
}

.metrics-layout-compact .metrics-stat-card {
    padding: 10px 12px;
    border-radius: 10px;
}

.metrics-layout-compact .metrics-stat-label {
    margin-bottom: 2px;
    font-size: 10px;
}

.metrics-layout-compact .metrics-stat-value {
    font-size: 20px;
}

.metrics-layout-compact .metrics-chart-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
}

.metrics-layout-compact .metrics-source-panel {
    grid-column: 1 / -1;
}

.metrics-layout-compact .metrics-panel {
    padding: 10px 12px;
    border-radius: 10px;
}

.metrics-layout-compact .metrics-panel h3 {
    margin-bottom: 6px;
    font-size: 13px;
}

.metrics-layout-compact .metrics-source-compact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.metrics-layout-compact .metrics-source-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.metrics-layout-compact .metrics-source-stat {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: linear-gradient(145deg, rgba(52, 152, 219, 0.08), rgba(255, 255, 255, 0.92));
    flex: 1 1 140px;
    min-width: 0;
}

.metrics-layout-compact .metrics-source-stat-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dim-text);
    margin-bottom: 2px;
}

.metrics-layout-compact .metrics-source-stat-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.metrics-layout-compact .metrics-source-stat-meta {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--dim-text);
}

.metrics-layout-compact .metrics-source-chart {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.metrics-layout-compact .metrics-chart-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.metrics-layout-compact .metrics-chart-inline .metrics-legend,
.metrics-layout-compact .metrics-source-chart .metrics-legend {
    flex: 1 1 120px;
    min-width: 0;
}

.metrics-layout-compact .metrics-source-chart .metrics-donut-wrap-compact {
    width: 96px;
    margin: 0;
    flex-shrink: 0;
}

.metrics-layout-compact .metrics-donut-wrap-compact {
    width: 96px;
    margin: 0;
    flex-shrink: 0;
}

.metrics-layout-compact .metrics-donut-compact {
    width: 96px;
    height: 96px;
}

.metrics-layout-compact .metrics-donut-total-compact {
    font-size: 12px;
}

.metrics-layout-compact .metrics-panel-verified {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metrics-layout-compact .metrics-panel-verified h3 {
    margin-bottom: 0;
}

.metrics-layout-compact .metrics-panel-verified .metrics-donut-wrap-compact {
    margin: 0;
}

.metrics-layout-compact .metrics-panel-verified .metrics-legend {
    gap: 4px;
}

.metrics-layout-compact .metrics-legend {
    gap: 6px;
}

.metrics-layout-compact .metrics-legend-item {
    gap: 8px;
    font-size: 12px;
}

.metrics-layout-compact .metrics-bar-chart-compact {
    min-height: 88px;
    gap: 4px;
    padding-top: 2px;
}

.metrics-layout-compact .metrics-bar-chart-compact .metrics-bar-track {
    height: 60px;
}

.metrics-layout-compact .metrics-bar-chart-compact .metrics-bar-col {
    gap: 4px;
}

.metrics-layout-compact .metrics-book-bars {
    gap: 6px;
    max-height: 148px;
    overflow-y: auto;
    padding-right: 2px;
}

.metrics-layout-compact .metrics-session-list {
    gap: 6px;
    max-height: 148px;
    overflow-y: auto;
    padding-right: 2px;
}

.metrics-layout-compact .metrics-panel-books,
.metrics-layout-compact .metrics-panel-sessions {
    min-height: 0;
}

.metrics-layout-compact .metrics-chart-empty {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
}

.metrics-layout-compact .metrics-session-row {
    padding: 8px 10px;
    border-radius: 8px;
}

.metrics-layout-compact .metrics-session-title {
    font-size: 13px;
}

.metrics-layout-compact .metrics-session-date,
.metrics-layout-compact .metrics-book-author {
    font-size: 11px;
}

.metrics-layout-compact .metrics-book-title {
    font-size: 13px;
}

.metrics-layout-compact .metrics-book-row {
    gap: 8px;
}

body.help-page {
    display: block;
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
}

html.help-standalone body.help-page {
    padding: 20px;
}

.help-shell {
    max-width: 720px;
    margin: 0 auto;
}

.help-embedded .help-shell {
    max-width: none;
    margin: 0;
}

.help-page-header {
    margin-bottom: 24px;
    padding: 24px 24px 0;
}

.help-embedded .help-page-header {
    display: none;
}

.help-page-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    color: var(--text-color);
}

.help-lead {
    margin: 0 0 12px;
    color: var(--dim-text);
    font-size: 16px;
    line-height: 1.5;
}

.help-back-link {
    display: inline-block;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.help-back-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.help-content {
    padding: 0 24px 32px;
}

.help-embedded .help-content {
    padding: 20px 24px 28px;
}

.help-section {
    margin-bottom: 28px;
}

.help-section h2 {
    margin: 0 0 12px;
    font-size: 20px;
    color: var(--text-color);
}

.help-section h3 {
    margin: 18px 0 8px;
    font-size: 16px;
    color: var(--text-color);
}

.help-section p {
    margin: 0 0 10px;
    color: var(--text-color);
    line-height: 1.55;
}

.help-figure {
    margin: 16px 0 20px;
    padding: 0;
}

.help-figure img {
    display: block;
    width: 100%;
    max-width: 720px;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.help-figure figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--dim-text);
    line-height: 1.45;
}

.help-steps,
.help-list {
    margin: 0 0 12px 20px;
    color: var(--text-color);
    line-height: 1.55;
}

.help-steps li,
.help-list li {
    margin-bottom: 6px;
}

.help-note {
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    background-color: rgba(52, 152, 219, 0.08);
    color: var(--dim-text);
    font-size: 14px;
}

.help-definitions {
    margin: 0;
}

.help-definitions dt {
    margin-top: 12px;
    font-weight: 600;
    color: var(--text-color);
}

.help-definitions dt:first-child {
    margin-top: 0;
}

.help-definitions dd {
    margin: 4px 0 0;
    color: var(--dim-text);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .help-content,
    .help-embedded .help-content {
        padding-left: 16px;
        padding-right: 16px;
    }

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

    .metrics-chart-grid {
        grid-template-columns: 1fr;
    }

    .metrics-bar-chart {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        overflow-x: auto;
    }

    .metrics-book-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .metrics-session-row {
        flex-direction: column;
    }

    .metrics-session-aside {
        text-align: left;
    }

    .metrics-layout-compact .metrics-source-compact {
        grid-template-columns: 1fr;
    }

    .metrics-layout-compact .metrics-source-chart {
        justify-content: flex-start;
    }

    .metrics-layout-compact .metrics-chart-inline {
        justify-content: flex-start;
    }
}

/* Principal data rollup explorer */
.principal-rollup-view {
    animation: metricsFadeIn 0.22s ease-out;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.principal-rollup-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.principal-rollup-panel-header {
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding-bottom: 10px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

.principal-rollup-panel-heading {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    min-width: 0;
}

.principal-rollup-panel-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    flex: 0 0 auto;
}

.principal-rollup-shell.panel {
    min-height: 0;
    padding: 12px 14px 14px;
    height: 100%;
}

.principal-rollup-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(168px, 200px);
    grid-template-rows: minmax(0, 1fr);
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    padding-top: 10px;
    overflow: hidden;
    align-items: stretch;
}

.principal-rollup-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.principal-rollup-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary-color) 3%, #fff);
    overflow: hidden;
}

.principal-rollup-sidebar-header {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.72);
}

.principal-rollup-sidebar-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.principal-rollup-details {
    padding: 8px 10px 10px;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.principal-rollup-toolbar {
    flex: 0 1 auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.principal-rollup-toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px 12px;
}

.principal-rollup-toolbar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--dim-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.principal-rollup-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
}

.principal-rollup-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 auto;
}

.principal-rollup-lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dim-text);
}

.principal-rollup-lead strong {
    color: var(--text-color);
    font-weight: 600;
}

.principal-rollup-explorer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
}

.principal-rollup-context {
    flex: 0 1 auto;
    min-height: 0;
    max-height: min(36vh, 320px);
}

.principal-rollup-context-header {
    padding-bottom: 8px;
}

.principal-rollup-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 0 0 auto;
}

.principal-rollup-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--dim-text);
}

.principal-rollup-crumb {
    background: rgba(0, 0, 0, 0.04);
    border: none;
    border-radius: 999px;
    padding: 4px 10px;
    color: var(--primary-color);
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}

.principal-rollup-crumb:hover {
    background: rgba(52, 152, 219, 0.12);
}

.principal-rollup-crumb.is-current {
    background: color-mix(in srgb, var(--primary-color) 12%, #fff);
    color: var(--text-color);
    cursor: default;
    font-weight: 600;
}

.principal-rollup-crumb-sep {
    opacity: 0.45;
    font-size: 11px;
    user-select: none;
}

.principal-rollup-vectors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 12px;
    padding: 2px 6px 2px 2px;
    align-content: start;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.principal-rollup-vectors.is-students-list {
    grid-template-columns: repeat(auto-fill, minmax(192px, 1fr));
    gap: 8px;
    padding: 0 4px 0 0;
}

.principal-rollup-vectors.is-students-list .principal-rollup-vector {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
    padding: 7px 9px;
    gap: 9px;
    text-align: left;
}

.principal-rollup-vectors.is-students-list .principal-rollup-vector-icon,
.principal-rollup-vectors.is-students-list .principal-rollup-vector-icon-photo {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.principal-rollup-vectors.is-students-list .principal-rollup-vector-body {
    align-items: flex-start;
    flex: 1 1 auto;
    min-width: 0;
    gap: 2px;
}

.principal-rollup-vectors.is-students-list .principal-rollup-vector-label {
    font-size: 12px;
    line-height: 1.2;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.principal-rollup-vectors.is-students-list .principal-rollup-vector-meta {
    font-size: 10px;
    line-height: 1.25;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--dim-text);
}

.principal-rollup-pagination {
    flex: 0 0 auto;
}

.principal-rollup-pagination-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 2px 0;
}

.principal-rollup-pagination-status {
    font-size: 13px;
    color: var(--dim-text);
    min-width: 12rem;
    text-align: center;
}

.principal-rollup-vector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    color: var(--rollup-accent, var(--primary-color));
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    text-align: center;
    min-height: 112px;
}

.principal-rollup-vector:hover {
    border-color: color-mix(in srgb, var(--rollup-accent, var(--primary-color)) 45%, var(--border-color));
    background: color-mix(in srgb, var(--rollup-accent, var(--primary-color)) 5%, #fff);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.principal-rollup-vector.is-coming-soon {
    opacity: 0.72;
}

.principal-rollup-vector-icon {
    width: 40px;
    height: 40px;
}

.principal-rollup-vector-icon-photo {
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--border-color);
    border: 1px solid color-mix(in srgb, var(--rollup-accent, var(--primary-color)) 25%, var(--border-color));
    flex-shrink: 0;
}

.principal-rollup-vector-icon-photo .student-photo,
.principal-rollup-student-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: none;
    display: block;
}

.principal-rollup-vector-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.principal-rollup-vector-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    color: var(--text-color);
}

.principal-rollup-vector-count {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: var(--rollup-accent, var(--primary-color));
}

.principal-rollup-vector-label {
    font-size: 13px;
    font-weight: 600;
}

.principal-rollup-vector-meta {
    font-size: 12px;
    color: var(--dim-text);
}

.principal-rollup-vector-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.06);
    color: var(--dim-text);
}

.principal-rollup-bottom {
    display: none;
}

.principal-rollup-details-panel,
.principal-rollup-search-panel {
    min-height: 0;
}

.principal-rollup-search {
    padding: 0;
}

.principal-rollup-detail-list {
    margin: 0;
    display: grid;
    gap: 8px;
}

.principal-rollup-detail-list div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: flex-start;
    margin-bottom: 0;
}

.principal-rollup-detail-list dt {
    margin: 0;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dim-text);
}

.principal-rollup-detail-list dd {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    color: var(--text-color);
    word-break: break-word;
}

.principal-rollup-detail-card--reading-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.principal-rollup-log-detail-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.principal-rollup-log-detail-student {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.principal-rollup-log-detail-student-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dim-text);
}

.principal-rollup-log-detail-student-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-color);
    word-break: break-word;
}

.principal-rollup-log-source-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.3;
}

.principal-rollup-log-source-badge.is-assigned {
    color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-color) 28%, transparent);
}

.principal-rollup-log-source-badge.is-student-added {
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary-color) 24%, transparent);
}

.principal-rollup-log-source-badge.is-unknown {
    color: var(--dim-text);
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
}

.principal-rollup-log-detail-source-only {
    margin-bottom: 2px;
}

.principal-rollup-log-detail-fields,
.principal-rollup-reading-summary.is-compact .principal-rollup-reading-summary-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px;
}

.principal-rollup-reading-summary.is-compact {
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.principal-rollup-reading-summary.is-compact .principal-rollup-reading-summary-title {
    margin: 0 0 6px;
    font-size: 9px;
}

.principal-rollup-reading-summary.is-compact .principal-rollup-reading-summary-details {
    margin-top: 0;
}

.principal-rollup-detail-hint {
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: var(--dim-text);
}

.principal-rollup-reading-summary {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.principal-rollup-reading-summary-title {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dim-text);
}

.principal-rollup-reading-summary-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.principal-rollup-reading-summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 6px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary-color) 6%, #fff);
    border: 1px solid color-mix(in srgb, var(--border-color) 80%, transparent);
    text-align: center;
}

.principal-rollup-reading-summary-value {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

.principal-rollup-reading-summary-caption {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--dim-text);
}

.principal-rollup-reading-summary-details {
    margin-top: 4px;
}

.principal-rollup-detail-student-photo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.principal-rollup-detail-student-photo-wrap.is-compact {
    margin-bottom: 0;
    flex: 0 0 auto;
}

.principal-rollup-detail-student-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background-color: var(--border-color);
    display: block;
}

.principal-rollup-detail-student-photo.is-compact {
    width: 40px;
    height: 40px;
    border-width: 1px;
}

.principal-rollup-search-form {
    display: flex;
    flex: 1 1 240px;
    gap: 8px;
    align-items: center;
    margin: 0;
    min-width: min(100%, 280px);
}

.principal-rollup-search-form .panel-search-input {
    flex: 1 1 auto;
}

.principal-rollup-search-help,
.principal-rollup-search-placeholder p {
    margin: 0;
    font-size: 13px;
    color: var(--dim-text);
}

.principal-rollup-coming-soon,
.principal-rollup-coming-soon-banner {
    padding: 18px;
    border-radius: 10px;
    border: 1px dashed var(--border-color);
    background: rgba(0, 0, 0, 0.02);
    color: var(--dim-text);
}

.principal-rollup-coming-soon h4 {
    margin: 0 0 8px;
    color: var(--text-color);
}

.principal-rollup-coming-soon p,
.principal-rollup-coming-soon-banner {
    margin: 0;
    line-height: 1.5;
}

.principal-rollup-loading {
    min-height: 120px;
}

.console-container > .screen:not(.hidden) > .principal-rollup-view {
    flex: 1 1 auto;
    min-height: 0;
}

#principalDashboard .dashboard-header,
#mediaSpecialistDashboard .dashboard-header {
    margin-bottom: 16px;
}

#principalDashboardMain.dashboard-content,
#mediaSpecialistDashboardMain.dashboard-content {
    min-height: 0;
    overflow: hidden;
}

#principalDashboardMain .principal-rollup-shell,
#mediaSpecialistDashboardMain .principal-rollup-shell {
    height: 100%;
}

#principalDashboard.screen:not(.hidden),
#mediaSpecialistDashboard.screen:not(.hidden) {
    overflow: hidden;
}

.principal-rollup-vector.is-selected {
    border-color: var(--rollup-accent, var(--primary-color));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rollup-accent, var(--primary-color)) 20%, transparent);
}

.principal-rollup-vector-endpoint {
    font-size: 10px;
    color: var(--dim-text);
    word-break: break-all;
}

.principal-header-school-dropdown {
    min-width: 180px;
}

.principal-rollup-detail-actions {
    margin-top: 16px;
}

@media (max-width: 900px) {
    .principal-rollup-body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .principal-rollup-sidebar {
        order: 2;
        max-height: 220px;
        height: auto;
    }

    .principal-rollup-main {
        order: 1;
    }

    .principal-rollup-panel-header {
        align-items: stretch;
    }

    .principal-rollup-toolbar-inner {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .principal-rollup-search-form {
        width: 100%;
    }

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