:root {
    --ink: #172033;
    --muted: #667085;
    --line: #d8dce2;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --primary: #2356d8;
    --primary-dark: #163ea0;
    --teal: #0f766e;
    --amber: #b7791f;
    --rose: #be3455;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
}

.auth-shell {
    min-height: 100vh;
    background: #eef4ff;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
}

.login-visual {
    position: relative;
    display: flex;
    align-items: end;
    padding: clamp(2rem, 5vw, 5rem);
    color: #fff;
    background:
        linear-gradient(120deg, rgba(10, 47, 95, .88), rgba(15, 118, 110, .78)),
        url("https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.login-visual h1 {
    max-width: 720px;
    margin: .75rem 0 1rem;
    font-size: clamp(2.4rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1;
}

.login-visual p {
    max-width: 620px;
    font-size: 1.15rem;
    color: rgba(255,255,255,.86);
}

.eyebrow {
    display: inline-flex;
    padding: .4rem .75rem;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    color: #d9fff8;
    font-weight: 700;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 2rem;
}

.login-card {
    width: min(100%, 430px);
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(31, 45, 71, .12);
}

.login-card h2 { margin: 0; font-size: 1.7rem; font-weight: 800; }
.login-card p, .panel-head p { margin: .25rem 0 0; color: var(--muted); }
.demo-logins {
    display: grid;
    gap: .35rem;
    margin-top: 1.25rem;
    color: var(--muted);
    font-size: .85rem;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 280px;
    padding: 1.25rem;
    background: #0c1729;
    color: #fff;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: .8rem;
    color: #fff;
    text-decoration: none;
    min-width: 0;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1.6rem;
}

.brand-text {
    min-width: 0;
}

.sidebar-collapse-btn {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    color: #cbd7ee;
    background: #16243a;
}

.sidebar-collapse-btn:hover {
    color: #fff;
    background: #1d2d49;
}

.sidebar-close-btn {
    display: none;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    color: #cbd7ee;
    background: #16243a;
}

.sidebar-close-btn:hover {
    color: #fff;
    background: #1d2d49;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #1f6feb;
}

.brand small {
    display: block;
    margin-top: .15rem;
    color: #9fb2d0;
    text-transform: capitalize;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .72rem .85rem;
    border-radius: 8px;
    color: #cbd7ee;
    font-weight: 650;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: #1d2d49;
}

.nav-heading {
    margin: 1.15rem .85rem .35rem;
    color: #7f95ba;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

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

.sidebar,
.main {
    transition: width .2s ease, margin-left .2s ease;
}

.sidebar-collapsed .sidebar {
    width: 92px;
    padding-inline: .85rem;
}

.sidebar-collapsed .main {
    margin-left: 92px;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-heading {
    display: none;
}

.sidebar-collapsed .brand-row {
    justify-content: center;
    flex-direction: column;
}

.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding-inline: .7rem;
    font-size: 0;
}

.sidebar-collapsed .sidebar .nav-link i {
    font-size: 1.15rem;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--line);
    background: rgba(245,247,251,.92);
    backdrop-filter: blur(12px);
}

.topbar h1 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.5rem);
    font-weight: 800;
}

.topbar p { margin: .1rem 0 0; color: var(--muted); }
.content { padding: 1.5rem; }

.user-pill {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .35rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.user-pill img, .profile-photo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: #fff;
}

.panel, .stat-card, .material-card, .empty-state {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(31,45,71,.07);
}

.panel { padding: 1.25rem; }
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1rem;
    min-height: 132px;
    display: grid;
    align-content: space-between;
}

.stat-card i { font-size: 1.6rem; }
.stat-card span { color: var(--muted); font-weight: 700; }
.stat-card strong { font-size: 2rem; line-height: 1; }
.stat-card.teal i { color: var(--teal); }
.stat-card.amber i { color: var(--amber); }
.stat-card.blue i { color: var(--primary); }
.stat-card.green i { color: #18844f; }
.stat-card.rose i { color: var(--rose); }
.stat-card.violet i { color: #6d3fc9; }

.table { margin-bottom: 0; }
.table th {
    color: #526174;
    font-size: .78rem;
    text-transform: uppercase;
}

.app-datatable {
    width: 100% !important;
    white-space: nowrap;
}

.dt-container {
    color: var(--ink);
}

.dt-container .dt-layout-row {
    gap: 1rem;
    margin: .75rem 0;
}

.dt-container .dt-search input,
.dt-container .dt-length select,
.column-search {
    border-color: #d8e0eb;
    border-radius: 8px;
}

thead [data-column-search-row] th,
tr[data-column-search-row] th {
    background: #f8fbff;
    padding-block: .55rem;
}

.column-search {
    min-width: 130px;
    font-size: .82rem;
}

.datatable-fallback-scroll {
    overflow-x: auto;
}

.dt-scroll-body {
    border-bottom: 1px solid var(--line) !important;
}

.dtfc-fixed-right {
    background: #fff;
    box-shadow: -10px 0 18px rgba(31,45,71,.07);
}

.dtfc-fixed-right .btn {
    white-space: nowrap;
}

.action-cell {
    background: #fff;
}

.material-grid {
    display: grid;
    gap: 1rem;
}

.materials-panel {
    display: grid;
    gap: 1rem;
}

.materials-filter {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #f8fbff;
}

.filter-title {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.filter-title i {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: #fff;
    background: var(--primary);
}

.filter-title strong {
    display: block;
    font-weight: 850;
}

.filter-title span {
    display: block;
    color: #42526a;
    font-size: .9rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
    align-items: end;
    gap: .85rem;
}

.filter-grid label {
    display: grid;
    gap: .35rem;
    min-width: 0;
}

.filter-grid label span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
}

.material-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.material-card h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.material-card p {
    margin: .5rem 0;
    color: var(--muted);
}

.material-icon {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    color: var(--primary);
    background: #eaf0ff;
    font-size: 1.35rem;
}

.btn-outline-danger {
    --bs-btn-color: #8a3320;
    --bs-btn-border-color: #b7795c;
    --bs-btn-hover-bg: #8a3320;
    --bs-btn-hover-border-color: #8a3320;
}

.btn-outline-secondary {
    --bs-btn-color: var(--gray);
    --bs-btn-border-color: var(--gray);
    --bs-btn-hover-bg: var(--gray);
    --bs-btn-hover-border-color: var(--gray);
}

.meta {
    color: #526174;
    font-weight: 700;
    font-size: .9rem;
}

.form-panel .form-control, .form-panel .form-select,
.modal .form-control, .modal .form-select {
    border-color: #d8e0eb;
}

.select2-container--bootstrap-5 .select2-selection {
    min-height: 48px;
    border-color: #d8e0eb;
    border-radius: 8px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding-block: .45rem;
    color: var(--ink);
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #d8e0eb;
    border-radius: 8px;
}

.select2-container--bootstrap-5 .select2-search__field {
    border-color: #d8e0eb !important;
    border-radius: 8px !important;
}

.subject-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    padding: .85rem;
    border: 1px solid #d8e0eb;
    border-radius: 8px;
    max-height: 190px;
    overflow: auto;
}

.subject-picker label {
    display: flex;
    gap: .45rem;
    color: #445166;
}

.webinar-fields,
.detail-fields {
    padding: 1rem;
    border: 1px solid #d8e0eb;
    border-radius: 8px;
    background: #f8fbff;
}

.webinar-field-grid,
.detail-field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.detail-field-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.upload-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .45rem;
    color: var(--muted);
    font-weight: 700;
}

.upload-progress {
    height: 12px;
    border-radius: 999px;
    background: #e6ebf2;
}

.upload-progress .progress-bar {
    border-radius: inherit;
    background: var(--primary);
    transition: width .18s ease;
}

.material-dropzone {
    min-height: 154px;
    border: 2px dashed #b7c5db;
    border-radius: 8px;
    background: #f8fbff;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.material-dropzone .dz-message {
    display: grid;
    place-items: center;
    gap: .35rem;
    margin: 0;
    color: var(--muted);
    text-align: center;
}

.material-dropzone .dz-message i {
    color: var(--primary);
    font-size: 2rem;
}

.material-dropzone .dz-message strong {
    color: var(--ink);
}

.material-dropzone .dz-preview {
    margin: .5rem;
}

.material-dropzone .dz-remove {
    position: relative;
    z-index: 50;
    display: inline-flex;
    justify-content: center;
    margin-top: .5rem;
    padding: .35rem .7rem;
    border: 1px solid #be3455;
    border-radius: 8px;
    background: #fff;
    color: #be3455;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
}

.material-dropzone .dz-remove:hover {
    background: #fff1f4;
    color: #8b1e38;
    text-decoration: none;
}

.material-dropzone .dz-error-message {
    display: none !important;
}

.upload-error-text {
    position: relative;
    z-index: 45;
    max-width: 260px;
    margin: .65rem auto 0;
    padding: .55rem .75rem;
    border-radius: 8px;
    color: #fff;
    background: #be3455;
    font-size: .85rem;
    font-weight: 700;
    text-align: center;
}

.material-dropzone .dz-preview.dz-error .dz-error-mark {
    opacity: 1;
}

.material-dropzone .dz-preview .dz-success-mark svg,
.material-dropzone .dz-preview .dz-error-mark svg {
    border-radius: 50%;
}

.material-dropzone .dz-preview.dz-success .dz-success-mark {
    opacity: 1;
}

.material-dropzone .dz-preview.dz-success .dz-success-mark svg {
    background: #18844f;
}

.material-dropzone .dz-preview.dz-error .dz-error-mark svg {
    background: #be3455;
}

.upload-complete-text {
    margin-top: .35rem;
    color: #18844f;
    font-size: .82rem;
    font-weight: 800;
}

.video-fallback {
    width: min(92%, 560px);
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    text-align: center;
    box-shadow: 0 18px 48px rgba(31,45,71,.08);
}

.video-fallback i {
    color: var(--amber);
    font-size: 3rem;
}

.video-fallback h3 {
    margin: .75rem 0 .5rem;
    font-size: 1.25rem;
    font-weight: 850;
}

.video-fallback p {
    margin: 0 auto 1rem;
    max-width: 460px;
    color: var(--muted);
}

.setting-card {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}

.setting-card i {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    border-radius: 8px;
    color: var(--primary);
    background: #eaf0ff;
    font-size: 1.35rem;
}

.setting-card h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 850;
}

.setting-card p {
    margin: .35rem 0 1rem;
    color: var(--muted);
}

.profile-form {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.profile-photo {
    width: 128px;
    height: 128px;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
}

.student-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border-radius: 8px;
    color: #fff;
    background:
        linear-gradient(120deg, rgba(20, 83, 45, .92), rgba(35, 86, 216, .85)),
        url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1500&q=80") center/cover;
    box-shadow: 0 24px 70px rgba(31,45,71,.14);
}

.student-hero h2 {
    margin: .55rem 0 .45rem;
    font-size: clamp(1.8rem, 5vw, 3.4rem);
    font-weight: 850;
    line-height: 1.03;
}

.student-hero p {
    max-width: 720px;
    margin: 0;
    color: rgba(255,255,255,.86);
    font-size: 1.05rem;
}

.hero-total {
    min-width: 150px;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 8px;
    background: rgba(255,255,255,.12);
    text-align: center;
    backdrop-filter: blur(8px);
}

.hero-total strong {
    display: block;
    font-size: 3rem;
    line-height: 1;
}

.hero-total span {
    color: rgba(255,255,255,.84);
    font-weight: 700;
}

.learning-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.learning-stat {
    display: grid;
    gap: .35rem;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 16px 38px rgba(31,45,71,.07);
}

.learning-stat i {
    font-size: 1.55rem;
}

.learning-stat span {
    color: var(--muted);
    font-weight: 800;
}

.learning-stat strong {
    font-size: 1.9rem;
    line-height: 1;
}

.learning-stat.rose i { color: var(--rose); }
.learning-stat.blue i { color: var(--primary); }
.learning-stat.amber i { color: var(--amber); }
.learning-stat.teal i { color: var(--teal); }
.learning-stat.green i { color: #18844f; }
.learning-stat.violet i { color: #6d3fc9; }

.dashboard-materials {
    display: grid;
    gap: 1rem;
}

.study-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
}

.study-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 8px;
    color: var(--primary);
    background: #eaf0ff;
    font-size: 1.45rem;
}

.study-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.study-card h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 850;
}

.study-card p {
    margin: .35rem 0;
    color: var(--muted);
}

.viewer-modal .modal-body {
    padding: 0;
}

.viewer-stage {
    min-height: min(70vh, 720px);
    display: grid;
    place-items: center;
    background: #111827;
}

.viewer-stage-light {
    background: #f8fafc;
}

.viewer-frame,
.viewer-video {
    width: 100%;
    height: min(70vh, 720px);
    border: 0;
    background: #111827;
}

.viewer-video-js {
    width: 100%;
    max-height: min(70vh, 720px);
}

.viewer-video-js.video-js {
    background: #111827;
}

.viewer-frame.compact {
    background: #fff;
}

.pdf-viewer-stage {
    display: block;
    place-items: initial;
    overflow: hidden;
}

.pdf-reader {
    height: min(70vh, 720px);
    display: grid;
    grid-template-rows: auto 1fr;
    background: #eef2f7;
}

.pdf-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem .9rem;
    border-bottom: 1px solid #d7dfec;
    background: #fff;
}

.pdf-toolbar-group {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.pdf-toolbar .btn {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-grid;
    place-items: center;
    border-color: #d7dfec;
}

.pdf-page-control {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.pdf-page-control input {
    width: 4.5rem;
    text-align: center;
}

.pdf-toolbar-spacer {
    flex: 1;
}

.pdf-zoom-label {
    min-width: 3.25rem;
    text-align: center;
    font-weight: 800;
    color: var(--ink);
}

.pdf-pages {
    overflow: auto;
    padding: 1.25rem;
    display: grid;
    gap: 1rem;
    justify-items: center;
}

.pdf-page {
    width: 100%;
    display: grid;
    gap: .45rem;
    justify-items: center;
}

.pdf-page-label {
    padding: .2rem .65rem;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

.pdf-page canvas {
    max-width: 100%;
    height: auto;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}

.pdf-loading {
    margin-top: 2rem;
    color: var(--muted);
    font-weight: 700;
}

.viewer-image {
    max-width: 100%;
    max-height: min(70vh, 720px);
    object-fit: contain;
}

.viewer-description {
    margin: 0;
    padding: 1rem 1.25rem;
    color: var(--muted);
    background: #fff;
}

.ppt-fallback {
    width: min(92%, 560px);
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    text-align: center;
    box-shadow: 0 18px 48px rgba(31,45,71,.08);
}

.ppt-fallback i {
    color: #b7791f;
    font-size: 3rem;
}

.ppt-fallback h3 {
    margin: .75rem 0 .5rem;
    font-size: 1.25rem;
    font-weight: 850;
}

.ppt-fallback p {
    margin: 0 auto 1rem;
    max-width: 460px;
    color: var(--muted);
}

@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-grid .btn { grid-column: 1 / -1; }
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-collapse-btn { display: none; }
    .sidebar-close-btn { display: grid; }
    .main { margin-left: 0; }
    .user-pill span { display: none; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-visual { min-height: 42vh; }
}

@media (max-width: 640px) {
    .content, .topbar { padding: 1rem; }
    .topbar { align-items: flex-start; }
    .topbar p { display: none; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panel-head, .material-card, .profile-form { flex-direction: column; align-items: stretch; }
    .filter-grid { grid-template-columns: 1fr; }
    .materials-filter { padding: .85rem; }
    .webinar-field-grid, .detail-field-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .subject-picker { grid-template-columns: 1fr; }
    .login-card { padding: 1.25rem; }
    .login-panel { padding: 1rem; }
    .student-hero, .study-card, .study-top { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
    .hero-total { width: 100%; }
    .viewer-modal .modal-header { padding: .75rem 1rem; }
    .viewer-modal .modal-title { font-size: 1.05rem; }
    .viewer-stage, .viewer-frame, .viewer-video { min-height: 68vh; height: 68vh; }
    .pdf-reader { height: 68vh; }
    .pdf-toolbar {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: .55rem;
        padding: .55rem .65rem;
    }
    .pdf-toolbar-group { gap: .35rem; }
    .pdf-page-group { min-width: 0; }
    .pdf-toolbar .btn {
        width: 2rem;
        height: 2rem;
        padding: 0;
    }
    .pdf-page-control {
        gap: .3rem;
        font-size: .82rem;
    }
    .pdf-page-control input {
        width: 3.15rem;
        padding-left: .25rem;
        padding-right: .25rem;
    }
    .pdf-zoom-label {
        min-width: 2.75rem;
        font-size: .82rem;
    }
    .pdf-pages {
        padding: .75rem .55rem 1rem;
        gap: .85rem;
    }
    .pdf-page-label {
        font-size: .75rem;
        padding: .15rem .55rem;
    }
    .pdf-toolbar-spacer { display: none; }
}

@media (max-width: 380px) {
    .pdf-toolbar {
        grid-template-columns: 1fr;
    }
    .pdf-zoom-group {
        justify-content: flex-end;
    }
}
