/* =====================================================================
   THU VIEN SO DAI HOC - DESIGN SYSTEM
   Tong mau: xanh la / xanh ngoc / trang - phong cach AI hien dai
   ===================================================================== */

:root {
  --primary-50:  #edfaf2;
  --primary-100: #cef2dc;
  --primary-500: #22c55e;
  --primary-600: #1ca24d;
  --primary-700: #16803d;
  --cyan-400:    #46dba3;
  --cyan-500:    #18d28c;
  --sky-500:     #43ce76;
  --gradient-primary: linear-gradient(135deg, var(--sky-500), var(--primary-600));
  --gradient-soft: linear-gradient(135deg, #edfbf3, #f3fdf7);

  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --success: #16a34a;
  --danger:  #dc2626;
  --warning: #d97706;
  --info:    var(--sky-500);

  --radius-sm: 3px;
  --radius: 3px;
  --radius-lg: 3px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --header-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif;
  color: var(--gray-800);
  background: #ffffff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0 0 .5em; color: var(--gray-900); font-weight: 700; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- Buttons (dong bo phong cach glow AI voi hero) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 3px; font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; cursor: pointer; transition: all .2s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(70,219,163,.4); }
.btn-primary {
  background: var(--gradient-primary); color: #fff;
  box-shadow: 0 6px 18px rgba(67,206,118,.32), 0 2px 6px rgba(28,162,77,.22);
}
.btn-primary:hover {
  filter: brightness(1.08); transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(67,206,118,.42), 0 4px 12px rgba(28,162,77,.3);
}
.btn-primary:active { transform: translateY(0); filter: brightness(1); }
.btn-outline { background: #fff; border-color: var(--gray-200); color: var(--gray-700); }
.btn-outline:hover {
  border-color: var(--sky-500); color: var(--primary-600); transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(67,206,118,.14), 0 6px 14px rgba(67,206,118,.12);
}
.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; border-color: #fca5a5; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(220,38,38,.16); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--gray-100);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo { height: 42px; width: auto; }
.brand-icon {
  width: 44px; height: 44px; border-radius: 3px; background: var(--gradient-primary);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px;
}

.main-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.main-nav > a, .nav-dropdown > a {
  padding: 10px 14px; border-radius: 3px; font-weight: 600; font-size: 14.5px; color: var(--gray-700);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.main-nav > a, .main-nav .nav-dropdown > a { padding: 10px 9px; font-size: 13.5px; }
.main-nav > a:hover, .nav-dropdown > a:hover { background: var(--primary-50); color: var(--primary-600); }
.nav-dropdown { position: relative; }
.nav-dropdown .dropdown-panel {
  position: absolute; top: 100%; left: 0; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 10px; min-width: 240px; opacity: 0; visibility: hidden;
  transform: translateY(8px); transition: all .18s ease; border: 1px solid var(--gray-100);
}
.nav-dropdown:hover .dropdown-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-panel a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 3px; font-size: 14px; color: var(--gray-700); font-weight: 500; }
.dropdown-panel a:hover { background: var(--primary-50); color: var(--primary-600); }
.user-dropdown .dropdown-panel { right: 0; left: auto; }

.header-search { display: flex; align-items: center; background: var(--gray-100); border-radius: 3px; padding: 4px 4px 4px 16px; width: 210px; position: relative; }
.header-search input { border: none; background: transparent; outline: none; flex: 1; font-size: 14px; padding: 8px 0; min-width: 0; }
.header-search button[type="submit"] { background: var(--gradient-primary); color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- Live search suggestions ---------- */
.search-suggest { display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 120; max-height: 320px; overflow-y: auto; }
.search-suggest a { display: block; padding: 10px 16px; font-size: 13.5px; color: var(--gray-700); border-bottom: 1px solid var(--gray-100); }
.search-suggest a:last-child { border-bottom: none; }
.search-suggest a:hover { background: var(--gray-50); color: var(--primary-600); }

/* ---------- Voice search ---------- */
.voice-search-btn { background: transparent; color: var(--gray-500); border: none; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: color .2s ease, background .2s ease; }
.voice-search-btn:hover { color: var(--primary-600); background: var(--gray-100); }
.voice-search-btn.listening { color: #fff; background: var(--danger); animation: voicePulse 1.2s ease-in-out infinite; }
@keyframes voicePulse {
  0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); }
  70%  { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.ai-search-panel { display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 130; text-align: left; max-height: 70vh; overflow-y: auto; }
.ai-search-panel.open { display: block; }
.ai-search-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--gray-100); }
.ai-search-panel-title { font-size: 13.5px; font-weight: 700; color: var(--gray-800); }
.ai-search-panel-title i { color: var(--primary-600); margin-right: 4px; }
.ai-search-panel-close { background: none; border: none; font-size: 20px; line-height: 1; color: var(--gray-400); flex-shrink: 0; }
.ai-search-panel-close:hover { color: var(--gray-700); }
.ai-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-filter-chip { background: var(--gray-100); color: var(--primary-600); font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.ai-search-panel-loading { padding: 24px 16px; text-align: center; color: var(--gray-500); font-size: 13.5px; }
.ai-search-panel-results { padding: 12px; }
.ai-search-panel-results .doc-grid { grid-template-columns: 1fr; gap: 8px; }
.ai-search-panel-footer { padding: 10px 16px; border-top: 1px solid var(--gray-100); text-align: center; }
.ai-search-panel-footer a { font-size: 13px; font-weight: 600; color: var(--primary-600); }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn-user { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 3px; background: var(--gray-100); }
.btn-user i { font-size: 20px; color: var(--primary-600); }
.hamburger { display: none; background: none; border: none; font-size: 22px; color: var(--gray-700); }

/* ---------- Hero (AI deep-green) ---------- */
.hero {
  background:
    radial-gradient(circle at 16% 22%, rgba(70,219,163,.24), transparent 42%),
    radial-gradient(circle at 84% 12%, rgba(34,197,94,.30), transparent 46%),
    radial-gradient(circle at 50% 105%, rgba(28,162,77,.38), transparent 55%),
    linear-gradient(160deg, #030a06 0%, #06231a 45%, #0a3d24 100%);
  padding: 92px 0 68px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(148,163,184,.18) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 15%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 15%, #000 40%, transparent 100%);
  opacity: .6;
}
.hero::after {
  content: '';
  position: absolute; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(70,219,163,.35), transparent 70%);
  top: -200px; right: -140px; filter: blur(10px);
  animation: heroGlowDrift 10s ease-in-out infinite alternate;
}
@keyframes heroGlowDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-30px, 30px) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .hero::after { animation: none; }
}
.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 780px; }
.hero h1 {
  font-size: 44px; letter-spacing: -.5px; line-height: 1.25; margin-bottom: 4px;
  background: linear-gradient(120deg, #fff6c8 0%, #ffd600 50%, #ffab00 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 60px rgba(255,214,0,.3);
}
.hero p { font-size: 17px; color: #ffffff; margin-bottom: 30px; }
.hero-search {
  display: flex; align-items: center; background: #fff; border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(70,219,163,.3), 0 20px 50px rgba(2,6,23,.55);
  padding: 6px 6px 6px 22px; max-width: 640px; margin: 0 auto; position: relative;
  transition: box-shadow .2s ease;
}
.hero-search:focus-within { box-shadow: 0 0 0 3px rgba(70,219,163,.45), 0 20px 50px rgba(2,6,23,.6); }
.hero-search i { color: var(--gray-400); margin-right: 12px; }
.hero-search input { flex: 1; border: none; outline: none; font-size: 15.5px; padding: 12px 0; min-width: 0; }
.hero-search button[type="submit"] { background: var(--gradient-primary); color: #fff; border: none; padding: 12px 28px; border-radius: 3px; font-weight: 700; flex-shrink: 0; }
.hero-search .voice-search-btn { width: 40px; height: 40px; }
.hero-links { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hero-links a {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,214,0,.25); backdrop-filter: blur(6px);
  padding: 9px 16px; border-radius: 3px; font-size: 13.5px; font-weight: 600; color: #ffd54f;
  display: inline-flex; align-items: center; gap: 8px; transition: all .2s ease;
}
.hero-links a:hover { color: #fff; background: rgba(255,214,0,.18); border-color: rgba(255,214,0,.5); transform: translateY(-2px); }

.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 44px; position: relative; z-index: 1; }
.stat-item { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(6px); border-radius: var(--radius); padding: 20px 12px; }
.stat-item strong {
  display: block; font-size: 26px; font-weight: 800;
  background: linear-gradient(120deg, #fff6c8, #ffd600);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-item span { font-size: 13px; color: #ffe9a8; font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--gray-50); }
.section-title { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.section-title i { color: var(--sky-500); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.link-more { font-weight: 600; font-size: 14px; color: var(--primary-600); display: flex; align-items: center; gap: 6px; }

.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 22px; }
.category-tile {
  background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 22px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; font-weight: 600; font-size: 13.5px;
  color: var(--gray-700); box-shadow: var(--shadow-sm); transition: all .2s ease;
}
.category-tile i { font-size: 26px; color: var(--sky-500); }
.category-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary-100); color: var(--primary-600); }

/* ---------- Document cards ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-top: 22px; }
.doc-card { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: all .22s ease; display: flex; flex-direction: column; }
.doc-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: var(--primary-100); }
.doc-card-thumb { position: relative; height: 150px; background: var(--gradient-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.doc-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-card-icon { font-size: 42px; color: var(--sky-500); opacity: .55; }
.badge { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 3px; }
.badge-noisinh { background: var(--primary-600); color: #fff; }
.doc-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.doc-card-title { font-size: 15.5px; line-height: 1.4; min-height: 2.8em; }
.doc-card-title a:hover { color: var(--primary-600); }
.doc-card-meta { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--gray-500); }
.doc-card-meta i { width: 14px; color: var(--sky-500); }
.doc-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--gray-200); }
.doc-card-views { font-size: 12px; color: var(--gray-400); }

/* ---------- CTA ---------- */
.cta-section { background: var(--gradient-primary); border-radius: var(--radius-lg); margin: 0 20px; max-width: 1240px; margin-inline: auto; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #fff; flex-wrap: wrap; padding: 44px 40px; }
.cta-inner h2 { color: #fff; font-size: 24px; }
.cta-inner p { color: rgba(255,255,255,.85); margin: 0; }
.cta-section .btn-primary { background: #fff; color: var(--primary-600); box-shadow: none; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; overflow: hidden; margin-top: 40px; color: #ffffff;
  background:
    radial-gradient(circle at 15% 0%, rgba(70,219,163,.16), transparent 45%),
    radial-gradient(circle at 85% 100%, rgba(34,197,94,.26), transparent 50%),
    linear-gradient(165deg, #030a06 0%, #06231a 55%, #0a3d24 100%);
}
.site-footer::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(148,163,184,.14) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 85% 100% at 50% 0%, #000 30%, transparent 90%);
  mask-image: radial-gradient(ellipse 85% 100% at 50% 0%, #000 30%, transparent 90%);
  opacity: .5;
}
.footer-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px; padding: 56px 20px 32px; }
.footer-col h3 {
  background: linear-gradient(120deg, #ffffff 0%, var(--cyan-400) 65%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 13.5px; color: #ffffff; transition: color .2s ease; }
.footer-col a:hover { color: var(--cyan-400); }
.footer-contact li { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: #ffffff; }
.footer-contact i { color: var(--sky-500); margin-top: 3px; }
.footer-stats { text-align: right; }
.footer-stats .footer-contact li { justify-content: flex-end; }
.footer-stats .footer-contact i { order: 2; margin-top: 3px; }
.visit-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 16px; }
.visit-stat { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #ffffff; }
.visit-stat i { color: var(--sky-500); font-size: 12px; }
.visit-stat-num { font-weight: 700; color: #fff; }
.visit-stat-label { opacity: .7; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px);
  transition: all .2s ease;
}
.footer-social a:hover { background: rgba(70,219,163,.16); border-color: rgba(70,219,163,.45); color: var(--cyan-400); transform: translateY(-2px); }
.footer-bottom { position: relative; z-index: 1; border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; font-size: 12.5px; color: #ffffff; }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-bottom-credit { text-align: right; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; color: var(--gray-700); }
.form-control {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 14.5px; outline: none; transition: border-color .15s, box-shadow .15s; background: #fff;
}
.form-control:focus { border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 5px; }
.form-error { font-size: 12.5px; color: var(--danger); margin-top: 5px; font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.form-card { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-sm); max-width: 480px; margin: 60px auto; }
.form-card h2 { text-align: center; }
.form-card-sub { text-align: center; color: var(--gray-500); font-size: 13.5px; margin-bottom: 26px; }
.form-links { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--gray-500); }
.form-links a { color: var(--primary-600); font-weight: 600; }

/* ---------- Filters / listing ---------- */
.page-header {
  position: relative; overflow: hidden; padding: 40px 0; margin-bottom: 36px;
  background:
    radial-gradient(circle at 12% 15%, rgba(70,219,163,.2), transparent 45%),
    radial-gradient(circle at 88% 90%, rgba(34,197,94,.26), transparent 50%),
    linear-gradient(160deg, #030a06 0%, #06231a 55%, #0a3d24 100%);
}
.page-header::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(148,163,184,.14) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 75% 100% at 50% 0%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 100% at 50% 0%, #000 40%, transparent 100%);
  opacity: .5;
}
.page-header .container { position: relative; z-index: 1; }
.page-header h1 {
  font-size: 26px;
  background: linear-gradient(120deg, #ffffff 0%, var(--cyan-400) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-header p { color: #a9b8d6; margin-top: 8px; }
.page-header .breadcrumb { color: #8fa2c7; }
.page-header .breadcrumb a { color: #c3d0ea; }
.page-header .breadcrumb a:hover { color: var(--cyan-400); }

.breadcrumb { font-size: 13px; color: var(--gray-500); margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--primary-600); }
.listing-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.filter-box { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); position: sticky; top: calc(var(--header-h) + 16px); }
.filter-box h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); margin: 18px 0 10px; }
.filter-box h4:first-child { margin-top: 0; }
.filter-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.filter-list label { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--gray-700); cursor: pointer; }
.filter-actions { display: flex; gap: 8px; margin-top: 20px; }
.listing-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.result-count { font-size: 14px; color: var(--gray-600); }
.result-count strong { color: var(--primary-600); }
.sort-select { padding: 9px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-200); font-size: 13.5px; }
.filter-open-btn { display: none; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-50); color: var(--primary-700); padding: 6px 12px; border-radius: 3px; font-size: 12.5px; font-weight: 600; }
.filter-chip button { border: none; background: none; color: inherit; cursor: pointer; font-size: 13px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-state i { font-size: 46px; margin-bottom: 16px; color: var(--gray-300); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; }
.page-link { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 3px; border: 1.5px solid var(--gray-200); font-size: 13.5px; font-weight: 600; color: var(--gray-600); }
.page-link.active { background: var(--gradient-primary); color: #fff; border-color: transparent; }
.page-link:hover:not(.active) { border-color: var(--primary-400); color: var(--primary-600); }
.page-dots { display: flex; align-items: center; padding: 0 4px; color: var(--gray-400); }

/* ---------- Detail page ---------- */
.detail-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; align-items: start; }
.detail-main { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); }
.detail-title { font-size: 24px; margin-bottom: 16px; }
.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tag { background: var(--gray-100); color: var(--gray-600); padding: 5px 12px; border-radius: 3px; font-size: 12px; font-weight: 600; }
.tag-access { background: #ecfdf5; color: var(--success); }
.detail-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin: 22px 0; padding: 20px; background: var(--gray-50); border-radius: var(--radius); }
.detail-sidebar .detail-info-grid { grid-template-columns: 1fr; gap: 12px; margin: 0; padding: 0; background: none; }
.info-item { font-size: 13.5px; }
.info-item .label { color: var(--gray-400); display: block; margin-bottom: 3px; font-size: 12px; }
.info-item .value { font-weight: 600; color: var(--gray-800); }
.detail-abstract h3 { font-size: 16px; }
.detail-abstract p { color: var(--gray-600); text-align: justify; }
.keyword-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.detail-actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.detail-sidebar { display: flex; flex-direction: column; gap: 20px; }
.side-card { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.side-card h4 { font-size: 14px; margin-bottom: 14px; }
.pdf-preview-hint { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--primary-700); background: var(--primary-50); border: 1px solid var(--primary-100); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.pdf-viewer { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pdf-loading { padding: 60px 0; color: var(--gray-500); font-size: 14px; }
.pdf-page-canvas { width: 100%; max-width: 100%; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.pdf-lock-notice { width: 100%; text-align: center; padding: 32px 20px; margin-top: 8px; background: var(--gray-50); border: 1px dashed var(--gray-300); border-radius: var(--radius); color: var(--gray-600); }
.pdf-lock-notice i { font-size: 22px; color: var(--primary-600); margin-bottom: 10px; display: block; }
.pdf-lock-notice p { margin: 4px 0; font-size: 13.5px; }

/* ---------- Author / Faculty ---------- */
.author-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.author-card { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow-sm); transition: all .2s; }
.author-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.author-avatar { width: 68px; height: 68px; border-radius: 50%; background: var(--gradient-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; margin: 0 auto 14px; }
.author-card h3 { font-size: 15.5px; margin-bottom: 6px; }
.author-card p { font-size: 12.5px; color: var(--gray-500); margin: 0 0 10px; }
.author-count { font-size: 12.5px; font-weight: 700; color: var(--primary-600); }

.faculty-tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.faculty-card { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.faculty-card h3 { font-size: 16.5px; display: flex; align-items: center; gap: 10px; }
.faculty-card h3 i { color: var(--sky-500); }
.faculty-majors { margin-top: 14px; padding-left: 6px; }
.faculty-majors li { padding: 7px 0; font-size: 13.5px; color: var(--gray-600); border-top: 1px dashed var(--gray-200); display: flex; align-items: center; gap: 8px; }
.faculty-majors li:first-child { border-top: none; }
.faculty-majors li i { color: var(--gray-300); font-size: 11px; }
.faculty-doc-count { display: inline-block; margin-top: 14px; font-size: 12.5px; font-weight: 700; color: var(--primary-600); }

/* ---------- Account area ---------- */
.account-layout { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.account-sidebar { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); position: sticky; top: calc(var(--header-h) + 16px); }
.account-user { text-align: center; padding-bottom: 18px; border-bottom: 1px solid var(--gray-100); margin-bottom: 14px; }
.account-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--gradient-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; margin: 0 auto 10px; }
.account-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 3px; font-size: 14px; font-weight: 600; color: var(--gray-600); margin-bottom: 3px; }
.account-nav a.active, .account-nav a:hover { background: var(--primary-50); color: var(--primary-600); }
.account-content { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--gray-100); }
.table th { color: var(--gray-500); font-weight: 700; text-transform: uppercase; font-size: 11.5px; letter-spacing: .03em; }
.table tr:hover td { background: var(--gray-50); }

/* ---------- Toast ---------- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #fff; border-radius: 3px; box-shadow: var(--shadow-lg); padding: 14px 18px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; min-width: 260px; border-left: 4px solid var(--primary-500); animation: toast-in .25s ease; }
.toast.success { border-color: var(--success); color: #166534; }
.toast.error { border-color: var(--danger); color: #991b1b; }
.toast.warning { border-color: var(--warning); color: #92400e; }
.toast.info { border-color: var(--info); color: #075985; }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- Misc ---------- */
.static-page { padding: 56px 0; max-width: 860px; margin: 0 auto; }
.static-page h1 { font-size: 28px; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--gray-200); border-top-color: var(--primary-500); border-radius: 50%; animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .listing-layout, .detail-layout, .account-layout { grid-template-columns: 1fr; }
  .filter-box, .account-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
/* The search box is the first thing to go — below this the full row
   (7 links + search + auth buttons) can't fit even though the nav
   links alone still can. */
@media (max-width: 1460px) {
  .header-search { display: none; }
  .header-actions { margin-left: auto; }
}
/* Below this, even without the search box, the 7 nav links no longer
   fit on one row, so it switches to the hamburger/off-canvas nav. */
@media (max-width: 1200px) {
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
    background: var(--gradient-primary);
    flex-direction: column; align-items: stretch; padding: 16px; overflow-y: auto;
    transform: translateX(-100%); transition: transform .25s ease; z-index: 90;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav > a, .main-nav .nav-dropdown > a { color: #fff; font-size: 14.5px; padding: 10px 14px; }
  .main-nav > a:hover, .main-nav .nav-dropdown > a:hover { background: rgba(255,255,255,.16); color: #fff; }
  .main-nav .nav-dropdown .dropdown-panel {
    position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; display: none;
    background: rgba(255,255,255,.1); border: none; margin-top: 2px; padding: 6px;
  }
  .main-nav .nav-dropdown.open .dropdown-panel { display: block; }
  .main-nav .dropdown-panel a { color: #fff; }
  .main-nav .dropdown-panel a:hover { background: rgba(255,255,255,.16); color: #fff; }
  .hamburger { display: block; }
}
@media (max-width: 860px) {
  .hero h1 { font-size: 30px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .doc-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .cta-inner { flex-direction: column; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
  .detail-info-grid { grid-template-columns: 1fr; }
  .filter-box { display: none; }
  .filter-box.open { display: block; position: fixed; inset: 0; z-index: 200; border-radius: 0; overflow-y: auto; }
  .filter-open-btn { display: inline-flex; }
}
@media (max-width: 520px) {
  .hero h1 { font-size: 24px; }
  .header-inner { gap: 6px; }
  .brand-logo { height: 24px; }
  .brand-icon { width: 32px; height: 32px; font-size: 15px; }
  .header-actions { gap: 3px; }
  .header-actions .btn { padding: 6px 8px; font-size: 11.5px; }
  .hamburger { font-size: 17px; flex-shrink: 0; padding: 0 0 0 3px; }
}
