body {
    font-family: "Literata", Arial, Helvetica, sans-serif;
    background-color: #f7f7f7;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
}

.topbar {
    width: 100%;
    background-color: #D3D3D3;
    color: #000000;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

/* Role ribbon below topbar */
.role-ribbon {
    width: 100%;
    box-sizing: border-box;
    position: fixed;
    top: 48px;
    left: 0;
    z-index: 1000;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.role-ribbon.admin {
    background: #ecfdf5;
    color: #065f46;
}

.role-ribbon.editor {
    background: #eff6ff;
    color: #1e40af;
}

.role-ribbon.reader {
    background: #fff7ed;
    color: #9a3412;
}

.topbar-title {
    font-size: 18px;
    font-weight: bold;
}

.menu-link {
    color: #000000;
    text-decoration: none;
    margin-right: 8px;
}

.menu-link:hover {
    text-decoration: underline;
}

.username {
    color: #000000;
    font-weight: bold;
}

.user-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    filter: none;
}

.logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}


.card-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    gap: 4px;
    padding: 0px;
    scrollbar-width: thin;
    justify-content: center;
    scroll-behavior: smooth;
    width: 100%;
    max-width: 1200px;
    min-width: 800px;
    align-items: stretch;
    margin: 0 auto;
}

.card-container::-webkit-scrollbar {
    height: 2px;
}

.card-container::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.card {
    flex: 0 0 103.164px;
    width: 103.164px;
    min-width: 103.164px;
    max-width: 103.164px;
    /* height: 130px; */
    border-radius: 4px;
    border: 1px solid #333;
    /* Dark gray border */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
    position: relative;
    font-size: clamp(8px, 1.5vw, 12px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-wrap: wrap;
    transition: background-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
    gap: 1px;
}

.card:hover {
    background-color: #e97f0dec !important;
    color: #ffffff;
    font-size: 13px;
    transition: font-size 0.3s ease;
}


.card:hover.selected {
    background-color: #e47a0f !important;
    color: #ffffff;
}

#first-row .card.selected {
    background-color: #e46c10 !important;
    /* darkest orange */
    color: rgb(255, 255, 255);
}

#second-row .card.selected {
    background-color: #ec812d !important;
    color: rgb(255, 255, 255);
}

#third-row .card.selected {
    background-color: #f29b54 !important;
    color: rgb(255, 255, 255);
}

#fourth-row .card.selected {
    background-color: #f7b47a !important;
    color: rgb(14, 13, 13);
}

#fifth-row .card.selected {
    background-color: #fbdcc2 !important;
    /* lightest orange */
    color: rgb(20, 18, 18);
}

#sixth-row .card.selected {
    background-color: #fee8d6 !important;
    /* lightest orange */
    color: rgb(20, 18, 18);
}

#seventh-row .card.selected {
    background-color: #fce9d9 !important;
    /* lightest orange */
    color: rgb(20, 18, 18);
}

.card .top {
    background-color: #de1717ef;
    color: white;
    font-weight: bold;
    padding: 1px 0;
}

.card .category {
    padding: 4px 2px;
    font-weight: bold;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    white-space: pre-line;
}

.card .count {
    color: #444;
    font-size: 11px;
    margin-bottom: 4px;
}

.card .info-icon {
    width: 18px;
    height: 18px;
    margin: 0 auto 4px;
}

.card:hover .info-icon {
    filter: invert(1);
}

.card.selected .info-icon {
    filter: invert(1);
}

.card:hover .count {
    color: #ffffff;
}

.card.selected .count {
    color: #ffffff;
}

.page-layout {
    display: flex;
    width: 100%;
    gap: 1px;
    min-height: 100vh;
    padding: 0;
    box-sizing: border-box;
    margin-top: 0;
}

.content-container {
    margin-top: 60px;
    margin-left: 200px;
    width: calc(100% - 200px);
    display: flex;
    justify-content: center;
    box-sizing: border-box;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.sidebar.collapsed+.content-container {
    margin-left: 66px;
    width: calc(100% - 66px);
}

/* Approvals page specific container */
.approvals-container {
    margin-top: 60px;
    margin-left: 200px;
    width: calc(100% - 200px);
    display: flex;
    justify-content: center;
    box-sizing: border-box;
    height: calc(100vh - 60px);
    overflow-y: hidden;
}

.sidebar.collapsed+.approvals-container {
    margin-left: 66px;
    width: calc(100% - 66px);
}


.wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* space between rows */
    padding: 1px;
    /* center rows horizontally */
    align-items: center;
    width: 100%;
}

.scroll-row {
    width: 100%;
    overflow-x: auto;
    /* This is the scrollable layer */
}

.down-arrow {
    display: none;
}

.scroll-column {
    width: 100%;
    overflow-y: auto;
    /* This is the scrollable layer */
}


.sidebar {
    width: 200px;
    flex-shrink: 0;
    background-color: #D3D3D3;
    border-radius: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: #000000;
    text-align: left;
    transition: width 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    font-size: 14px;
    z-index: 1100;
    overflow-y: auto;
    height: 100vh;
}


.sidebar.collapsed {
    width: 66px;
    padding: 16px 8px;
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .title {
    font-weight: bold;
}

.sidebar.collapsed .sidebar-top {
    gap: 4px;
}

.sidebar.collapsed .title,
.sidebar.collapsed .sidebar-middle {
    display: none;
    font-size: 10px;
}

.sidebar.collapsed .logo {
    width: 28px;
    height: 28px;
}


.menu-item {
    margin: 12px 0;
    cursor: pointer;
}

.toggle-btn {
    background: none;
    color: #000000;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 2px 4px;
}

.sidebar.collapsed .toggle-btn {
    background-color: #555;
    border-radius: 4px;
    color: #000000;
}


.main-content {
    flex-grow: 1;
    overflow-x: auto;
    padding: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

#first-row .card .top {
    background-color: #8b0000;
    /* darkest red */
    color: white;
}

#second-row .card .top {
    background-color: #b22222;
    color: white;
}

#third-row .card .top {
    background-color: #cd5c5c;
    color: white;
}

#fourth-row .card .top {
    background-color: #f08080;
    color: black;
}

#fifth-row .card .top {
    background-color: #f8d7da;
    /* lightest */
    color: black;
}

#sixth-row .card .top {
    background-color: #fee8d6;
    /* lightest */
    color: black;
}

#seventh-row .card .top {
    background-color: #fce9d9;
    /* lightest */
    color: black;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    /* 🔥 stack children vertically */
    align-items: center;
    /* center horizontally */
    gap: 10px;
    /* space between items */
    margin-top: auto;
    padding-bottom: 16px;
}

.github-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #000000;
    text-decoration: none;
    font-size: 14px;
}

.github-link:hover {
    color: #cccccc;
}

.github-icon {
    width: 18px;
    height: 18px;
    filter: none;
    /* makes the SVG black */
}

.whatsapp-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #000000;
    text-decoration: none;
    font-size: 14px;
    margin-top: 10px;
}

.whatsapp-link:hover {
    color: #25D366;
}

.catalogue-link {
    color: #000000;
    text-decoration: none;
}

.catalogue-link:hover {
    text-decoration: underline;
}

.whatsapp-icon {
    width: 18px;
    height: 18px;
    filter: none;
    /* icon remains dark */
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    /* space between logo and first row */
}

.logo-container img {
    max-width: 100%;
    height: auto;
    max-height: 100px;
    /* optional: control logo height */
}

.books-display {
    width: 100%;
    max-width: 1000px;
    margin-top: 30px;
    padding: 16px 20px;
    border-radius: 12px;
    background-color: #f4f4f4;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-family: "Literata", Arial, Helvetica, sans-serif;
    font-size: 18px;
    color: #333;
    text-align: left;
}

.placeholder-text {
    font-weight: 500;
    color: #444;
}

.hierarchy-tree {
    font-family: 'Literata', Georgia, serif;
    color: #24568c;
    font-size: 16px;
    line-height: 1.6;
    padding: 16px 24px;
    border-left: 4px solid #ccc;
    margin-top: 20px;
    background-color: #fdfdfd;
    border-radius: 6px;
    border: 1px solid black;
}

.level {
    margin: 4px 0;
}

.indent-0 {
    padding-left: 0em;
}

.indent-1 {
    padding-left: 1em;
}

.indent-2 {
    padding-left: 2em;
}

.indent-3 {
    padding-left: 3em;
}

.indent-4 {
    padding-left: 4em;
}

.book-count {
    color: rgb(0, 72, 255);
    font-weight: bold;
    font-size: 20px;
}

.horizontal-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    align-items: stretch;
    max-width: 1200px;
    min-width: 800px;
    margin: 0 auto;
}

.barren-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(114px, 1fr));
    gap: 4px;
    padding: 8px;
    background-color: transparent;
    max-width: 1080px;
    min-width: 720px;
    width: 90%;
    margin: 0 auto;
}

#barren-row,
#leaf-row {
    display: none;
}

#second-row,
#third-row,
#fourth-row,
#fifth-row,
#sixth-row,
#seventh-row {
    display: none;
}

.horizontal-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border: 1px solid #333;
    border-radius: 8px;
    background-color: #fff;
    padding: 12px 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-family: "Literata", Arial, Helvetica, sans-serif;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.horizontal-card:hover {
    background-color: #000;
    color: #fff;
}

.horizontal-card.selected {
    background-color: #000;
    color: #ffffff !important;
}

.card-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    margin-right: 6px;
}

.card-center {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
    flex: 1;
    overflow: hidden;
}

.card-title {
    background-color: #a3b9ff;
    font-weight: bold;
    font-size: 16px;
}

.card-subtitle {
    font-size: 14px;
    color: #555;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    white-space: pre-line;
}

.card-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #777;
    flex-shrink: 0;
}

.horizontal-card.selected .card-left,
.horizontal-card.selected .card-right,
.horizontal-card.selected .card-center,
.horizontal-card.selected .card-title,
.horizontal-card.selected .card-subtitle,
.horizontal-card.selected .card-meta {
    color: #ffffff;
}


.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 0.7s linear infinite;
    margin: 20px auto;
}

.hidden {
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes popHighlight {
    0% {
        transform: scale(1);
        background-color: #fff;
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
        background-color: #ffcccc;
    }

    100% {
        transform: scale(1);
        background-color: #fff;
    }
}

.book-list {
    margin-top: 10px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.book-card {
    border: 1px solid #333;
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-family: "Literata", Arial, Helvetica, sans-serif;
    display: flex;
    flex-direction: row;
    min-height: 80px;
    cursor: pointer;
    transition: transform 0.9s ease;
}

.book-card-left {
    background-color: #f8d7da;
    color: #8b0000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    min-width: 70px;
    font-size: 20px;
    font-weight: bold;
}

.book-card-right {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.book-card-header {
    font-weight: bold;
    font-size: 18px;
}

.book-card:hover {
    background-color: #f0f0f0;
    padding-left: 0;
}

.book-card.pop-animate {
    animation: popHighlight 0.9s ease-in-out;
}

.book-title {
    font-weight: bold;
    font-size: 16px;
}

.book-author,
.book-pages,
.book-year,
.book-language,
.book-language-note {
    font-size: 14px;
    color: #555;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.pagination button {
    padding: 4px 8px;
}

.add-icon {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border: 1px solid #333;
    border-radius: 50%;
    background: #fff;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.edit-icon {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    border: 1px solid #333;
    border-radius: 50%;
    background: #fff;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.horizontal-card .add-icon {
    position: static;
    bottom: auto;
    right: auto;
    margin-left: 4px;
}

.horizontal-card .edit-icon {
    position: static;
    bottom: auto;
    left: auto;
    margin-right: 4px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Modal container */
.modal-content {
    position: relative;
    background: var(--surface, #ffffff);
    padding: 24px 24px 16px 24px;
    border-radius: 16px;
    width: min(900px, 92vw);
    max-width: 900px;
    max-height: 90vh;
    box-shadow: var(--shadow, 0 6px 24px rgba(0, 0, 0, 0.2));
    font-family: "Inter", "Literata", Arial, Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Elevated close button already present as .modal-close */

/* Polished, card-like forms inside modals */
.react-form .form-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

@media (max-width: 720px) {
    .react-form .form-fields {
        grid-template-columns: 1fr;
    }
}

.react-form .form-group label {
    font-size: 12px;
    color: var(--muted-text, #6b7280);
    font-weight: 600;
    margin-bottom: 6px;
}

.react-form .form-group input,
.react-form .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 10px;
    font-size: 14px;
    background: var(--surface, #ffffff);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-sizing: border-box;
}

.react-form .form-group input:focus,
.react-form .form-group textarea:focus {
    border-color: var(--primary, #0b66ff);
    box-shadow: 0 0 0 3px rgba(11, 102, 255, 0.15);
}

.react-form .form-group textarea {
    min-height: 96px;
    resize: vertical;
}

/* Make longer fields span two columns (using :has for modern browsers) */
.react-form .form-group:has([name="classification_number"]),
.react-form .form-group:has([name="subject"]),
.react-form .form-group:has([name="title"]),
.react-form .form-group:has([name="subtitle"]),
.react-form .form-group:has([name="title_with_author"]),
.react-form .form-group:has([name="title_indian_language"]),
.react-form .form-group:has([name="subtitle_indian_language"]),
.react-form .form-group:has([name="general_note"]),
.react-form .form-group:has([name="toc"]),
.react-form .form-group:has([name="series_note"]),
.react-form .form-group:has([name="libraries"]) {
    grid-column: 1 / -1;
}

.react-form .form-actions {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border, #e5e7eb);
    display: flex;
    justify-content: flex-end;
}

.react-form button {
    padding: 10px 16px;
    background-color: var(--primary, #0b66ff);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
}

/* Edit modal form tweaks */
.edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.edit-form .form-group label {
    font-size: 12px;
    color: var(--muted-text, #6b7280);
    font-weight: 600;
    margin-bottom: 6px;
}

.edit-form input,
.edit-form textarea {
    padding: 12px 14px;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-sizing: border-box;
}

.edit-form input:focus,
.edit-form textarea:focus {
    border-color: var(--primary, #0b66ff);
    box-shadow: 0 0 0 3px rgba(11, 102, 255, .15);
}

.edit-form .form-group:nth-child(2) {
    grid-column: 2;
}

.edit-form .form-group:nth-child(1),
.edit-form .form-group:nth-child(2) {
    align-self: start;
}

.edit-form .form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
}

.edit-form .form-actions button {
    background: var(--primary, #0b66ff);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 600;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #666;
    cursor: pointer;
}

.modal-close:hover {
    color: #333;
}

/* Book modal specific styling */
#bookModal .modal-content {
    max-width: 720px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    background-color: #fafafa;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

/* Simple message modal */
#messageModal .modal-content {
    width: 300px;
    max-width: 80vw;
    height: auto;
    text-align: center;
}

.book-details-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 8px 12px;
    font-size: 14px;
}

.book-details-grid .field-name {
    font-weight: bold;
    text-align: right;
}

.book-details-grid .field-value {
    text-align: left;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    max-height: 4.5em;
    overflow-y: auto;
}

#bookModalClose {
    margin-top: 12px;
    padding: 6px 12px;
    background-color: #8b0000;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#bookModalClose:hover {
    background-color: #a00;
}

.react-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    font-family: "Literata", Arial, Helvetica, sans-serif;
    height: 100%;
    min-height: 0;
}

.react-form .form-group {
    display: flex;
    flex-direction: column;
}

.modal-content {
    font-size: 16px;
}

.react-form .form-group label {
    font-size: 0.75em;
    margin-bottom: 4px;
}

.react-form input,
.react-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.75em;
    box-sizing: border-box;
}

.react-form textarea {
    resize: vertical;
    min-height: 3em;
}

.react-form .form-actions {
    text-align: right;
    margin-top: 8px;
    flex-shrink: 0;
}

.react-form button {
    padding: 8px 16px;
    background-color: #003B5C;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75em;
}

.react-form button:disabled {
    background-color: #777;
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.edit-form .form-group {
    display: flex;
    flex-direction: column;
}

.edit-form input,
.edit-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    box-sizing: border-box;
}

.edit-form .form-actions {
    text-align: right;
}

#reactFormRoot {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Search styles */
#search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 16px auto;
    display: flex;
    flex-direction: column;
    font-size: 18px;
}

#search-container label {
    font-weight: bold;
    margin-bottom: 4px;
    text-align: center;
    align-self: center;
}

/* Ensure floating label variant inside search container positions correctly */
#search-container.md-field.floating>label {
    text-align: left;
    align-self: auto;
    top: 50%;
    transform: translateY(-50%);
}

#search-container.md-field.floating>.md-input:focus+label,
#search-container.md-field.floating>.md-input:not(:placeholder-shown)+label {
    top: 6px;
    transform: none;
    font-size: 11px;
}

#search-input {
    padding: 20px 10px 8px;
    font-size: 18px;
    border: 1px solid #333;
    border-radius: 4px;
}

#search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

#search-suggestions.hidden {
    display: none;
}

.suggestion-item {
    padding: 6px 10px;
    cursor: pointer;
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

/* Highlighted search term */
.search-highlight {
    font-weight: bold;
    color: green;
    font-size: 1.1em;
    padding: 1px 3px;
    border: 1px solid green;
    border-radius: 3px;
}

/* Settings floating button and modal */
#settings-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: #565555;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
}

#settings-modal {
    position: fixed;
    bottom: 70px;
    right: 20px;
    background-color: #fff;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#settings-modal.hidden {
    display: none;
}

body.no-hyphenation .card .category,
body.no-hyphenation .card-subtitle {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    white-space: pre-line;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.switch input:checked+.slider {
    background-color: #2196F3;
}

.switch input:checked+.slider:before {
    transform: translateX(20px);
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #eee;
}

body.dark-mode .sidebar {
    background-color: #333;
    color: #fff;
}

body.dark-mode .books-display {
    background-color: #444;
    color: #eee;
}

body.dark-mode #settings-icon {
    background-color: #333;
}


/* Approvals page styles */
.approvals-wrapper {
    display: flex;
    flex-direction: row;
    gap: 16px;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
    min-height: 100vh;
}

.approvals-list-pane {
    flex-basis: 30%;
    max-width: 320px;
    min-width: 220px;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.filter-label {
    font-size: 0.85em;
    margin-bottom: 4px;
}

.sort-label {
    font-size: 0.85em;
    margin-bottom: 4px;
}

.sort-select {
    width: 100%;
    padding: 4px 8px;
    margin-bottom: 8px;
}

#status-filter {
    width: 100%;
    margin-bottom: 8px;
}

.multi-select {
    position: relative;
    width: 100%;
    margin-bottom: 8px;
}

.multi-select .dropdown-button {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ccc;
    background-color: #fff;
    text-align: left;
    cursor: pointer;
}

.multi-select .options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.multi-select .options.hidden {
    display: none;
}

.multi-select .options label {
    display: block;
    padding: 4px 8px;
    font-size: 0.9em;
}

.submission-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

.approvals-detail-pane {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
}

.approvals-list-item {
    padding: 8px 4px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.approvals-list-item:focus {
    outline: 2px solid #003B5C;
    outline-offset: -2px;
}

.approvals-list-item.selected {
    background-color: #ffd6d6;
}

.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: capitalize;
}

.status-badge.pending {
    background-color: #f0ad4e;
    color: #000;
}

.status-badge.approved {
    background-color: #5cb85c;
    color: #fff;
}

.status-badge.rejected {
    background-color: #d9534f;
    color: #fff;
}

.approval-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: "Literata", Arial, Helvetica, sans-serif;
}

.approval-form textarea {
    width: 100%;
    min-height: 3em;
}

.approval-form .current-value {
    font-size: 0.75em;
    color: #555;
    margin-bottom: 2px;
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 4px;
}

.approval-form .changed {
    border-left: 4px solid #f0ad4e;
    background-color: #fff7e0;
    padding-left: 4px;
}

.approval-form .changed textarea {
    border-color: #f0ad4e;
    background-color: #fff;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.action-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
}

.action-buttons .approve-btn {
    background-color: #5cb85c;
}

.action-buttons .reject-btn {
    background-color: #d9534f;
}

@media (max-width: 640px) {
    .approvals-wrapper {
        flex-direction: column;
    }

    .approvals-list-pane {
        max-width: none;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #ccc;
    }
}

/* ---- Modern theme overrides (non-breaking, cascade last) ---- */
:root {
    --bg: #f6f8fc;
    --surface: #ffffff;
    --muted-surface: #f2f6ff;
    --text: #0f172a;
    --muted-text: #475569;
    --primary: #0b66ff;
    --primary-hover: #0956d6;
    --accent: #7c3aed;
    --border: #e6e8f0;
    --shadow: 0 10px 24px rgba(2, 6, 23, 0.08);
}

body {
    font-family: "Inter", "Literata", Arial, Helvetica, sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

.topbar {
    background-color: var(--surface);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 12px 20px;
}

.menu-link {
    color: var(--text);
    padding: 6px 10px;
    border-radius: 8px;
}

.menu-link:hover {
    background-color: var(--muted-surface);
    text-decoration: none;
}

.username {
    color: var(--text);
    font-weight: 600;
}

.help-btn {
    background: var(--muted-surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    cursor: pointer;
}

.help-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.sidebar {
    background-color: var(--surface);
    color: var(--text);
    border-right: 1px solid var(--border);
}

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

.card {
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.horizontal-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background-color: var(--surface);
    box-shadow: var(--shadow);
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.horizontal-card:hover {
    background-color: var(--muted-surface);
    color: var(--text);
}

.horizontal-card.selected {
    background-color: var(--primary);
    color: #fff !important;
}

.books-display {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    color: var(--text);
}

#search-input {
    border: 1px solid var(--border);
    border-radius: 8px;
}

.loader {
    border-top-color: var(--primary);
}

#settings-icon {
    background-color: var(--primary);
    box-shadow: var(--shadow);
}

#settings-modal {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.approvals-list-item {
    border-bottom: 1px solid var(--border);
}

.approvals-list-item.selected {
    background-color: var(--muted-surface);
}

/* Onboarding modal */
.onboard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.onboard-overlay.active {
    opacity: 1;
    visibility: visible;
}

.onboard-card {
    position: relative;
    width: min(720px, 92vw);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transform: translateY(12px) scale(.98);
    animation: onboardIn .4s ease forwards;
}

.onboard-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    color: var(--muted-text);
    font-size: 24px;
    cursor: pointer;
}

.onboard-body {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 16px;
    padding: 20px;
}

.onboard-illustration {
    min-height: 180px;
    background: radial-gradient(120px 80px at 30% 30%, #e0e7ff, transparent),
        radial-gradient(140px 100px at 80% 60%, #fee2e2, transparent),
        linear-gradient(135deg, #f8fafc, #eef2ff);
    border-radius: 12px;
}

.onboard-content h2 {
    margin: 6px 0 8px 0;
}

.onboard-content p {
    margin: 0;
    color: var(--muted-text);
}

.onboard-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.onboard-skip {
    background: transparent;
    border: none;
    color: var(--muted-text);
    cursor: pointer;
}

.onboard-next {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
}

.onboard-next:hover {
    background: var(--primary-hover);
}

.onboard-steps {
    display: flex;
    gap: 6px;
}

.onboard-steps .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.onboard-steps .dot.active {
    background: var(--primary);
}

@keyframes onboardIn {
    to {
        transform: translateY(0) scale(1);
    }
}

/* Guided tour styles */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.tour-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tour-overlay .tour-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
}

.tour-tooltip {
    position: absolute;
    max-width: 320px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 12px 14px;
    transform: translateY(-8px);
}

.tour-tooltip h3 {
    margin: 4px 0 6px 0;
    font-size: 16px;
}

.tour-tooltip p {
    margin: 0 0 10px 0;
    color: var(--muted-text);
    font-size: 14px;
}

.tour-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tour-dots {
    display: flex;
    gap: 6px;
}

.tour-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
}

.tour-dots .dot.active {
    background: var(--primary);
}

.tour-actions .tour-prev,
.tour-actions .tour-next {
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.tour-actions .tour-prev {
    background: var(--muted-surface);
    color: var(--text);
}

.tour-actions .tour-next {
    background: var(--primary);
    color: #fff;
}

.tour-actions .tour-next:hover {
    background: var(--primary-hover);
}

/* ---- Material tokens and form system (appended) ---- */
:root {
    --bg: #f6f8fc;
    --surface: #ffffff;
    --muted-surface: #f2f6ff;
    --text: #0f172a;
    --muted-text: #475569;
    --primary: #0b66ff;
    --primary-hover: #0956d6;
    --accent: #7c3aed;
    --error: #d93025;
    --success: #16a34a;
    --border: #e6e8f0;
    --border-strong: #cbd5e1;
    --shadow: 0 10px 24px rgba(2, 6, 23, 0.08);
    --radius-field: 12px;
}

/* Field group */
.md-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.md-field>label {
    font-size: 12px;
    color: var(--muted-text);
    font-weight: 600;
}

/* Inputs */
.md-input,
.md-textarea,
.sort-select,
.multi-select .dropdown-button {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-field);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.md-textarea {
    min-height: 96px;
    resize: vertical;
}

.md-input:focus,
.md-textarea:focus,
.sort-select:focus,
.multi-select .dropdown-button:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 102, 255, 0.16);
}

/* Floating label variant */
.md-field.floating {
    position: relative;
}

.md-field.floating>label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    padding: 0 4px;
    color: var(--muted-text);
    pointer-events: none;
    transition: all .15s ease;
}

.md-field.floating>.md-input {
    padding-top: 20px;
    padding-bottom: 8px;
}

/* Hide placeholder so label pattern works consistently */
.md-field.floating>.md-input::placeholder {
    color: transparent;
}

.md-field.floating>.md-input:focus+label,
.md-field.floating>.md-input:not(:placeholder-shown)+label,
.md-field.floating.has-value>label {
    top: 6px;
    transform: none;
    font-size: 11px;
    background: var(--surface);
}

/* Buttons */
.md-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.md-btn:hover {
    background: var(--primary-hover);
}

.md-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.md-btn.outline {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}

.md-btn.outline:hover {
    border-color: var(--border);
    background: var(--muted-surface);
}

/* Checkbox */
.md-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text);
}

.md-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    appearance: none;
    display: grid;
    place-items: center;
    background: #fff;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.md-checkbox input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(11, 102, 255, 0.16);
    border-color: var(--primary);
}

.md-checkbox input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.md-checkbox input[type="checkbox"]:checked::after {
    content: "";
    width: 10px;
    height: 10px;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="white" d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>') center / contain no-repeat;
    background: #fff;
}

/* Approvals & modal forms alignment */
.approval-form textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius-field);
    padding: 12px 14px;
    font-size: 14px;
    background: var(--surface);
}

.approval-form .action-buttons button {
    border-radius: 10px;
    padding: 10px 16px;
}

.approval-form .approve-btn {
    background: var(--success);
}

.approval-form .reject-btn {
    background: var(--error);
}

/* Modern approvals layout */
.approvals-wrapper {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
}

.approvals-list-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.approvals-list-item.cardish {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 12px 14px;
    cursor: pointer;
}

.approvals-list-item.cardish.selected {
    outline: 2px solid var(--primary);
}

.list-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.code-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 600;
    background: var(--muted-surface);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
}

.status-pill.pending {
    background: #fff8e1;
    border-color: #ffe082;
}

.status-pill.approved {
    background: #e6f4ea;
    border-color: #b7e1c1;
}

.status-pill.rejected {
    background: #fdecea;
    border-color: #f5c2c0;
}

.list-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.list-row-bottom .muted {
    color: var(--muted-text);
    font-size: 12px;
}

.approvals-detail-pane {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.approvals-card {
    padding: 16px;
}

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

.approvals-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.approvals-header-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.approvals-header-meta .meta-label {
    display: block;
    font-size: 12px;
    color: var(--muted-text);
}

.approvals-header-meta .meta-value {
    font-weight: 600;
}

.progress-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-item {
    display: flex;
    gap: 10px;
    align-items: center;
}

.progress-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--muted-surface);
}

.progress-item.done .progress-icon {
    background: #e6f4ea;
}

.progress-item.rejected .progress-icon {
    background: #fdecea;
}

.progress-title {
    font-weight: 600;
}

.progress-sub {
    font-size: 12px;
    color: var(--muted-text);
}

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

/* Selects & dropdowns */
.sort-select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position: calc(100% - 16px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 28px;
}

.multi-select .dropdown-button {
    border-radius: var(--radius-field);
}

@media (prefers-reduced-motion: reduce) {

    .md-btn,
    .md-input,
    .md-textarea {
        transition: none;
    }
}

/* ---- Specificity boost so md- styles win in existing forms ---- */
.react-form .form-group .md-input,
.react-form .form-group .md-textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius-field);
    padding: 12px 14px;
    font-size: 14px;
    background: var(--surface);
}

.react-form .form-group .md-input:focus,
.react-form .form-group .md-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 102, 255, .16);
}

.approval-form .md-textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius-field);
}

/* ---- Design system: typography, utilities, components ---- */
:root {
    --container-max: 1200px;
    --radius-card: 16px;
}

/* Typography */
.h1 {
    font-size: clamp(28px, 3.5vw, 40px);
    line-height: 1.2;
    font-weight: 700;
}

.h2 {
    font-size: clamp(22px, 3vw, 28px);
    line-height: 1.25;
    font-weight: 700;
}

.h3 {
    font-size: clamp(18px, 2.4vw, 22px);
    line-height: 1.3;
    font-weight: 600;
}

.text-muted {
    color: var(--muted-text);
}

/* Utilities */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.rounded {
    border-radius: var(--radius-card);
}

.shadow {
    box-shadow: var(--shadow);
}

.surface {
    background: var(--surface);
    border: 1px solid var(--border);
}

/* Links */
a {
    color: var(--text);
    text-decoration: none;
}

a:hover {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Topbar polish */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.menu-link {
    padding: 8px 10px;
    border-radius: 10px;
}

.menu-link:hover {
    background: var(--muted-surface);
    text-decoration: none;
}

/* Sidebar polish */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.sidebar .title {
    font-weight: 700;
}

.sidebar-divider {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

/* Card polish */
.card,
.horizontal-card {
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.card:hover {
    transform: translateY(-2px);
}

.horizontal-card:hover {
    transform: translateY(-2px);
}

/* Search suggestions */
#search-suggestions,
.suggestions {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    border-radius: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 10px 12px;
}

.suggestion-item:hover {
    background: var(--muted-surface);
}

/* Focus visibility */
:where(button, [role="button"], a, input, textarea, select, .dropdown-button):focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(11, 102, 255, .18);
    border-color: var(--primary);
}

/* Pagination buttons */
.pagination button {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
}

.pagination button:hover {
    background: var(--muted-surface);
}

.pagination button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ---- Book card redesign ---- */
.book-list {
    gap: 12px;
}

.book-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card, 14px);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform .15s ease, background-color .2s ease, border-color .2s ease;
}

.book-card:hover {
    transform: translateY(-2px);
    background: var(--muted-surface);
    border-color: var(--border-strong);
}

.book-card-left {
    min-width: 84px;
    background: transparent;
    color: inherit;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
    min-width: 70px;
    text-align: center;
}

.book-card-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
}

.book-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.book-title,
.book-card-header {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.3;
    color: var(--text);
}

.book-subtitle {
    font-size: 14px;
    color: var(--muted-text);
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.chip.muted {
    background: transparent;
    color: var(--muted-text);
}

.book-note {
    font-size: 13px;
    color: var(--muted-text);
    margin-top: 4px;
    line-height: 1.4;
}

.book-subtitle-alt {
    font-size: 13px;
    color: var(--muted-text);
    font-style: italic;
}

/* Navigation breadcrumb styles */
.navigation-breadcrumb {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.breadcrumb-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumb-label {
    font-weight: 600;
    color: var(--primary);
    margin-right: 8px;
    font-size: 14px;
}

.breadcrumb-item {
    font-size: 14px;
    color: var(--text);
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(11, 102, 255, 0.1);
    transition: all 0.2s ease;
}

.breadcrumb-item.current {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--muted-text);
    font-size: 16px;
    font-weight: bold;
    margin: 0 4px;
}

.books-header {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

/* User meta in topbar */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.role-badge {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-text);
}

.role-badge.admin {
    color: #065f46;
}

.role-badge.editor {
    color: #1e40af;
}

.role-badge.reader {
    color: #9a3412;
}

/* Signout button */
.signout-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    color: var(--muted-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.signout-btn:hover {
    background: var(--error, #d93025);
    color: #fff;
    border-color: var(--error, #d93025);
}