/* ===================================================================
   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;
}

/* Davlat tanlash (multi-country) dropdown */
/* Flag emoji'lar Windows/Chrome'da harf ("UZ","KZ"...) bo'lib ko'rinadi. Bu font faqat bayroq
   belgilarini (regional indicator) haqiqiy bayroq qilib chizadi; matn fallback fontdan keladi. */
@font-face {
  font-family: "Twemoji Country Flags";
  unicode-range: U+1F1E6-1F1FF;
  src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2") format("woff2");
  font-display: swap;
}

.country-switch {
  display: inline-flex;
  align-items: center;
}

.country-select {
  height: 38px;
  padding: 0 30px 0 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #334155;
  font-family: "Twemoji Country Flags", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.country-select:hover {
  border-color: var(--sinoai-green);
}

.country-select:focus {
  border-color: var(--sinoai-green);
  box-shadow: 0 0 0 2px rgba(80, 171, 147, 0.22);
}

.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;
}

/* Sidebar toggle — persistent (visible at all widths). */
.mobile-menu-btn {
  display: inline-flex;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Collapsed sidebar (manual toggle or auto on narrow viewport) — works at all widths. */
.page.nav-closed .admin-sidebar {
  transform: translateX(-100%);
}
.page.nav-closed .admin-content {
  margin-left: 0;
}
/* Dimmer behind the sidebar when it's open over content (narrow screens). */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}
.sidebar-overlay.show {
  display: block;
}

/* ---- 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);
}

/* Online widget: header row with manual refresh button + last-updated meta. */
.online-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.online-refresh-btn {
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: #ffffff;
  color: #2563eb;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  transition: background 0.15s ease;
}
.online-refresh-btn:hover { background: rgba(59, 130, 246, 0.1); }
.online-refresh-btn.is-loading { pointer-events: none; opacity: 0.7; }
.online-refresh-btn.is-loading i { animation: vspin 0.8s linear infinite; }
.online-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.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;
  }
}

/* On narrow viewports the content takes full width; the sidebar (when open) overlays
   it with the dimmer. JS adds/removes .nav-closed across the 1024px threshold. */
@media (max-width: 1024px) {
  .admin-content {
    margin-left: 0;
  }
  .admin-sidebar {
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.3);
  }
}

@media (max-width: 768px) {
  .admin-page-content {
    padding: 16px;
  }
  .users-stats-row {
    grid-template-columns: 1fr;
  }
}

/* ===== 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;
}

/* Bounded-sample note under the activity timeline (recent activity only). */
.ud-timeline-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: #b45309;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 10px;
}
.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);
}

/* ============ No-flash (FOUC prevention) ============
   Sahifa body.admin-layout.no-flash bilan keladi.
   admin-auth.js buildSidebar tugagach "no-flash"ni olib tashlaydi.
*/
body.no-flash {
  visibility: hidden !important;
}
body.admin-layout:not(.no-flash) {
  visibility: visible;
  animation: fadeInPage 0.15s ease-out;
}
@keyframes fadeInPage {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Har ehtimolga — 1 soniya ichida ko'rinmasa ham ko'rsatsin */
body.no-flash {
  animation: noFlashTimeout 1s forwards;
}
@keyframes noFlashTimeout {
  99% { visibility: hidden; }
  100% { visibility: visible; }
}

/* ============================================================
   Cross-page navigation polish — flicker'ni kamaytirish
   ============================================================
*/

/* HTML va body ga admin panelga mos fon — sahifa o'tganda oq flash o'rniga yoqimli rang */
html {
  background-color: #f1f5f9;
}
html, body {
  background-color: #f1f5f9;
}

/* View Transitions API (Chrome 111+, Edge 111+, Safari 18+) — MPA uchun smooth fade */
@view-transition {
  navigation: auto;
}

/* Transition animatsiyasi */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.25s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
::view-transition-old(root) {
  animation-name: vt-fade-out;
}
::view-transition-new(root) {
  animation-name: vt-fade-in;
}
@keyframes vt-fade-out {
  to { opacity: 0; }
}
@keyframes vt-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Sidebar transition'da qotirilsin — shift ko'rinmasin */
.admin-sidebar {
  view-transition-name: admin-sidebar;
}
::view-transition-group(admin-sidebar) {
  animation-duration: 0s;  /* sidebar mutlaqo harakatlanmaydi */
}

/* ============ KPI Info Button ============ */
.kpi-chip-header {
  position: relative;
}
.kpi-info-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  transition: color 0.15s ease, background 0.15s ease;
}
.kpi-info-btn:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}
.kpi-info-btn:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

/* ============ Retention Info Modal ============ */
.info-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10010;
  padding: 24px;
  overflow-y: auto;
}
.info-modal-backdrop.open {
  display: flex;
}
.info-modal {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.info-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
}
.info-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.info-modal-title i {
  font-size: 22px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.info-modal-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
.info-modal-close {
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.15s ease, color 0.15s ease;
}
.info-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.info-modal-body {
  padding: 20px 24px 28px;
  overflow-y: auto;
  color: #334155;
  font-size: 14px;
  line-height: 1.6;
}
.info-modal-body h3 {
  margin: 18px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.info-modal-body h3:first-child {
  margin-top: 0;
}
.info-modal-body h4 {
  margin: 14px 0 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.info-modal-body p {
  margin: 6px 0;
}
.info-modal-body ul {
  margin: 6px 0 10px;
  padding-left: 22px;
}
.info-modal-body li {
  margin: 3px 0;
}
.info-modal-body code {
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.info-modal-body .info-example {
  background: #f8fafc;
  border-left: 3px solid #10b981;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
}
.info-modal-body .info-example strong {
  color: #0f172a;
}
.info-modal-body .info-note {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 12px 0;
}

/* ============ Retention KPI — D1/D7/D30 kompakt ============ */
/* Ikki qator (retention + churn) ustma-ust. Har birida bir xil kenglikdagi yorliq bor, shu sababli
   D1/D7/D30 qiymatlari ikkala qatorda ham bitta vertikal chiziqdan boshlanadi. */
.kpi-retention-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.kpi-retention-inline .kpi-retention-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
.kpi-retention-inline .kpi-retention-item + .kpi-retention-item {
  position: relative;
}
.kpi-retention-inline .kpi-retention-item + .kpi-retention-item::before {
  content: "·";
  color: #cbd5e1;
  margin-right: 6px;
  font-weight: 400;
}
.kpi-retention-inline em {
  font-size: 10.5px;
  font-weight: 600;
  font-style: normal;
  color: #94a3b8;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Churn qatori — retention ostida (churn = 100 − retention). Alohida qatorga tushadi. */
.kpi-churn-inline {
  margin-top: 6px;
  font-size: 13.5px;
}
/* Churn — oddiy ko'rsatkich, XATO EMAS. Qizil (#dc2626) ogohlantirishdek ko'rinardi; endi neytral
   kulrang: e'tiborni retention (asosiy qiymat) o'ziga oladi. */
.kpi-churn-inline .kpi-retention-item {
  color: #475569;
}

/* Har ikkala qator yorlig'i — bir xil eng kichik kenglik = D1/D7/D30 qiymatlari tekislanadi.
   `flex: 0 0 auto` + `min-width`: uzunroq tarjima (masalan "Удержание") qisilib ketmaydi, balki
   yorliqni kengaytiradi — matn kesilmaydi. Katta harflar YO'Q: kirill uchun o'qish osonroq. */
.kpi-metric-tag {
  flex: 0 0 auto;
  min-width: 78px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-radius: 6px;
  padding: 2px 7px;
  line-height: 1.5;
  white-space: nowrap;
}
.kpi-metric-tag.is-retention {
  color: #2b7a68;                       /* --sidebar-accent (#50ab93) ning to'q varianti — kontrast uchun */
  background: rgba(80, 171, 147, 0.14);
}
.kpi-metric-tag.is-churn {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
}

/* ============ Operator call-back status cell (page5-details) ============ */
/* Shared here so BOTH the standalone (Frontend/page5-details.html) and the SPA fragment
   (Frontend/pages/page5-details.html) render the operator-status column identically. */
.op-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}
/* Rang indikatori qatori: holat nuqtasi + select. */
.op-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.op-status-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.05);
  transition: background 0.15s ease;
}
.op-status-select {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.op-status-select:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}
/* "Boshqa" izohi: matn maydoni + tasdiqlash/bekor qilish tugmalari bitta qatorda. */
.op-status-note-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
/* `hidden` atributi `display:flex`dan kuchsizroq — aks holda qator baribir ko'rinardi. */
.op-status-note-row[hidden] {
  display: none;
}
.op-status-note {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.op-status-note:focus {
  border-color: #7c3aed;
}
.op-status-note[hidden] {
  display: none;
}
/* Tasdiqlash/bekor qilish faqat o'zgarish kiritilganda ko'rinadi — `hidden`ni JS boshqaradi. */
.op-status-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.op-status-actions[hidden] {
  display: none;
}
.op-status-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font-size: 15px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.op-status-btn:hover:not(:disabled) {
  background: #f8fafc;
}
.op-status-btn.is-confirm:hover:not(:disabled) {
  color: #16a34a;
  border-color: #16a34a66;
}
.op-status-btn.is-cancel:hover:not(:disabled) {
  color: #dc2626;
  border-color: #dc262666;
}
.op-status-btn:disabled {
  background: #f1f5f9;
  color: #cbd5e1;
  cursor: not-allowed;
}

/* ============ Notification Multi-language Blocks ============ */
.notif-multi-lang .notif-lang-hint {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 6px;
  margin-bottom: 12px;
  line-height: 1.4;
}
.notif-multi-lang .notif-lang-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  margin-bottom: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.notif-multi-lang .notif-lang-block:focus-within {
  border-color: #3b82f6;
  background: #ffffff;
}
.notif-multi-lang .notif-lang-block:last-child {
  margin-bottom: 0;
}
.notif-multi-lang .notif-lang-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.notif-multi-lang .notif-lang-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: 6px;
}
.notif-multi-lang .notif-lang-required {
  font-size: 10.5px;
  font-weight: 600;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.notif-multi-lang .notif-lang-block input,
.notif-multi-lang .notif-lang-block textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.notif-multi-lang .notif-lang-block input:focus,
.notif-multi-lang .notif-lang-block textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.notif-multi-lang .notif-lang-block textarea {
  resize: vertical;
  min-height: 72px;
}

/* ===== Banner Admin ===== */
.banner-admin-layout {
  display: grid;
  grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.banner-form-card,
.banner-list-card {
  border-color: #d8e1ea;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.banner-form-card .notif-form-header,
.banner-list-card .notif-form-header {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-bottom-color: #e6edf5;
}

.banner-upload {
  width: 100%;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(80, 171, 147, 0.08), rgba(59, 130, 246, 0.06)),
    #f8fafc;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.banner-lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.banner-lang-upload {
  position: relative;
}

.banner-lang-label {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 7px;
  padding: 0 8px;
  background: rgba(15, 23, 42, 0.76);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.banner-upload:hover {
  border-color: #50ab93;
  box-shadow: 0 10px 24px rgba(80, 171, 147, 0.14);
  transform: translateY(-1px);
}

.banner-upload-preview {
  /* width:100% pins the box to the button. Without it, aspect-ratio + min-height
     drive the WIDTH from the height (112 * 16/6.2 ≈ 289px), overflowing the
     narrower button — which clips the icon/text and pushes them off-centre. */
  width: 100%;
  box-sizing: border-box;
  aspect-ratio: 16 / 6.2;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #53657d;
  font-weight: 800;
  position: relative;
}

.banner-upload-preview i {
  font-size: 28px;
  color: #50ab93;
}

/* Upload prompt matni quti ichida qolsin (uzun RU matni ham): markazlash + o'rash. */
.banner-upload-preview span {
  display: block;
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
  padding: 0 10px;
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
  /* Ota elementdan meros bo'lgan nowrap'ni bekor qilamiz — matn quti ichida o'ralsin. */
  white-space: normal !important;
  overflow-wrap: break-word;
  word-break: break-word;
}

.banner-upload-preview img,
.banner-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-form-row {
  display: grid;
  /* The toggle column is `auto` so it grows to fit its label ("Активен" is wider
     than a fixed 104px and used to spill outside the box). */
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.banner-active-toggle {
  height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #fbfdff;
  color: #26364a;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.banner-list {
  display: grid;
  /* min(280px, 100%) lets a card shrink (squeeze) to the column width instead of
     forcing a rigid 280px track that overflows / gets cut when the page is halved. */
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 16px;
  padding: 18px;
}

.banner-item {
  display: flex;
  flex-direction: column;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  min-width: 0;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.banner-item:hover {
  border-color: #b7c6d8;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.banner-item.is-inactive {
  opacity: 0.62;
}

.banner-thumb {
  aspect-ratio: 16 / 7;
  border-radius: 7px;
  overflow: hidden;
  background: #e2e8f0;
  position: relative;
}

.banner-item-main {
  min-width: 0;
  padding: 4px 2px 0;
}

.banner-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0;
}

.banner-type,
.banner-status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 7px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.banner-type {
  background: #ecfeff;
  color: #0e7490;
}

.banner-status {
  background: #f8fafc;
  color: #475569;
}

.banner-item.is-active .banner-status {
  background: #dcfce7;
  color: #166534;
}

.banner-url {
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-lang-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.banner-lang-dot {
  display: inline-flex;
  align-items: center;
  height: 22px;
  border-radius: 7px;
  padding: 0 7px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.banner-lang-dot.is-ready {
  background: #eefbf7;
  color: #0f766e;
}

.banner-meta {
  margin-top: 7px;
  color: #94a3b8;
  font-size: 12px;
}

.banner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid #edf2f7;
}

.banner-thumb-overlay {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.banner-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.banner-icon-btn:hover {
  background: #eef6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.banner-icon-btn.is-danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* Banner kliklari modal */
.banner-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.banner-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  /* Booking jadvali 7 ustunli (status select bilan) — modalni kengaytiramiz, aks holda
     oxirgi ustun (o'chirish) modal chetidan chiqib ketadi. */
  max-width: 760px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.3);
}

.banner-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eef2f7;
}

.banner-modal-body {
  padding: 16px 20px;
  overflow: auto;
}

.banner-clicks-total {
  font-weight: 700;
  color: #334155;
  margin-bottom: 12px;
}

.banner-clicks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.banner-clicks-table th,
.banner-clicks-table td {
  text-align: left;
  padding: 8px 7px;
  border-bottom: 1px solid #f1f5f9;
}
/* Oxirgi (o'chirish) ustun ixcham — modal chetidan chiqib ketmasligi uchun. */
.banner-clicks-table th:last-child,
.banner-clicks-table td:last-child {
  width: 1%;
  padding-right: 0;
  white-space: nowrap;
}

.banner-clicks-table th {
  color: #64748b;
  font-weight: 600;
}

.banner-click-platform {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

/* Product category badge */
.banner-cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  background: #f3e8ff;
  color: #7c3aed;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

/* Category filter bar in the banner list header */
/* Sarlavha bir qatorda: sarlavha CHAPDA, filtr O'NGDA (space-between). */
.notif-form-header.has-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.banner-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}
.banner-filter-bar .admin-select {
  max-width: 200px;
}

/* Events modal: interest/booking filter chips + booking-status filter */
.banner-events-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 0;
}
/* Buyurtma holati filtri — o'ng tomonga suriladi (faqat product banner uchun ko'rinadi). */
.banner-status-filter {
  margin-left: auto;
  height: 32px;
  min-width: 150px;
  max-width: 190px;
  font-size: 12px;
}
.banner-evt-chip {
  border: 1px solid #dbe4ee;
  background: #f8fafc;
  color: #475569;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.banner-evt-chip.is-active {
  background: linear-gradient(135deg, #50ab93, #3e8f7a);
  color: #fff;
  border-color: transparent;
}

/* Action badge in the events table */
.banner-evt-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}
.banner-evt-badge.is-interest {
  background: #eef6ff;
  color: #1d4ed8;
}
.banner-evt-badge.is-booking {
  background: #dcfce7;
  color: #15803d;
}

/* Product booking status dropdown — themed select (.admin-select) tinted by status. */
.booking-status-select {
  height: 32px;
  min-width: 108px;
  font-size: 12px;
  border-left-width: 4px;
}
.booking-status-select.is-new { border-left-color: #94a3b8; }
.booking-status-select.is-confirmed { border-left-color: #2563eb; }
.booking-status-select.is-delivered { border-left-color: var(--sinoai-green); }
.booking-status-select.is-cancelled { border-left-color: #ef4444; }

/* Delete event button */
.banner-evt-del {
  border: 1px solid #fee2e2;
  background: #fff5f5;
  color: #ef4444;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease;
}
.banner-evt-del:hover { background: #fee2e2; }

/* Stack the form above the list before the right column gets too narrow to hold a
   card (≈1024–1060px with the sidebar open), so banners never get cramped/cut. */
@media (max-width: 1080px) {
  .banner-admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .banner-lang-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Market Orders ===== */
.market-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.market-header {
  align-items: center;
}

.market-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 170px 170px;
  gap: 14px;
  align-items: center;
}

.market-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.market-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  padding: 22px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.market-stat-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 24px;
}

.market-stat-icon.is-green {
  background: #ecfdf5;
  color: #047857;
}

.market-stat-icon.is-blue {
  background: #eff6ff;
  color: #1d4ed8;
}

.market-stat-icon.is-amber {
  background: #fffbeb;
  color: #b45309;
}

.market-stat-icon.is-red {
  background: #fef2f2;
  color: #dc2626;
}

.market-stat-card p {
  margin: 0 0 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.market-stat-card strong {
  color: #0f172a;
  font-size: 30px;
  line-height: 1;
}

.market-table-card {
  overflow: hidden;
}

.market-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid #e5edf6;
}

.market-card-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
}

.market-card-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
}

.market-order-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.market-order-cell strong {
  color: #0f172a;
  font-size: 14px;
}

.market-order-cell span {
  color: #94a3b8;
  font-size: 12px;
}

.market-status {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.market-status-completed,
.market-status-done {
  background: #dcfce7;
  color: #166534;
}

.market-status-cancelled,
.market-status-canceled,
.market-status-rejected {
  background: #fee2e2;
  color: #991b1b;
}

.market-status-processing,
.market-status-pending,
.market-status-new {
  background: #dbeafe;
  color: #1d4ed8;
}

@media (max-width: 1100px) {
  .market-filters,
  .market-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .market-filters,
  .market-stat-grid {
    grid-template-columns: 1fr;
  }

  .market-header {
    align-items: flex-start;
  }
}

/* ============================================================
   Global checkbox fix — `.form-group input` (style.css) forces width:100%;
   height:42px on ALL inputs, which turns checkboxes into a giant box. Keep
   checkboxes a normal small box everywhere (blog auto-slug/active, banner
   active, community premium, and any future one). Loaded after style.css so
   this wins the tie; more specific rules (e.g. .perm-checkbox) still override.
   ============================================================ */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
  accent-color: #50ab93;
  cursor: pointer;
}
