/* ═══════════════════════════════════════════════════════
   DASHBOARD SIDEBAR — Sprint UI v7.88
   Mục đích: Layout 2 cột cho #user-dashboard-view
   Phụ thuộc: base.css (CSS vars), gamification.css (frame animations)
   ═══════════════════════════════════════════════════════ */

/* ---- 1. LAYOUT SHELL ---- */

/* Ẩn navbar cũ khi dashboard active — sidebar thay thế navigation */
body:not(.guest-mode) #navbar-placeholder {
  display: none !important;
}

/* [v7.93] #adaptive-chat-dock KHÔNG ẩn nữa — bubble draggable FAB đã thay thế dock cố định.
   JS toggle display:flex/none khi user click FAB. CSS !important cũ đã block JS hoàn toàn. */

/* Ẩn floating ⚙️ admin button — sidebar item đã thay thế nó */
body:not(.guest-mode) #ff-admin-btn {
  display: none !important;
}

/* Di chuyển admin panel sang góc dưới-phải để không bị sidebar che */
body:not(.guest-mode) #ff-admin-panel {
  left: auto !important;
  right: 20px !important;
  bottom: 20px !important;
}

/* Mobile: thu gọn chat FAB xuống bên phải, tránh chồng với sidebar toggle */
body:not(.guest-mode) .dock-fab {
  bottom: 80px; /* đẩy lên trên sidebar toggle */
  right: 15px;
}

/* [FIX v7.93] Initial state: ẩn dashboard cho đến khi auth.js resolve
   auth.js sẽ set display:block khi user login */
#user-dashboard-view {
  display: none;
  padding-top: 0; /* Không cần offset — navbar đã ẩn */
}

/* [FIX v7.93] Ẩn guest-only sections khi đã đăng nhập — chúng nằm NGOÀI
   cả #guest-landing-view lẫn #user-dashboard-view nên cần CSS riêng */
body:not(.guest-mode) #register,
body:not(.guest-mode) #salary-tool,
body:not(.guest-mode) #seo-internal-links,
body:not(.guest-mode) #footer-placeholder {
  display: none !important;
}

/* [FIX v7.94+v7.95] Body + Shell locked — chặn global scroll phá SPA */
body:not(.guest-mode) {
  background: #121215 !important;
  height: 100vh;
  overflow: hidden;
}

.ytt-dash-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}


/* ---- 2. SIDEBAR ---- */
.ytt-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #0d0d1a;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  border-right: 1px solid rgba(212, 175, 55, 0.1);
  transition: transform 0.3s ease, width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden; /* Clip content khi collapse animation */
}

/* -- 2a. Avatar block -- */
.ytt-sb-profile {
  display: none !important; /* [FIX v7.92] Ẩn user card theo yêu cầu Founder — giữ DOM cho auth.js update */
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
  text-align: center;
}

.ytt-sb-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  cursor: pointer;
}

/* [FIX v7.92] Xóa .ytt-sb-avatar-frame (conic-gradient xoay) — avatar đơn giản hơn theo yêu cầu Founder */

.ytt-sb-avatar-img {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212, 175, 55, 0.4);
  z-index: 1;
  background: #1a1a2e;
}

.ytt-sb-avatar-hover {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--accent-gold, #ffd700);
  opacity: 0;
  z-index: 2;
  transition: opacity 0.15s ease;
  cursor: pointer;
}

.ytt-sb-avatar-wrap:hover .ytt-sb-avatar-hover {
  opacity: 1;
}

/* [FIX v7.92] Xóa @keyframes ytt-sb-spin — không còn dùng sau khi xóa .ytt-sb-avatar-frame */

.ytt-sb-username {
  font-size: 13px;
  font-weight: 600;
  color: #f1f1f1;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ytt-sb-rank {
  font-size: 10px;
  color: var(--accent-gold, #ffd700);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ytt-sb-currencies {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.ytt-sb-cur {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  gap: 3px;
}

.ytt-sb-cur b {
  color: var(--accent-gold, #ffd700);
  font-weight: 600;
}

/* -- 2b. Sidebar 3-Zone Layout [v7.95] -- */

/* Header: Dashboard item ghim cố định */
.ytt-sb-header {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
  padding: 4px 0;
}

/* Body: Feature list scrollable */
.ytt-sb-body,
.ytt-sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 12px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.2) transparent;
}

.ytt-sb-body::-webkit-scrollbar,
.ytt-sb-nav::-webkit-scrollbar {
  width: 5px;
}

.ytt-sb-body::-webkit-scrollbar-track,
.ytt-sb-nav::-webkit-scrollbar-track {
  background: transparent;
}

.ytt-sb-body::-webkit-scrollbar-thumb,
.ytt-sb-nav::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.2);
  border-radius: 4px;
}

.ytt-sb-body::-webkit-scrollbar-thumb:hover,
.ytt-sb-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.4);
}

/* Footer: Admin + Logout ghim cố định */
.ytt-sb-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(212, 175, 55, 0.08);
  padding: 10px 14px;
}

/* .ytt-sb-group = container nhóm, không còn là label */
.ytt-sb-group {
  padding: 0;
}

/* Label text của nhóm */
.ytt-sb-group-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.22);
  padding: 12px 14px 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}

/* Icon chip — nền màu nhỏ phía sau icon */
.ytt-sb-icon-chip {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--ic, rgba(255,255,255,0.3)) 16%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ic, rgba(255,255,255,0.5));
  font-size: 13px;
  transition: background 0.15s;
  flex-shrink: 0;
}

/* Nút thu gọn / mở rộng */
.ytt-sb-collapse-bar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 6px 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.06);
}

.ytt-sb-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
}

.ytt-sb-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.75);
  border-color: rgba(212, 175, 55, 0.35);
}

/* ══ Collapsed state ══ */
.ytt-sidebar.collapsed {
  width: 64px;
}

.ytt-sidebar.collapsed .ytt-sb-item {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
  border-left-width: 2px;
}

/* Ẩn text span, giữ lại icon-chip */
.ytt-sidebar.collapsed .ytt-sb-item > span:not(.ytt-sb-icon-chip),
.ytt-sidebar.collapsed .ytt-sb-group-label,
.ytt-sidebar.collapsed .ytt-sb-badge,
.ytt-sidebar.collapsed .ytt-sb-tag {
  display: none;
}

.ytt-sidebar.collapsed .ytt-sb-collapse-bar {
  justify-content: center;
  padding: 6px 0;
}

.ytt-sidebar.collapsed .ytt-sb-logout-btn {
  justify-content: center;
  padding: 8px 0;
}

.ytt-sidebar.collapsed .ytt-sb-logout-btn > span {
  display: none;
}

.ytt-sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.12s ease;
  position: relative;
  text-decoration: none;
}

.ytt-sb-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.75);
}

.ytt-sb-item.active {
  background: color-mix(in srgb, var(--ic, var(--primary-red, #d32f2f)) 12%, transparent);
  color: rgba(255, 255, 255, 0.92);
  border-left-color: var(--ic, var(--primary-red, #d32f2f));
  font-weight: 600;
}

.ytt-sb-item.active .ytt-sb-icon-chip {
  background: color-mix(in srgb, var(--ic, var(--primary-red, #d32f2f)) 24%, transparent);
}

.ytt-sb-item:hover .ytt-sb-icon-chip {
  background: color-mix(in srgb, var(--ic, rgba(255,255,255,0.3)) 22%, transparent);
}

.ytt-sb-item.modal-type:hover {
  color: var(--accent-gold, #ffd700);
}

.ytt-sb-icon {
  font-size: 14px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.ytt-sb-badge {
  margin-left: auto;
  font-size: 9px;
  background: rgba(211, 47, 47, 0.7);
  color: #fff;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}

.ytt-sb-tag {
  margin-left: auto;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 5px;
  border-radius: 3px;
}

.ytt-sb-divider {
  height: 1px;
  background: rgba(212, 175, 55, 0.08);
  margin: 6px 12px;
}

/* -- 2c. Logout [v7.95: styles moved to .ytt-sb-footer] -- */
/* .ytt-sb-logout deprecated — wrapper div đã đổi thành .ytt-sb-footer */

.ytt-sb-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: rgba(211, 47, 47, 0.1);
  border: 1px solid rgba(211, 47, 47, 0.2);
  border-radius: 6px;
  color: #ff8a80;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ytt-sb-logout-btn:hover {
  background: rgba(211, 47, 47, 0.2);
  border-color: rgba(211, 47, 47, 0.4);
}

/* ---- 3. MAIN PANEL (bên phải) ---- */
.ytt-dash-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* prevent flex overflow */
  background: #121215; /* Cố định dark — KHÔNG dùng var(--bg-dark) vì nó = #fff ở light mode */
  color: #f1f1f1;
}

/* -- 3a. Top breadcrumb bar -- */
.ytt-dash-topbar {
  height: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 8px;
  flex-shrink: 0;
  background: rgba(18, 18, 18, 0.95);
}

.ytt-tb-breadcrumb {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ytt-tb-sep {
  color: rgba(255, 255, 255, 0.2);
}

.ytt-tb-current {
  color: #f1f1f1;
  font-weight: 500;
}

.ytt-tb-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.ytt-tb-btn {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.12s ease;
  text-decoration: none;
}

.ytt-tb-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f1f1;
}

/* -- 3b. Content area [v7.95: bỏ height:calc vì shell đã locked 100vh] -- */
.ytt-dash-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-height: 0; /* Ngăn flex child overflow ra ngoài shell */
}

/* Custom scrollbar cho content area (khi có iframe tràn) */
.ytt-dash-content-area::-webkit-scrollbar {
  width: 6px;
}
.ytt-dash-content-area::-webkit-scrollbar-track {
  background: transparent;
}
.ytt-dash-content-area::-webkit-scrollbar-thumb {
  background: rgba(180, 180, 180, 0.15);
  border-radius: 4px;
}
.ytt-dash-content-area::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.3);
}

/* Home view */
.ytt-dash-home {
  padding: 18px 20px;
  height: 100%;
  overflow-y: auto;
  overflow-y: overlay; /* [v7.94] Scrollbar nằm BÊN TRONG content, không chiếm space */
  background: #121215;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.25) transparent;
}

.ytt-dash-home::-webkit-scrollbar {
  width: 6px;
}

.ytt-dash-home::-webkit-scrollbar-track {
  background: transparent;
}

.ytt-dash-home::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.2);
  border-radius: 3px;
}

.ytt-dash-home::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.4);
}

/* Admin Panel View [v7.97] — Full-height SPA view, không modal */
.ytt-dash-admin-view {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  overflow-y: overlay;
  background: #121215;
  display: none; /* JS sẽ đổi sang flex khi active */
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.25) transparent;
}

.ytt-dash-admin-view::-webkit-scrollbar {
  width: 6px;
}
.ytt-dash-admin-view::-webkit-scrollbar-track {
  background: transparent;
}
.ytt-dash-admin-view::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.2);
  border-radius: 3px;
}
.ytt-dash-admin-view::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.4);
}

/* Stat cards row */
.ytt-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.ytt-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.ytt-stat-value {
  font-size: 20px;
  font-weight: 600;
  color: #f1f1f1;
  line-height: 1.2;
}

.ytt-stat-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 3px;
}

/* Section headings */
.ytt-dash-heading {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

/* Mission cards */
.ytt-mission-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.ytt-mission-row {
  display: flex;
  align-items: center;
  padding: 7px 0;
  gap: 10px;
}

.ytt-mission-row + .ytt-mission-row {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ytt-mission-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

.ytt-mission-check.done {
  background: rgba(76, 175, 80, 0.15);
  border-color: #4caf50;
  color: #4caf50;
}

.ytt-mission-label {
  font-size: 12px;
  color: #e0e0e0;
  flex: 1;
}

.ytt-mission-reward {
  font-size: 11px;
  font-weight: 600;
}

.ytt-mission-reward.done {
  color: rgba(255, 255, 255, 0.3);
  text-decoration: line-through;
}

.ytt-mission-reward.todo {
  color: #4caf50;
}

/* Quick access grid */
.ytt-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.ytt-quick-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
}

.ytt-quick-card:hover {
  border-color: rgba(212, 175, 55, 0.3);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.ytt-quick-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.ytt-quick-name {
  font-size: 12px;
  font-weight: 600;
  color: #f1f1f1;
}

.ytt-quick-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 1px;
}

/* -- 3c. Iframe container -- */
.ytt-dash-iframe-wrap {
  display: none;
  width: 100%;
  height: 100%;
}

.ytt-dash-iframe-wrap.active {
  display: block;
}

.ytt-dash-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--bg-dark, #121212);
}

/* Iframe loading spinner */
.ytt-dash-loading {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  /* Cố định dark — KHÔNG dùng var(--bg-dark) vì ở light mode = #fff gây loading trắng */
  background: #0f0f18;
  z-index: 5;
}

.ytt-dash-loading.active {
  display: flex;
}

.ytt-dash-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: #ffd700;
  border-radius: 50%;
  animation: ytt-sb-spin 0.7s linear infinite;
}

.ytt-dash-loading-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* ---- 4. MOBILE HAMBURGER ---- */
.ytt-sb-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1a1a2e, #0d0d1a);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 50%;
  color: var(--accent-gold, #ffd700);
  font-size: 18px;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.ytt-sb-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 49;
}

/* ---- 5. RESPONSIVE ---- */
@media (max-width: 768px) {
  /* Sidebar: ẩn hoàn toàn, slide từ trái khi open */
  .ytt-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px !important; /* Luôn expanded trên mobile — ghi đè collapsed state */
    height: 100vh;
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
  }

  /* Trên mobile: luôn hiện đầy đủ text dù sidebar đang collapsed trên desktop */
  .ytt-sidebar.collapsed .ytt-sb-item { justify-content: flex-start; padding: 9px 14px; gap: 10px; }
  .ytt-sidebar.collapsed .ytt-sb-item > span:not(.ytt-sb-icon-chip),
  .ytt-sidebar.collapsed .ytt-sb-group-label { display: revert; }
  .ytt-sidebar.collapsed .ytt-sb-collapse-bar { justify-content: flex-end; padding: 6px 12px; }
  .ytt-sidebar.collapsed .ytt-sb-logout-btn { justify-content: flex-start; padding: 8px 10px; }
  .ytt-sidebar.collapsed .ytt-sb-logout-btn > span { display: revert; }

  .ytt-sidebar.open {
    transform: translateX(0);
  }

  /* Panel: chiếm TOÀN BỘ màn hình khi sidebar ẩn */
  .ytt-dash-panel {
    width: 100%;
    min-width: 0;
  }

  /* Topbar mobile: thêm padding cho hamburger button */
  .ytt-dash-topbar {
    padding: 0 8px 0 60px; /* left padding cho hamburger */
    min-height: 44px;
    font-size: 0.85rem;
  }

  .ytt-tb-btn {
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  /* Hamburger toggle: hiện trên mobile */
  .ytt-sb-toggle {
    display: flex;
    bottom: 20px;
    left: 15px;
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .ytt-sb-backdrop.open {
    display: block;
  }

  /* Stats: 2 cột */
  .ytt-stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* Quick grid: 2 cột */
  .ytt-quick-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* Home padding compact */
  .ytt-dash-home {
    padding: 12px;
  }

  /* Content area height: toàn màn hình */
  .ytt-dash-content-area {
    height: calc(100vh - 44px);
  }

  /* Section titles nhỏ hơn */
  .ytt-section-title {
    font-size: 0.8rem;
    margin-bottom: 8px;
  }

  /* Stat card compact */
  .ytt-stat-card {
    padding: 10px 12px;
  }

  .ytt-stat-val {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .ytt-stat-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .ytt-quick-grid {
    grid-template-columns: 1fr 1fr; /* 2 cột trên phone nhỏ */
    gap: 6px;
  }

  .ytt-quick-card {
    padding: 10px;
    gap: 6px;
  }

  .ytt-quick-icon {
    font-size: 1.2rem;
  }

  .ytt-quick-name {
    font-size: 0.8rem;
  }

  .ytt-quick-sub {
    font-size: 0.68rem;
  }

  .ytt-dash-home {
    padding: 10px;
  }

  /* Sidebar rộng full trên phone nhỏ */
  .ytt-sidebar {
    width: 100vw;
  }
}

/* ═══════════════════════════════════════════════════
   Sprint S2 — Dashboard Home UI (.ydh-*)
═══════════════════════════════════════════════════ */

.ydh-greeting { padding: 0 0 16px; }
.ydh-greeting h2 { font-size: 18px; font-weight: 500; color: #f0f0f0; margin: 0; }
.ydh-greeting p { font-size: 12px; color: rgba(255,255,255,0.45); margin: 4px 0 0; }

.ydh-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.ydh-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.ydh-stat-val {
  font-size: 20px;
  font-weight: 500;
  color: #f0f0f0;
}
.ydh-stat-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 4px;
}

.ydh-section-title {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.ydh-mission-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}
.ydh-mission-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 12px;
}
.ydh-mission-row + .ydh-mission-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.ydh-mission-row.done .ydh-m-label {
  color: rgba(255, 255, 255, 0.3);
  text-decoration: line-through;
}
.ydh-mission-row.done .ydh-m-reward {
  color: rgba(255, 255, 255, 0.3);
  text-decoration: line-through;
}
.ydh-m-label { color: rgba(255, 255, 255, 0.75); }
.ydh-m-reward {
  color: #4caf50;
  font-weight: 500;
  font-size: 11px;
}

/* ── [v7.94] Progress Ring Section ── */
.ydh-progress-section {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.ydh-progress-ring-wrap {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
}
.ydh-ring-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: 700;
  color: #66bb6a;
}
.ydh-progress-info { flex: 1; min-width: 0; }
.ydh-progress-title {
  font-size: 13px;
  font-weight: 600;
  color: #f0f0f0;
  margin-bottom: 4px;
}
.ydh-progress-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
}

/* ── Meta Stats Row ── */
.ydh-meta-stats {
  display: flex;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px 8px;
  margin-bottom: 20px;
}
.ydh-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ydh-meta-val {
  font-size: 18px;
  font-weight: 700;
}
.ydh-meta-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

/* ── [v7.94] Action Cards Grid ── */
.ydh-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.ydh-action-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.ydh-action-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--card-accent, rgba(255,255,255,0.1));
  opacity: 0;
  transition: opacity 0.3s;
}
.ydh-action-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}
.ydh-action-card:hover::before { opacity: 1; }

.ydh-action-review { --card-accent: linear-gradient(90deg, #ffd700, #ff9800); }
.ydh-action-refer { --card-accent: linear-gradient(90deg, #66bb6a, #4caf50); }
.ydh-action-feedback { --card-accent: linear-gradient(90deg, #4fc3f7, #29b6f6); }

.ydh-action-icon {
  font-size: 28px;
  margin-bottom: 10px;
}
.ydh-action-name {
  font-size: 12px;
  font-weight: 600;
  color: #f0f0f0;
  margin-bottom: 4px;
}
.ydh-action-desc {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 12px;
  line-height: 1.4;
}
.ydh-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--btn-color, rgba(255,255,255,0.2));
  border-radius: 20px;
  background: transparent;
  color: var(--btn-color, #f0f0f0);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.ydh-action-btn:hover {
  background: color-mix(in srgb, var(--btn-color, #fff) 15%, transparent);
  transform: scale(1.04);
}
.ydh-action-btn i {
  font-size: 10px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .ydh-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .ydh-action-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ydh-action-card {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 12px;
    padding: 14px;
  }
  .ydh-action-icon {
    font-size: 24px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .ydh-action-name { margin-bottom: 2px; }
  .ydh-action-desc { margin-bottom: 8px; }
}

@media (max-width: 480px) {
  .ydh-stat-grid { gap: 6px; }
  .ydh-stat-val { font-size: 16px; }
  .ydh-meta-val { font-size: 14px; }
  .ydh-progress-section { padding: 12px; gap: 12px; }
  .ydh-progress-ring-wrap { width: 60px; height: 60px; }
  .ydh-progress-ring-wrap svg { width: 60px; height: 60px; }
  .ydh-ring-percent { font-size: 13px; }
}

