/* ===========================================
   STYLE.CSS – Thiết kế theo phong cách waka.vn
   Nền trắng sạch, navbar trắng, carousel sách,
   accent cam/đỏ, chữ tối – tối giản hiện đại
=========================================== */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Màu chủ đạo */
    --primary:   #e84646;   /* đỏ/cam waka */
    --primary-dk:#c73030;
    --primary-lt:#fff1f1;
    --orange:    #f97316;

    /* Trung tính */
    --dark:      #1a1a2e;
    --text:      #2d2d3a;
    --muted:     #6b7280;
    --border:    #e8e8ef;
    --bg:        #f7f8fa;
    --white:     #ffffff;

    /* Shadow */
    --shadow-sm: 0 2px 8px rgba(0,0,0,.07);
    --shadow:    0 4px 20px rgba(0,0,0,.09);
    --shadow-lg: 0 8px 40px rgba(0,0,0,.13);

    /* Radius */
    --r:    10px;
    --r-lg: 16px;
    --r-xl: 24px;

    --font:       'Be Vietnam Pro', sans-serif;
    --transition: all .22s ease;
}

body {
    font-family: var(--font);
    background:  var(--bg);
    color:       var(--text);
    font-size:   15px;
    line-height: 1.6;
    min-height:  100vh;
    display:     flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dk); }
img { max-width: 100%; }
.fw-600 { font-weight: 600; }

/* ── NAVBAR – trắng như waka.vn ── */
.navbar-main {
    background:    var(--white);
    border-bottom: 1px solid var(--border);
    padding:       0;
    position:      sticky;
    top: 0;
    z-index: 1000;
    box-shadow:    var(--shadow-sm);
}
.navbar-main .container {
    display: flex;
    align-items: center;
    height: 62px;
    gap: 0;
}

/* Logo */
.navbar-brand {
    display:     flex;
    align-items: center;
    gap: 9px;
    color:       var(--dark) !important;
    font-weight: 800;
    font-size:   1.2rem;
    letter-spacing: -.4px;
    flex-shrink: 0;
    margin-right: 24px;
}
.brand-icon {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1rem;
}

/* Tabs thể loại navbar */
.nav-tabs-main {
    display:     flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    overflow-x:  auto;
    scrollbar-width: none;
}
.nav-tabs-main::-webkit-scrollbar { display: none; }
.nav-tab {
    padding: 6px 14px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    border-radius: 8px;
    white-space: nowrap;
    transition: var(--transition);
    border: 1.5px solid transparent;
}
.nav-tab:hover { color: var(--primary); background: var(--primary-lt); }
.nav-tab.active {
    color: var(--primary);
    background: var(--primary-lt);
    border-color: rgba(232,70,70,.2);
}

/* Search thanh tìm kiếm navbar */
.nav-search-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid rgba(37,41,54,0.06);
    border-radius: 999px;
    padding: 6px 8px;
    box-shadow: 0 6px 18px rgba(15,23,42,0.04);
    flex-shrink: 0;
    transition: var(--transition);
}
.nav-search-wrap:focus-within {
.nav-search-wrap { position: relative; }
.nav-search-wrap .search-left-icon {
    position: absolute; left: 12px; color: var(--muted); font-size: 1rem;
}
.nav-search-wrap input {
    border: none; outline: none;
    background: transparent;
    font-family: var(--font);
    font-size: .92rem;
    padding: 8px 36px 8px 40px; /* top/right/bottom/left */
    width: 260px;
    max-width: 40vw;
    color: var(--text);
}
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(232,70,70,.08);
}
.nav-search-wrap i {
    padding: 0 10px 0 12px;
    color: var(--muted);
    font-size: .92rem;
}

/* Khi input có giá trị, ẩn icon để gọn */
.nav-search-wrap.has-value i {
    opacity: 0;
    transform: translateX(-6px) scale(.95);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
}
.nav-search-wrap input {
    border: none; outline: none;
    background: transparent;
    font-family: var(--font);
    font-size: .92rem;
    padding: 6px 8px;
    width: 260px;
    max-width: 40vw;
    color: var(--text);
}
.nav-search-wrap input::placeholder { color: var(--muted); }
.nav-search-wrap button {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 6px 10px;
    font-size: .9rem;
    font-weight: 800;
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
}
.nav-search-wrap:focus-within button { color: var(--primary-dk); }

/* Small icon button for search (replaces text). Hidden when input has value */
.btn-search-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 999px;
    background: transparent; color: var(--primary);
    padding: 0; margin: 0; font-size: 1rem;
}
.btn-search-icon i { width: 16px; }
.nav-search-wrap.has-value .btn-search-icon {
    opacity: 0; transform: translateX(6px) scale(.9); pointer-events: none;
}
.nav-search-wrap:not(.has-value) .btn-search-icon { opacity: 1; transform: none; }
.btn-clear-search {
    position: absolute; right: 8px; display: none;
    align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 999px;
    background: rgba(0,0,0,0.03); color: var(--muted);
    border: none; cursor: pointer; font-size: .9rem;
}
.btn-clear-search i { font-size: .8rem; }
.nav-search-wrap.has-value .btn-clear-search { display: inline-flex; }

/* Nút đăng nhập / avatar navbar */
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.btn-nav-login {
    background: var(--primary);
    color: #fff !important;
    border-radius: 8px;
    padding: 7px 18px;
    font-size: .85rem;
    font-weight: 700;
    transition: var(--transition);
}
.btn-nav-login:hover { background: var(--primary-dk); color: #fff !important; }

/* Avatar dropdown */
.avatar-sm {
    width: 32px; height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .82rem;
    color: #fff; margin-right: 6px;
}
.user-menu { display: flex; align-items: center; color: var(--text) !important; font-weight: 600; font-size: .88rem; }
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: .5rem;
    min-width: 200px;
}
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-size: .88rem; color: var(--text); }
.dropdown-item:hover { background: var(--bg); color: var(--primary); }
.dropdown-header { padding: .5rem .75rem; font-size: .85rem; }

/* Toggler mobile */
.navbar-toggler { border: none; padding: 4px 8px; }
.navbar-toggler:focus { box-shadow: none; }
.navbar-toggler-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(26,26,46,0.9)' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); }

/* Admin menu on navbar (right side) */
.admin-menu a {
    background: transparent; color: var(--dark);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 6px 10px; border-radius: 8px;
    font-size: .82rem; font-weight: 700; text-decoration: none;
}
.admin-menu a:hover { background: rgba(232,70,70,.06); color: var(--primary); border-color: rgba(232,70,70,.12); }

/* Read button styling */
.btn-read-book {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(90deg, var(--primary), var(--orange));
    color: #fff !important; border: none; border-radius: 8px;
    padding: 7px 12px; font-weight: 700; font-size: .86rem;
}
.btn-read-book i { font-size: .95rem; }
.btn-read-book:hover { filter: brightness(.95); transform: translateY(-2px); }

/* Ensure nav-actions wrap nicely on small screens */
@media (max-width: 767px) {
    .admin-menu { display: none; }
    .nav-search-wrap input { width: 120px; }
    .nav-actions { gap: 6px; }
    .btn-read-book { padding: 6px 10px; font-size: .82rem; }
}


/* ── HERO BANNER – waka.vn style ── */
.hero-wrap {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d5e 55%, #e84646 100%);
    padding: 52px 0 60px;
    position: relative;
    overflow: hidden;
}
.hero-wrap::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 80% 50%, rgba(232,70,70,.35), transparent 55%);
    pointer-events: none;
}
.hero-text { position: relative; z-index: 1; }
.hero-tag {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: .78rem; font-weight: 700;
    color: rgba(255,255,255,.95);
    text-transform: uppercase; letter-spacing: .6px;
    margin-bottom: 16px;
}
.hero-title {
    font-size: clamp(1.9rem, 4vw, 3.2rem);
    font-weight: 800; letter-spacing: -1px;
    color: #fff; line-height: 1.2;
    margin-bottom: 14px;
}
.hero-sub { color: rgba(255,255,255,.75); font-size: 1rem; margin-bottom: 28px; max-width: 480px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-hero-primary {
    background: var(--primary);
    color: #fff; border: none;
    padding: 13px 28px; border-radius: 10px;
    font-weight: 700; font-size: .95rem;
    cursor: pointer; transition: var(--transition);
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font);
}
.btn-hero-primary:hover { background: var(--primary-dk); color: #fff; transform: translateY(-2px); }
.btn-hero-outline {
    background: rgba(255,255,255,.12);
    color: #fff; border: 1.5px solid rgba(255,255,255,.35);
    padding: 12px 24px; border-radius: 10px;
    font-weight: 600; font-size: .95rem;
    display: inline-flex; align-items: center; gap: 8px;
    transition: var(--transition);
}
.btn-hero-outline:hover { background: rgba(255,255,255,.2); color: #fff; }

/* Ảnh bìa sách hero – hiển thị nổi bật bên phải */
.hero-books {
    display: flex; gap: 14px;
    align-items: flex-end;
    justify-content: center;
    position: relative; z-index: 1;
}
.hero-book-item {
    text-align: center;
    transition: var(--transition);
}
.hero-book-item:hover { transform: translateY(-8px); }
.hero-book-item img {
    width: 110px; height: 155px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0,0,0,.4);
}
/* Sách ở giữa to hơn */
.hero-book-item.main img { width: 130px; height: 185px; }
.hero-book-title {
    color: rgba(255,255,255,.8);
    font-size: .72rem; font-weight: 600;
    margin-top: 8px;
    max-width: 110px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Stats nhỏ dưới hero */
.hero-stats {
    display: flex; gap: 32px;
    margin-top: 36px;
}
.hero-stat-item .num { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1; }
.hero-stat-item .lbl { font-size: .78rem; color: rgba(255,255,255,.65); margin-top: 3px; }


/* ── SECTION WRAPPER – wrapper chung cho các section ── */
.section-wrap {
    padding: 40px 0 36px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}
.section-wrap.bg-gray { background: var(--bg); }

/* Header của section: tiêu đề + nút xem tất cả */
.sec-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.sec-title {
    font-size: 1.25rem; font-weight: 800;
    color: var(--dark); letter-spacing: -.3px;
}
.sec-title i { color: var(--primary); }
.sec-sub { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.btn-see-all {
    font-size: .83rem; font-weight: 700;
    color: var(--primary); white-space: nowrap;
    padding: 6px 16px;
    border: 1.5px solid rgba(232,70,70,.3);
    border-radius: 8px;
    background: var(--primary-lt);
    transition: var(--transition);
}
.btn-see-all:hover { background: var(--primary); color: #fff; }


/* ── CAROUSEL – cuộn ngang sách nổi bật ── */
.carousel-wrap { position: relative; }
.carousel-track {
    display: flex; gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }

/* Carousel dùng CSS cuộn thuần – không cần nút JS */


/* ── BOOK CARD – thẻ sách waka.vn style ── */
.book-card {
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 155px;
    background: var(--white);
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    display: flex; flex-direction: column;
}
.book-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

/* Trong grid (không phải carousel) – chiều rộng linh hoạt */
.grid-card {
    width: 100%;
    flex-shrink: unset;
    scroll-snap-align: unset;
}

/* Ảnh bìa sách */
.book-thumb {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f4ff, #fff0f0);
    display: flex; align-items: center; justify-content: center;
}
.book-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.book-card:hover .book-thumb img { transform: scale(1.06); }
.book-thumb .no-img { font-size: 3.5rem; color: var(--primary); opacity: .2; }

/* Badge còn / hết sách */
.book-badge {
    position: absolute; top: 10px; right: 10px;
    padding: 3px 9px; border-radius: 999px;
    font-size: .7rem; font-weight: 700;
    backdrop-filter: blur(4px);
}
.book-badge.available { background: rgba(16,185,129,.15); color: #065f46; }
.book-badge.out       { background: rgba(232,70,70,.15);  color: #b91c1c; }

/* Body thẻ sách */
.book-body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.book-category {
    font-size: .68rem; font-weight: 700;
    color: var(--primary); text-transform: uppercase;
    letter-spacing: .4px; margin-bottom: 4px;
}
.book-title {
    font-size: .88rem; font-weight: 700;
    color: var(--dark); line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 3px;
}
.book-author {
    font-size: .75rem; color: var(--muted);
    margin-bottom: 8px;
}
.book-price {
    font-size: .88rem; font-weight: 800;
    color: var(--primary); margin-top: auto;
}
.book-actions { margin-top: 10px; }


/* ── CATEGORY GRID – lưới thể loại ── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}
.cat-item {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 10px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px 12px;
    text-align: center;
    font-size: .85rem; font-weight: 600;
    color: var(--text);
    transition: var(--transition);
    cursor: pointer;
}
.cat-item:hover {
    border-color: var(--primary);
    background: var(--primary-lt);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}
.cat-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}


/* ── FILTER BAR ── */
.filter-bar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}
.filter-bar .label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.filter-chip {
    padding: 5px 14px; border-radius: 999px;
    font-size: .82rem; font-weight: 600;
    border: 1.5px solid var(--border);
    color: var(--muted); background: var(--white);
    text-decoration: none; display: inline-block;
    transition: var(--transition);
}
.filter-chip:hover, .filter-chip.active {
    background: var(--primary); border-color: var(--primary); color: #fff;
}


/* ── BUTTONS ── */
.btn-primary-custom {
    background: var(--primary); color: #fff; border: none;
    border-radius: var(--r); padding: 9px 20px;
    font-size: .88rem; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--font); transition: var(--transition);
}
.btn-primary-custom:hover { background: var(--primary-dk); color: #fff; transform: translateY(-1px); }

.btn-outline-custom {
    background: transparent; color: var(--primary);
    border: 1.5px solid rgba(232,70,70,.35);
    border-radius: var(--r); padding: 8px 18px;
    font-size: .88rem; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--font); transition: var(--transition);
    text-decoration: none;
}
.btn-outline-custom:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn-success-custom {
    background: #10b981; color: #fff; border: none;
    border-radius: var(--r); padding: 9px 20px;
    font-size: .88rem; font-weight: 700; cursor: pointer;
    font-family: var(--font); transition: var(--transition);
    display: inline-flex; align-items: center; gap: 7px;
}
.btn-success-custom:hover { background: #059669; color: #fff; }

.btn-danger-custom {
    background: var(--primary); color: #fff; border: none;
    border-radius: var(--r); padding: 9px 20px;
    font-size: .88rem; font-weight: 700; cursor: pointer;
    font-family: var(--font); transition: var(--transition);
    display: inline-flex; align-items: center; gap: 7px;
}
.btn-danger-custom:hover { background: var(--primary-dk); color: #fff; }


/* ── PAGE SECTIONS ── */
.section-title { font-size: 1.4rem; font-weight: 800; color: var(--dark); margin-bottom: 4px; }
.section-sub   { color: var(--muted); font-size: .88rem; margin-bottom: 20px; }


/* ── PANELS / CARDS ── */
.panel {
    background: var(--white); border-radius: var(--r-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.panel-header {
    padding: 18px 24px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.panel-header h4 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.panel-body { padding: 24px; }


/* ── FORMS ── */
.form-label { font-weight: 600; font-size: .85rem; color: var(--text); margin-bottom: 6px; }
.form-control, .form-select {
    border: 1.5px solid var(--border); border-radius: var(--r);
    padding: 10px 14px; font-family: var(--font);
    font-size: .9rem; color: var(--text); transition: var(--transition);
    background: var(--white);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary); outline: none;
    box-shadow: 0 0 0 3px rgba(232,70,70,.1);
}


/* ── TABLE ── */
.table-panel {
    background: var(--white); border-radius: var(--r-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.table { margin: 0; }
.table thead th {
    background: var(--bg); color: var(--muted);
    font-size: .76rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    padding: 12px 16px; border: none;
}
.table tbody td {
    padding: 13px 16px; border-color: var(--border);
    vertical-align: middle; font-size: .88rem;
}
.table tbody tr:hover { background: #fafafa; }


/* ── BADGE / STATUS ── */
.status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 999px;
    font-size: .74rem; font-weight: 700;
}
.status-dang-muon { background: #dbeafe; color: #1d4ed8; }
.status-da-tra    { background: #d1fae5; color: #065f46; }
.status-qua-han   { background: #fee2e2; color: #b91c1c; }
.status-warn      { background: #fff4e6; color: #92400e; }


/* ── STAT CARDS (admin) ── */
.stat-card {
    background: var(--white); border-radius: var(--r-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    padding: 20px 18px;
    display: flex; align-items: center; gap: 16px;
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon {
    width: 50px; height: 50px; border-radius: var(--r);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon.blue  { background: #dbeafe; color: #2563eb; }
.stat-icon.green { background: #d1fae5; color: #059669; }
.stat-icon.amber { background: #fef3c7; color: #d97706; }
.stat-icon.red   { background: #fee2e2; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--dark); line-height: 1; }


/* ── AUTH PAGES ── */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d5e 50%, #e84646 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 40px 16px;
}
.auth-card {
    background: var(--white); border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 440px; overflow: hidden;
}
.auth-header {
    background: linear-gradient(135deg, #1a1a2e, #e84646);
    color: #fff; padding: 32px 36px 24px; text-align: center;
}
.auth-header .icon-wrap {
    width: 60px; height: 60px; background: rgba(255,255,255,.18);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; margin: 0 auto 14px;
}
.auth-header h2 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.auth-header p  { margin: 6px 0 0; opacity: .82; font-size: .88rem; }
.auth-body      { padding: 28px 36px; }
.auth-footer    { background: var(--bg); padding: 14px 36px 20px; text-align: center; font-size: .88rem; }


/* ── BOOK DETAIL PAGE ── */
.detail-cover {
    background: linear-gradient(135deg, #f0f4ff, #fff0f0);
    border-radius: var(--r-lg); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    min-height: 360px; overflow: hidden;
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-lg); }
.detail-cover .no-img { font-size: 6rem; color: var(--primary); opacity: .2; }
.detail-meta { display: flex; flex-direction: column; gap: 10px; }
.meta-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.meta-row:last-child { border: none; }
.meta-icon { width: 30px; text-align: center; color: var(--primary); flex-shrink: 0; padding-top: 2px; }
.meta-label { font-size: .76rem; color: var(--muted); font-weight: 600; }
.meta-value { font-size: .9rem; color: var(--dark); font-weight: 600; }


/* ── ALERTS ── */
.alert { border: none; border-radius: var(--r); font-size: .88rem; padding: 12px 16px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger   { background: #fee2e2; color: #b91c1c; }
.alert-warning  { background: #fef3c7; color: #92400e; }
.alert-info     { background: #dbeafe; color: #1e40af; }
.alert-auto { animation: fadeInDown .3s ease; }
@keyframes fadeInDown {
    from { opacity:0; transform:translateY(-8px); }
    to   { opacity:1; transform:translateY(0); }
}

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 56px 20px; }
.empty-state h5 { font-size: 1.1rem; font-weight: 700; color: var(--muted); }


/* ── ADMIN SIDEBAR ── */
.admin-wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: 238px; flex-shrink: 0;
    background: var(--dark);
    position: fixed; top: 0; left: 0; height: 100vh;
    z-index: 100; overflow-y: auto;
    display: flex; flex-direction: column;
}
.sidebar-brand {
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: #fff; font-size: 1.05rem; font-weight: 800;
    display: flex; align-items: center; gap: 9px;
}
.sidebar-section {
    padding: 10px 14px 4px;
    font-size: .68rem; font-weight: 700;
    color: rgba(255,255,255,.28); text-transform: uppercase; letter-spacing: 1px;
}
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; color: rgba(255,255,255,.65);
    font-size: .86rem; font-weight: 600; border-radius: 8px;
    margin: 2px 8px; transition: var(--transition);
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(232,70,70,.2);
    color: #fff;
}
.sidebar-link i { width: 18px; text-align: center; }
.admin-main { margin-left: 238px; flex: 1; display: flex; flex-direction: column; }
.admin-topbar {
    background: var(--white); border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: var(--shadow-sm);
}
.admin-content { padding: 28px; flex: 1; background: var(--bg); }


/* ── FOOTER ── */
.site-footer {
    background: var(--dark);
    color: rgba(255,255,255,.65);
    padding: 40px 0 20px;
    font-size: .88rem;
    margin-top: auto;
}
.site-footer h5, .site-footer h6 { color: #fff; margin-bottom: 12px; font-weight: 700; }
.site-footer a { color: rgba(255,255,255,.5); }
.site-footer a:hover { color: #fff; }
.site-footer li { margin-bottom: 6px; }
.footer-brand {
    font-size: 1.1rem; font-weight: 800; color: #fff;
    display: flex; align-items: center; gap: 9px; margin-bottom: 12px;
}
.footer-brand-icon {
    width: 34px; height: 34px; background: var(--primary);
    border-radius: 9px; display: flex; align-items: center; justify-content: center;
    font-size: .95rem;
}


/* ── BREADCRUMB ── */
.breadcrumb { background: transparent; padding: 0; margin: 0; }
.breadcrumb-item a { color: var(--primary); }
.breadcrumb-item.active { color: var(--muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--muted); }


/* ── BOOK CARD – hiệu ứng hover đẹp hơn ── */
.book-card {
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 155px;
    background: var(--white);
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease;
    cursor: pointer;
    display: flex; flex-direction: column;
    position: relative;
}
.book-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 12px 32px rgba(0,0,0,.14);
    border-color: rgba(232,70,70,.25);
}

/* Shine overlay khi hover */
.book-thumb::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg,
        rgba(255,255,255,.15) 0%,
        transparent 60%);
    opacity: 0; transition: opacity .25s ease;
    pointer-events: none;
}
.book-card:hover .book-thumb::after { opacity: 1; }

/* "Xem chi tiết" overlay khi hover */
.book-thumb::before {
    content: 'Xem chi tiết';
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(232,70,70,.85), transparent);
    color: #fff; font-size: .72rem; font-weight: 700;
    text-align: center; padding: 20px 8px 10px;
    opacity: 0; transition: opacity .25s ease;
    pointer-events: none;
    letter-spacing: .3px;
}
.book-card:hover .book-thumb::before { opacity: 1; }

/* Đường sọc màu bên trái theo thể loại */
.book-card::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    opacity: 0; transition: opacity .25s ease;
    border-radius: 0 0 0 var(--r-lg);
}
.book-card:hover::before { opacity: 1; }


/* ── READING STAGE BADGES – trên trang detail ── */
.reading-stage-badge {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 18px; border-radius: 999px;
    font-size: .88rem; font-weight: 700;
}
.stage-want    { background: #fef3c7; color: #92400e; border: 1.5px solid #fde68a; }
.stage-reading { background: #dbeafe; color: #1d4ed8; border: 1.5px solid #bfdbfe; }

/* Reader UI */
.reader-toolbar { gap:10px; }
.reader { --reader-font:16px; font-size: var(--reader-font); line-height: 1.8; color: var(--text); background: var(--white); padding: 24px; border-radius: 12px; }
.reader p { margin-bottom: 1rem; }
.reader.dark { background: #0b1220; color: #e6eef8; }
.reader.dark a { color: #9bd1ff; }
.reader-toolbar .btn-reader-action { min-width:44px; }
.reader.fullscreen { position: fixed; inset: 18px; z-index: 2000; background: inherit; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }

/* Force neutral colors inside reader to avoid inherited 'danger' styles */
.reader, .reader * {
    color: inherit;
    background: transparent;
}
.reader { color: var(--dark) !important; background: var(--white) !important; }
.reader a { color: var(--primary) !important; }
.reader .text-danger, .reader .status-badge, .reader .badge-overdue { color: var(--dark) !important; background: transparent !important; }
.stage-done    { background: #d1fae5; color: #065f46; border: 1.5px solid #a7f3d0; }


/* ── TỦ SÁCH PAGE ── */
.tusach-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d5e 60%, #e84646 100%);
    border-radius: var(--r-xl);
    position: relative; overflow: hidden;
}
.tusach-header::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 90% 50%, rgba(232,70,70,.3), transparent 60%);
    pointer-events: none;
}
.tusach-title {
    font-size: 1.6rem; font-weight: 800;
    color: #fff; margin: 0; position: relative; z-index: 1;
}
.tusach-sub {
    color: rgba(255,255,255,.7); font-size: .88rem;
    margin: 4px 0 0; position: relative; z-index: 1;
}

/* 3 tab trạng thái */
.reading-tabs {
    display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap;
}
.reading-tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--r-lg);
    font-size: .88rem; font-weight: 700;
    border: 2px solid transparent;
    background: var(--white);
    color: var(--muted);
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.reading-tab:hover  { color: var(--text); border-color: var(--border); }
.tab-count {
    background: rgba(0,0,0,.08); color: inherit;
    border-radius: 999px; padding: 1px 8px;
    font-size: .75rem;
}

/* Tab active theo màu trạng thái */
.reading-tab.tab-want.active {
    background: #fffbeb; color: #92400e;
    border-color: #fde68a; box-shadow: 0 4px 12px rgba(234,179,8,.2);
}
.reading-tab.tab-reading.active {
    background: #eff6ff; color: #1d4ed8;
    border-color: #bfdbfe; box-shadow: 0 4px 12px rgba(37,99,235,.2);
}
.reading-tab.tab-done.active {
    background: #f0fdf4; color: #15803d;
    border-color: #bbf7d0; box-shadow: 0 4px 12px rgba(22,163,74,.2);
}

/* Grid sách trong tủ */
.tusach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
}
.tusach-card {
    background: var(--white);
    border-radius: var(--r-lg);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex; flex-direction: column;
}
.tusach-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: rgba(232,70,70,.2);
}
.tusach-card.overdue { border-color: #fca5a5; }

/* Ảnh bìa trong tủ sách */
.tusach-cover {
    position: relative; display: block;
    height: 200px; overflow: hidden;
    background: linear-gradient(135deg, #f0f4ff, #fff0f0);
}
.tusach-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .3s ease;
}
.tusach-card:hover .tusach-cover img { transform: scale(1.05); }
.tusach-cover-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: var(--primary); opacity: .2;
}

/* Badge trạng thái overlay trên ảnh */
.tusach-status-badge {
    position: absolute; bottom: 8px; left: 8px;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 999px;
    font-size: .7rem; font-weight: 700;
    backdrop-filter: blur(6px);
}
.badge-want    { background: rgba(254,243,199,.92); color: #92400e; }
.badge-reading { background: rgba(219,234,254,.92); color: #1d4ed8; }

/* ── PAGINATION ── */
.pagination { gap: 4px; }
.pagination .page-link {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: .85rem;
    padding: 8px 14px;
    background: var(--white);
    transition: var(--transition);
    font-family: var(--font);
}
.pagination .page-link:hover {
    background: var(--primary-lt);
    color: var(--primary);
    border-color: rgba(232,70,70,.3);
}
.pagination .active .page-link {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination .disabled .page-link {
    color: var(--muted);
    pointer-events: none;
    background: var(--bg);
}
.badge-done    { background: rgba(209,250,229,.92); color: #065f46; }
.badge-overdue { background: rgba(254,226,226,.92); color: #b91c1c; }

/* Thông tin sách trong tủ */
.tusach-info { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.tusach-book-title {
    font-size: .88rem; font-weight: 700;
    color: var(--dark); line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 4px; text-decoration: none;
}
.tusach-book-title:hover { color: var(--primary); }
.tusach-author { font-size: .75rem; color: var(--muted); margin-bottom: 8px; }
.tusach-meta {
    font-size: .75rem; color: var(--muted);
    display: flex; align-items: center; gap: 5px;
    margin-bottom: 4px;
}
.tusach-meta i { color: var(--primary); }
.text-warning { color: #d97706 !important; }
.text-danger  { color: #b91c1c !important; }

/* Nút hành động trong tủ */
.btn-stage-action {
    display: inline-flex; align-items: center; gap: 6px;
    width: 100%; justify-content: center;
    padding: 8px 12px; border-radius: 8px;
    font-size: .8rem; font-weight: 700;
    border: none; cursor: pointer;
    font-family: var(--font); transition: var(--transition);
}
.btn-start-reading {
    background: #eff6ff; color: #1d4ed8;
    border: 1.5px solid #bfdbfe;
}
.btn-start-reading:hover { background: #1d4ed8; color: #fff; }
.btn-finish-reading {
    background: #f0fdf4; color: #15803d;
    border: 1.5px solid #bbf7d0;
}
.btn-finish-reading:hover { background: #15803d; color: #fff; }
.tusach-done-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .8rem; font-weight: 700; color: #059669;
}

/* Empty states cho tủ sách */
.empty-tusach {
    text-align: center; padding: 80px 20px;
    background: var(--white); border-radius: var(--r-xl);
    border: 1.5px dashed var(--border);
}
.empty-tusach-icon {
    width: 80px; height: 80px;
    background: var(--primary-lt); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem; color: var(--primary);
}
.empty-tusach h4 { font-weight: 800; color: var(--dark); margin-bottom: 8px; }
.empty-tusach p  { color: var(--muted); font-size: .92rem; }
.empty-tab {
    text-align: center; padding: 48px 20px;
    color: var(--muted);
}
.empty-tab i { font-size: 2.5rem; display: block; margin-bottom: 12px; opacity: .3; }
.empty-tab p { font-size: .92rem; }


/* ══════════════════════════════════════════════════════════════
   ADMIN VIP UPGRADE — sidebar gradient, cards nổi, bảng đẹp
   ══════════════════════════════════════════════════════════════ */

/* Sidebar: deep indigo gradient thay vì flat dark */
.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 55%, #1a1a2e 100%);
    border-right: none;
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
}
.sidebar-brand {
    background: rgba(255,255,255,.04);
    margin: 8px;
    border-radius: 12px;
    border: none;
    padding: 14px 16px;
    letter-spacing: -.3px;
}
.sidebar-brand i { color: #f87171; font-size: 1.15rem; }

/* Section labels sáng hơn, subtle separator */
.sidebar-section {
    color: rgba(255,255,255,.22);
    font-size: .65rem;
    letter-spacing: 1.4px;
    margin-top: 6px;
    padding: 10px 22px 3px;
    border-top: 1px solid rgba(255,255,255,.05);
}
.sidebar-section:first-of-type { border-top: none; }

/* Links: pill hover + active gradient */
.sidebar-link {
    padding: 9px 16px;
    margin: 2px 10px;
    border-radius: 10px;
    color: rgba(255,255,255,.55);
    font-size: .84rem;
    letter-spacing: -.1px;
}
.sidebar-link:hover {
    background: rgba(248,113,113,.12);
    color: rgba(255,255,255,.9);
    transform: translateX(2px);
}
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(232,70,70,.3), rgba(249,115,22,.15));
    color: #fff;
    box-shadow: inset 3px 0 0 #e84646;
}
.sidebar-link.active i { color: #f87171; }

/* Topbar: glass card effect */
.admin-topbar {
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 2px 16px rgba(0,0,0,.06);
    padding: 14px 32px;
}

/* Admin content background: subtle pattern */
.admin-content {
    background: #f1f5f9;
    background-image:
        radial-gradient(rgba(232,70,70,.025) 1px, transparent 1px);
    background-size: 28px 28px;
    padding: 28px 32px;
}

/* Stat cards: accent left border + gradient icon */
.stat-card {
    border: 1px solid rgba(0,0,0,.06);
    border-left: 4px solid transparent;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    transition: all .2s ease;
    padding: 18px 20px;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,.11);
}

/* Stat icon gradients */
.stat-icon.blue  { background: linear-gradient(135deg,#dbeafe,#bfdbfe); color: #1d4ed8; }
.stat-icon.green { background: linear-gradient(135deg,#d1fae5,#a7f3d0); color: #059669; }
.stat-icon.amber { background: linear-gradient(135deg,#fef3c7,#fde68a); color: #d97706; }
.stat-icon.red   { background: linear-gradient(135deg,#fee2e2,#fecaca); color: #dc2626; }
.stat-icon { border-radius: 12px; font-size: 1.25rem; }

/* Stat label/value typography */
.stat-label { font-size: .72rem; letter-spacing: .2px; color: #64748b; }
.stat-value { font-size: 1.8rem; font-weight: 900; letter-spacing: -1px; color: #0f172a; margin-top: 2px; }

/* Table panel: cleaner card */
.table-panel {
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 4px 20px rgba(0,0,0,.07);
}
.panel-header {
    display: flex; align-items: center; gap: 10px;
}
.panel-header h4 {
    margin: 0; font-size: 1rem; font-weight: 700; color: #0f172a;
}

/* Table: better header + alternating rows */
.table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: .72rem;
    letter-spacing: .7px;
    padding: 13px 18px;
    border-bottom: 2px solid #e2e8f0;
}
.table tbody tr:nth-child(even) { background: rgba(248,250,252,.6); }
.table tbody tr:hover { background: rgba(232,70,70,.03); }
.table tbody td { padding: 14px 18px; border-color: #f1f5f9; }

/* Status badges: pill với border subtle */
.status-badge {
    padding: 4px 12px; border-radius: 999px; font-size: .72rem; font-weight: 700;
    border: 1px solid transparent;
}
.status-dang-muon { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.status-da-tra    { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.status-qua-han   { background: #fff1f2; color: #dc2626; border-color: #fecaca; }
.status-warn      { background: #fffbeb; color: #d97706; border-color: #fde68a; }

/* Button upgrades */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--orange));
    box-shadow: 0 4px 14px rgba(232,70,70,.3);
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: -.1px;
}
.btn-primary-custom:hover {
    filter: brightness(.92);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(232,70,70,.4);
}
.btn-success-custom {
    background: linear-gradient(135deg,#059669,#34d399);
    box-shadow: 0 4px 12px rgba(5,150,105,.25);
    color: #fff; border: none; border-radius: 10px;
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .84rem; font-weight: 700; cursor: pointer;
    transition: all .2s ease;
}
.btn-success-custom:hover {
    filter: brightness(.92); transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(5,150,105,.35);
}
.btn-warning-custom {
    background: linear-gradient(135deg,#d97706,#f59e0b);
    box-shadow: 0 4px 12px rgba(217,119,6,.25);
    color: #fff; border: none; border-radius: 10px;
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .84rem; font-weight: 700; cursor: pointer;
    transition: all .2s ease;
}
.btn-warning-custom:hover {
    filter: brightness(.92); transform: translateY(-1px);
}
.btn-outline-custom {
    border-radius: 10px;
    font-weight: 600;
    font-size: .84rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    color: #475569;
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer; transition: all .2s ease;
    padding: 7px 14px;
}
.btn-outline-custom:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
}
.btn-danger-custom {
    background: linear-gradient(135deg,#dc2626,#f87171);
    box-shadow: 0 4px 12px rgba(220,38,38,.25);
    color: #fff; border: none; border-radius: 10px;
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .84rem; font-weight: 700; cursor: pointer;
    padding: 7px 14px; transition: all .2s ease;
}
.btn-danger-custom:hover { filter: brightness(.92); transform: translateY(-1px); }

/* Reading tabs */
.reading-tab {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    border-radius: 10px;
    padding: 8px 18px;
    font-size: .84rem;
    font-weight: 600;
    transition: all .18s ease;
    display: inline-flex; align-items: center; gap: 7px;
}
.reading-tab:hover { border-color: #e84646; color: #e84646; background: #fff1f1; }
.reading-tab.active {
    background: linear-gradient(135deg,#fff1f1,#fff8f8);
    border-color: #fca5a5;
    color: #dc2626;
    box-shadow: 0 2px 8px rgba(220,38,38,.12);
}
.tab-count {
    background: #dc2626; color: #fff;
    border-radius: 999px; font-size: .68rem;
    padding: 1px 7px; font-weight: 800;
}

/* Dashboard quick-link buttons spacing */
.btn-primary-custom, .btn-outline-custom {
    text-decoration: none;
    white-space: nowrap;
}

/* ── RESPONSIVE ── */
@media (max-width: 992px) {
    .carousel-btn { display: none; }
    .hero-books   { display: none; }
}

@media (max-width: 768px) {
    .nav-tabs-main { display: none; }
    .nav-search-wrap input { width: 140px; }
    .hero-wrap { padding: 36px 0 42px; }
    .hero-title { font-size: 1.7rem; }
    .book-card  { width: 135px; }
    .book-thumb { height: 175px; }
    .cat-grid   { grid-template-columns: repeat(auto-fill, minmax(100px,1fr)); }
    .admin-main { margin-left: 0; }
    .sidebar    { transform: translateX(-100%); }
    .auth-body, .auth-header, .auth-footer { padding-left: 20px; padding-right: 20px; }
    .tusach-grid { grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 12px; }
    .tusach-header { padding: 18px 16px; }
    .tusach-title  { font-size: 1.3rem; }
    .reading-tab   { padding: 8px 14px; font-size: .82rem; }
}
