/* =====================================================================
   IT-Flipbook — Giao diện ngoài (thư viện flipbook)
   ===================================================================== */

:root {
    --jd-primary: #0149f2;
    --jd-primary-dark: #012fa8;
    --jd-text: #0d1f3c;
    --jd-text-muted: #64748b;
    --jd-border: #e5eaf2;
    --jd-surface: #ffffff;
    --jd-bg: #f7f9fc;
    --jd-radius: 12px;
    --jd-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 26px rgba(15, 23, 42, .06);

    /* Bảng màu ĐO TỪ LOGO (R26) — đo bằng GD trên `it-flipbook-logo.png`:
       navy #05152F (14,5%) · navy nhạt #0F2F5F · xanh #0149F2/#015FF7 · cam #FB8F13 · kem #F5F4F3. */
    --brand-navy: #05152f;
    --brand-navy-soft: #0f2f5f;
    --brand-blue: #0149f2;
    --brand-blue-soft: #e9f0ff;
    --brand-blue-strong: #012fa8;
    --brand-orange: #fb8f13;
    --brand-orange-soft: #fff4e5;
    --brand-orange-strong: #a8590a;
    --brand-cream: #f5f4f3;
}

* { box-sizing: border-box; }

/* Xem ghi chú trong admin.css: rule display của tác giả ghi đè thuộc tính hidden. */
[hidden] { display: none !important; }

body.site {
    margin: 0;
    background: var(--jd-bg);
    color: var(--jd-text);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--jd-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: Consolas, "Courier New", monospace;
    font-size: .88em;
    background: #eef2f7;
    padding: 2px 6px;
    border-radius: 5px;
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* -------------------------------------------------------------- Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--jd-border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.site-header__inner { display: flex; align-items: center; gap: 16px; padding: 12px 18px; }

.brand { display: flex; align-items: center; gap: 11px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand__mark {
    width: 40px; height: 40px;
    border-radius: 11px;
    background: linear-gradient(140deg, #3b82f6, #1e40af);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__text small { color: var(--jd-text-muted); font-size: 12.5px; }

/* Logo website ở header (R25) — ảnh ngang nên canh theo CHIỀU CAO (`--site-logo-h` do view đặt),
   bề rộng co theo ĐÚNG tỉ lệ ảnh (không méo) và tự thu thêm lại trên màn hình hẹp. */
.brand__logo {
    display: block;
    width: auto;
    height: auto;
    max-height: var(--site-logo-h, 40px);
    max-width: min(62vw, 280px);
}
.brand--logo { gap: 10px; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 18px; font-weight: 600; }
.site-nav__admin {
    border: 1px solid var(--jd-border);
    padding: 6px 13px;
    border-radius: 8px;
    color: var(--jd-text);
}

/* ---------------------------------------------------------------- Main */
.site-main { flex: 1 1 auto; padding: 26px 0 50px; }

.hero { text-align: center; padding: 22px 0 30px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.4px; }
.hero p { margin: 0; color: var(--jd-text-muted); }
.hero__count { margin-top: 10px; font-size: 13.5px; }

/* --------------------------------------------------------------- Cards */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
    margin-top: 8px;
}

.book-card {
    background: var(--jd-surface);
    border: 1px solid var(--jd-border);
    border-radius: var(--jd-radius);
    overflow: hidden;
    box-shadow: var(--jd-shadow);
    display: flex;
    flex-direction: column;
    transition: transform .16s ease, box-shadow .16s ease;
}
.book-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15, 23, 42, .12); }

.book-card__cover {
    display: grid;
    place-items: center;
    aspect-ratio: 3 / 4;
    background: linear-gradient(155deg, #dbeafe, #eff6ff 55%, #e0e7ff);
    color: #1e3a8a;
    font-size: 44px;
    font-weight: 700;
}
.book-card__placeholder { opacity: .55; }
.book-card__body { padding: 13px 15px 16px; display: flex; flex-direction: column; gap: 5px; }
.book-card__title { margin: 0; font-size: 15.5px; line-height: 1.35; }
.book-card__author, .book-card__meta { margin: 0; font-size: 13px; color: var(--jd-text-muted); }
.book-card__body .btn { margin-top: 8px; align-self: flex-start; }

/* -------------------------------------------------------------- Alerts */
.alert {
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    border-radius: var(--jd-radius);
    border: 1px solid var(--jd-border);
    background: #fff;
    margin-bottom: 18px;
}
.alert-success { background: #dcfce7; border-color: #bbf7d0; }
.alert-warning { background: #fef3c7; border-color: #fde68a; }
.alert-danger { background: #fee2e2; border-color: #fecaca; }
.alert-info { background: #cffafe; border-color: #a5f3fc; }
.alert-icon {
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(15, 23, 42, .35); color: #fff;
    display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 20px;
}
.alert-close { margin-left: auto; background: none; border: 0; font-size: 19px; cursor: pointer; color: #475569; }

/* --------------------------------------------------------- Empty state */
.empty-state {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    text-align: center;
    padding: 46px 24px;
    margin-top: 10px;
}
.empty-state__icon { font-size: 42px; color: #93c5fd; }
.empty-state h2 { margin: 10px 0 6px; font-size: 19px; }
.empty-state p { margin: 0 auto 18px; color: var(--jd-text-muted); max-width: 460px; }

/* --------------------------------------------------------------- Error */
.error-page { text-align: center; padding: 60px 0; }
.error-page__code { font-size: 74px; font-weight: 800; color: #cbd5e1; line-height: 1; }
.error-page h1 { margin: 6px 0 10px; }
.error-page p { color: var(--jd-text-muted); }
.error-page__actions { margin-top: 20px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* -------------------------------------------------------------- Button */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 14.5px; font-weight: 600;
    cursor: pointer;
    background: #eef2f7; color: var(--jd-text);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--jd-primary); color: #fff; }
.btn-primary:hover { background: var(--jd-primary-dark); color: #fff; }
.btn-outline { background: #fff; border-color: var(--jd-border); color: var(--jd-text); }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }

/* -------------------------------------------------------------- Footer */
.site-footer { background: #fff; border-top: 1px solid var(--jd-border); padding: 18px 0; }
.site-footer__inner { display: flex; gap: 14px; flex-wrap: wrap; color: var(--jd-text-muted); font-size: 13.5px; }

/* R31 — chân trang nhiều cột: nhận diện sản phẩm · sản phẩm khác · liên hệ */
.site-footer { padding: 0; }
.site-footer__top {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
    gap: 26px 32px;
    padding: 26px 18px 22px;
}
.site-footer__brand { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.site-footer__brand-row { display: flex; align-items: center; gap: 10px; }
.site-footer__mark {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand-blue);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .5px;
}
.site-footer__brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.site-footer__brand-text strong { color: var(--brand-navy); font-size: 15.5px; }
.site-footer__brand-text small { color: var(--jd-text-muted); font-size: 12.5px; }
.site-footer__about { margin: 0; max-width: 46ch; color: var(--jd-text-muted); font-size: 13.5px; line-height: 1.6; }
.site-footer__owner { margin: 0; color: var(--jd-text-muted); font-size: 13.5px; }
.site-footer__owner strong, .site-footer__owner a { color: var(--brand-navy); font-weight: 600; }
.site-footer__col { min-width: 0; }
.site-footer__title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--brand-navy);
}
.site-footer__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.site-footer__list a { color: var(--jd-text); font-size: 13.5px; }
.site-footer__list a:hover { color: var(--brand-blue); }
.site-footer__muted { color: var(--jd-text-muted); }
.site-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px 18px;
    flex-wrap: wrap;
    padding: 12px 18px 14px;
    border-top: 1px solid var(--jd-border);
    color: var(--jd-text-muted);
    font-size: 12.5px;
}
@media (max-width: 900px) {
    .site-footer__top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .site-footer__top { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

/* =====================================================================
   P6 — Thư viện công khai, trang chi tiết, chia sẻ, mã QR
   ===================================================================== */

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ------------------------------------------------------------ Tiêu đề */
.library-head { text-align: center; padding: 10px 0 18px; }
.library-head h1 { margin: 0 0 8px; font-size: clamp(24px, 3.6vw, 34px); letter-spacing: -.4px; }
.library-head__desc { margin: 0 auto; color: var(--jd-text-muted); max-width: 62ch; }
.library-head__count { margin: 8px 0 0; font-size: 13.5px; color: var(--jd-text-muted); }

/* --------------------------------------------------------------- Lọc */
.library-tools {
    background: var(--jd-surface);
    border: 1px solid var(--jd-border);
    border-radius: var(--jd-radius);
    box-shadow: var(--jd-shadow);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.search-form { display: flex; gap: 8px; flex-wrap: wrap; }
.search-form__field { flex: 1 1 260px; }
.search-form input[type="search"] {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--jd-border);
    border-radius: 9px;
    font-size: 14.5px;
    background: #fff;
    color: inherit;
}

.sort-bar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sort-bar__label { color: var(--jd-text-muted); font-size: 13.5px; }
.sort-chip {
    padding: 5px 11px;
    border: 1px solid var(--jd-border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--jd-text-muted);
    background: #fff;
}
.sort-chip:hover { text-decoration: none; border-color: var(--jd-primary); color: var(--jd-primary); }
.sort-chip.is-active { background: var(--jd-primary); border-color: var(--jd-primary); color: #fff; }

.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.chip-row--tags { margin-top: 2px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--jd-border);
    border-radius: 999px;
    background: #fff;
    font-size: 13.5px;
    color: var(--jd-text);
}
.chip:hover { text-decoration: none; border-color: var(--jd-primary); color: var(--jd-primary); }
.chip.is-active { background: #e8efff; border-color: #b7cdfb; color: var(--jd-primary-dark); font-weight: 600; }
.chip__count { color: var(--jd-text-muted); font-size: 12px; }
.chip--tag { font-size: 13px; }

/* -------------------------------------------------------------- Thẻ sách */
.book-card__cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.book-card__title a { color: inherit; }
.book-card__category {
    align-self: flex-start;
    font-size: 12.5px;
    color: var(--jd-primary);
    background: #eef4ff;
    border-radius: 999px;
    padding: 2px 9px;
}
.book-card__actions { display: flex; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.book-card__actions .btn { margin-top: 0; }

/* ---------------------------------------------------------- Phân trang */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 26px 0 6px;
}
.page-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 38px;
    justify-content: center;
    padding: 7px 12px;
    border: 1px solid var(--jd-border);
    border-radius: 9px;
    background: #fff;
    font-size: 14px;
    color: var(--jd-text);
}
.page-link:hover { text-decoration: none; border-color: var(--jd-primary); color: var(--jd-primary); }
.page-link.is-current { background: var(--jd-primary); border-color: var(--jd-primary); color: #fff; font-weight: 600; }
.page-link.is-disabled { opacity: .45; pointer-events: none; }
.pagination__info { color: var(--jd-text-muted); font-size: 13px; margin-left: 6px; }

/* ----------------------------------------------------------- Đường dẫn */
.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; color: var(--jd-text-muted); font-size: 13.5px; margin-bottom: 14px; }
.breadcrumb a { color: var(--jd-primary); }

/* ------------------------------------------------------ Trang chi tiết */
.book-detail {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 26px;
    align-items: start;
    background: var(--jd-surface);
    border: 1px solid var(--jd-border);
    border-radius: var(--jd-radius);
    box-shadow: var(--jd-shadow);
    padding: 20px;
}
.book-detail__cover {
    display: grid;
    place-items: center;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f7;
    border: 1px solid var(--jd-border);
}
.book-detail__cover img { width: 100%; height: auto; display: block; }
.book-detail__info h1 { margin: 0 0 12px; font-size: clamp(21px, 2.6vw, 28px); line-height: 1.3; }
.book-detail__meta { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--jd-text-muted); font-size: 14px; }
.book-detail__meta strong { color: var(--jd-text); font-weight: 600; }
.book-detail__description { color: #3f4d63; line-height: 1.7; margin: 0 0 16px; }
.book-detail__actions { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }

.share-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.share-row__label { color: var(--jd-text-muted); font-size: 13.5px; }
.share-btn {
    padding: 5px 12px;
    border: 1px solid var(--jd-border);
    border-radius: 999px;
    font-size: 13px;
    background: #fff;
    color: var(--jd-text);
}
.share-btn:hover { text-decoration: none; border-color: var(--jd-primary); color: var(--jd-primary); }

.embed-box { margin-top: 4px; }
.embed-box summary { cursor: pointer; color: var(--jd-primary); font-weight: 600; }
.embed-box textarea {
    width: 100%;
    margin-top: 8px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12.5px;
    padding: 9px;
    border: 1px solid var(--jd-border);
    border-radius: 8px;
    background: #fbfcfe;
    color: inherit;
}

/* ------------------------------------------------------------- Mã QR */
.qr-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 50;
}
.qr-modal__box {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    max-width: 92vw;
}
.qr-modal__code img { display: block; margin: 0 auto; }
.qr-modal__url { margin: 10px 0 14px; font-size: 12.5px; color: var(--jd-text-muted); word-break: break-all; max-width: 320px; }

/* --------------------------------------------------------- Xem trước */
.preview-strip, .related { margin-top: 30px; }
.preview-strip h2, .related h2 { margin: 0 0 14px; font-size: 19px; }
.preview-strip__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}
.preview-strip__grid a {
    display: block;
    border: 1px solid var(--jd-border);
    border-radius: 9px;
    overflow: hidden;
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
}
.preview-strip__grid a:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(15, 23, 42, .12); }
.preview-strip__grid img { width: 100%; height: auto; display: block; }
.preview-strip__more { color: var(--jd-text-muted); font-size: 13.5px; margin-top: 10px; }

.noscript-pages { margin-top: 26px; color: var(--jd-text-muted); }
.noscript-pages ol { line-height: 1.9; }

@media (max-width: 760px) {
    .book-detail { grid-template-columns: 1fr; }
    .book-detail__cover { max-width: 320px; }
}

/* =====================================================================
   R24 — TRANG CHỦ CÔNG KHAI (tinh gọn: TÌM tài liệu · GỬI PDF)
   Khối: hero + ô tìm kiếm có gợi ý tức thì · thẻ “Gửi PDF” · “Mới nhất” ·
   chip danh mục (1 hàng) · dải số liệu (1 hàng) · 3 bước (1 hàng).
   Đã BỎ băng CTA cuối trang. Danh sách đầy đủ nằm ở /thu-vien.
   ===================================================================== */

.site-nav__link.is-active { color: var(--jd-primary); }

/* Header trên màn hẹp: menu phải nằm 1 DÒNG (đo ở 390px: mỗi mục bị xuống 2 dòng, header cao 94px)
   nên bỏ khẩu hiệu dưới tên thương hiệu và chặn ngắt dòng ở các mục menu.
   R25: logo website rộng hơn dấu chữ cũ (156px ở chiều cao 52px) nên ở màn hẹp phải (a) thu logo lại
   và (b) cho phép header XUỐNG DÒNG — nếu không, mục “Quản trị” bị đẩy ra ngoài và trang bị cuộn ngang
   (đo thật ở 390px: scrollWidth 464px > 390px trước khi sửa). */
@media (max-width: 620px) {
    .site-header__inner { gap: 10px 12px; padding: 10px 14px; flex-wrap: wrap; }
    .site-nav { gap: 12px; font-size: 14px; flex-wrap: wrap; }
    .site-nav__link, .site-nav__admin { white-space: nowrap; }
    .brand__text small { display: none; }
    .brand__logo { max-height: min(var(--site-logo-h, 40px), 38px); max-width: 46vw; }
    .brand--logo { flex: 1 1 auto; min-width: 0; }
}

/* =====================================================================
   R26 — TRANG CHỦ LANDING: GỬI PDF NGAY BANNER ĐẦU
   Cấu trúc: hero (2 cột: lời chào + khối gửi PDF thật · cột phụ: xấp bìa + số liệu + cam kết)
   → “Tài liệu mới nhất” (lưới bìa + chip danh mục) → “Vì sao chọn” (4 thẻ đặc trưng).
   ===================================================================== */

/* ---------- HERO ---------- */
.home-hero { padding: 30px 0 22px; }
.home-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
    gap: 40px;
    align-items: start;
}
.home-hero__cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }


/* Ô tìm kiếm nhanh đã được GỠ khỏi trang chủ (30/09): tìm kiếm nằm ở /thu-vien và /tim-kiem.
   Tệp `assets/js/home-search.js` + API `/api/v1/public/search` vẫn giữ nguyên để dùng lại. */

/* Thẻ “Gửi PDF” trong hero — nền SÁNG để biểu mẫu đọc rõ, viền trên màu navy như “cửa sổ tải lên” */
.upload-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 22px 24px;
    margin: 0 0 6px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--jd-border);
    box-shadow: 0 22px 50px rgba(5, 21, 47, .12);
}
.upload-card__title { margin: 0; font-size: 20px; letter-spacing: -.3px; color: var(--brand-navy); }

/* Biến thể gọn cho hero: khung kéo-thả thấp hơn, các ô tuỳ chọn gấp trong <details> */
.up-form--hero .up-drop { padding: 22px 16px; }
.up-form--hero .up-drop__icon { font-size: 26px; }
.up-more { margin-top: 2px; }
.up-more > summary {
    cursor: pointer;
    color: var(--brand-blue);
    font-size: 13.5px;
    font-weight: 600;
}
.up-more[open] > summary { margin-bottom: 10px; }

/* (R30) Ô tìm kiếm và dải số liệu của trang chủ đã được gỡ - xem khối R30 ở cuối tệp. */

/* 3 bước compact: 1 hàng, KHÔNG dùng thẻ để không chiếm chỗ */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px 22px;
}
.step { display: grid; grid-template-columns: auto 1fr; gap: 3px 11px; align-content: start; }
.step__num {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--jd-primary);
    font-weight: 700;
    font-size: 13px;
}
.step__title { font-weight: 600; font-size: 15px; }
.step__text { color: var(--jd-text-muted); font-size: 13.5px; line-height: 1.55; }

@media (max-width: 980px) {
    .home-hero__grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 620px) {
    .home-hero { padding-top: 20px; }
    .upload-card { padding: 18px; border-radius: 16px; }
}

/* =====================================================================
   R24 — Gửi PDF công khai (/tai-len) + trang theo dõi (/tai-len/{token})
   ===================================================================== */

.up-head { max-width: 800px; margin: 0 0 22px; }
.up-head__eyebrow {
    margin: 0 0 10px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--jd-primary);
}
.up-head h1 { margin: 0 0 10px; font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.6px; }
.up-head__lead { margin: 0 0 16px; color: #3f4d63; font-size: 15.5px; line-height: 1.65; }
.up-head__steps { margin-top: 2px; }

.up-form { max-width: 800px; display: flex; flex-direction: column; gap: 16px; }

.up-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 30px 20px;
    text-align: center;
    background: var(--jd-surface);
    border: 2px dashed var(--jd-border);
    border-radius: 16px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.up-drop:hover, .up-drop.is-over { border-color: var(--jd-primary); background: #f5f9ff; }
.up-drop:focus-visible { outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 2px; }
.up-drop__icon { font-size: 30px; color: var(--jd-primary); }
.up-drop__hint { color: var(--jd-text-muted); font-size: 13.5px; }

.up-picked {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--jd-surface);
    border: 1px solid var(--jd-border);
    border-radius: var(--jd-radius);
}
.up-picked__cover { width: 60px; height: 80px; border-radius: 6px; background: #eef2f7; border: 1px solid var(--jd-border); }
.up-picked__text { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; min-width: 0; }
.up-picked__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.up-picked__meta { color: var(--jd-text-muted); font-size: 13.5px; }

.up-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.up-field--wide { grid-column: 1 / -1; }
.up-field > span { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.up-field em { color: var(--jd-danger); font-style: normal; }
.up-field input, .up-field select, .up-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--jd-border);
    border-radius: 9px;
    /* 16px là ngưỡng cứng của iOS Safari: nhỏ hơn thì Safari TỰ PHÓNG TO trang khi focus. */
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    color: inherit;
}
.up-field input:focus, .up-field select:focus, .up-field textarea:focus {
    outline: none;
    border-color: var(--jd-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.up-agree { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.55; }
.up-agree input { margin-top: 3px; }

/* Vùng chạm trên điện thoại: nút gửi/đổi tệp ≥ 44px (khuyến nghị của Apple/Google) */
@media (max-width: 767px) {
    .up-form .btn, .up-form .up-actions button, .up-form #upFileChange { min-height: 44px; }
    .up-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Logo thương hiệu của người gửi (R25) — khối tuỳ chọn, tách khỏi nhóm ô bắt buộc bằng nét đứt. */
.up-logo {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border: 1px dashed var(--jd-border);
    border-radius: var(--jd-radius);
    background: var(--jd-surface-soft, #f7f9fc);
}
.up-logo__head { display: flex; align-items: center; gap: 12px; }
.up-logo__preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    min-height: 52px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--jd-border);
    border-radius: 10px;
}
.up-logo__preview img { display: block; max-width: 180px; max-height: 44px; width: auto; height: auto; }
.up-logo__text { display: flex; flex-direction: column; gap: 2px; }
.up-logo__optional { color: var(--jd-text-muted); font-weight: 500; }
.up-logo__hint { color: var(--jd-text-muted); font-size: 13px; line-height: 1.5; max-width: 620px; }
.up-logo__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
/* Ô chọn tệp gốc của trình duyệt hiện nhãn tiếng Anh (“Choose File”) và khó tạo kiểu ⇒ ẩn đi, dùng
   <label for="upLogo"> làm nút “Chọn ảnh logo” (bấm vào nhãn vẫn mở hộp chọn tệp bình thường). */
.up-logo__file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.up-logo__row label.btn { cursor: pointer; }
.up-logo__meta { color: var(--jd-text-muted); font-size: 13px; }

/* Ô chống bot: nằm ngoài màn hình, người thật không thấy */
.up-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.up-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.up-note { color: var(--jd-text-muted); font-size: 13.5px; }
.up-progress__track { height: 8px; border-radius: 999px; background: #e6ecf5; overflow: hidden; }
.up-progress__bar { display: block; height: 100%; width: 0; background: var(--jd-primary); transition: width .2s ease; }
.up-progress__text { margin: 8px 0 0; color: var(--jd-text-muted); font-size: 13.5px; }
.up-error {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--jd-danger-bg);
    color: var(--jd-danger);
    font-size: 14px;
}
.up-foot { margin: 22px 0 0; color: var(--jd-text-muted); font-size: 13.5px; }

/* Trang theo dõi */
.track { max-width: 800px; }
.track h1 { margin: 6px 0 14px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.4px; }
.track__badge {
    display: inline-block;
    padding: 5px 13px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--jd-primary-dark);
    font-weight: 600;
    font-size: 13.5px;
}
.track__status--converted .track__badge { background: var(--jd-success-bg); color: var(--jd-success); }
.track__status--rejected .track__badge { background: var(--jd-danger-bg); color: var(--jd-danger); }
.track__status--expired .track__badge { background: #eef2f7; color: var(--jd-text-muted); }
.track__reason { display: block; margin-top: 8px; color: var(--jd-danger); font-size: 14px; }

.track__steps { list-style: none; margin: 20px 0 22px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.track__step { display: flex; gap: 12px; align-items: flex-start; }
.track__dot { width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: #cbd5e1; }
.track__step.is-done .track__dot { background: var(--jd-success); }
.track__step.is-current .track__dot { background: var(--jd-primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.track__step-text { display: flex; flex-direction: column; gap: 2px; }
.track__step-text strong { font-size: 15px; }
.track__step-text span { color: var(--jd-text-muted); font-size: 13.5px; }

.track__meta { margin: 0 0 18px; display: flex; flex-direction: column; gap: 4px; }
.track__meta dt { color: var(--jd-text-muted); font-size: 13px; }
.track__meta dd { margin: 0 0 8px; font-size: 14px; }
/* Logo khách tải kèm (R25): ảnh nhỏ cạnh dòng mô tả, không làm khối thông tin cao thêm nhiều. */
.track__logo dd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.track__logo-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 32px;
    padding: 3px 8px;
    background: #fff;
    border: 1px solid var(--jd-border);
    border-radius: 8px;
}
.track__logo-thumb img { display: block; max-width: 120px; max-height: 24px; width: auto; height: auto; }

/* =====================================================================
   R26 — HEADER TRONG SUỐT + TRẠNG THÁI TÀI KHOẢN
   ===================================================================== */

.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; }

/* Nền trang chủ: dải sáng phía trên để header TRONG SUỐT hoà vào banner (không cần ảnh nền).
   body chỉ có class `home-page` ở trang chủ (HomeController truyền `bodyClass`). */
body.home-page { background: linear-gradient(180deg, #eef3fc 0%, #f8fafe 46%, var(--jd-bg) 100%); }

.site-header--solid { background: #fff; }
.site-header--overlay { background: transparent; border-bottom-color: transparent; box-shadow: none; }
.site-header--overlay.is-scrolled {
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom-color: var(--jd-border);
    box-shadow: 0 10px 28px rgba(5, 21, 47, .09);
}

/* Chưa đăng nhập: nút Đăng nhập (nút ĐẶC màu thương hiệu để nổi trên header trong suốt).
   Đã đăng nhập: chip tài khoản (xem .user-chip bên dưới). */
.site-nav__login {
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--brand-blue);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: background-color .15s ease, transform .15s ease;
}
.site-nav__login:hover { background: #013bc4; color: #fff; text-decoration: none; transform: translateY(-1px); }
.site-header--overlay .site-nav__login { background: var(--brand-blue); }

/* CTA chính của landing (R29): chỉ hiện với KHÁCH, trỏ thẳng vào luồng gửi PDF.
   Ở màn hẹp thì ẩn để header không bị tràn ngang (thẻ gửi PDF ngay dưới đã là CTA). */
.site-nav__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    background: var(--brand-blue);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(1, 73, 242, .22);
    transition: background-color .15s ease, transform .15s ease;
}
.site-nav__cta:hover { background: #013bc4; color: #fff; text-decoration: none; transform: translateY(-1px); }
@media (max-width: 720px) { .site-nav__cta { display: none; } }

/* Menu tài khoản — <details> nên không cần JS; bấm ra ngoài không tự đóng (đổi lại nếu cần) */
.user-chip { position: relative; }
.user-chip > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 5px;
    border-radius: 999px;
    border: 1px solid var(--jd-border);
    background: #fff;
    cursor: pointer;
    list-style: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.user-chip > summary::-webkit-details-marker { display: none; }
.user-chip[open] > summary, .user-chip > summary:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.user-chip__avatar {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--brand-navy);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
}
.user-chip__caret { color: var(--jd-text-muted); font-size: 11px; }
.user-chip__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 200px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--jd-border);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(5, 21, 47, .16);
    display: flex;
    flex-direction: column;
    z-index: 30;
}
.user-chip__menu a, .user-chip__menu button {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--jd-text);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}
.user-chip__menu a:hover, .user-chip__menu button:hover {
    background: var(--brand-blue-soft);
    color: var(--brand-blue);
    text-decoration: none;
}
.user-chip__logout { margin: 0; }

.track__bookmark {
    padding: 14px 16px;
    margin-bottom: 18px;
    background: var(--jd-surface);
    border: 1px solid var(--jd-border);
    border-radius: var(--jd-radius);
}
.track__bookmark p { margin: 0 0 8px; color: var(--jd-text-muted); font-size: 13.5px; }
.track__url { display: block; word-break: break-all; font-size: 13px; }
.track__actions { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.track__note { color: var(--jd-text-muted); font-size: 14px; }

@media (max-width: 620px) {
    .up-fields { grid-template-columns: 1fr; }
    .up-drop { padding: 24px 14px; }
    .up-actions .btn { width: 100%; }
}

/* =====================================================================
/* =====================================================================
   R30 — TRANG CHỦ LANDING (theo template `it-flipbook-template-home.png`)
   Chỉ còn: hero 2 cột (4 đặc trưng · thẻ GỬI PDF) + header/footer.
   Đã GỠ theo yêu cầu 30/09: ô tìm kiếm · khối “Mới lên thư viện” · dải số liệu · xấp bìa trang trí
   (CSS của chúng đã xoá; `book-row.php` + `previewUrl()/time_ago()` vẫn giữ để dựng lại khi cần).
   Màu/bo góc lấy từ logo (--brand-*) và token sẵn có (--jd-*).
   ===================================================================== */

/* ---------- HERO ---------- */
.home-hero--landing { padding: 26px 0 6px; }
.home-hero--landing .home-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
    gap: 40px;
    align-items: center;
}
.home-hero--landing .home-hero__copy { min-width: 0; }

.home-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 14px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--brand-blue-soft);
    color: var(--brand-blue);
    font-size: 12.5px;
    font-weight: 700;
}
.home-hero__title {
    margin: 1px 0 14px;
    font-size: 46px;
    line-height: 1.2;
    letter-spacing: -1px;
    color: var(--brand-navy);
}
.home-hero__accent { color: var(--brand-blue); }
.home-hero__lead { margin: 0 0 22px; max-width: 48ch; color: #3d4b62; font-size: 16px; line-height: 1.6; }
.home-hero__fallback-title { margin: 0 0 6px; font-size: 24px; color: var(--brand-navy); }

/* 4 đặc trưng: icon trong ô trắng + tiêu đề đậm + một dòng mô tả */
.home-feature {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}
.home-feature__item { display: flex; align-items: flex-start; gap: 11px; }
.home-feature__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #fff;
    border: 1px solid var(--jd-border);
    color: var(--brand-blue);
    box-shadow: 0 6px 16px rgba(5, 21, 47, .06);
}
.home-feature__icon svg { width: 19px; height: 19px; }
.home-feature__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-feature__text strong { font-size: 14px; color: var(--brand-navy); }
.home-feature__text span { color: var(--jd-text-muted); font-size: 12.5px; line-height: 1.5; }

/* ---------- Thẻ gửi PDF (cột phải) ---------- */
.home-hero__panel { min-width: 0; }
.home-hero--landing .upload-card {
    position: relative;
    z-index: 1;
    gap: 12px;
    padding: 22px 22px 20px;
    margin: 0;
    border-radius: 20px;
}
.home-hero--landing .upload-card__title { margin: 0; font-size: clamp(21px, 2vw, 25px); letter-spacing: -.5px; color: var(--brand-navy); }
.home-hero--landing .up-form--hero { gap: 9px; }
.home-hero--landing .up-form--hero .up-drop { padding: 28px 16px; }
.home-hero--landing .up-form--hero .up-drop__icon { font-size: 26px; }
.up-fields--required { margin-bottom: 0; }
.home-hero--landing .up-agree { gap: 8px; font-size: 13px; }
/* Bớt chữ trên trang chủ: dòng “mỗi ngày 3 tài liệu · xem hướng dẫn” chỉ còn ở /tai-len */
.home-hero--landing .up-note { display: none; }

/* Xấp bìa trang trí, khối “Mới lên thư viện” và dải số liệu đã được GỠ khỏi trang chủ (R30):
   xem yêu cầu 30/09 trong `docs/CHANGELOG.md`. Partial `views/partials/book-row.php`,
   helper `LibraryService::previewUrl()/previewThumbUrl()` và `time_ago()` vẫn được giữ nguyên
   để dựng lại khối danh sách khi cần (khi đó nhớ thêm lại 2 cột `page_image`/`page_thumb`
   vào `LibraryService::CARD_COLUMNS`). */


/* ---------- Màn hình hẹp ---------- */
@media (max-width: 980px) {
    .home-hero--landing .home-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    /* Việc chính (gửi PDF) phải nằm TRƯỚC phần giới thiệu trên điện thoại */
    .home-hero__panel { order: -1; }
}

@media (max-width: 620px) {
    .home-hero--landing { padding: 16px 0 4px; }
    .home-hero__lead { font-size: 15px; }
    .home-feature { gap: 12px 14px; }
    .home-feature__text span { font-size: 12px; }
}

/* Hàng “3 bước” của trang /tai-len: số và nhãn nằm cùng dòng cho gọn */
.steps--compact .step { grid-template-columns: auto auto; align-items: center; gap: 4px 7px; }
.steps--compact .step__num { grid-row: auto; width: 21px; height: 21px; font-size: 11.5px; }
.steps--compact .step__title { font-size: 13px; }

/* =====================================================================
   R32 — THÀNH VIÊN: thẻ mời đăng ký (trang chủ), popup đăng nhập/đăng ký,
   khối điều khoản dưới ô đồng ý, và dashboard “Tài liệu của tôi”.
   ===================================================================== */

/* --- Thẻ mời đăng ký thay cho form gửi tài liệu khi khách chưa đăng nhập --- */
.upload-card--gate { text-align: left; }
.upload-card__kicker {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--brand, #2563eb);
}
.upload-card--gate .upload-card__lead { margin: 8px 0 14px; font-size: 14px; color: var(--muted, #4b5563); }
.upload-card__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.upload-card__actions .btn { flex: 1 1 170px; }

/* --- Khối điều khoản bung ra dưới ô đồng ý --- */
.up-terms { margin: 2px 0 10px; font-size: 13px; }
.up-terms > summary {
    cursor: pointer;
    color: var(--brand, #2563eb);
    font-weight: 600;
    list-style: none;
}
.up-terms > summary::-webkit-details-marker { display: none; }
.up-terms > summary::before { content: 'ⓘ '; }
.up-terms[open] > summary { margin-bottom: 6px; }
.up-terms ul { margin: 0; padding-left: 18px; color: var(--muted, #4b5563); }
.up-terms li + li { margin-top: 4px; }

/* --- Popup thành viên --- */
.ma { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ma[hidden] { display: none; }
.ma__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.ma__dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}
.ma__x {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
}
.ma__x:hover { background: #f1f5f9; color: #0f172a; }
.ma__kicker {
    margin: 0 0 2px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand, #2563eb);
}
.ma__title { margin: 0 0 6px; font-size: 21px; line-height: 1.25; color: #0f172a; }
.ma__lead { margin: 0 0 16px; font-size: 13.5px; color: var(--muted, #4b5563); }
.ma__lead--sm { font-size: 13px; }

.ma__tabs { display: flex; gap: 4px; padding: 4px; background: #f1f5f9; border-radius: 10px; margin-bottom: 16px; }
.ma__tab {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 8px 6px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}
.ma__tab.is-active { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

.ma__alert { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #fef2f2; color: #b91c1c; font-size: 13px; }
.ma__alert.is-ok { background: #ecfdf5; color: #047857; }

.ma__form { display: none; }
.ma__form.is-active { display: block; }
.ma__field { display: block; margin-bottom: 12px; }
.ma__label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: #334155; }
.ma__field input,
.ma__field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 16px; /* ≥16px để iOS Safari không tự phóng to khi focus */
    font-family: inherit;
    color: #0f172a;
    background: #fff;
}
.ma__field input:focus,
.ma__field textarea:focus { outline: 2px solid rgba(37, 99, 235, .35); border-color: var(--brand, #2563eb); }
.ma__hint { display: block; margin-top: 4px; font-size: 12px; color: #64748b; }
.ma__check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0 14px; font-size: 13px; color: #334155; }
.ma__check input { margin-top: 2px; }
.ma__link {
    border: 0;
    background: none;
    padding: 0;
    color: var(--brand, #2563eb);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
.ma__submit { width: 100%; }
.ma__swap { margin: 12px 0 0; font-size: 13px; color: var(--muted, #4b5563); text-align: center; }

.ma__google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
}
.ma__google:hover:not([disabled]) { background: #f8fafc; }
.ma__google[disabled] { opacity: .55; cursor: not-allowed; }
.ma__or { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: 12px; color: #94a3b8; }
.ma__or::before,
.ma__or::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

.ma__terms { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #f8fafc; font-size: 12.5px; color: #475569; }
.ma__terms p { margin: 0 0 6px; }
.ma__terms ul { margin: 0; padding-left: 16px; }

.ma__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

html.ma-open { overflow: hidden; }

@media (max-width: 520px) {
    .ma { padding: 0; align-items: flex-end; }
    .ma__dialog { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; padding: 20px 18px 26px; }
}

/* --- Dashboard thành viên --- */
.member { padding: 28px 0 40px; }
.member__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.member__kicker {
    margin: 0 0 4px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand, #2563eb);
}
.member__title { margin: 0 0 6px; font-size: 26px; color: #0f172a; }
.member__lead { margin: 0; font-size: 14px; color: var(--muted, #4b5563); }
.member__cta { white-space: nowrap; }

.member-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0 22px;
    padding: 0;
    list-style: none;
}
.member-stat { padding: 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.member-stat__num { display: block; font-size: 22px; font-weight: 700; color: #0f172a; }
.member-stat__label { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted, #4b5563); }

.member-empty { padding: 32px 20px; border: 1px dashed #cbd5e1; border-radius: 14px; background: #f8fafc; text-align: center; }
.member-empty__title { margin: 0 0 6px; font-size: 17px; color: #0f172a; }
.member-empty__text { margin: 0 0 14px; font-size: 14px; color: var(--muted, #4b5563); }
.member-empty__note { margin: 0; font-size: 13px; color: #64748b; }

.member-table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
.member-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.member-table th,
.member-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid #f1f5f9; }
.member-table thead th { background: #f8fafc; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; white-space: nowrap; }
.member-table tbody tr:last-child td { border-bottom: 0; }
.member-table__title { display: block; font-weight: 600; color: #0f172a; }
.member-table__meta { display: block; margin-top: 3px; font-size: 12.5px; color: #64748b; }
.member-table__reject { display: block; margin-top: 6px; font-size: 12.5px; color: #b91c1c; }
.member-table__date { font-size: 13px; color: #475569; white-space: nowrap; }
.member-table__dash { color: #cbd5e1; }
.member-table__note { font-size: 13px; color: #64748b; }
.member-table__act { min-width: 190px; }
.member-table__act-col { width: 190px; }

.member-link { display: inline-block; border: 0; background: none; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--brand, #2563eb); text-decoration: none; cursor: pointer; }
.member-link:hover { text-decoration: underline; }
.member-link--danger { color: #b91c1c; }
.member-del { display: inline; }

.member-edit { display: inline-block; margin-left: 10px; }
.member-edit > summary { list-style: none; cursor: pointer; }
.member-edit > summary::-webkit-details-marker { display: none; }
.member-edit__form { margin-top: 10px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; width: min(340px, 70vw); }
.member-edit__field { display: block; margin-bottom: 8px; font-size: 12.5px; color: #475569; }
.member-edit__field span { display: block; margin-bottom: 4px; font-weight: 600; }
.member-edit__field input,
.member-edit__field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px; /* ≥16px: tránh iOS tự zoom khi focus */
    background: #fff;
}

/* Trạng thái phiếu gửi */
.mst { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.mst--received { background: #fef3c7; color: #92400e; }
.mst--reviewing { background: #dbeafe; color: #1d4ed8; }
.mst--converted { background: #d1fae5; color: #047857; }
.mst--rejected { background: #fee2e2; color: #b91c1c; }
.mst--expired { background: #f1f5f9; color: #475569; }

@media (max-width: 900px) {
    .member-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Điện thoại: bảng chuyển thành danh sách thẻ (nhãn lấy từ `data-label`) */
@media (max-width: 720px) {
    .member-table-wrap { border: 0; overflow: visible; background: transparent; }
    .member-table thead { display: none; }
    .member-table,
    .member-table tbody,
    .member-table tr,
    .member-table td { display: block; width: 100%; }
    .member-table tr { margin-bottom: 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 6px 4px; }
    .member-table td { border-bottom: 1px dashed #f1f5f9; padding: 10px 12px; }
    .member-table td:last-child { border-bottom: 0; }
    .member-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        font-size: 11.5px;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: #94a3b8;
    }
    .member-table__act { min-width: 0; }
    .member-edit__form { width: 100%; }
}
