/* ===================================================================
   SinoAdmin Panel — Sidebar Layout System
   Professional dark sidebar + light content area
   =================================================================== */

:root {
  --sidebar-w: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(80, 171, 147, 0.18);
  --sidebar-text: rgba(255, 255, 255, 0.55);
  --sidebar-text-active: #ffffff;
  --sidebar-accent: #50ab93;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --topbar-h: 64px;
  --content-bg: #f1f5f9;
}

/* ---- Reset page body for sidebar layout ---- */
body.admin-layout {
  margin: 0;
  padding: 0;
  background: var(--content-bg);
  display: flex;
  min-height: 100vh;
}

body.admin-layout .page {
  display: flex;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Hide old top-strip header in admin layout */
body.admin-layout .top-strip {
  display: none;
}

/* ===== SIDEBAR ===== */

.admin-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---- Logo Section ---- */
.sidebar-logo {
  padding: 24px 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sidebar-accent), #39917a);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sidebar-logo-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--sidebar-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---- Nav Sections ---- */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section-label {
  padding: 0 10px;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  position: relative;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: rgba(255, 255, 255, 0.85);
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
}

.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: var(--sidebar-accent);
}

.sidebar-link i {
  font-size: 18px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link .link-badge {
  margin-left: auto;
  background: var(--sidebar-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  line-height: 1.4;
}

/* ---- Sidebar User Profile ---- */
.sidebar-user {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--sidebar-accent), #2dd4bf);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 10px;
  font-weight: 600;
  color: var(--sidebar-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-logout {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ===== MAIN CONTENT AREA ===== */

.admin-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Top Bar ---- */
.admin-topbar {
  height: var(--topbar-h);
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #94a3b8;
}

.topbar-breadcrumb a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.12s;
}

.topbar-breadcrumb a:hover {
  color: #475569;
}

.topbar-breadcrumb .bc-sep {
  font-size: 10px;
}

.topbar-breadcrumb .bc-current {
  color: #0f172a;
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #dbe7f3;
}

.lang-switch-btn {
  min-width: 40px;
  height: 30px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-switch-btn.active {
  background: linear-gradient(135deg, #50ab93, #3e8f7a);
  color: #fff;
  box-shadow: 0 8px 18px rgba(80, 171, 147, 0.24);
}

.lang-switch-btn:hover:not(.active) {
  background: #eef4f9;
  color: #334155;
}

.topbar-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.12s ease;
  position: relative;
}

.topbar-btn:hover {
  background: #e2e8f0;
  color: #334155;
}

.topbar-btn .notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #ffffff;
}

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ---- Page Content ---- */
.admin-page-content {
  flex: 1;
  padding: 28px;
}

/* ---- Stats Cards Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.users-stats-row {
  grid-template-columns: minmax(220px, 0.9fr) minmax(360px, 1.4fr);
  align-items: start;
}

.stat-card-online {
  background:
    radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.12), transparent 35%),
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.green { background: rgba(80, 171, 147, 0.12); color: #047857; }
.stat-icon.blue { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.stat-icon.purple { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }

.stat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-top: 2px;
}

.stat-subtext {
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.online-presence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.online-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.96);
  border: 1px solid rgba(191, 219, 254, 0.95);
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 700;
}

.online-user-pill i {
  font-size: 13px;
  color: #2563eb;
}

.online-user-pill.is-loading {
  width: 112px;
  border: none;
  background: linear-gradient(100deg, #e2e8f0 25%, #f8fafc 40%, #e2e8f0 55%);
  background-size: 220% 100%;
  animation: statShimmer 1.15s linear infinite;
}

.online-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

.online-user-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-user-more {
  background: rgba(241, 245, 249, 0.95);
  border-color: rgba(226, 232, 240, 0.95);
  color: #475569;
}

.online-user-empty {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.stat-change.up { background: #d1fae5; color: #065f46; }
.stat-change.down { background: #fee2e2; color: #991b1b; }

/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
  :root {
    --sidebar-w: 240px;
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.3);
  }

  .admin-content {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .admin-page-content {
    padding: 16px;
  }

  .users-stats-row {
    grid-template-columns: 1fr;
  }

  /* Overlay when sidebar open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
  }

  .sidebar-overlay.show {
    display: block;
  }
}

/* ===== ADMIN TABLE OVERRIDES for sidebar layout ===== */

body.admin-layout .admin-main {
  padding: 0;
}

body.admin-layout .admin-card {
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

/* ===== PROFILE PAGE in sidebar layout ===== */

body.admin-layout .profile-main {
  max-width: 700px;
}

body.admin-layout .profile-big-avatar {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  font-size: 26px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

body.admin-layout .profile-big-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.15s ease;
  border-radius: inherit;
}

.profile-big-avatar:hover .avatar-upload-overlay {
  opacity: 1;
}

/* ===== EMBED OLD STAT PAGES ===== */

body.admin-layout .stat-page-wrapper {
  flex: 1;
}

/* Existing clicks-page, chart-card etc work inside admin-page-content */
body.admin-layout .clicks-page-modern,
body.admin-layout .clicks-page {
  gap: 18px;
}

/* ===================================================================
   APP USERS, USER DETAIL, NOTIFICATIONS — Component Styles
   =================================================================== */

/* ---- App Users Skeleton Loading ---- */
.stats-row.is-loading .stat-card {
  position: relative;
}

.stat-value-loading {
  position: relative;
  display: inline-block;
  width: clamp(72px, 28%, 120px);
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(100deg, #e2e8f0 25%, #f1f5f9 40%, #e2e8f0 55%);
  background-size: 220% 100%;
  animation: statShimmer 1.2s linear infinite;
}

.stat-value-loading::after {
  content: "";
}

.table-skeleton-row td {
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom-color: #eef2f7;
}

.table-skeleton-row:hover {
  background: transparent !important;
}

.table-skel-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-skel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(100deg, #e2e8f0 25%, #f8fafc 40%, #e2e8f0 55%);
  background-size: 220% 100%;
  animation: statShimmer 1.15s linear infinite;
}

.table-skel-stack {
  display: grid;
  gap: 8px;
}

.table-skel-line {
  height: 11px;
  border-radius: 999px;
  display: inline-block;
  background: linear-gradient(100deg, #e2e8f0 25%, #f8fafc 40%, #e2e8f0 55%);
  background-size: 220% 100%;
  animation: statShimmer 1.15s linear infinite;
}

.table-skel-line.w-24 { width: 24px; }
.table-skel-line.w-50 { width: 50px; }
.table-skel-line.w-70 { width: 70px; }
.table-skel-line.w-90 { width: 90px; }
.table-skel-line.w-120 { width: 120px; }
.table-skel-line.w-160 { width: 160px; }

@keyframes statShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ---- Platform Badge ---- */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}
.platform-app { background: #dbeafe; color: #1e40af; }
.platform-tg { background: #e0e7ff; color: #4338ca; }
.time-ago { font-size: 12px; color: #64748b; }
.text-muted { color: #94a3b8 !important; }
.text-danger { color: #ef4444; }

/* ---- Table Pagination ---- */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
}
.page-btn {
  width: 36px; height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s;
}
.page-btn:hover { background: #f1f5f9; }
.page-btn.active { background: var(--sinoai-green); color: #fff; border-color: var(--sinoai-green); }
.page-dots { color: #94a3b8; font-size: 14px; padding: 0 4px; }

/* ---- Back Link ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.12s;
}
.back-link:hover { color: var(--sinoai-green); }

/* ===== USER DETAIL PAGE ===== */

.user-detail-main { max-width: 1100px; }

/* Profile Card */
.ud-profile-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  padding: 24px 28px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ud-profile-left {
  display: flex; align-items: center; gap: 20px;
}
.ud-avatar {
  width: 80px; height: 80px;
  border-radius: 22px;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4338ca;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}
.ud-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ud-info h1 {
  margin: 0; font-size: 24px; font-weight: 800; color: #0f172a;
  letter-spacing: -0.02em;
}
.ud-meta-row {
  display: flex; align-items: center; gap: 14px; margin-top: 6px; flex-wrap: wrap;
}
.ud-meta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: #475569; font-weight: 500;
}
.ud-meta i { font-size: 15px; color: #94a3b8; }

/* AI Card */
.ud-ai-card {
  background: linear-gradient(135deg, #faf5ff, #ede9fe);
  border: 1px solid #ddd6fe;
  border-radius: 20px;
  padding: 22px 24px;
  margin-bottom: 20px;
}
.ud-ai-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.ud-ai-icon {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.ud-ai-header h3 { margin: 0; font-size: 15px; font-weight: 800; color: #4c1d95; }
.ud-ai-text {
  font-size: 14px; line-height: 1.65; color: #5b21b6;
  padding: 14px 16px;
  background: rgba(255,255,255,0.6);
  border-radius: 14px;
}

/* Grid */
.ud-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
@media (max-width: 900px) { .ud-grid { grid-template-columns: 1fr; } }

.ud-col { display: flex; flex-direction: column; gap: 20px; }

.ud-section { padding: 0; overflow: hidden; }
.ud-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #f1f5f9;
}
.ud-section-header h3 {
  margin: 0; font-size: 15px; font-weight: 800; color: #0f172a;
  display: flex; align-items: center; gap: 8px;
}
.ud-section-header h3 i { color: var(--sinoai-green); font-size: 18px; }
.ud-count {
  font-size: 12px; font-weight: 700; color: #64748b;
  background: #f1f5f9; padding: 3px 10px; border-radius: 8px;
}
.ud-empty {
  padding: 30px; text-align: center; color: #94a3b8; font-size: 13px;
}

/* Doctor Cards */
.ud-doctors-list { padding: 8px; }
.ud-doctor-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  transition: background 0.12s;
  cursor: pointer;
}
.ud-doctor-card:hover { background: #f8fafc; }
.ud-doctor-avatar {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; flex-shrink: 0; overflow: hidden;
}
.ud-doctor-avatar.small { width: 36px; height: 36px; font-size: 12px; border-radius: 10px; }
.ud-doctor-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ud-doctor-info { flex: 1; min-width: 0; }
.ud-doctor-name { font-size: 14px; font-weight: 700; color: #0f172a; }
.ud-doctor-spec { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.ud-doctor-stats { display: flex; gap: 6px; margin-top: 4px; }
.ud-chip {
  padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 700;
}
.ud-chip-green { background: #d1fae5; color: #065f46; }
.ud-chip-red { background: #fee2e2; color: #991b1b; }
.ud-doctor-count {
  font-size: 16px; font-weight: 800; color: #6366f1;
  background: #eef2ff; padding: 4px 10px; border-radius: 10px;
}

/* Rating Cards */
.ud-ratings-list { padding: 8px; }
.ud-rating-card {
  padding: 14px; border-radius: 14px; margin-bottom: 4px;
  transition: background 0.12s;
}
.ud-rating-card:hover { background: #fffbeb; }
.ud-rating-top { display: flex; align-items: center; gap: 10px; }
.ud-rating-info { flex: 1; }
.ud-rating-stars { flex-shrink: 0; }
.ud-rating-comment {
  margin-top: 8px; font-size: 13px; color: #475569;
  font-style: italic; line-height: 1.5;
  padding: 8px 12px; background: #fefce8; border-radius: 10px;
  border-left: 3px solid #fbbf24;
}
.ud-rating-date { margin-top: 6px; font-size: 11px; color: #94a3b8; }

/* Click Items */
.ud-clicks-grid { padding: 12px 16px; }
.ud-click-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid #f8fafc;
}
.ud-click-item:last-child { border-bottom: none; }
.ud-click-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.ud-click-info { flex: 1; }
.ud-click-name { font-size: 12px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.ud-click-bar-wrap {
  height: 5px; background: #f1f5f9; border-radius: 99px; overflow: hidden;
}
.ud-click-bar {
  height: 100%; border-radius: 99px; transition: width 0.5s ease;
}
.ud-click-count {
  font-size: 15px; font-weight: 800; color: #0f172a; min-width: 40px; text-align: right;
}

/* Activity Timeline */
.ud-timeline { padding: 12px 16px; }
.ud-activity-latest {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}
.ud-activity-latest-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.ud-activity-latest-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ud-activity-latest-text strong {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.ud-activity-latest-text span {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}
.ud-timeline-item {
  position: relative;
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid #f8fafc;
}
.ud-timeline-item:last-child { border-bottom: none; }
.ud-timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: -8px;
  width: 1px;
  background: linear-gradient(to bottom, rgba(148, 163, 184, 0.45), rgba(148, 163, 184, 0.12));
}
.ud-timeline-dot {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.ud-timeline-content { flex: 1; }
.ud-timeline-label { font-size: 13px; font-weight: 700; color: #0f172a; }
.ud-timeline-details { font-size: 12px; color: #64748b; margin-top: 2px; }
.ud-timeline-time { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* ===== NOTIFICATIONS PAGE ===== */

.notif-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
@media (max-width: 900px) { .notif-layout { grid-template-columns: 1fr; } }

.notif-form-card, .notif-history-card { overflow: hidden; }
.notif-form-header {
  padding: 18px 22px; border-bottom: 1px solid #f1f5f9;
}
.notif-form-header h3 {
  margin: 0; font-size: 16px; font-weight: 800; color: #0f172a;
  display: flex; align-items: center; gap: 8px;
}
.notif-form-header h3 i { color: var(--sinoai-green); }
.notif-form-body { padding: 20px 22px; }
.notif-form-footer {
  padding: 14px 22px; border-top: 1px solid #f1f5f9;
  display: flex; justify-content: flex-end;
}

.notif-form-body textarea {
  width: 100%; border-radius: 12px; border: 1px solid #e2e8f0;
  padding: 12px 14px; font-size: 14px; color: #0f172a;
  font-family: inherit; resize: vertical; outline: none;
  transition: border-color 0.15s;
}
.notif-form-body textarea:focus {
  border-color: var(--sinoai-green);
  box-shadow: 0 0 0 3px rgba(80,171,147,0.15);
}

.btn-lg { padding: 12px 28px; font-size: 15px; }

/* Image Upload */
.notif-image-upload { cursor: pointer; }
.notif-image-preview {
  width: 100%; height: 120px;
  border: 2px dashed #e2e8f0; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: #94a3b8; font-size: 13px; font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}
.notif-image-preview:hover { border-color: var(--sinoai-green); background: #f0fdf7; }
.notif-image-preview i { font-size: 28px; }

/* Target Selection Grid */
.notif-target-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.notif-target-option { cursor: pointer; }
.notif-target-option input { display: none; }
.target-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: 14px;
  border: 2px solid #e2e8f0; background: #fff;
  transition: all 0.15s; text-align: center;
}
.target-card i { font-size: 22px; color: #94a3b8; transition: color 0.15s; }
.target-card span { font-size: 11px; font-weight: 700; color: #475569; }
.notif-target-option:hover .target-card { border-color: #cbd5e1; }
.notif-target-option.active .target-card {
  border-color: var(--sinoai-green); background: #f0fdf7;
}
.notif-target-option.active .target-card i { color: var(--sinoai-green); }
.notif-target-option.active .target-card span { color: var(--sinoai-green-dark); }

/* Live progress */
.notif-progress-card {
  margin-top: 10px;
  border: 1px solid #dbe7f5;
  background: linear-gradient(180deg, #f8fbff 0%, #f4f8ff 100%);
  border-radius: 14px;
  padding: 14px;
}
.notif-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.notif-progress-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.notif-progress-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.notif-progress-status .ti-loader-2 {
  animation: notifSpin 0.9s linear infinite;
}
@keyframes notifSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.notif-progress-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}
.notif-progress-bar-wrap {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 10px;
}
.notif-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa 0%, #22c55e 100%);
  transition: width 0.35s ease;
}
.notif-progress-stats {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.notif-progress-stat {
  border: 1px solid #dde6f5;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
}
.notif-progress-stat span {
  display: block;
  font-size: 11px;
  color: #64748b;
}
.notif-progress-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
@media (max-width: 640px) {
  .notif-progress-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* History */
.notif-history-list { max-height: 600px; overflow-y: auto; }
.notif-history-item {
  display: flex; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid #f8fafc; transition: background 0.12s;
}
.notif-history-item:hover { background: #f8fafc; }
.notif-history-icon {
  width: 32px; height: 32px; border-radius: 10px;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.notif-history-content { flex: 1; min-width: 0; }
.notif-history-title { font-size: 14px; font-weight: 700; color: #0f172a; }
.notif-history-body {
  font-size: 12px; color: #64748b; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif-history-meta {
  display: flex; gap: 12px; margin-top: 6px; font-size: 11px; color: #94a3b8;
}
.notif-history-meta span { display: inline-flex; align-items: center; gap: 3px; }
.notif-history-img {
  width: 48px; height: 48px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0;
}

/* History skeleton loader */
.notif-history-skel:hover { background: transparent; }
.notif-skel-icon,
.notif-skel-thumb,
.notif-skel-line {
  background: linear-gradient(100deg, #e2e8f0 25%, #f8fafc 40%, #e2e8f0 55%);
  background-size: 220% 100%;
  animation: statShimmer 1.15s linear infinite;
}
.notif-skel-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
}
.notif-skel-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
}
.notif-skel-line {
  height: 10px;
  border-radius: 999px;
  display: block;
}
.notif-skel-line.w-85 { width: 85%; margin-top: 8px; }
.notif-skel-line.w-55 { width: 55%; }
.notif-skel-line.w-28 { width: 28%; }
.notif-skel-line.w-24 { width: 24%; }
.notif-skel-line.w-20 { width: 20%; }
.notif-skel-meta {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* ---- Channel Toggle in Admin Layout ---- */
.page-channel-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.page-channel-toggle .toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.page-channel-toggle .toggle-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-channel-toggle .toggle-btn:hover {
  color: #334155;
}

.page-channel-toggle .toggle-btn.active {
  background: var(--sinoai-green);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(80, 171, 147, 0.3);
}

/* ===================================================================
   USER DETAIL PAGE — Hero + 3-Column + Scroll
   =================================================================== */

.udp-main { max-width: 100%; }

/* ---- Hero Profile Card ---- */
.udp-hero {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #0f172a;
}

.udp-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(80, 171, 147, 0.3), transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(99, 102, 241, 0.25), transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.udp-hero-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px 32px 20px;
}

.udp-hero-avatar {
  width: 110px;
  height: 110px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  border: 3px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.udp-hero-avatar img { width: 100%; height: 100%; object-fit: cover; }

.udp-hero-info h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.udp-hero-sub {
  margin: 6px 0 0;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}

.udp-hero-badges {
  position: relative;
  display: flex;
  gap: 8px;
  padding: 0 32px 24px;
  flex-wrap: wrap;
}

.udp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
}

.udp-badge-app { background: rgba(59, 130, 246, 0.3); border-color: rgba(59, 130, 246, 0.3); }
.udp-badge-tg { background: rgba(99, 102, 241, 0.3); border-color: rgba(99, 102, 241, 0.3); }
.udp-badge-outline { background: rgba(255,255,255,0.06); }

/* ---- Stats Strip ---- */
.udp-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.udp-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 18px 20px;
}

.udp-stat-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}

.udp-stat-icon.green { background: rgba(16,185,129,0.1); color: #059669; }
.udp-stat-icon.red { background: rgba(239,68,68,0.1); color: #dc2626; }
.udp-stat-icon.blue { background: rgba(59,130,246,0.1); color: #2563eb; }
.udp-stat-icon.purple { background: rgba(139,92,246,0.1); color: #7c3aed; }

.udp-stat span {
  font-size: 11px; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.03em;
}

.udp-stat strong {
  display: block; font-size: 24px; font-weight: 800;
  color: #0f172a; line-height: 1.1; margin-top: 2px;
}

/* ---- 3 Column Grid ---- */
.udp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* ---- Scroll Box ---- */
.udp-scroll-box {
  max-height: 420px;
  overflow-y: auto;
  padding: 4px;
}

.udp-scroll-box::-webkit-scrollbar { width: 5px; }
.udp-scroll-box::-webkit-scrollbar-track { background: transparent; }
.udp-scroll-box::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 99px; }
.udp-scroll-box::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* ---- Clicks Row ---- */
.udp-clicks-row,
.udp-clicks-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 16px 20px;
}

.udp-click-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(80, 171, 147, 0.1), transparent 38%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  text-align: left;
}

.udp-click-card:hover {
  transform: translateY(-2px);
  background:
    radial-gradient(circle at 0% 0%, rgba(80, 171, 147, 0.14), transparent 42%),
    linear-gradient(180deg, #ffffff, #f0f9ff);
  border-color: rgba(80, 171, 147, 0.35);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.udp-click-card.is-active {
  background:
    radial-gradient(circle at 0% 0%, rgba(80, 171, 147, 0.18), transparent 44%),
    linear-gradient(180deg, #ffffff, #ecfeff);
  border-color: rgba(34, 197, 94, 0.28);
  box-shadow: 0 18px 40px rgba(6, 182, 212, 0.12);
}

.udp-click-card-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.udp-click-icon {
  width: 42px; height: 42px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.udp-click-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  background: rgba(241, 245, 249, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.95);
}

.udp-click-main {
  min-width: 0;
}

.udp-click-label-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.udp-click-label {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
  color: #0f172a;
}

.udp-click-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.udp-click-bar-wrap {
  width: 100%;
  height: 7px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}

.udp-click-bar { height: 100%; border-radius: 99px; transition: width 0.5s ease; }

.udp-click-num {
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  color: #0f172a;
  min-width: 48px;
  text-align: right;
  letter-spacing: -0.03em;
}

.udp-click-last {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

.udp-click-last.is-muted {
  color: #94a3b8;
}

.udp-click-history {
  margin: 8px 20px 20px;
  border-radius: 22px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 16px 36px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.udp-click-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.udp-click-history-head h4 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
  color: #0f172a;
}

.udp-click-history-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.udp-click-history-close:hover {
  transform: translateY(-1px);
  color: #0f172a;
  border-color: rgba(59, 130, 246, 0.28);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.udp-click-history-body {
  padding: 18px 20px 20px;
}

.udp-click-history-summary {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fafc, #eef8ff);
  border: 1px solid rgba(226, 232, 240, 0.95);
}

.udp-click-history-summary-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.udp-click-history-summary-main {
  min-width: 0;
}

.udp-click-history-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.udp-click-history-summary-top strong {
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
}

.udp-click-history-summary-top span {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(226, 232, 240, 0.95);
  font-size: 12px;
  font-weight: 800;
  color: #334155;
}

.udp-click-history-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.udp-click-history-summary-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.udp-click-history-items {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  max-height: 472px;
  overflow-y: auto;
  padding-right: 6px;
  align-content: start;
}

.udp-click-history-items::-webkit-scrollbar {
  width: 8px;
}

.udp-click-history-items::-webkit-scrollbar-track {
  background: rgba(241, 245, 249, 0.9);
  border-radius: 999px;
}

.udp-click-history-items::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.9), rgba(125, 211, 252, 0.9));
  border-radius: 999px;
}

.udp-click-history-items::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(100, 116, 139, 0.95), rgba(56, 189, 248, 0.95));
}

.udp-click-history-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.udp-click-history-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.udp-click-history-item-main {
  min-width: 0;
}

.udp-click-history-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.udp-click-history-item-head strong {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.udp-click-history-item-head span {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  padding: 4px 8px;
}

.udp-click-history-item-details {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
  color: #475569;
}

.udp-click-history-item-time {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.udp-timeline-loading {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 32%),
    linear-gradient(135deg, #f8fbff 0%, #eff7ff 100%);
  border: 1px solid rgba(191, 219, 254, 0.72);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  color: #475569;
  overflow: hidden;
}

.udp-timeline-loading-spinner-wrap {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(191, 219, 254, 0.75);
}

.udp-timeline-loading-spinner {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2.5px solid rgba(56, 189, 248, 0.14);
  border-top-color: #0ea5a4;
  border-right-color: #3b82f6;
  animation: udpTimelineSpinner 0.85s linear infinite;
}

.udp-timeline-loading-main {
  min-width: 0;
}

.udp-timeline-loading-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(191, 219, 254, 0.9);
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.udp-timeline-loading-title {
  margin-top: 8px;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
}

.udp-timeline-loading-lines {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.udp-timeline-loading-lines span {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(226, 232, 240, 0.75), rgba(191, 219, 254, 0.95), rgba(226, 232, 240, 0.75));
  background-size: 200% 100%;
  animation: udpLoadingShimmer 1.8s linear infinite;
}

.udp-timeline-loading-lines span:nth-child(1) { width: 100%; }
.udp-timeline-loading-lines span:nth-child(2) { width: 82%; }
.udp-timeline-loading-lines span:nth-child(3) { width: 64%; }

@keyframes udpLoadingShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes udpTimelineSpinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---- Responsive ---- */
@media (max-width: 1100px) { .udp-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) {
  .udp-grid { grid-template-columns: 1fr; }
  .udp-stats-strip { grid-template-columns: repeat(2, 1fr); }
  .udp-hero-content { flex-direction: column; text-align: center; }
  .udp-hero-badges { justify-content: center; }
  .udp-hero-avatar { width: 90px; height: 90px; font-size: 28px; }
  .udp-click-history,
  .udp-clicks-list { margin-left: 0; margin-right: 0; }
  .udp-click-history-head,
  .udp-click-history-body { padding-left: 16px; padding-right: 16px; }
  .udp-click-history-summary { grid-template-columns: 1fr; }
  .udp-click-history-item { grid-template-columns: 1fr; }
  .udp-click-history-items { max-height: 420px; padding-right: 2px; }
  .udp-timeline-loading { grid-template-columns: 1fr; }
  .udp-timeline-loading-spinner-wrap { width: 52px; height: 52px; }
}

/* ---- Channel Toggle ---- */
.page-channel-toggle {
  display: flex; justify-content: flex-end; margin-bottom: 16px;
}
.page-channel-toggle .toggle-group {
  display: inline-flex; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 14px; padding: 4px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
}
.page-channel-toggle .toggle-btn {
  border: none; border-radius: 10px; padding: 8px 20px;
  font-size: 13px; font-weight: 700; color: #64748b;
  background: transparent; cursor: pointer; transition: all 0.15s;
}
.page-channel-toggle .toggle-btn:hover { color: #334155; }
.page-channel-toggle .toggle-btn.active {
  background: var(--sinoai-green); color: #fff;
  box-shadow: 0 4px 12px rgba(80,171,147,0.3);
}
