  :root {
    --primary-color: #1a4d9c;
    /* Màu xanh chủ đạo - lịch sự cho cqnn */
    --primary-light: #e6f0fa;
    --secondary-color: #fbc02d;
    /* Vàng */
    --accent-color: #0d2c61;
    /* Xanh đậm */
    --bg-color: #f4f6f9;
    --text-color: #2c3e50;
    --text-muted: #6c757d;
    --card-bg: #ffffff;
    --border-radius: 12px;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(26, 77, 156, 0.12);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
  }

  body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  /* Custom Scrollbar theo màu chủ đạo */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  ::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
  }

  /* Header 64px */
  header {
    background: linear-gradient(135deg, var(--accent-color) 0%, #113473 100%);
    color: #eea623;
    height: 64px;
    top: 0 !important;
    margin: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1030;
  }

  /* Đường line dưới header */
  header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #fbc02d, #d32f2f, #fbc02d)
  }

  .header-title {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  }

  .btn-refresh {
    border-color: rgba(255, 255, 255, 0.4);
  }

  .btn-refresh:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #fff;
  }

  /* Main content spacing */
  .page-content {
    margin-top: 50px;
    /* 64px header + 24px spacing */
    margin-bottom: 20px;
  }

  /* App Group Heading */
  .group-heading-wrap {
    margin-bottom: 1.5rem;
    margin-top: 2.5rem;
  }

  .group-heading {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-color);
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* Gạch dưới độ dài bằng chữ */
  .group-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
  }

  .group-divider {
    border-bottom: 2px solid #e9ecef;
    margin-top: -2px;
    margin-bottom: 1.5rem;
  }

  #appList .alert-info {
    margin-top: 30px;
  }

  /* Card Styles */
  .app-card {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--border-radius);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
  }

  .app-card:not(.card-disabled):hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: rgba(26, 77, 156, 0.3);
  }

  /* Card bị mờ khi "Đang xây dựng" */
  .card-disabled {
    opacity: 0.55;
    pointer-events: none;
    filter: grayscale(40%);
  }

  .app-card-header {
    padding: 1.25rem 1.25rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .app-icon {
    font-size: 1.7rem;
    color: var(--primary-color);
    background: var(--primary-light);
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(26, 77, 156, 0.1);
  }

  .app-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--accent-color);
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
  }

  .app-card-body {
    padding: 0.5rem 1.25rem 1.5rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
  }

  .app-card-footer {
    padding: 0.6rem 1.25rem;
    background: #fcfdfe;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    text-align: center;
  }

  .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
  }

  .btn-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 4px 10px rgba(26, 77, 156, 0.3);
  }

  /* Footer */
  .footer {
    border-top: 1px solid #e9ecef;
  }

  /* Back to Top */
  #btnBackToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none;
    z-index: 999;
    width: 46px;
    height: 46px;
    padding: 0;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    transition: var(--transition);
  }

  #btnBackToTop:hover {
    background-color: var(--accent-color);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(26, 77, 156, 0.3) !important;
  }

  /* Responsive Mobile */
  @media (max-width: 768px) {
    .header-title {
      font-size: 1.3rem;
    }

    .header-logo {
      height: 38px;
    }

    #btnBackToTop {
      bottom: 20px;
      right: 20px;
    }

    .page-content {
      margin-top: 40px;
    }

    .group-heading {
      font-size: 1.15rem;
    }
  }

  /* Install Modal */
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .modal-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .modal-content {
    background: #fff;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
  }

  .modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-color);
  }

  .close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    color: #666;
  }

  .modal-body {
    padding: 20px;
  }

  .step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
  }

  .step-num {
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 12px;
    flex-shrink: 0;
  }

  .step-desc {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.4;
  }

  /* Hide install button when running as PWA */
  @media all and (display-mode: standalone) {
    #install-btn {
      display: none !important;
    }
  }