:root {
      --primary: #007bff;
      --navy: #0a3663;
      --navy-dark: #072242;
      --slate-50: #f8fafc;
      --slate-100: #f1f5f9;
      --slate-200: #e2e8f0;
      --slate-600: #475569;
      --slate-800: #1e293b;
    }

    body {
      background: #f4f7f6;
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      color: #2c3e50;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    /* Navbar */
    .navbar {
      background: #ffffff;
      border-bottom: 1px solid #e0e0e0;
      padding: 10px 24px;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    }

    .navbar-brand {
      font-weight: 700;
      color: #007bff !important;
      font-size: 1.25rem;
    }

    .nav-link {
      color: #555 !important;
      font-weight: 500;
      margin-right: 8px;
      transition: color 0.15s ease;
    }

    .nav-link:hover,
    .nav-link.active {
      color: #007bff !important;
    }

    .nav-btn-join {
      background: #0284c7;
      color: white !important;
      font-weight: 600;
      padding: 6px 14px;
      border-radius: 6px;
      text-decoration: none;
      font-size: 0.9rem;
    }

    .nav-btn-join:hover {
      background: #0369a1;
      text-decoration: none;
    }

    /* Main Container */
    .main-content {
      max-width: 1140px;
      margin: 30px auto 60px auto;
      padding: 0 20px;
      flex: 1;
      width: 100%;
    }

    /* Hero Banner */
    .hero-library {
      background: linear-gradient(135deg, #0a3663 0%, #0369a1 100%);
      color: #ffffff;
      border-radius: 14px;
      padding: 40px 36px;
      margin-bottom: 30px;
      box-shadow: 0 10px 25px rgba(10, 54, 99, 0.12);
    }

    .hero-title {
      font-family: 'Outfit', sans-serif;
      font-weight: 800;
      font-size: 2.2rem;
      letter-spacing: -0.5px;
      margin-bottom: 10px;
    }

    .hero-sub {
      font-size: 1.05rem;
      color: #e0f2fe;
      margin: 0;
      max-width: 800px;
    }

    /* Filter Card */
    .filter-card {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      padding: 20px 24px;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
      margin-bottom: 30px;
    }

    .filter-btn {
      background: #f1f5f9;
      color: #475569;
      border: 1px solid #e2e8f0;
      border-radius: 6px;
      padding: 6px 14px;
      font-size: 0.88rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.15s ease;
      margin-right: 6px;
      margin-bottom: 6px;
    }

    .filter-btn.active,
    .filter-btn:hover {
      background: #0284c7;
      color: #ffffff;
      border-color: #0284c7;
    }

    /* Library Single-Column Row Item */
    .library-row-item {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      padding: 22px 24px;
      box-shadow: 0 2px 6px rgba(11, 23, 42, 0.03);
      transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 16px;
    }

    @media (min-width: 768px) {
      .library-row-item {
        flex-direction: row;
        align-items: center;
        gap: 24px;
      }
    }

    .library-row-item:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 22px rgba(10, 54, 99, 0.08);
      border-color: #cbd5e1;
    }

    .library-row-main {
      flex: 1;
      min-width: 0;
    }

    .library-row-header {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 8px;
    }

    .badge-doc {
      background: #f0fdf4;
      color: #166534;
      border: 1px solid #bbf7d0;
      font-weight: 600;
      font-size: 0.75rem;
      padding: 3px 8px;
      border-radius: 4px;
      display: inline-flex;
      align-items: center;
    }

    .badge-year {
      background: #f8fafc;
      color: #475569;
      border: 1px solid #e2e8f0;
      font-weight: 600;
      font-size: 0.75rem;
      padding: 3px 8px;
      border-radius: 4px;
      display: inline-flex;
      align-items: center;
    }

    .badge-category {
      background: #e0f2fe;
      color: #0284c7;
      font-weight: 600;
      font-size: 0.75rem;
      padding: 3px 8px;
      border-radius: 4px;
      display: inline-flex;
      align-items: center;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .library-title {
      font-family: 'Outfit', sans-serif;
      font-weight: 700;
      font-size: 1.18rem;
      color: #0a3663;
      margin-bottom: 6px;
      line-height: 1.35;
    }

    .library-title a {
      color: #0b172a;
      text-decoration: none;
      transition: color 0.15s ease;
    }

    .library-title a:hover {
      color: #0284c7;
    }

    .library-summary {
      color: #64748b;
      font-size: 0.92rem;
      line-height: 1.55;
      margin-bottom: 0;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .library-row-action {
      flex-shrink: 0;
    }

    .btn-doc-view {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      background: #f8fafc;
      color: #0a3663;
      border: 1px solid #cbd5e1;
      padding: 8px 16px;
      border-radius: 8px;
      font-size: 0.88rem;
      font-weight: 600;
      text-decoration: none;
      white-space: nowrap;
      transition: all 0.15s ease;
    }

    .btn-doc-view:hover {
      background: #0284c7;
      color: #ffffff;
      border-color: #0284c7;
      text-decoration: none;
      box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    }

    /* Inline document reader */
    .reader-panel {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
      margin-bottom: 30px;
      overflow: hidden;
    }

    .reader-panel-header {
      background: linear-gradient(135deg, #0a3663 0%, #0369a1 100%);
      color: #ffffff !important;
      padding: 18px 24px;
      border-top-left-radius: 12px;
      border-top-right-radius: 12px;
    }

    .reader-panel-header h1,
    .reader-panel-header h2,
    .reader-panel-header .h5,
    #readerDocTitle {
      color: #ffffff !important;
      font-family: 'Outfit', sans-serif;
      font-weight: 700;
      font-size: 1.25rem;
      line-height: 1.35;
      margin: 0;
    }

    .btn-back-library {
      color: #fde68a !important;
      font-weight: 600;
      font-size: 0.85rem;
      text-decoration: none;
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid rgba(255, 255, 255, 0.25);
      padding: 5px 12px;
      border-radius: 6px;
      transition: all 0.2s ease;
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
    }

    .btn-back-library:hover {
      background: rgba(255, 255, 255, 0.22);
      color: #ffffff !important;
      text-decoration: none;
    }

    .reader-panel-body {
      padding: 28px 36px;
    }

    .reader-panel .embed-responsive {
      min-height: 600px;
    }

    .reader-panel .embed-responsive-item {
      border: 0;
    }

    .reader-layout {
      display: none;
    }

    .library-detail-page .reader-layout {
      display: flex;
    }

    .library-detail-page .hero-library,
    .library-detail-page .filter-card,
    .library-detail-page #libraryGrid {
      display: none;
    }

    .library-detail-page .reader-panel {
      margin-top: 10px;
    }

    .library-sidebar-card {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      padding: 24px;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
      margin: 10px 0 24px;
    }

    .library-sidebar-title {
      font-family: 'Outfit', sans-serif;
      font-weight: 700;
      font-size: 1.15rem;
      color: #0a3663;
      margin-bottom: 16px;
      border-bottom: 2px solid #f1f5f9;
      padding-bottom: 8px;
    }

    @media (max-width: 767.98px) {
      .reader-panel-body {
        padding: 20px 16px;
      }

      .reader-panel .embed-responsive {
        min-height: 450px;
      }
    }

    /* Footer */
    footer {
      background: #ffffff;
      border-top: 1px solid #e0e0e0;
      padding: 30px 20px 20px;
      color: #64748b;
      font-size: 0.9rem;
      margin-top: auto;
    }

    .footer-links a {
      color: #475569;
      text-decoration: none;
      margin: 0 12px;
      transition: color 0.15s ease;
    }

    .footer-links a:hover {
      color: #007bff;
    }
