:root {
    --app-sidebar-width: 248px;
    --app-primary: #2563eb;
    --app-primary-dark: #1d4ed8;
    --app-primary-soft: #eff6ff;
    --app-sidebar: #111827;
    --app-sidebar-muted: #94a3b8;
    --app-surface: #ffffff;
    --app-surface-subtle: #f8fafc;
    --app-background: #f3f6fb;
    --app-border: #e2e8f0;
    --app-border-strong: #cbd5e1;
    --app-text: #182235;
    --app-text-secondary: #64748b;
    --app-success: #16a34a;
    --app-warning: #d97706;
    --app-danger: #dc2626;
    --app-radius: 12px;
    --app-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.035);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 0;
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--app-text);
    background: var(--app-background);
    font-family: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

.app-sidebar {
    position: fixed;
    z-index: 1040;
    inset: 0 auto 0 0;
    width: var(--app-sidebar-width);
    padding: 20px 14px;
    overflow-y: auto;
    color: #ffffff;
    background:
        radial-gradient(circle at 10% 0, rgba(59, 130, 246, 0.16), transparent 32%),
        var(--app-sidebar);
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.08);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    height: 48px;
    margin: 0 4px 28px;
    color: #ffffff;
}

.app-brand-mark {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    color: #ffffff;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.32);
    font-size: 17px;
    font-weight: 750;
}

.app-brand-name {
    min-width: 0;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.app-nav-toggle {
    display: none;
    width: 38px;
    height: 38px;
    margin-left: auto;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.app-nav-toggle-line {
    display: block;
    width: 18px;
    height: 2px;
    margin: 3px 0;
    border-radius: 999px;
    background: currentColor;
}

.app-nav {
    display: grid;
    gap: 5px;
}

.app-nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 13px;
    border-radius: 9px;
    color: #b7c1d1;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.app-nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
}

.app-nav-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.92), rgba(37, 99, 235, 0.72));
    box-shadow: 0 5px 14px rgba(30, 64, 175, 0.25);
}

.app-nav-icon {
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    margin-right: 12px;
    opacity: 0.86;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.app-nav-link.active .app-nav-icon {
    opacity: 1;
}

.app-main {
    min-height: 100vh;
    margin-left: var(--app-sidebar-width);
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    padding: 0 32px;
    border-bottom: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}

.app-platform-name {
    overflow: hidden;
    color: var(--app-text);
    font-size: 16px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-admin-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 10px 5px 5px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    color: #475569;
    background: var(--app-surface);
    font-size: 13px;
    font-weight: 550;
}

.app-admin-avatar {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    color: var(--app-primary-dark);
    background: var(--app-primary-soft);
    font-size: 12px;
    font-weight: 700;
}

.app-content {
    width: min(100%, 1600px);
    margin: 0 auto;
    padding: 30px 32px 48px;
}

.app-content > h1 {
    margin: 0 0 24px;
    color: #0f172a;
    font-size: 25px;
    font-weight: 680;
    letter-spacing: -0.02em;
}

.app-card {
    min-height: 0;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}

.app-card .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--app-text);
    --bs-table-hover-bg: #f8fafc;
}

.app-card .table > :not(caption) > * > * {
    padding: 14px 16px;
    border-bottom-color: #edf0f5;
}

.app-card .table > thead > tr > th {
    border-bottom-width: 1px;
    color: #64748b;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.015em;
    white-space: nowrap;
}

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

.table-responsive {
    border-radius: inherit;
    scrollbar-width: thin;
}

.table-responsive > .table {
    min-width: 720px;
}

.form-label {
    margin-bottom: 6px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.form-control,
.form-select {
    min-height: 40px;
    border-color: var(--app-border-strong);
    border-radius: 8px;
    color: var(--app-text);
    background-color: #ffffff;
    font-size: 14px;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:focus,
.form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    min-height: 38px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 550;
}

.btn-sm {
    min-height: 32px;
    border-radius: 7px;
    font-size: 13px;
}

.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary-dark);
    --bs-btn-hover-border-color: var(--app-primary-dark);
    --bs-btn-active-bg: var(--app-primary-dark);
    --bs-btn-active-border-color: var(--app-primary-dark);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.16);
}

.btn-outline-primary {
    --bs-btn-color: var(--app-primary);
    --bs-btn-border-color: #93c5fd;
    --bs-btn-hover-bg: var(--app-primary);
    --bs-btn-hover-border-color: var(--app-primary);
}

.badge {
    padding: 5px 9px;
    font-weight: 600;
}

.modal-content,
.offcanvas {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.modal-header,
.modal-footer,
.offcanvas-header {
    border-color: var(--app-border);
}

.modal-header,
.offcanvas-header {
    padding: 18px 20px;
}

.modal-body,
.offcanvas-body {
    padding: 20px;
}

.modal-footer {
    padding: 14px 20px;
}

.toast-container {
    z-index: 1090;
}

.toast {
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

/* Shared layout utilities for resource and list pages. */
.page-heading,
.page-toolbar,
.table-pagination {
    display: flex;
    align-items: center;
}

.page-heading,
.page-toolbar {
    justify-content: space-between;
    gap: 16px;
}

.table-pagination {
    justify-content: flex-end;
    gap: 8px;
    padding: 16px;
}

.empty-state {
    padding: 48px 24px;
    color: var(--app-text-secondary);
    text-align: center;
}

.page-title {
    margin: 0;
    color: #0f172a;
    font-size: 25px;
    font-weight: 680;
    letter-spacing: -0.02em;
}

.app-content > .page-title {
    margin-bottom: 8px;
}

.page-subtitle {
    margin-top: 5px;
    color: var(--app-text-secondary);
    font-size: 13px;
}

.page-subtitle strong {
    color: #334155;
    font-weight: 650;
}

.page-filter-card {
    padding: 16px 18px;
}

.page-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    color: var(--app-text-secondary);
    font-size: 13px;
    font-weight: 550;
    text-decoration: none;
}

.page-back-link:hover {
    color: var(--app-primary);
}

.school-detail-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.school-profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.school-profile-card {
    padding: 20px;
}

.profile-card-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.profile-card-heading h2,
.resource-section-heading h2,
.resource-table-toolbar h3 {
    margin: 0;
    color: #172033;
    font-weight: 650;
}

.profile-card-heading h2,
.resource-section-heading h2 {
    font-size: 16px;
}

.profile-card-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 9px;
    color: var(--app-primary-dark);
    background: var(--app-primary-soft);
    font-size: 13px;
    font-weight: 700;
}

.profile-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.profile-list > div {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #eef2f7;
}

.profile-list > div:last-child {
    border-bottom: 0;
}

.profile-list dt,
.credential-label {
    color: var(--app-text-secondary);
    font-size: 12px;
    font-weight: 550;
}

.profile-list dd {
    min-width: 0;
    margin: 0;
    color: #334155;
    font-size: 13px;
    font-weight: 550;
    overflow-wrap: anywhere;
}

.credential-block {
    padding: 10px 0 13px;
    border-bottom: 1px solid #eef2f7;
}

.credential-block:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.credential-label {
    display: block;
    margin-bottom: 7px;
}

.credential-line {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.credential-line code {
    min-width: 0;
    margin-right: auto;
    overflow: hidden;
    color: #334155;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.credential-action {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    color: var(--app-primary);
    background: transparent;
    font-size: 12px;
    font-weight: 600;
}

.credential-action:hover {
    color: var(--app-primary-dark);
}

.credential-action-warning {
    color: var(--app-warning);
}

.school-resource-card {
    overflow: hidden;
}

.resource-section-heading {
    display: flex;
    align-items: center;
    min-height: 70px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--app-border);
}

.resource-section-heading p {
    margin: 4px 0 0;
    color: var(--app-text-secondary);
    font-size: 12px;
}

.resource-section-heading strong {
    color: #334155;
}

.school-resource-workspace {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 450px;
}

.resource-folder-panel {
    padding: 16px 12px;
    border-right: 1px solid var(--app-border);
    background: #f8fafc;
}

.resource-panel-title {
    padding: 0 10px 10px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.school-folder-list {
    display: grid;
    gap: 4px;
}

.school-folder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 0 10px;
    border-radius: 8px;
    color: #475569;
    font-size: 13px;
    font-weight: 550;
    text-decoration: none;
}

.school-folder-item:hover {
    color: var(--app-primary-dark);
    background: #eef4ff;
}

.school-folder-item.active {
    color: var(--app-primary-dark);
    background: #e8f0ff;
    font-weight: 650;
}

.school-folder-name {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.school-folder-name > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-glyph {
    position: relative;
    flex: 0 0 17px;
    width: 17px;
    height: 13px;
    border-radius: 3px;
    background: #cbd5e1;
}

.folder-glyph::before {
    position: absolute;
    top: -3px;
    left: 1px;
    width: 7px;
    height: 4px;
    border-radius: 2px 2px 0 0;
    background: inherit;
    content: "";
}

.school-folder-item.active .folder-glyph {
    background: #60a5fa;
}

.school-folder-count {
    display: grid;
    flex: 0 0 24px;
    min-width: 24px;
    height: 22px;
    padding: 0 5px;
    place-items: center;
    border-radius: 999px;
    color: #64748b;
    background: #e2e8f0;
    font-size: 11px;
}

.school-folder-item.active .school-folder-count {
    color: var(--app-primary-dark);
    background: #dbeafe;
}

.folder-empty {
    padding: 30px 10px;
    color: var(--app-text-secondary);
    font-size: 13px;
    text-align: center;
}

.resource-table-panel {
    min-width: 0;
    background: var(--app-surface);
}

.resource-table-toolbar {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--app-border);
}

.resource-table-toolbar h3 {
    font-size: 15px;
}

.resource-table-toolbar > div > span {
    display: block;
    margin-top: 3px;
    color: var(--app-text-secondary);
    font-size: 12px;
}

.resource-search {
    width: min(100%, 300px);
}

.resource-search .form-control {
    min-height: 38px;
}

.resource-table {
    min-width: 650px;
}

.video-resource-cell {
    display: flex;
    min-width: 250px;
    align-items: center;
    gap: 12px;
}

.video-resource-cell img {
    width: 58px;
    height: 38px;
    flex: 0 0 58px;
    border-radius: 6px;
    object-fit: cover;
    background: #e2e8f0;
}

.video-resource-cell strong,
.video-resource-cell span {
    display: block;
}

.video-resource-cell strong {
    color: #253047;
    font-size: 13px;
    font-weight: 620;
}

.video-resource-cell span {
    margin-top: 3px;
    color: #94a3b8;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
}

.status-dot-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #475569;
    font-size: 12px;
}

.status-dot-label i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--app-success);
}

/* Video resource workspace */
.video-page-heading {
    margin-bottom: 18px;
}

.page-heading-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.filter-toolbar {
    margin-bottom: 16px;
    padding: 14px 16px;
}

.filter-toolbar form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-search {
    position: relative;
    flex: 1 1 360px;
    min-width: 220px;
}

.filter-search .form-control {
    padding-left: 39px;
}

.filter-search-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 14px;
    width: 13px;
    height: 13px;
    border: 1.7px solid #94a3b8;
    border-radius: 50%;
    transform: translateY(-58%);
}

.filter-search-icon::after {
    position: absolute;
    right: -4px;
    bottom: -3px;
    width: 6px;
    height: 1.7px;
    border-radius: 2px;
    background: #94a3b8;
    content: "";
    transform: rotate(45deg);
}

.filter-field {
    flex: 0 1 210px;
}

.filter-field-status {
    flex-basis: 150px;
}

.filter-submit,
.filter-reset {
    flex: 0 0 auto;
}

.video-resource-workspace {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 570px;
    overflow: hidden;
}

.video-folder-panel {
    min-width: 0;
}

.video-folder-heading {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px 8px 10px;
}

.video-folder-heading .resource-panel-title {
    padding: 0;
}

.folder-more-button,
.table-more-button {
    display: inline-grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 7px;
    color: #64748b;
    background: transparent;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.folder-more-button:hover:not(:disabled),
.table-more-button:hover {
    color: var(--app-text);
    background: #e9eef5;
}

.folder-more-button:disabled {
    opacity: 0.35;
}

.video-folder-list {
    display: grid;
    gap: 3px;
}

.video-folder-item {
    display: flex;
    min-width: 0;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 9px 0 calc(9px + var(--folder-level, 0) * 11px);
    border-radius: 8px;
    color: #475569;
    font-size: 13px;
    font-weight: 550;
    text-decoration: none;
}

.video-folder-item:hover {
    color: var(--app-primary-dark);
    background: #eef4ff;
}

.video-folder-item.active {
    color: var(--app-primary-dark);
    background: #e8f0ff;
    font-weight: 650;
}

.video-folder-item.active .folder-glyph {
    background: #60a5fa;
}

.video-folder-item.active .school-folder-count {
    color: var(--app-primary-dark);
    background: #dbeafe;
}

.video-folder-name {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.video-folder-name > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-table-toolbar h2 {
    margin: 0;
    color: #172033;
    font-size: 16px;
    font-weight: 650;
}

.video-table-toolbar strong {
    color: #334155;
}

.selection-toolbar {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 18px;
    border-bottom: 1px solid #bfdbfe;
    color: var(--app-primary-dark);
    background: #eff6ff;
    font-size: 13px;
}

.selection-toolbar[hidden] {
    display: none;
}

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

.video-table {
    min-width: 850px;
}

.video-table .selection-column {
    width: 46px;
    padding-right: 4px !important;
    text-align: center;
}

.video-table .video-resource-cell {
    min-width: 230px;
}

.video-duration,
.sync-time {
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.folder-cell {
    display: inline-block;
    max-width: 130px;
    overflow: hidden;
    color: #475569;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-dot-label.is-error {
    color: var(--app-danger);
}

.status-dot-label.is-error i {
    background: var(--app-danger);
}

.sync-time {
    display: block;
    margin-top: 3px;
    font-size: 11px;
}

.authorization-count {
    display: inline-grid;
    min-width: 28px;
    height: 25px;
    padding: 0 7px;
    place-items: center;
    border-radius: 999px;
    color: #475569;
    background: #f1f5f9;
    font-size: 12px;
    font-weight: 650;
}

.table-action {
    min-height: 30px;
    padding-inline: 6px;
    color: var(--app-primary);
    text-decoration: none;
}

.table-action:hover {
    color: var(--app-primary-dark);
}

.sync-summary {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fbff;
}

.sync-summary-icon {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
    color: var(--app-primary-dark);
    background: #dbeafe;
    font-size: 21px;
}

.sync-summary strong,
.sync-summary span {
    display: block;
}

.sync-summary strong {
    color: #1e293b;
    font-size: 14px;
}

.sync-summary div > span {
    margin-top: 2px;
    color: var(--app-text-secondary);
    font-size: 12px;
}

.video-detail-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 18px;
    border-radius: 10px;
    object-fit: cover;
    background: #e2e8f0;
}

.video-detail-list {
    margin: 0;
}

.video-detail-list > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
}

.video-detail-list dt {
    color: var(--app-text-secondary);
    font-size: 12px;
    font-weight: 550;
}

.video-detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #334155;
    font-size: 13px;
}

.detail-section-title {
    margin: 22px 0 8px;
    color: #1e293b;
    font-size: 14px;
    font-weight: 650;
}

.video-preview-body {
    padding: 0;
    overflow: hidden;
    border-radius: 0 0 14px 14px;
    background: #0f172a;
}

.video-preview-body video {
    display: block;
    max-height: 70vh;
    background: #0f172a;
}

@media (max-width: 1199.98px) {
    :root {
        --app-sidebar-width: 224px;
    }

    .app-content {
        padding-inline: 24px;
    }

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

    .video-resource-workspace {
        grid-template-columns: 220px minmax(0, 1fr);
    }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        height: auto;
        max-height: 100vh;
        padding: 10px 16px;
        overflow: visible;
        box-shadow: 0 4px 18px rgba(15, 23, 42, 0.14);
    }

    .app-brand {
        height: 44px;
        margin: 0;
    }

    .app-brand-mark {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        border-radius: 9px;
        font-size: 16px;
    }

    .app-brand-name {
        font-size: 16px;
    }

    .app-nav-toggle {
        display: block;
    }

    .app-nav {
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        max-height: calc(100vh - 76px);
        margin-top: 10px;
        padding: 8px 0 6px;
        overflow-y: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .app-sidebar.is-open .app-nav {
        display: grid;
    }

    .app-nav-link {
        min-height: 42px;
    }

    .app-main {
        margin-left: 0;
    }

    .app-topbar {
        height: 58px;
        padding: 0 20px;
    }

    .app-content {
        padding: 22px 20px 40px;
    }

    .app-content > h1 {
        margin-bottom: 20px;
        font-size: 22px;
    }

    .school-profile-grid {
        grid-template-columns: 1fr;
    }

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

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

    .resource-folder-panel {
        border-right: 0;
        border-bottom: 1px solid var(--app-border);
    }

    .school-folder-list,
    .video-folder-list {
        display: flex;
        padding-bottom: 2px;
        overflow-x: auto;
    }

    .school-folder-item,
    .video-folder-item {
        flex: 0 0 auto;
    }

    .video-folder-item {
        padding-inline: 10px;
    }

    .filter-toolbar form {
        flex-wrap: wrap;
    }

    .filter-search {
        flex-basis: 100%;
    }
}

@media (max-width: 575.98px) {
    .app-nav {
        grid-template-columns: 1fr;
    }

    .app-nav-link {
        padding-inline: 12px;
    }

    .app-topbar {
        padding: 0 16px;
    }

    .app-platform-name {
        font-size: 15px;
    }

    .app-admin-chip > span:last-child {
        display: none;
    }

    .app-admin-chip {
        padding-right: 5px;
    }

    .app-content {
        padding: 18px 12px 32px;
    }

    .app-card {
        border-radius: 10px;
    }

    .page-heading,
    .page-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .page-heading .btn,
    .page-toolbar .btn {
        width: 100%;
    }

    .page-heading-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .page-heading-actions .btn:last-child {
        grid-column: 1 / -1;
    }

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

    .filter-search {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .filter-field {
        min-width: 0;
    }

    .filter-submit,
    .filter-reset {
        width: 100%;
    }

    .school-detail-titlebar,
    .resource-table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .school-detail-titlebar .btn,
    .resource-search {
        width: 100%;
    }

    .video-table-toolbar {
        align-items: center;
        flex-direction: row;
    }

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

    .selection-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Authorization workspace */
.authorization-page {
    --authorization-panel-padding: 20px;
}

.authorization-page-heading {
    margin-bottom: 20px;
}

.authorization-school-summary {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    min-height: 108px;
    margin-bottom: 18px;
    overflow: hidden;
}

.authorization-school-picker {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding: 20px 22px;
    border-right: 1px solid var(--app-border);
    background: #f8fafc;
}

.authorization-school-picker label {
    color: #475569;
    font-size: 12px;
    font-weight: 650;
}

.authorization-school-picker .form-select {
    height: 42px;
    border-color: var(--app-border-strong);
    background-color: #ffffff;
    font-weight: 580;
}

.authorization-school-metrics {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) minmax(120px, 0.55fr);
    align-items: center;
    min-width: 0;
}

.authorization-school-identity,
.authorization-summary-item {
    min-width: 0;
    padding: 18px 24px;
}

.authorization-school-identity {
    display: flex;
    align-items: center;
    gap: 13px;
}

.authorization-school-identity > div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.authorization-school-identity strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 16px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.authorization-school-mark {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #bfdbfe;
    border-radius: 11px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 17px;
    font-weight: 720;
}

.authorization-summary-item {
    display: grid;
    gap: 6px;
    border-left: 1px solid var(--app-border);
}

.authorization-summary-item > span {
    color: var(--app-text-secondary);
    font-size: 12px;
}

.authorization-summary-item code {
    overflow: hidden;
    color: #334155;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.authorization-summary-item strong {
    color: #334155;
    font-size: 13px;
    font-weight: 550;
}

.authorization-summary-item strong b {
    margin-right: 4px;
    color: #0f172a;
    font-size: 23px;
    font-weight: 720;
}

.authorization-school-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    color: var(--app-text-secondary);
}

.authorization-school-empty strong {
    font-weight: 600;
}

.authorization-workspace {
    display: grid;
    grid-template-columns: 228px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
}

.authorization-folder-panel {
    position: sticky;
    top: 18px;
    overflow: hidden;
}

.authorization-folder-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 16px;
    border-bottom: 1px solid var(--app-border);
}

.authorization-folder-heading > span:last-child {
    color: var(--app-text-secondary);
    font-size: 12px;
}

.authorization-folder-list {
    display: grid;
    max-height: 720px;
    padding: 8px;
    overflow-y: auto;
}

.authorization-folder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    min-height: 38px;
    padding: 0 10px 0 calc(10px + var(--folder-level, 0) * 10px);
    border-radius: 8px;
    color: #475569;
    font-size: 13px;
    text-decoration: none;
}

.authorization-folder-item:hover {
    color: var(--app-primary-dark);
    background: #f8fafc;
}

.authorization-folder-item.active {
    color: var(--app-primary-dark);
    background: var(--app-primary-soft);
    font-weight: 620;
}

.authorization-folder-name {
    display: flex;
    align-items: center;
    min-width: 0;
}

.authorization-folder-name > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.authorization-folder-item b {
    flex: 0 0 auto;
    min-width: 25px;
    margin-left: 8px;
    padding: 1px 6px;
    border-radius: 999px;
    color: #64748b;
    background: #eef2f7;
    font-size: 11px;
    font-weight: 650;
    text-align: center;
}

.authorization-folder-item.active b {
    color: var(--app-primary-dark);
    background: #dbeafe;
}

.authorization-list-stack {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.authorization-list-panel {
    min-width: 0;
    overflow: hidden;
}

.authorization-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 14px var(--authorization-panel-padding);
    border-bottom: 1px solid var(--app-border);
}

.authorization-panel-heading > div {
    min-width: 0;
}

.authorization-panel-heading h2 {
    margin: 0 0 3px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 680;
}

.authorization-panel-heading span {
    color: var(--app-text-secondary);
    font-size: 12px;
}

.authorization-panel-heading span strong {
    color: #334155;
}

.authorization-panel-heading .btn {
    flex: 0 0 auto;
    min-width: 118px;
}

.authorization-table-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px var(--authorization-panel-padding);
    border-bottom: 1px solid #edf0f5;
    background: #fbfcfe;
}

.authorization-search {
    width: min(100%, 390px);
    min-width: 220px;
}

.authorization-table-scroll {
    width: 100%;
    border-radius: 0;
}

.authorization-table {
    min-width: 760px;
}

.authorization-table .selection-column {
    width: 46px;
    padding-right: 6px !important;
    text-align: center;
}

.authorization-table .video-resource-cell {
    min-width: 210px;
}

.authorization-table .folder-cell {
    max-width: 150px;
}

.authorization-table .empty-state {
    height: 116px;
}

.authorization-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 9px var(--authorization-panel-padding);
    border-top: 1px solid var(--app-border);
    color: var(--app-text-secondary);
    background: #fbfcfe;
    font-size: 12px;
}

.authorization-table-footer .table-pagination {
    padding: 0;
    border: 0;
    background: transparent;
}

.authorization-page #playUrlModal .modal-header > div {
    min-width: 0;
}

#playUrlModal .modal-subtitle {
    display: block;
    margin-top: 3px;
    color: var(--app-text-secondary);
    font-size: 12px;
}

#playUrlModal .modal-body {
    padding: 22px;
}

#playUrlModal .form-control {
    height: 44px;
    color: #334155;
    background: #f8fafc;
}

@media (max-width: 1199.98px) {
    .authorization-school-summary {
        grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
    }

    .authorization-school-metrics {
        grid-template-columns: minmax(190px, 1fr) minmax(180px, 0.85fr) 120px;
    }

    .authorization-school-identity,
    .authorization-summary-item {
        padding-inline: 18px;
    }
}

@media (max-width: 991.98px) {
    .authorization-school-summary {
        grid-template-columns: 1fr;
    }

    .authorization-school-picker {
        border-right: 0;
        border-bottom: 1px solid var(--app-border);
    }

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

    .authorization-folder-panel {
        position: static;
    }

    .authorization-folder-list {
        display: flex;
        max-height: none;
        padding-bottom: 10px;
        overflow-x: auto;
    }

    .authorization-folder-item {
        flex: 0 0 auto;
        padding-inline: 10px;
    }
}

@media (max-width: 767.98px) {
    .authorization-school-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .authorization-school-identity {
        grid-column: 1 / -1;
        border-bottom: 1px solid var(--app-border);
    }

    .authorization-summary-item:first-of-type {
        border-left: 0;
    }

    .authorization-panel-heading,
    .authorization-table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .authorization-panel-heading .btn,
    .authorization-table-toolbar .btn,
    .authorization-search {
        width: 100%;
    }

    .authorization-search {
        min-width: 0;
    }
}

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

    .authorization-school-picker {
        padding: 16px;
    }

    .authorization-school-metrics {
        grid-template-columns: 1fr;
    }

    .authorization-school-identity,
    .authorization-summary-item {
        grid-column: auto;
        padding: 15px 16px;
        border-left: 0;
        border-bottom: 1px solid var(--app-border);
    }

    .authorization-summary-item:last-child {
        border-bottom: 0;
    }

    .authorization-table-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

/* Statistics */
.statistics-page-heading {
    margin-bottom: 18px;
}

.statistics-page-heading .btn {
    min-width: 112px;
}

.statistics-filter-card {
    margin-bottom: 18px;
    padding: 17px 18px;
}

.statistics-filter-card form {
    display: grid;
    grid-template-columns: 1.15fr 1.15fr 0.65fr 0.8fr 0.8fr auto;
    align-items: end;
    gap: 12px;
}

.statistics-filter-field {
    min-width: 0;
}

.statistics-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.statistics-filter-actions .btn {
    min-width: 68px;
}

.statistics-filter-actions .btn-light {
    border-color: var(--app-border-strong);
    color: #475569;
    background: #ffffff;
}

.statistics-filter-actions .btn-light:hover {
    border-color: #94a3b8;
    color: var(--app-text);
    background: #f8fafc;
}

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

.statistics-metric-card {
    position: relative;
    min-height: 124px;
    padding: 21px 22px;
    overflow: hidden;
}

.statistics-metric-card::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: #dbeafe;
    content: "";
}

.statistics-metric-label {
    color: var(--app-text-secondary);
    font-size: 13px;
    font-weight: 580;
}

.statistics-metric-value {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin-top: 10px;
}

.statistics-metric-value strong {
    color: #0f172a;
    font-size: 30px;
    font-weight: 720;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.statistics-metric-value span {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 550;
}

.statistics-detail-card {
    overflow: hidden;
}

.statistics-detail-heading {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--app-border);
}

.statistics-detail-heading h2 {
    margin: 0;
    color: #172033;
    font-size: 16px;
    font-weight: 680;
}

.statistics-detail-heading span {
    display: block;
    margin-top: 4px;
    color: var(--app-text-secondary);
    font-size: 12px;
}

.statistics-detail-heading strong {
    color: #334155;
}

.statistics-table {
    min-width: 760px;
}

.statistics-school-name,
.statistics-video-name {
    display: block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.statistics-school-name {
    color: #253047;
    font-size: 13px;
    font-weight: 620;
}

.statistics-video-name {
    color: #475569;
}

.statistics-time,
.statistics-duration,
.statistics-ip {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.statistics-time {
    color: #64748b;
}

.statistics-duration strong {
    color: #334155;
    font-weight: 620;
}

.statistics-duration span {
    margin-left: 3px;
    color: #94a3b8;
    font-size: 11px;
}

.statistics-ip {
    color: #64748b;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12px;
}

.statistics-result {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #475569;
    font-size: 12px;
    font-weight: 580;
    white-space: nowrap;
}

.statistics-result i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
}

.statistics-result.is-success i {
    background: var(--app-success);
}

.statistics-result.is-error {
    color: var(--app-danger);
}

.statistics-result.is-error i {
    background: var(--app-danger);
}

.statistics-detail-card > .table-pagination {
    min-height: 58px;
    border-top: 1px solid var(--app-border);
    background: #fbfcfe;
}

@media (max-width: 1199.98px) {
    .statistics-filter-card form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .statistics-filter-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 767.98px) {
    .statistics-filter-card form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .statistics-filter-school,
    .statistics-filter-video {
        grid-column: span 1;
    }

    .statistics-filter-period {
        grid-column: 1 / -1;
    }

    .statistics-filter-actions {
        grid-column: 1 / -1;
    }

    .statistics-filter-actions .btn {
        flex: 1 1 0;
    }

    .statistics-metrics {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .statistics-metric-card {
        min-height: 104px;
        padding: 17px 18px;
    }

    .statistics-metric-value {
        margin-top: 7px;
    }
}

@media (max-width: 575.98px) {
    .statistics-page-heading {
        align-items: stretch;
    }

    .statistics-filter-card {
        padding: 15px;
    }

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

    .statistics-filter-school,
    .statistics-filter-video,
    .statistics-filter-period,
    .statistics-filter-actions {
        grid-column: auto;
    }

    .statistics-detail-heading {
        min-height: 62px;
        padding-inline: 15px;
    }

    .statistics-detail-card > .table-pagination {
        justify-content: flex-start;
        overflow-x: auto;
    }
}
