html {
    font-size: 75%;
}

:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: #334155;
    --input-bg: #0f172a;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 2rem;
    padding: 0;
}

h1,
h2,
h3,
h4 {
    color: var(--text-primary);
    margin-top: 0;
}

h1 {
    display: none; /* Hide top h1 if any left */
}

.sidebar-logo {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to right, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

/* Common Components */
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.btn-primary,
.btn-scrape {
    background: var(--accent);
    color: white;
}

.btn-primary:hover,
.btn-scrape:hover {
    background: var(--accent-hover);
}

.btn-success,
.btn-parse {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-default {
    background: #334155;
    color: white;
    border: 1px solid var(--border-color);
}

.btn-default:hover {
    background: #475569;
}

/* Cards & Sections */
.card,
.section,
.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: var(--transition);
}

/* Forms */
input[type="text"],
input[type="password"],
select,
textarea {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    outline: none;
    transition: var(--transition);
}

input[type="text"]:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Pagination */
.pagination {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.pagination a,
.pagination strong {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.pagination strong {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Bookshelf Grid */
.bookshelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 1rem;
}

.book {
    position: relative;
    background: var(--card-bg);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.book:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.book img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.book h2 {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.4rem;
}

/* Alerts & Toasts */
.alert,
.toast-message {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
}

/* Books Toolbar */
.books-toolbar {
    width: 100%;
    margin: 0 auto 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.books-count {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Display Toggle Button (List / Grid) */
.display-toggle {
    display: inline-flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px;
    gap: 4px;
}

.display-toggle-button {
    width: 42px;
    height: 36px;
    border: none;
    border-radius: 4px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background-color 0.2s, color 0.2s;
}

.display-toggle-button.active {
    color: #fff;
    background: var(--accent);
}

.display-toggle-button:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.display-toggle-divider {
    width: 1px;
    height: 22px;
    background: var(--border-color);
    margin: 0 2px;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(2, 9px);
    gap: 4px;
}

.icon-grid span {
    width: 9px;
    height: 9px;
    border: 2px solid currentColor;
    border-radius: 2px;
    box-sizing: border-box;
}

.icon-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.icon-list span {
    width: 20px;
    height: 3px;
    border-radius: 10px;
    background: currentColor;
    display: block;
}

@media (max-width: 768px) {
    .books-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .display-toggle {
        align-self: flex-end;
    }
}

/* Favorite Button */
.favorite-btn {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    color: var(--text-secondary);
    padding: 0;
}

.favorite-btn:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--accent);
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #f43f5e;
    border-color: #f43f5e;
    background: rgba(244, 63, 94, 0.1);
}

.favorite-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    transition: var(--transition);
}

.favorite-btn.active svg {
    fill: currentColor;
}

/* Search Form Favorite Toggle */
.favorite-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.favorite-filter-toggle:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.favorite-filter-toggle.active {
    background: rgba(244, 63, 94, 0.1);
    border-color: #f43f5e;
    color: #f43f5e;
}

.favorite-filter-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
}

.favorite-filter-toggle.active svg {
    fill: currentColor;
}

/* --- Integrated from index.html --- */
.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    max-width: 1100px;
    margin: 0 auto 2rem;
}

.toast-container {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(92vw, 500px);
    pointer-events: none;
}

.toast-message {
    pointer-events: auto;
    animation: toast-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.page-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.shelf-sidebar {
    width: 280px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: left;
    position: sticky;
    top: 1.5rem;
}

.shelf-sidebar h2 {
    margin: 0 0 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.shelf-create-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.shelf-create-input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.shelf-create-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.shelf-create-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
}

.shelf-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shelf-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    transition: var(--transition);
}

.shelf-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--text-secondary);
}

.shelf-item.active {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.shelf-link {
    display: block;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.shelf-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.shelf-actions {
    display: flex;
    justify-content: flex-end;
}

.shelf-delete-btn {
    border: none;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    transition: var(--transition);
}

.shelf-delete-btn:hover {
    background: var(--danger);
    color: #fff;
}

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

.search-form {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    text-align: left;
}

.search-form-top {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.search-form-top input[type="text"] {
    flex: 1 1 300px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
}

.filter-box {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.filter-box summary {
    list-style: none;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-box summary::before {
    content: "→";
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.filter-box[open]>summary::before {
    transform: rotate(90deg);
}

.summary-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
}

.summary-badge {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 0 0.5rem;
}

.filter-tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.filter-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.filter-tag.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.filter-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.main-controls-bar {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.view-mode-toggle {
    display: flex;
    background: var(--bg-color);
    padding: 0.3rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.compact-sort-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.compact-sort-form select {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    cursor: pointer;
}

.btn-sort-dir {
    padding: 0.5rem 0.75rem;
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.btn-sort-dir:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Display Toggles */
.display-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-color);
    padding: 0.3rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.display-toggle-button {
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.display-toggle-button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.display-toggle-button.active {
    background: var(--accent);
    color: white;
}

.icon-grid, .icon-list {
    display: flex;
    flex-wrap: wrap;
    width: 16px;
    height: 16px;
    gap: 2px;
}

.icon-grid span {
    width: 7px;
    height: 7px;
    background: currentColor;
    border-radius: 1px;
}

.icon-list {
    flex-direction: column;
    gap: 3px;
}

.icon-list span {
    width: 100%;
    height: 3px;
    background: currentColor;
    border-radius: 1px;
}

.books-info-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 0 0.5rem;
}

.books-count {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.view-mode-toggle a {
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.view-mode-toggle a.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.book-title-link {
    color: inherit;
    text-decoration: none;
}

.book-title-link:hover {
    color: var(--accent);
}

.book-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.volume-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
}

.bookshelf.is-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bookshelf.is-list .book {
    display: grid;
    grid-template-columns: 105px 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
    align-items: flex-start;
    text-align: left;
}

.bookshelf.is-list .book h2 {
    height: auto;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    font-size: 1.1rem;
}

.bookshelf:not(.is-list) .book-extra {
    display: none;
}

.book-extra {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.is-series-view .book-extra {
    grid-template-columns: 1fr;
}

.is-series-view .book-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.4rem 1.5rem;
    width: 100%;
}

.author-link {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

.book-description {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    grid-column: 1 / -1;
}

.book-description-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    cursor: pointer;
    outline: none;
}

.book-description-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding: 0.5rem 0;
}

.book-shelf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.book-shelf-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.book-shelf-select {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.book-shelf-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.book-shelf-btn.add {
    background: var(--accent);
    color: white;
}

.book-shelf-btn.remove {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.bulk-add-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translate(-50%, 150%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 1rem 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(12px);
}

.bulk-add-bar.show {
    transform: translate(-50%, 0);
}

.book-bulk-checkbox {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
}

@media (max-width: 1024px) {
    .page-layout {
        flex-direction: column;
    }

    .shelf-sidebar {
        width: 100%;
        position: static;
    }

    .book-tags-panel {
        border-left: none;
        padding-left: 0;
    }
}

.debug-panel {
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
    padding: 1.5rem !important;
    border-radius: 12px;
    border: 1px solid #333;
    margin: 0 auto 2rem 0;
    text-align: left !important;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 100%;
}

.debug-panel h3 {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    color: #569cd6;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
    opacity: 0.8;
}

.debug-sql {
    margin: 0;
    padding: 0;
    background: transparent !important;
}

.debug-params,
.debug-time {
    color: #ce9178;
    font-size: 0.85rem;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #333;
}

.debug-time {
    color: #4ec9b0;
    font-weight: bold;
}

pre[class*="language-"] {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Authors Page Styles */
.authors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.author-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.author-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.author-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.author-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.stat-value {
    color: var(--accent);
    font-weight: 700;
}

.search-container {
    display: flex;
    gap: 0.5rem;
}

.btn-home {
    margin-bottom: 2rem;
    display: inline-flex;
}

.books-info-line .pagination {
    margin: 0;
}

/* Performance Widget */
.performance-widget {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.performance-widget:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.perf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.perf-total {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--accent);
}

.perf-details {
    margin-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.perf-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.perf-val {
    font-family: monospace;
    color: var(--text-primary);
}

/* --- End of Integration --- */

/* Search Suggestions Autocomplete */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 5px;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.suggestion-item:hover,
.suggestion-item.active {
    background-color: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--accent);
}

.suggestion-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.suggestion-label {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}

.label-author {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.label-series {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.label-book {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.2);
}