/* =============================================
   BiblioSmart — Luxury Dark Theme
   Aesthetic: Refined literary elegance
   ============================================= */

/* ─── Google Fonts loaded via header ─── */
/* Playfair Display (headings) + DM Sans (body) */

/* ─── CSS Variables ─── */
:root {
    --bg-primary:    #0C0E14;
    --bg-secondary:  #131620;
    --bg-card:       #181B28;
    --bg-card-hover: #1E2235;
    --bg-glass:      rgba(24, 27, 40, 0.75);
    --border:        rgba(201, 168, 76, 0.15);
    --border-light:  rgba(255, 255, 255, 0.06);

    --gold:          #C9A84C;
    --gold-light:    #E8C87A;
    --gold-dark:     #A8862E;
    --gold-glow:     rgba(201, 168, 76, 0.25);

    --text-primary:  #F0EAD6;
    --text-secondary:#A8A099;
    --text-muted:    #6B6560;
    --text-gold:     #C9A84C;

    --accent-red:    #C94C4C;
    --accent-green:  #4CB87A;
    --accent-blue:   #4C8AC9;

    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  20px;
    --radius-xl:  32px;

    --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
    --shadow-md:  0 8px 32px rgba(0,0,0,0.5);
    --shadow-lg:  0 20px 60px rgba(0,0,0,0.6);
    --shadow-gold:0 0 30px rgba(201,168,76,0.2);

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Grain texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }
ul { list-style: none; }
input, textarea, select, button { font-family: var(--font-body); }

/* ─── Typography ─── */
h1,h2,h3,h4,h5,h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }

/* ─── NAVBAR ─── */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(12, 14, 20, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}
.navbar.scrolled { background: rgba(12, 14, 20, 0.97); }
.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--gold); }
.logo-icon { font-size: 1.5rem; }
.logo-text em { font-style: italic; color: var(--gold); }
.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.nav-links a {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-badge {
    background: rgba(201,168,76,0.1) !important;
    color: var(--gold) !important;
    border: 1px solid var(--border) !important;
}
.btn-nav-primary {
    background: var(--gold) !important;
    color: #0C0E14 !important;
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
}
.btn-nav-primary:hover { background: var(--gold-light) !important; transform: translateY(-1px); }
.nav-user {
    display: flex !important;
    align-items: center;
    gap: 8px;
}
.user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #0C0E14;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}
.nav-logout { color: var(--text-muted) !important; }
.nav-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}
.nav-burger span {
    display: block;
    width: 24px; height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ─── HERO ─── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 24px 80px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    width: 700px; height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 70%);
    top: -200px; right: -200px;
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(76,138,201,0.06) 0%, transparent 70%);
    bottom: -100px; left: -100px;
    pointer-events: none;
}
.hero-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    position: relative;
    z-index: 1;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 50px;
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.3);
    color: var(--gold);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 24px;
}
.hero h1 {
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 500px;
    line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-stats {
    display: flex;
    gap: 32px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-light);
}
.hero-stat-num {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold);
}
.hero-stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
.book-stack {
    position: relative;
    width: 280px;
    height: 380px;
}
.book-card-float {
    position: absolute;
    width: 180px;
    height: 240px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    transition: transform 0.3s ease;
}
.book-card-float:nth-child(1) { top: 0; left: 0; transform: rotate(-6deg); }
.book-card-float:nth-child(2) { top: 60px; left: 60px; transform: rotate(2deg); z-index: 2; }
.book-card-float:nth-child(3) { top: 20px; left: 100px; transform: rotate(8deg); z-index: 1; }
.hero-visual:hover .book-card-float:nth-child(1) { transform: rotate(-10deg) translateY(-10px); }
.hero-visual:hover .book-card-float:nth-child(2) { transform: rotate(0deg) translateY(-15px); }
.hero-visual:hover .book-card-float:nth-child(3) { transform: rotate(12deg) translateY(-5px); }

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #0C0E14;
    box-shadow: 0 4px 20px rgba(201,168,76,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(201,168,76,0.4);
    color: #0C0E14;
}
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    background: var(--bg-card);
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-1px);
}
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text-secondary); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ─── SECTION ─── */
.section { padding: 80px 24px; position: relative; }
.section-container { max-width: 1280px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-label {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 50px;
    background: rgba(201,168,76,0.1);
    color: var(--gold);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.section-header h2 { margin-bottom: 12px; }
.section-header p { color: var(--text-secondary); max-width: 560px; margin: 0 auto; }

/* ─── BOOK GRID ─── */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 28px;
}
.book-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
}
.book-card:hover {
    transform: translateY(-6px);
    border-color: var(--border);
    box-shadow: var(--shadow-md), var(--shadow-gold);
}
.book-cover {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-card-hover), var(--bg-secondary));
}
.book-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.book-card:hover .book-cover img { transform: scale(1.04); }
.book-cover-placeholder {
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    background: linear-gradient(135deg, #1A1D2E, #232742);
    gap: 8px;
}
.book-cover-placeholder span { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-body); }
.book-badge {
    position: absolute;
    top: 10px; left: 10px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.badge-free { background: var(--accent-green); color: #0C0E14; }
.badge-price { background: rgba(201,168,76,0.9); color: #0C0E14; }
.badge-new { background: var(--accent-blue); color: #fff; }
.book-info { padding: 16px; }
.book-category {
    font-size: 0.72rem;
    color: var(--gold);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.book-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-author { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px; }
.book-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.book-rating { font-size: 0.78rem; color: var(--gold); }
.book-price {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
}
.book-price.free { color: var(--accent-green); }

/* ─── FILTERS ─── */
.filters-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}
.filter-chip {
    padding: 8px 18px;
    border-radius: 50px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.filter-chip:hover, .filter-chip.active {
    background: rgba(201,168,76,0.1);
    border-color: var(--gold);
    color: var(--gold);
}

/* ─── FORMS ─── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
    background: var(--bg-card);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }
.form-error { font-size: 0.82rem; color: var(--accent-red); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ─── AUTH PAGES ─── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 40px;
    background: radial-gradient(ellipse at top, rgba(201,168,76,0.05) 0%, transparent 60%);
}
.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-lg);
}
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.auth-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 8px;
}
.auth-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
}
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.role-option {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}
.role-option.selected {
    border-color: var(--gold);
    background: rgba(201,168,76,0.08);
}
.role-option-icon { font-size: 2rem; margin-bottom: 6px; }
.role-option-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.role-option-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.auth-footer { text-align: center; margin-top: 24px; color: var(--text-muted); font-size: 0.88rem; }
.auth-footer a { color: var(--gold); }

/* ─── ALERTS ─── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-success { background: rgba(76,184,122,0.1); border: 1px solid rgba(76,184,122,0.3); color: #4CB87A; }
.alert-error   { background: rgba(201,76,76,0.1);  border: 1px solid rgba(201,76,76,0.3);  color: #E07070; }
.alert-info    { background: rgba(76,138,201,0.1); border: 1px solid rgba(76,138,201,0.3); color: #6EB0E8; }
.alert-warning { background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.3); color: var(--gold); }

/* ─── BOOK DETAIL PAGE ─── */
.book-detail {
    padding: 120px 24px 80px;
}
.book-detail-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
    align-items: start;
}
.book-cover-large {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg), var(--shadow-gold);
    aspect-ratio: 3/4;
    background: var(--bg-card);
}
.book-cover-large img { width: 100%; height: 100%; object-fit: cover; }
.book-detail-info .book-category { font-size: 0.85rem; margin-bottom: 12px; }
.book-detail-info h1 { font-size: 2.5rem; margin-bottom: 12px; }
.book-detail-author {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 1rem;
}
.book-detail-author span { color: var(--gold); }
.book-detail-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding: 16px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
.meta-item { font-size: 0.85rem; color: var(--text-muted); }
.meta-item strong { display: block; color: var(--text-primary); font-size: 1rem; margin-bottom: 2px; }
.book-description { color: var(--text-secondary); line-height: 1.8; margin-bottom: 32px; }
.purchase-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 24px;
}
.purchase-price {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--gold);
    font-weight: 900;
    margin-bottom: 16px;
}
.purchase-price.free { color: var(--accent-green); }
.purchase-features {
    list-style: none;
    margin: 16px 0 24px;
}
.purchase-features li {
    padding: 6px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.purchase-features li::before { content: '✓'; color: var(--gold); }

/* ─── READER ─── */
.reader-wrap {
    display: flex;
    min-height: 100vh;
    padding-top: 68px;
    background: var(--bg-primary);
}
.reader-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    padding: 24px 0;
    overflow-y: auto;
    height: calc(100vh - 68px);
    position: sticky;
    top: 68px;
    transition: transform var(--transition);
}
.reader-sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}
.reader-book-title { font-family: var(--font-heading); font-size: 1rem; color: var(--text-primary); margin-bottom: 4px; }
.reader-progress-bar {
    height: 3px;
    background: var(--border-light);
    border-radius: 2px;
    margin-top: 10px;
}
.reader-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 2px;
    transition: width 0.5s ease;
}
.reader-chapter-list {}
.reader-chapter-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.reader-chapter-item:hover { background: rgba(201,168,76,0.05); color: var(--text-secondary); }
.reader-chapter-item.active {
    border-left-color: var(--gold);
    background: rgba(201,168,76,0.08);
    color: var(--gold);
    font-weight: 600;
}
.reader-chapter-num { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 2px; }
.reader-content-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 48px;
    max-height: calc(100vh - 68px);
    scroll-behavior: smooth;
}
.reader-content {
    max-width: 680px;
    margin: 0 auto;
}
.reader-chapter-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}
.reader-chapter-subtitle { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 40px; }
.reader-body {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-secondary);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}
.reader-body p { margin-bottom: 1.5em; }
.reader-body h2, .reader-body h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin: 2em 0 0.8em;
}
.reader-toolbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}
.reader-toolbar button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-size: 0.85rem;
}
.reader-toolbar button:hover { background: var(--bg-secondary); color: var(--gold); }
.reader-toolbar .font-size-display { color: var(--text-primary); min-width: 40px; text-align: center; font-size: 0.85rem; }

/* ─── DASHBOARD LAYOUT ─── */
.dashboard-wrap {
    display: flex;
    min-height: 100vh;
    padding-top: 68px;
}
.dashboard-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    padding: 28px 0;
    position: sticky;
    top: 68px;
    height: calc(100vh - 68px);
    overflow-y: auto;
}
.dash-user-info {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}
.dash-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #0C0E14;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 10px;
}
.dash-username { font-weight: 700; margin-bottom: 2px; }
.dash-role {
    font-size: 0.75rem;
    color: var(--gold);
    background: rgba(201,168,76,0.1);
    display: inline-block;
    padding: 2px 10px;
    border-radius: 50px;
    border: 1px solid rgba(201,168,76,0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}
.dash-nav-item:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.dash-nav-item.active {
    color: var(--gold);
    background: rgba(201,168,76,0.07);
    border-left-color: var(--gold);
}
.dash-nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.dash-nav-section {
    padding: 12px 20px 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.dashboard-main {
    flex: 1;
    padding: 40px 48px;
    overflow-x: hidden;
}
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}
.dashboard-title { font-family: var(--font-heading); font-size: 1.8rem; }
.dashboard-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

/* ─── STATS CARDS ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    background: radial-gradient(circle, var(--stat-color, rgba(201,168,76,0.1)) 0%, transparent 70%);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon { font-size: 1.8rem; margin-bottom: 12px; }
.stat-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label { font-size: 0.82rem; color: var(--text-muted); }
.stat-change { font-size: 0.78rem; color: var(--accent-green); margin-top: 6px; }

/* ─── TABLES ─── */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.table-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.table-card-title { font-weight: 700; font-family: var(--font-heading); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border-light);
}
.data-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: var(--text-secondary);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.td-strong { color: var(--text-primary); font-weight: 600; }

/* ─── STATUS BADGES ─── */
.status {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 50px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.status-active, .status-published, .status-completed { background: rgba(76,184,122,0.15); color: var(--accent-green); }
.status-pending { background: rgba(201,168,76,0.15); color: var(--gold); }
.status-suspended, .status-failed, .status-expired { background: rgba(201,76,76,0.15); color: var(--accent-red); }
.status-draft { background: rgba(108,108,108,0.15); color: var(--text-muted); }

/* ─── PRICING SECTION ─── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    max-width: 960px;
    margin: 0 auto;
}
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 36px;
    transition: all var(--transition);
    position: relative;
}
.pricing-card.featured {
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}
.pricing-card.featured::before {
    content: 'Populaire';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: #0C0E14;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 50px;
    letter-spacing: 0.05em;
}
.pricing-card:hover { transform: translateY(-4px); }
.pricing-name { font-family: var(--font-heading); font-size: 1.3rem; margin-bottom: 8px; }
.pricing-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; }
.pricing-price {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 4px;
}
.pricing-period { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 28px; }
.pricing-features li {
    padding: 8px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.pricing-features li::before { content: '✓'; color: var(--gold); font-weight: 700; }
.pricing-features li:last-child { border-bottom: none; }

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.88rem; margin-bottom: 24px; }

/* ─── TOAST NOTIFICATIONS ─── */
#toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    min-width: 280px;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
}
.toast-success { background: rgba(76,184,122,0.9); color: #0C0E14; }
.toast-error   { background: rgba(201,76,76,0.9);  color: #fff; }
.toast-info    { background: rgba(76,138,201,0.9); color: #fff; }

/* ─── FOOTER ─── */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: 64px 24px 24px;
    margin-top: 80px;
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 48px;
    margin-bottom: 48px;
}
.footer-brand p { color: var(--text-muted); font-size: 0.88rem; margin-top: 16px; line-height: 1.7; }
.footer-links h4 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.footer-links ul li { margin-bottom: 8px; }
.footer-links a { color: var(--text-muted); font-size: 0.88rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--gold); }
.footer-payments h4 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.payment-logos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pay-badge {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.security-note { font-size: 0.8rem; color: var(--text-muted); }
.footer-bottom {
    border-top: 1px solid var(--border-light);
    padding-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    max-width: 1280px;
    margin: 0 auto;
}

/* ─── MODAL ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform var(--transition);
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: color var(--transition);
    line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

/* ─── PAGINATION ─── */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 40px;
}
.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.88rem;
    transition: all var(--transition);
    text-decoration: none;
}
.page-link:hover, .page-link.active {
    background: rgba(201,168,76,0.1);
    border-color: var(--gold);
    color: var(--gold);
}

/* ─── ANIMATIONS ─── */
@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; } to { opacity: 0; }
}
@keyframes fadeInUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.animate-fadeup {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

/* ─── STARS ─── */
.star { font-size: 0.9rem; }
.star.filled { color: var(--gold); }
.star.empty { color: var(--text-muted); }
.star.half { color: var(--gold); opacity: 0.5; }

/* ─── SEARCH ─── */
.search-wrap { position: relative; }
.search-wrap input { padding-left: 40px !important; }
.search-wrap::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
}

/* ─── COVER UPLOAD ─── */
.cover-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-secondary);
}
.cover-upload:hover { border-color: var(--gold); background: rgba(201,168,76,0.03); }
.cover-upload-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.6; }
.cover-upload p { color: var(--text-muted); font-size: 0.88rem; }

/* ─── PRINT: DISABLE ─── */
@media print { body { display: none !important; } }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-visual { display: none; }
    .hero-actions { justify-content: center; }
    .hero-stats { justify-content: center; }
    .book-detail-container { grid-template-columns: 1fr; }
    .book-cover-large { max-width: 260px; margin: 0 auto; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .dashboard-main { padding: 24px; }
}
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        top: 68px; left: 0; right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 16px;
        gap: 4px;
        align-items: stretch;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 16px; }
    .nav-burger { display: flex; }
    .form-row { grid-template-columns: 1fr; }
    .dashboard-sidebar {
        position: fixed;
        left: -280px;
        z-index: 500;
        top: 68px;
        height: calc(100vh - 68px);
        transition: left var(--transition);
    }
    .dashboard-sidebar.open { left: 0; }
    .reader-sidebar {
        position: fixed;
        left: -280px;
        z-index: 500;
        top: 68px;
        transition: left var(--transition);
    }
    .reader-sidebar.open { left: 0; }
    .reader-content-wrap { padding: 24px 16px 80px; }
    .footer-inner { grid-template-columns: 1fr; gap: 32px; }
    .books-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .reader-toolbar { left: 16px; right: 16px; transform: none; }
}
@media (max-width: 480px) {
    .books-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 28px; }
}
