/* ==========================================================================
   GIAO DIỆN THƯ VIỆN & MƯỢN SÁCH ĐỘC GIẢ (THEO MẪU ẢNH 2 - READOWL SHELVES)
   Dễ dàng chỉnh sửa màu sắc, kệ sách tại :root bên dưới.
   ========================================================================== */
:root {
    --owl-outer-bg: #eef1f6;
    --owl-frame-bg: #fdfbf7;
    --owl-canvas-bg: #f6efe6;
    --owl-sidebar-width: 245px;
    --owl-text-main: #4a3b32;
    --owl-text-muted: #8c7a6b;
    --owl-accent: #8b5e3c;
    --owl-pill-active: #efe6da;
    --owl-pill-border: #d8c8b4;
    --owl-shelf-top: #f3eadf;
    --owl-shelf-front: #e5d8c7;
    --owl-shelf-shadow: rgba(74, 59, 50, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--owl-outer-bg);
    color: var(--owl-text-main);
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
}

/* Khung hiển thị linh hoạt tự thích ứng theo mọi độ phân giải */
.readowl-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    margin: 0;
    background: var(--owl-frame-bg);
    border-radius: 0;
    box-shadow: none;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* ==========================================================================
   1. SIDEBAR BÊN TRÁI (CÓ NÚT "<" VÀ NÚT 3 GẠCH NGANG ĐỂ ĐÓNG/MỞ)
   ========================================================================== */
.readowl-sidebar {
    width: var(--owl-sidebar-width);
    flex-shrink: 0;
    background: var(--owl-frame-bg);
    border-right: 2px dashed #e2d7c8;
    padding: 24px 16px 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #dfd3c3 transparent;
    transition: width 0.28s ease, padding 0.28s ease, opacity 0.2s ease, transform 0.28s ease;
    z-index: 20;
}

.readowl-shell.sidebar-collapsed .readowl-sidebar {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-right: none;
    overflow: hidden;
    opacity: 0;
}

/* Nút tròn "<" đóng/mở nằm trên đường kẻ phân cách giống yêu cầu */
.readowl-edge-toggle {
    position: absolute;
    top: 30px;
    left: calc(var(--owl-sidebar-width) - 15px);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--owl-text-main);
    border: 1px solid #dfd3c3;
    box-shadow: 0 3px 8px rgba(74, 59, 50, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1070;
    transition: left 0.28s ease, transform 0.18s ease;
    font-size: 13px;
}

.readowl-edge-toggle:hover {
    background: var(--owl-pill-active);
    transform: scale(1.07);
}

.readowl-shell.sidebar-collapsed .readowl-edge-toggle {
    display: none !important;
}

/* Logo Cú mèo Readowl / Thư viện giống mẫu Ảnh 2 */
.readowl-brand {
    text-align: center;
    margin-bottom: 32px;
    text-decoration: none;
    color: var(--owl-text-main);
    display: block;
}

.readowl-brand .owl-glasses {
    font-size: 24px;
    color: #c88a4b;
    line-height: 1;
    display: block;
}

.readowl-brand .brand-word {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 26px;
    font-weight: 700;
    color: #6b4423;
    letter-spacing: -0.5px;
}

/* Menu điều hướng độc giả (Không chứa bất kỳ chức năng Admin nào) */
.readowl-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.readowl-nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--owl-text-muted);
    font-size: 14.5px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
}

.readowl-nav-btn i {
    font-size: 17px;
}

.readowl-nav-btn:hover {
    color: var(--owl-text-main);
    background: rgba(239, 230, 218, 0.55);
}

.readowl-nav-btn.active {
    background: var(--owl-pill-active);
    border-color: var(--owl-pill-border);
    color: var(--owl-text-main);
    font-weight: 700;
}

/* Hộp "Đang mượn (Continue reading)" ở góc dưới bên trái giống Ảnh 2 */
.continue-reading-box {
    margin-top: auto;
    background: #e6e7eb;
    border-radius: 18px;
    padding: 14px 14px 16px;
    text-align: center;
    margin-bottom: 12px;
}

.continue-reading-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #525866;
    margin: 0 0 10px;
}

.mini-book-cover {
    width: 88px;
    height: 124px;
    margin: 0 auto 10px;
    border-radius: 4px 8px 8px 4px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.22);
    padding: 10px 8px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    overflow: hidden;
}

.mini-progress-track {
    height: 6px;
    background: #d8d5ce;
    border-radius: 999px;
    overflow: hidden;
    width: 85%;
    margin: 0 auto;
}

.mini-progress-bar {
    height: 100%;
    background: #b5926b;
    border-radius: 999px;
}

/* Thanh thông tin User ở đáy Sidebar giống "Stephan >" trong Ảnh 2 */
.sidebar-member-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f4efe8;
    border: 1px solid #e4d9c8;
    border-radius: 14px;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--owl-text-main);
    transition: background 0.15s ease;
}

.sidebar-member-pill:hover {
    background: #ebe2d5;
    color: var(--owl-text-main);
}

.member-pill-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #8b5e3c;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

/* ==========================================================================
   2. KHU VỰC KỆ SÁCH CHÍNH BÊN PHẢI (MAIN BOOKSHELF CANVAS)
   ========================================================================== */
.readowl-main {
    flex: 1;
    min-width: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.readowl-canvas {
    background: var(--owl-canvas-bg);
    border-radius: 22px;
    padding: 24px 32px 36px;
    flex: 1;
    box-shadow: inset 0 2px 6px rgba(74, 59, 50, 0.04);
}

/* Thanh công cụ phía trên cùng (Tabs + Search in My library) giống Ảnh 2 */
.canvas-topbar {
    background: #fdfbf7;
    border-radius: 14px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 3px 12px rgba(74, 59, 50, 0.06);
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.btn-owl-hamburger {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid #e4d9c8;
    background: #ffffff;
    color: var(--owl-text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
}

.readowl-shell:not(.sidebar-collapsed) .btn-owl-hamburger,
body.admin-theme-mode .readowl-shell:not(.sidebar-collapsed) .btn-owl-hamburger {
    display: none !important;
}

.btn-owl-hamburger:hover {
    background: var(--owl-pill-active);
}

.canvas-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.canvas-tab-btn {
    border: none;
    background: transparent;
    color: var(--owl-text-muted);
    font-size: 13.5px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.canvas-tab-btn.active {
    background: var(--owl-pill-active);
    color: var(--owl-text-main);
}

.canvas-search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.canvas-search-box i {
    position: absolute;
    display: none !important;
    top: 50%;
    transform: translateY(-50%);
    display: block !important;
    left: 14px;
    color: #9c8c7c;
}

.canvas-search-input {
    width: 100%;
    border: none;
    background: #f1ede7;
    border-radius: 10px;
    padding: 8px 14px 8px 38px;
    font-size: 13.5px;
    color: var(--owl-text-main);
}

.canvas-search-input:focus {
    outline: 2px solid #d8c8b4;
    background: #ffffff;
}

/* ==========================================================================
   3. KỆ SÁCH 3D & BÌA SÁCH (BOOKSHELVES & COVERS GIỐNG MẪU ẢNH 2)
   ========================================================================== */
.shelf-section {
    margin-bottom: 34px;
}

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

.shelf-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #6b5748;
}

.shelf-action-link {
    background: transparent;
    border: none;
    color: #6b5748;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.shelf-action-link:hover {
    text-decoration: underline;
}

/* Dãy sách đặt trên kệ */
.books-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 24px;
    align-items: end;
    padding: 0 14px;
    position: relative;
    z-index: 2;
}

.book-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.book-item:hover {
    transform: translateY(-6px);
}

/* Bìa sách có gáy nổi như sách thật */
.book-cover-card {
    width: 118px;
    height: 168px;
    border-radius: 3px 8px 8px 3px;
    box-shadow: -4px 6px 14px rgba(15, 23, 42, 0.22), inset 4px 0 8px rgba(255, 255, 255, 0.2);
    padding: 12px 10px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.book-cover-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: rgba(0, 0, 0, 0.22);
}

.book-cover-category {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    line-height: 1.35;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.88;
}

.book-cover-title {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-cover-author {
    font-size: 10px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nhan so luong nam trong phan chu thich, ben ngoai bia sach. */
.book-stock-tag {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    max-width: 100%;
    margin-top: 8px;
    padding: 4px 9px;
    border: 1px solid #cddfce;
    border-radius: 999px;
    background: #edf5ee;
    color: #326848;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
}

.book-stock-tag--empty,
.book-stock-tag--returned {
    background: #f0ece7;
    color: #76685c;
    border-color: #ded5ca;
}

.book-stock-tag--pending {
    background: #fff3dc;
    color: #8b5b12;
    border-color: #ead4ac;
}

.book-stock-tag--borrowed {
    background: #e9f0fc;
    color: #345b92;
    border-color: #cbd8ef;
}

/* Thanh kệ gỗ/kem 3D đỡ bên dưới hàng sách đúng như Ảnh 2 */
.shelf-ledge {
    height: 14px;
    background: linear-gradient(180deg, var(--owl-shelf-top) 0%, var(--owl-shelf-front) 100%);
    border-radius: 6px;
    box-shadow: 0 8px 14px var(--owl-shelf-shadow);
    margin-top: -2px;
    position: relative;
    z-index: 1;
}

/* Thanh trạng thái dưới chân từng cuốn sách đang mượn giống Ảnh 2 */
.book-progress-strip {
    width: 96px;
    height: 5px;
    background: #dfd5c7;
    border-radius: 999px;
    margin-top: 8px;
    overflow: hidden;
}

.book-progress-fill {
    height: 100%;
    background: #b58d63;
    border-radius: 999px;
}

.book-caption {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 148px;
    min-width: 0;
    margin-top: 14px;
    text-align: center;
}

.book-caption-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.8em;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--owl-text-main);
    white-space: normal;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.book-caption-sub {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.8em;
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--owl-text-muted);
    overflow: hidden;
    overflow-wrap: anywhere;
}

/* ==========================================================================
   BUTTONS: CHỮ TRẮNG NỀN MÀU THEO YÊU CẦU (ÁP DỤNG MỌI TRANG)
   ========================================================================== */
.table .btn,
.modern-table .btn {
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 6px;
    padding: 5px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    text-decoration: none !important;
}

.table .btn-danger,
.table .btn-outline-danger,
.modern-table .btn-danger,
.modern-table .btn-outline-danger,
.btn-danger,
.btn-outline-danger {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}
.table .btn-danger:hover,
.table .btn-outline-danger:hover,
.modern-table .btn-danger:hover,
.modern-table .btn-outline-danger:hover,
.btn-danger:hover,
.btn-outline-danger:hover {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.table .btn-purple,
.table .btn-outline-purple,
.modern-table .btn-purple,
.modern-table .btn-outline-purple,
.btn-purple,
.btn-outline-purple {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
    border-color: #4338ca !important;
    color: #ffffff !important;
}

.table .btn-primary,
.table .btn-outline-primary,
.modern-table .btn-primary,
.modern-table .btn-outline-primary {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

.table .btn-success,
.table .btn-outline-success,
.modern-table .btn-success,
.modern-table .btn-outline-success {
    background-color: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
}

.table .btn-warning,
.table .btn-outline-warning,
.modern-table .btn-warning,
.modern-table .btn-outline-warning {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
    color: #ffffff !important;
}

@media (max-width: 991.98px) {
    body {
        padding: 0;
    }
    .readowl-shell {
        border-radius: 0;
        min-height: 100vh;
    }
    .readowl-sidebar,
    body.admin-theme-mode .readowl-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        width: 270px !important;
        max-width: 82vw;
        z-index: 1060;
        transform: translateX(0);
        box-shadow: 6px 0 25px rgba(15, 23, 42, 0.28);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        background: #fdfbf7;
        border-right: 1px solid #e4d9c8;
        padding: 24px 16px 20px !important;
        overflow-y: auto !important;
    }

    body.admin-theme-mode .readowl-sidebar {
        background: linear-gradient(180deg, #32047a 0%, #240154 100%) !important;
        border-right: none !important;
    }

    .readowl-shell.sidebar-collapsed .readowl-sidebar,
    body.admin-theme-mode .readowl-shell.sidebar-collapsed .readowl-sidebar {
        transform: translateX(-105%) !important;
        width: 270px !important;
        padding: 24px 16px 20px !important;
        opacity: 1 !important;
        pointer-events: none;
    }

    .readowl-edge-toggle {
        display: flex !important;
        position: fixed !important;
        top: 24px !important;
        left: calc(min(270px, 82vw) - 15px) !important;
        z-index: 1070 !important;
    }

    .readowl-shell.sidebar-collapsed .readowl-edge-toggle,
    body.admin-theme-mode .readowl-shell.sidebar-collapsed .readowl-edge-toggle {
        display: none !important;
    }

    .readowl-canvas {
        padding: 18px 14px;
    }

    .canvas-topbar {
        padding: 10px 12px;
        gap: 8px;
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .readowl-canvas {
        padding: 14px 10px;
    }

    .canvas-topbar {
        padding: 8px 10px;
        gap: 8px;
    }

    .canvas-tabs {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 4px;
    }

    .canvas-search-box {
        width: 100%;
        flex: 1 1 100%;
    }

    .books-row {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 16px;
        padding: 0 4px;
    }

    .book-cover-card {
        width: 108px;
        height: 154px;
        padding: 10px 8px;
    }

    .book-cover-title {
        font-size: 11.5px;
    }

    .book-caption-card {
        max-width: 120px;
    }
}

/* ==========================================================================
   4. CHẾ ĐỘ ADMIN THEME (TỰ ĐỘNG BẬT KHI TÀI KHOẢN ĐĂNG NHẬP LÀ ADMIN)
   Đồng bộ 100% Sidebar tím đậm + Topbar trắng + Workspace Card giống hệt trang Admin
   ========================================================================== */
.admin-only-block {
    display: none !important;
}

body.admin-theme-mode {
    padding: 0;
    background: #f4f5f9;
    color: #1e293b;
}

body.admin-theme-mode .admin-only-block {
    display: flex !important;
}

body.admin-theme-mode .sidebar-user-box.admin-only-block,
body.admin-theme-mode .sidebar-logo.admin-only-block {
    display: block !important;
}

body.admin-theme-mode .owl-only-block {
    display: none !important;
}

body.admin-theme-mode .readowl-shell {
    max-width: none;
    min-height: 100vh;
    margin: 0;
    background: #f4f5f9;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

body.admin-theme-mode .readowl-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #32047a 0%, #240154 100%);
    color: #ffffff;
    border-right: none;
    padding: 28px 18px 22px;
    position: sticky;
    top: 0;
    height: 100vh;
}

body.admin-theme-mode .readowl-shell.sidebar-collapsed .readowl-sidebar {
    width: 0;
    padding-left: 0;
    padding-right: 0;
}

body.admin-theme-mode .readowl-edge-toggle {
    position: fixed;
    top: 24px;
    left: 244px;
    width: 32px;
    height: 32px;
    color: #2e026d;
    border: 1px solid #e2e8f0;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
}

body.admin-theme-mode .readowl-shell.sidebar-collapsed .readowl-edge-toggle {
    display: none !important;
}

body.admin-theme-mode .sidebar-logo {
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffffff;
    text-transform: uppercase;
    margin-bottom: 26px;
    text-decoration: none;
}

body.admin-theme-mode .sidebar-user-box {
    text-align: center;
    margin-bottom: 28px;
    padding: 0 8px;
}

body.admin-theme-mode .sidebar-avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 10px;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

body.admin-theme-mode .sidebar-user-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

body.admin-theme-mode .sidebar-user-role {
    margin: 2px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.68);
}

body.admin-theme-mode .readowl-nav {
    gap: 6px;
}

body.admin-theme-mode .readowl-nav-bottom {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

body.admin-theme-mode .readowl-nav-btn {
    color: rgba(255, 255, 255, 0.82);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    padding: 11px 16px;
}

body.admin-theme-mode .readowl-nav-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
}

body.admin-theme-mode .readowl-nav-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

body.admin-theme-mode .readowl-main {
    padding: 0;
    background: #f4f5f9;
}

body.admin-theme-mode .admin-top-navbar {
    height: 74px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 32px 0 38px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 1010;
}

body.admin-theme-mode .admin-topbar-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: #1e293b;
    font-weight: 600;
    font-size: 14px;
}

body.admin-theme-mode .admin-topbar-pill:hover {
    background: #f1f5f9;
}

body.admin-theme-mode .admin-topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #4338ca;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
}

body.admin-theme-mode .admin-heading-wrap {
    padding: 30px 36px 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

body.admin-theme-mode .admin-heading-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
}

body.admin-theme-mode .admin-heading-sub {
    margin: 4px 0 0;
    font-size: 14px;
    color: #64748b;
}

body.admin-theme-mode .btn-admin-purple {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: #ffffff;
    border: none;
    font-weight: 600;
    padding: 9px 20px;
    border-radius: 8px;
    text-decoration: none;
}

body.admin-theme-mode .btn-admin-purple:hover {
    background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
    color: #ffffff;
}

body.admin-theme-mode .readowl-canvas {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    margin: 0 36px 36px;
    padding: 26px;
}

body.admin-theme-mode .canvas-topbar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

body.admin-theme-mode .canvas-search-input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}

body.admin-theme-mode .shelf-title,
body.admin-theme-mode .book-caption-title {
    color: #0f172a;
}

body.admin-theme-mode .book-caption-sub {
    color: #64748b;
}

body.admin-theme-mode .shelf-ledge {
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
    box-shadow: 0 8px 14px rgba(15, 23, 42, 0.08);
}

/* Lớp nền mờ đóng Sidebar khi chạm ra ngoài trên Tablet & Điện thoại */
.sidebar-mobile-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar-mobile-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 1050;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .readowl-shell:not(.sidebar-collapsed) ~ .sidebar-mobile-backdrop,
    .app-wrapper:not(.sidebar-collapsed) ~ .sidebar-mobile-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .readowl-main {
        padding: 12px;
    }

    body.admin-theme-mode .admin-top-navbar {
        padding: 0 16px;
        height: 62px;
    }

    body.admin-theme-mode .admin-heading-wrap {
        padding: 20px 16px 0;
        margin-bottom: 16px;
    }

    body.admin-theme-mode .admin-heading-title {
        font-size: 22px;
    }

    body.admin-theme-mode .readowl-canvas {
        margin: 0 16px 24px;
        padding: 18px 16px;
    }

    .shelf-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .books-row {
        grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
        gap: 18px;
        padding: 0 8px;
    }
}

@media (max-width: 767.98px) {
    .readowl-main {
        padding: 8px;
    }

    .readowl-canvas,
    body.admin-theme-mode .readowl-canvas {
        padding: 14px 12px;
        border-radius: 16px;
    }

    body.admin-theme-mode .readowl-canvas {
        margin: 0 10px 18px;
    }

    .canvas-topbar {
        padding: 10px;
        gap: 8px;
    }

    .canvas-tabs {
        flex: 1 1 auto;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: thin;
    }

    .canvas-tab-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    #category-filter,
    #filter-category,
    #filter-sort,
    #filter-limit {
        flex: 1 1 calc(50% - 6px);
        min-width: 130px !important;
        max-width: 100% !important;
    }

    .canvas-search-box {
        flex: 1 1 100%;
        width: 100%;
        order: 10;
    }

    .shelf-title {
        font-size: 15px;
    }

    .books-row {
        grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
        gap: 14px;
        padding: 0 4px;
    }
}

@media (max-width: 576px) {
    .readowl-main {
        padding: 4px;
    }

    body.admin-theme-mode .admin-heading-wrap {
        padding: 14px 10px 0;
    }

    body.admin-theme-mode .admin-heading-title {
        font-size: 19px;
    }

    body.admin-theme-mode .readowl-canvas {
        margin: 0 8px 14px;
        padding: 12px 10px;
    }

    .books-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 10px;
        padding: 0 2px;
    }
}

