@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;0,600;0,700;1,600&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ==========================================================================
   DESIGN SYSTEM: Modern Editorial & Gallery Style
   Application: Trưng Bày Sách
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-body: #FAF8F5;
    --bg-card: #FFFFFF;
    --bg-tint: #F2EDE4;
    --bg-dark: #161A18;
    --bg-dark-card: #202522;
    
    --text-main: #1C221F;
    --text-muted: #5E6763;
    --text-light: #8E9894;
    
    --accent-emerald: #1B4332;
    --accent-emerald-light: #2D6A4F;
    --accent-gold: #C68B59;
    --accent-gold-soft: #F4EAD8;
    --accent-terracotta: #C05621;
    
    --border-subtle: #E6E0D5;
    --border-focus: #1B4332;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(27, 67, 50, 0.04);
    --shadow-md: 0 8px 24px -4px rgba(27, 67, 50, 0.08);
    --shadow-lg: 0 16px 40px -8px rgba(27, 67, 50, 0.14);
    --shadow-book: -8px 12px 28px -4px rgba(20, 24, 22, 0.22), 2px 0 6px rgba(0, 0, 0, 0.08);
    --shadow-book-hover: -14px 22px 38px -6px rgba(20, 24, 22, 0.32), 4px 0 10px rgba(0, 0, 0, 0.12);

    /* Fonts */
    --font-heading: 'Lora', Georgia, 'Times New Roman', serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Base Reset & Globals */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text-main);
    background-color: var(--bg-body);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hide default spinner arrows on input type="number" globally */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
    background: rgba(250, 248, 245, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background var(--transition-fast);
}

.nav-wrap {
    min-height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--accent-emerald);
}

.brand-badge {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    background: var(--accent-emerald);
    color: var(--accent-gold-soft);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.brand-badge-img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    box-shadow: var(--shadow-sm);
}

.brand-text {
    background: linear-gradient(135deg, var(--accent-emerald) 0%, #2A5A46 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    font-weight: 500;
    font-size: 14px;
}

.main-nav a {
    position: relative;
    padding: 8px 0;
    color: var(--text-muted);
}

.main-nav a:hover {
    color: var(--accent-emerald);
}

.main-nav a.active {
    color: var(--accent-emerald);
    font-weight: 600;
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gold);
    border-radius: 2px;
}

.main-nav .nav-admin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--accent-emerald);
    color: var(--accent-emerald);
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.main-nav .nav-admin:hover {
    background: var(--accent-emerald);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

/* Flash Messages */
.flash-wrap {
    margin-top: 20px;
}

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.flash.success {
    background: #E8F5E9;
    color: #1B5E20;
    border: 1px solid #C8E6C9;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    background: linear-gradient(180deg, var(--bg-body) 0%, var(--bg-tint) 100%);
    padding: 80px 0 90px;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    align-items: center;
    gap: 60px;
}

.eyebrow-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(198, 139, 89, 0.12);
    color: var(--accent-gold);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-gold);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(198, 139, 89, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(198, 139, 89, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(198, 139, 89, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(198, 139, 89, 0); }
}

.hero-title {
    margin: 0 0 20px;
    font-family: var(--font-heading);
    font-size: clamp(38px, 4.5vw, 62px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1.5px;
    color: var(--text-main);
}

.hero-title em {
    font-style: italic;
    color: var(--accent-gold);
    font-weight: 600;
}

.hero-copy {
    max-width: 560px;
    margin: 0 0 32px;
    color: var(--text-muted);
    font-size: 17px;
    line-height: 1.6;
}

/* Search Box Component */
.search-box {
    display: flex;
    gap: 8px;
    max-width: 580px;
    background: var(--bg-card);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--accent-emerald);
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(27, 67, 50, 0.08);
}

.search-input-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    padding-left: 12px;
}

.search-icon {
    color: var(--text-light);
    margin-right: 10px;
    flex-shrink: 0;
}

.search-box input,
.catalog-search input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-main);
}

.search-box input::placeholder {
    color: var(--text-light);
}

.search-box button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-emerald);
    color: #FFFFFF;
    border: 0;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.search-box button:hover {
    background: var(--accent-emerald-light);
    transform: translateY(-1px);
}

/* Hero Visual Editorial Stack */
.editorial-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.stack-card {
    padding: 24px 28px;
    border-radius: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-smooth);
}

.card-1 {
    transform: rotate(-2deg);
    border-left: 5px solid var(--accent-emerald);
}

.card-2 {
    transform: rotate(2deg) translateX(10px);
    border-left: 5px solid var(--accent-gold);
    background: #FFFDF9;
}

.card-3 {
    transform: rotate(-1deg) translateY(-5px);
    border-left: 5px solid var(--accent-terracotta);
}

.editorial-stack:hover .stack-card {
    transform: rotate(0) translateX(0);
}

.stack-tag {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.stack-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

/* ==========================================================================
   Sections Layout & Section Headings
   ========================================================================== */

.section {
    padding: 80px 0;
}

.section-tint {
    background-color: var(--bg-tint);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 36px;
    gap: 20px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent-gold);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

.section-heading h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.8px;
    color: var(--text-main);
}

.see-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--accent-emerald);
}

.see-all-link:hover {
    color: var(--accent-gold);
}

.see-all-link svg {
    transition: transform var(--transition-fast);
}

.see-all-link:hover svg {
    transform: translateX(4px);
}

/* ==========================================================================
   Category Gallery Grid
   ========================================================================== */

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.category-tile {
    min-height: 160px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.category-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-gold);
}

.category-num {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-gold);
}

.category-name {
    margin-top: auto;
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
}

.category-action {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.category-tile:hover .category-action {
    color: var(--accent-emerald);
}

/* ==========================================================================
   Book Cards & 3D Cover Presentation
   ========================================================================== */

.book-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px 24px;
}

.book-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* 3D Book Cover Wrapper */
.book-cover-wrapper {
    display: block;
    perspective: 1000px;
    margin-bottom: 16px;
}

.book-cover-3d {
    position: relative;
    aspect-ratio: 0.68;
    border-radius: 3px 8px 8px 3px;
    transform-style: preserve-3d;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    box-shadow: var(--shadow-book);
    background: var(--accent-emerald);
    overflow: hidden;
}

.book-spine {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 12px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0%, rgba(255, 255, 255, 0.2) 40%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 10;
    pointer-events: none;
}

.book-cover-front {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.book-cover-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-cover-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 60%);
    pointer-events: none;
    z-index: 9;
}

.book-cover-wrapper:hover .book-cover-3d {
    transform: translateY(-6px) rotateY(-4deg) scale(1.02);
    box-shadow: var(--shadow-book-hover);
}

/* Fallback Book Cover Design */
.book-cover-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #1B4332 0%, #0F281E 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.fallback-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: radial-gradient(#FFFFFF 1px, transparent 1px);
    background-size: 12px 12px;
}

.fallback-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.fallback-badge {
    align-self: flex-start;
    padding: 4px 8px;
    background: var(--accent-gold);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 1px;
}

.fallback-title {
    font-family: var(--font-heading);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin-top: auto;
    margin-bottom: 8px;
}

.fallback-author {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

/* Book Card Body */
.book-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tag {
    display: inline-block;
    padding: 3px 8px;
    background: var(--accent-gold-soft);
    color: #7F5539;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;

}

.book-card-title {
    margin: 0 0 6px;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.book-card-title a:hover {
    color: var(--accent-emerald);
}

.book-card-author {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ==========================================================================
   Catalog Page & Sidebar Filters
   ========================================================================== */

.page-section {
    padding-top: 50px;
    padding-bottom: 90px;
    min-height: 75vh;
}

.page-heading {
    margin-bottom: 32px;
}

.page-heading h1 {
    margin: 0 0 10px;
    font-family: var(--font-heading);
    font-size: clamp(34px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
}

.page-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 16px;
}

.catalog-search {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    background: var(--bg-card);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
}

.catalog-search button {
    padding: 12px 28px;
    background: var(--accent-emerald);
    color: #FFFFFF;
    border: 0;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.catalog-search button:hover {
    background: var(--accent-emerald-light);
}

.search-clear {
    margin-left: 8px;
    color: var(--text-light);
    font-size: 14px;
    padding: 4px;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
}

/* Sidebar Filters */
.filters {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 100px;
    box-shadow: var(--shadow-sm);
}

.filters-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--accent-gold);
    color: var(--text-main);
}

.filters-header strong {
    font-family: var(--font-heading);
    font-size: 16px;
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.filter-item:hover {
    background: var(--bg-tint);
    color: var(--accent-emerald);
}

.filter-item.selected {
    background: var(--accent-emerald);
    color: #FFFFFF;
    font-weight: 600;
}

.count-badge {
    padding: 2px 7px;
    background: var(--bg-tint);
    color: var(--text-muted);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.filter-item.selected .count-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

/* Results Bar */
.results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.results-count strong {
    color: var(--text-main);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
}

.empty-icon {
    color: var(--accent-gold);
    margin-bottom: 16px;
}

.empty-state h2, .empty-state h3 {
    font-family: var(--font-heading);
    margin: 0 0 10px;
    color: var(--text-main);
}

.empty-state p {
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 24px;
}

.button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent-emerald);
    color: #FFFFFF;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.button:hover {
    background: var(--accent-emerald-light);
}

/* Pagination Component */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 48px;
}

.pagination a, .pagination span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

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

.pagination a.current {
    background: var(--accent-emerald);
    color: #FFFFFF;
    border-color: var(--accent-emerald);
    font-weight: 600;
}

.pagination span.disabled {
    opacity: 0.4;
}

/* ==========================================================================
   Book Detail Page (Open Book Layout)
   ========================================================================== */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 32px;
    color: var(--accent-emerald);
    font-weight: 600;
    font-size: 14px;
}

.back-link:hover {
    color: var(--accent-gold);
}

.book-detail {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 48px;
    align-items: start;
}

.detail-3d {
    aspect-ratio: 0.68;
    width: 100%;
}

.detail-title {
    margin: 12px 0 8px;
    font-family: var(--font-heading);
    font-size: clamp(32px, 3.5vw, 46px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -1px;
}

.author-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 28px;
    font-size: 16px;
    color: var(--accent-terracotta);
}

.summary-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.summary-section h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin: 0 0 14px;
    color: var(--text-main);
}

.editorial-prose p {
    color: #38423E;
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-line;
}

/* Specs Sheet Side Card */
.book-specs {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.specs-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--accent-gold);
    color: var(--accent-emerald);
    margin-bottom: 16px;
}

.specs-header h2 {
    font-family: var(--font-heading);
    font-size: 17px;
    margin: 0;
}

.specs-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spec-item dt {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spec-item dd {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.isbn-code {
    font-family: var(--font-body);
    letter-spacing: 0.5px;
}

.related-section {
    margin-top: 60px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--bg-dark);
    color: #E2E8E5;
    margin-top: 80px;
    border-top: 1px solid #2B332F;
}

.footer-wrap {
    padding: 60px 0;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
}

.footer-brand .brand {
    color: #FFFFFF;
}

.footer-brand .brand-text {
    background: linear-gradient(135deg, #FFFFFF 0%, #C68B59 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-desc {
    color: #9EA8A3;
    font-size: 14px;
    max-width: 440px;
    margin-top: 16px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 60px;
}

.footer-col h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    color: #FFFFFF;
    margin: 0 0 16px;
}

.footer-col a {
    display: block;
    color: #9EA8A3;
    font-size: 14px;
    margin-bottom: 10px;
}

.footer-col a:hover {
    color: var(--accent-gold);
}

.footer-bottom {
    background: #0E1110;
    border-top: 1px solid #1F2623;
    padding: 20px 0;
    font-size: 13px;
    color: #727D78;
}

.footer-copy {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   Auth & Admin Interface Styling
   ========================================================================== */

/* --- Auth Page & Login Form --- */
.auth-page {
    min-height: calc(100vh - 280px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: var(--bg-body);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    padding: 40px 36px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}

.auth-card .eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--accent-gold);
    text-transform: uppercase;
    margin: 0 0 6px;
}

.auth-card h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    color: var(--accent-emerald);
    margin: 0 0 6px;
    line-height: 1.2;
}

.auth-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 24px;
}

.auth-card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-main);
    margin-bottom: 18px;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-body);
    background: #FAF9F6;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus,
.auth-card input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-emerald);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.12);
}

.auth-card label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 24px;
}

.auth-card label.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-emerald);
    cursor: pointer;
}

.button, .auth-card .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 24px;
    background: var(--accent-emerald);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.button:hover, .auth-card .button:hover {
    background: var(--accent-emerald-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.form-error {
    padding: 12px 14px;
    background: #FDF2F2;
    border-left: 4px solid #E53E3E;
    color: #9B2C2C;
    font-size: 13.5px;
    border-radius: 6px;
    margin-bottom: 18px;
}

.flash.form-error ul {
    margin: 6px 0 0 18px;
    padding: 0;
}

/* --- Admin Layout & Shell --- */
.admin-body {
    background: #F4F1EA;
    font-family: var(--font-body);
    margin: 0;
}

.admin-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    padding: 32px 24px;
    background: var(--accent-emerald);
    color: #EFF4DF;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.05);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 36px;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.3px;
}

.admin-brand span {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: var(--accent-gold);
    color: var(--accent-emerald);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
}

.admin-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-menu a {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
    transition: all var(--transition-fast);
}

.admin-menu a.active, .admin-menu a:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
}

.admin-menu form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.admin-menu form button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 11px 16px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.admin-menu form button:hover {
    background: rgba(229, 62, 62, 0.2);
    color: #FEB2B2;
}

.admin-content {
    padding: 40px 48px;
    max-width: 1400px;
    width: 100%;
}

.admin-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.admin-top h1 {
    font-family: var(--font-heading);
    margin: 0;
    font-size: 32px;
    color: var(--accent-emerald);
}

.admin-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

/* --- Admin Stats & Cards --- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card span {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-card strong {
    font-family: var(--font-heading);
    font-size: 38px;
    margin-top: 6px;
    display: block;
    color: var(--accent-emerald);
    line-height: 1.1;
}

.admin-card {
    padding: 32px;
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
}

.admin-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-actions h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin: 0 0 4px;
    color: var(--text-main);
}

.admin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-emerald);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.admin-button:hover {
    background: var(--accent-emerald-light);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.admin-button.secondary {
    background: #F4F1EA;
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    box-shadow: none;
}

.admin-button.secondary:hover {
    background: #E8E3D8;
    color: var(--text-main);
}

/* --- Tables & Table Tools --- */
.table-wrap {
    overflow-x: auto;
}

.table-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-search input {
    padding: 9px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 14px;
    width: 280px;
    font-family: var(--font-body);
    background: #FAF9F6;
}

.admin-search input:focus {
    outline: none;
    border-color: var(--accent-emerald);
    background: #FFFFFF;
}

.admin-search button {
    padding: 9px 16px;
    background: var(--accent-emerald);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.admin-search button:hover {
    background: var(--accent-emerald-light);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.data-table th {
    padding: 12px 16px;
    background: #F8F5F0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 700;
    text-align: left;
    border-bottom: 2px solid var(--border-subtle);
}

.data-table th:first-child {
    border-top-left-radius: 8px;
}

.data-table th:last-child {
    border-top-right-radius: 8px;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    color: var(--text-main);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #FAF8F5;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #E6F4EA;
    color: #137333;
}

.status.off {
    background: #F1F3F4;
    color: #5F6368;
}

.admin-link {
    color: var(--accent-emerald);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    font-family: inherit;
    text-decoration: underline;
}

.admin-link:hover {
    color: var(--accent-gold);
}

.inline-form {
    display: inline-flex;
    margin-left: 0;
}

/* --- Action Buttons (Sửa / Xóa) --- */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    line-height: 1.2;
    border: 1px solid transparent;
}

.btn-action svg {
    flex-shrink: 0;
}

.btn-action.btn-edit {
    background-color: #F0F7F4;
    color: #1B4332;
    border-color: #C8E6C9;
}

.btn-action.btn-edit:hover {
    background-color: #1B4332;
    color: #FFFFFF;
    border-color: #1B4332;
    box-shadow: 0 2px 8px rgba(27, 67, 50, 0.2);
    transform: translateY(-1px);
}

.btn-action.btn-delete {
    background-color: #FFF5F5;
    color: #C53030;
    border-color: #FED7D7;
}

.btn-action.btn-delete:hover {
    background-color: #E53E3E;
    color: #FFFFFF;
    border-color: #E53E3E;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.25);
    transform: translateY(-1px);
}

/* --- Delete Confirmation Modal --- */
.delete-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 22, 19, 0.55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.delete-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.delete-modal-card {
    background: #FFFFFF;
    border-radius: 16px;
    width: min(420px, 100%);
    padding: 28px 24px 24px;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    border: 1px solid var(--border-subtle);
    transform: scale(0.92) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.delete-modal-backdrop.active .delete-modal-card {
    transform: scale(1) translateY(0);
}

.delete-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #FEE2E2;
    color: #DC2626;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 4px solid #FEF2F2;
}

.delete-modal-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px;
}

.delete-modal-text {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 24px;
}

.delete-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-modal-cancel {
    flex: 1;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: #F4F1EA;
    color: var(--text-main);
    font-weight: 600;
    font-size: 14px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-modal-cancel:hover {
    background: #E8E3D8;
}

.btn-modal-confirm {
    flex: 1;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    background: #DC2626;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 14px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-modal-confirm:hover {
    background: #B91C1C;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}

/* --- Form Redesign & Components --- */
.form-card {
    padding: 36px 40px;
    background: #FFFFFF;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 20px rgba(27, 67, 50, 0.05);
}

.form-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-subtle);
}

.form-header-bar h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-emerald);
    margin: 0 0 4px;
}

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

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: #FAF8F5;
    color: var(--text-main);
    font-size: 13.5px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-back:hover {
    background: #F2EDE4;
    border-color: #D6CEBE;
    color: var(--accent-emerald);
}

.form-sections {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.form-section {
    background: #FAF9F6;
    border: 1px solid #ECE7DE;
    border-radius: 14px;
    padding: 24px 28px;
}

.form-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #E0D9CB;
}

.section-badge {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-emerald);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
}

.form-section-head h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-main);
    line-height: 1.4;
}

.form-label .req {
    color: #E53E3E;
    margin-left: 2px;
    display: inline;
}

.form-label .sub-label {
    font-weight: normal;
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 4px;
    display: inline;
}

.form-control {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid #D8D2C6;
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--font-body);
    background: #FFFFFF;
    color: var(--text-main);
    transition: all var(--transition-fast);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-emerald);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(27, 67, 50, 0.08);
}

.form-control::placeholder {
    color: #A0A9A4;
}

/* Custom File Upload Box */
.file-upload-box {
    position: relative;
}

.file-upload-box input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: #FFFFFF;
    border: 1.5px dashed #C8C2B4;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.file-upload-box:hover .file-upload-label {
    border-color: var(--accent-emerald);
    background: #F4F8F6;
    color: var(--accent-emerald);
}

.current-cover-wrap {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cover-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Category Chips */
.cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.cat-chip {
    cursor: pointer;
    user-select: none;
}

.cat-chip input[type="checkbox"] {
    display: none;
}

.chip-body {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #FFFFFF;
    border: 1px solid #D6CEBE;
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-main);
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.chip-body .check-icon {
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-fast);
}

.cat-chip:hover .chip-body {
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
}

.cat-chip input[type="checkbox"]:checked + .chip-body {
    background: #E8F3EE;
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(27, 67, 50, 0.12);
}

.cat-chip input[type="checkbox"]:checked + .chip-body .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* Status Toggle Switch Card */
.status-toggle-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #FFFFFF;
    border: 1px solid #D6CEBE;
    border-radius: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #D1D5DB;
    transition: .3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-emerald);
}

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

.toggle-info {
    display: flex;
    flex-direction: column;
}

.toggle-info strong {
    font-size: 14px;
    color: var(--text-main);
}

.toggle-info span {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* Footer Action Buttons */
.form-footer-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

/* --- Admin Form Layout & Controls --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 24px;
    margin-bottom: 28px;
}

.form-grid > label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.form-grid label.full {
    grid-column: 1 / -1;
}

.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid input[type="file"],
.form-grid textarea,
.form-grid select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-body);
    background: #FAF9F6;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.form-grid textarea {
    resize: vertical;
    line-height: 1.5;
}

.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
    outline: none;
    border-color: var(--accent-emerald);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.1);
}

.form-grid label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.form-grid label.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-emerald);
    cursor: pointer;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px 16px;
    padding: 16px;
    background: #FAF8F5;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    margin-top: 4px;
}

.check-grid label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 13.5px;
    cursor: pointer;
}

.check-grid input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-emerald);
}

.cover-preview {
    max-width: 140px;
    max-height: 190px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    margin-top: 10px;
    box-shadow: var(--shadow-sm);
}

.danger-note {
    padding: 12px 16px;
    background: #FFF5F5;
    border-left: 4px solid #E53E3E;
    color: #C53030;
    font-size: 13.5px;
    border-radius: 6px;
    margin: 16px 0;
}

.help {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0;
    font-weight: normal;
}

/* --- Pagination Component --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
}

.pagination a, .pagination span {
    display: inline-grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: #FFFFFF;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

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

.pagination a.current {
    background: var(--accent-emerald);
    color: #FFFFFF;
    border-color: var(--accent-emerald);
    font-weight: 700;
}

.pagination .disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #FAF8F5;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .editorial-stack {
        max-width: 480px;
        margin: 0 auto;
    }
    
    .category-grid, .book-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    
    .filters {
        position: static;
    }
    
    .book-detail {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .detail-3d {
        max-width: 260px;
        margin: 0 auto;
    }
    
    .footer-wrap {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 640px) {
    .category-grid, .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .nav-wrap {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 0;
    }
    
    .main-nav {
        gap: 16px;
        width: 100%;
        overflow-x: auto;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box button {
        justify-content: center;
        width: 100%;
    }
    
    .admin-shell {
        grid-template-columns: 1fr;
    }
}

