/* Customer PC Portal — layout คล้าย Admin */
@media (min-width: 960px) {
  body.customer-pc-portal #customer-portal-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 248px;
    z-index: 200;
    background: linear-gradient(180deg, #0d47a1 0%, #1565c0 48%, #1976d2 100%);
    color: #fff;
    box-shadow: 2px 0 16px rgba(15, 23, 42, 0.12);
  }

  body.customer-pc-portal-sidebar-collapsed #customer-portal-sidebar {
    transform: translateX(-100%);
    pointer-events: none;
    visibility: hidden;
  }

  body.customer-pc-portal.customer-pc-portal-sidebar-collapsed #customer-sidebar-reopen {
    display: flex;
  }

  body.customer-pc-portal-sidebar-collapsed .app {
    margin-left: 0 !important;
  }

  body.customer-pc-portal .app {
    margin-left: 248px !important;
    max-width: none !important;
    width: auto !important;
    min-height: 100vh;
  }

  body.customer-pc-portal #pc-panel,
  body.customer-pc-portal #pc-panel-desktop-reopen,
  body.customer-pc-portal #pc-panel-backdrop,
  body.customer-pc-portal #pc-panel-collapse-desktop,
  body.customer-pc-portal #mobile-app-header,
  body.customer-pc-portal #mobile-app-tabbar,
  body.customer-pc-portal #mobile-pending-fab,
  body.customer-pc-portal #admin-portal-sidebar,
  body.customer-pc-portal #admin-global-toolbar,
  body.customer-pc-portal #admin-sidebar-reopen {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.customer-pc-portal .db-report-screen {
    display: none;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #f5f8ff;
  }

  body.customer-pc-portal .db-report-screen.active {
    display: flex !important;
  }

  body.customer-pc-portal .db-report-screen .db-report-mount {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  body.customer-pc-portal #page-dashboard.admin-db-embedded,
  body.customer-pc-portal #page-dashboard.customer-db-embedded {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    z-index: 1 !important;
    overflow-y: auto;
    background: #f0f4fa;
  }

  body.customer-pc-portal #page-dashboard.admin-db-embedded .db-tabs,
  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-tabs,
  body.customer-pc-portal #page-dashboard.admin-db-embedded .db-back,
  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-back {
    display: none !important;
  }

  body.customer-pc-portal #page-dashboard.admin-db-embedded .db-hdr,
  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-hdr {
    position: sticky;
    top: 0;
    z-index: 5;
  }

  body.customer-pc-portal .cp-hold-screen {
    display: none;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #f0f4fa;
  }

  body.customer-pc-portal .cp-hold-screen.active {
    display: flex !important;
  }

  /* OSA Summary — ตาม mockup ลูกค้า: แถบตัวกรองบน PC, ไม่ใช้ drawer */
  body.customer-pc-portal #page-dashboard.customer-db-embedded > .db-hdr {
    display: none !important;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-mob-filter-btn,
  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-filter-excel-btn {
    display: none !important;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-filter-bar.db-osa-filter-bar {
    background: linear-gradient(135deg, #e3f2fd 0%, #dbeafe 55%, #e8f0fe 100%);
    border-bottom: 1px solid #bfdbfe;
    padding: 14px 20px !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-filter-drawer-wrap {
    position: static;
    inset: auto;
    pointer-events: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-filter-drawer-scrim,
  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-filter-drawer-hdr,
  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-filter-apply-btn {
    display: none !important;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-filter-drawer-panel {
    position: static;
    transform: none;
    width: auto;
    background: transparent;
    box-shadow: none;
    display: block;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-filter-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 0;
    gap: 10px 12px;
    overflow: visible;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-filter-select,
  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-filter-date {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    min-height: 36px;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-card {
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.07);
    border: 1px solid #e8edf3;
    position: relative;
    overflow: hidden;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-card::after {
    content: 'B2C GROUP';
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: rgba(21, 101, 192, 0.06);
    pointer-events: none;
    user-select: none;
    line-height: 1;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-kpi-card {
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.07);
    border: 1px solid #e8edf3;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-osa-hero-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-osa-hero-kpi {
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.07);
    border: 1px solid #e8edf3;
    background: #fff !important;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-osa-hero-val {
    font-size: 36px !important;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-osa-macro-charts {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-osa-macro-card::after,
  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-osa-heatmap-card::after {
    display: none;
  }

  /* OOS & Reason Code — Executive dashboard */
  body.customer-pc-portal #page-dashboard.customer-db-embedded .db-filter-bar.db-oos-filter-bar {
    background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 45%, #fef2f2 100%);
    border-bottom: 1px solid #fecaca;
    padding: 14px 20px !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded #db-tab-oos .db-oos-kw-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded #db-tab-oos .db-oos-filter.db-oos-top-problem {
    box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.14), 0 10px 28px rgba(198, 40, 40, 0.16) !important;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded #db-tab-oos .db-oos-insight-card {
    margin-bottom: 14px;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded #db-tab-oos .db-oos-exec-table {
    font-size: 12px;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded #db-tab-oos .db-oos-list-card::after {
    display: none;
  }

  body.customer-pc-portal #page-dashboard.customer-db-embedded #db-tab-oos .db-oos-insight-card::after {
    display: none;
  }

  body.customer-pc-portal #customer-portal-sidebar .admin-nav-item.active {
    background: rgba(255, 255, 255, 0.24);
    font-weight: 700;
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.85);
  }

  body.customer-pc-portal #customer-portal-sidebar .admin-acc {
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid transparent;
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.2);
  }

  body.customer-pc-portal #customer-portal-sidebar .admin-acc[data-acc="reports"] {
    background: linear-gradient(145deg, rgba(167, 243, 208, 0.42) 0%, rgba(110, 231, 183, 0.2) 100%);
    border-color: rgba(167, 243, 208, 0.52);
    box-shadow: inset 3px 0 0 #6ee7b7;
  }

  body.customer-pc-portal #customer-portal-sidebar .admin-acc[data-acc="hold"] {
    background: linear-gradient(145deg, rgba(254, 215, 170, 0.46) 0%, rgba(253, 186, 116, 0.24) 100%);
    border-color: rgba(254, 215, 170, 0.58);
    box-shadow: inset 3px 0 0 #fdba74;
  }

  body.customer-pc-portal #customer-portal-sidebar .admin-acc[data-acc="reports"] .admin-nav-item.active {
    background: rgba(167, 243, 208, 0.4);
  }

  body.customer-pc-portal #customer-portal-sidebar .admin-acc[data-acc="hold"] .admin-nav-item.active {
    background: rgba(254, 215, 170, 0.42);
  }
}

#customer-sidebar-reopen {
  display: none;
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 210;
  border: none;
  border-radius: 0 10px 10px 0;
  background: #1565c0;
  color: #fff;
  padding: 14px 10px 14px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 0 14px rgba(0, 0, 0, 0.18);
  font-family: inherit;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

#customer-portal-sidebar .admin-sidebar-brand h1 {
  font-size: 17px;
}

.customer-sidebar-foot {
  margin-top: auto;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.customer-sidebar-user {
  margin-bottom: 10px;
  word-break: break-word;
}

.customer-sidebar-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.customer-sidebar-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.45);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.customer-sidebar-user-text {
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.95;
  min-width: 0;
}

.customer-sidebar-user-region {
  opacity: 0.78;
  font-size: 11px;
  margin-top: 2px;
}

.customer-sidebar-logout {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.customer-sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.16);
}

#customer-portal-sidebar .admin-nav-item.customer-nav-maint {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  opacity: 0.82;
  cursor: not-allowed;
}

#customer-portal-sidebar .admin-nav-item.customer-nav-maint:hover {
  background: rgba(255, 255, 255, 0.1);
}

#customer-portal-sidebar .customer-nav-label {
  font-size: 13px;
  font-weight: 600;
}

#customer-portal-sidebar .customer-nav-badge {
  font-size: 10px;
  font-weight: 600;
  color: #fde68a;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.35;
}

#customer-portal-sidebar .customer-nav-oos-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 8px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.cp-maint-msg {
  color: #b45309 !important;
  font-weight: 600;
}

.cp-maint-panel {
  background: #fff;
  border: 1px dashed #fcd34d;
  border-radius: 14px;
  padding: 40px 24px;
  text-align: center;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.cp-maint-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.cp-maint-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #b45309;
}

.cp-maint-desc {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.cp-page-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 32px;
}

.cp-page-hdr h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: #0f172a;
}

.cp-page-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.cp-hold-body {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.cp-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.cp-account-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  padding: 14px 14px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  cursor: default;
  font-family: inherit;
  min-height: 88px;
}

.cp-account-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.cp-account-card-sub {
  font-size: 11px;
  color: #94a3b8;
}

.cp-account-empty {
  text-align: center;
  color: #94a3b8;
  padding: 28px 12px;
  font-size: 13px;
}

/* Competitor Intelligence Wall */
.cp-competitor-wall {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cp-competitor-overview,
.cp-competitor-detail {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 32px;
}

.cp-competitor-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.cp-competitor-hdr h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: #0f172a;
}

.cp-competitor-hdr-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cp-competitor-round-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.cp-competitor-round-filter select {
  min-width: 180px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
}

.cp-competitor-refresh-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #1565c0;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.cp-competitor-refresh-btn:hover {
  background: #eff6ff;
}

.cp-competitor-admin-rounds {
  margin: 0 0 20px;
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.cp-competitor-admin-rounds-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cp-competitor-admin-rounds-hdr h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: #0f172a;
}

.cp-competitor-admin-rounds-hdr p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.cp-competitor-rounds-list {
  display: grid;
  gap: 8px;
}

.cp-competitor-round-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.cp-competitor-round-card.is-inactive {
  opacity: 0.72;
  background: #f8fafc;
}

.cp-competitor-round-card-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.cp-competitor-round-card-meta {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.cp-competitor-round-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.cp-competitor-round-badge.on {
  background: #dcfce7;
  color: #166534;
}

.cp-competitor-round-badge.off {
  background: #fee2e2;
  color: #991b1b;
}

.cp-competitor-round-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.cp-competitor-round-form {
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.cp-competitor-round-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.cp-competitor-round-form input[type="text"],
.cp-competitor-round-form input[type="date"] {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}

.cp-competitor-round-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cp-competitor-round-active {
  display: flex !important;
  align-items: center;
  gap: 8px;
  grid-template-columns: none !important;
}

.cp-competitor-round-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cp-competitor-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.cp-competitor-account-card {
  border-radius: 16px;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-size: cover;
  background-position: center;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.cp-competitor-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 0;
}

.cp-competitor-card-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.cp-competitor-card-count {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.55);
  padding: 4px 10px;
  border-radius: 999px;
}

.cp-competitor-card-body {
  padding: 14px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.82) 28%, rgba(15, 23, 42, 0.92) 100%);
  color: #fff;
}

.cp-competitor-card-name {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
}

.cp-competitor-card-sub {
  margin: 0 0 12px;
  font-size: 11px;
  opacity: 0.88;
}

.cp-competitor-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cp-competitor-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}

.cp-competitor-btn-primary {
  background: #1565c0;
  color: #fff;
  box-shadow: 0 2px 10px rgba(21, 101, 192, 0.35);
}

.cp-competitor-btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.cp-competitor-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cp-competitor-detail-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.cp-competitor-back-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.cp-competitor-detail-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.cp-competitor-detail-title-wrap h3 {
  margin: 0;
  font-size: 20px;
  color: #0f172a;
}

.cp-competitor-detail-count {
  font-size: 12px;
  color: #64748b;
}

.cp-competitor-download-all-btn {
  border: none;
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(21, 101, 192, 0.28);
  white-space: nowrap;
}

.cp-competitor-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.cp-competitor-back-sub-btn {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: #475569;
}

.cp-competitor-gallery-breadcrumb {
  font-size: 12px;
  font-weight: 700;
  color: #1565c0;
  margin-right: 8px;
}

.cp-competitor-category-browser {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cp-competitor-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.cp-competitor-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.cp-competitor-section-hdr.kc {
  background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
  color: #fff;
}

.cp-competitor-section-hdr.competitor {
  background: linear-gradient(135deg, #c62828 0%, #8e0000 100%);
  color: #fff;
}

.cp-competitor-section-hdr h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.cp-competitor-section-count {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
}

.cp-competitor-subcat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 14px;
}

.cp-competitor-subcat-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.cp-competitor-subcat-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(21, 101, 192, 0.12);
  transform: translateY(-1px);
}

.cp-competitor-subcat-card.has-photos {
  background: #fff;
  border-color: #bfdbfe;
}

.cp-competitor-subcat-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 6px;
}

.cp-competitor-subcat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
}

.cp-competitor-subcat-count {
  font-weight: 700;
  color: #1565c0;
}

.cp-competitor-subcat-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 8px;
  background: #e2e8f0;
  display: block;
}

.cp-competitor-subcat-empty {
  font-size: 10px;
  color: #94a3b8;
  font-style: italic;
}

.cp-competitor-filter-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cp-competitor-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-right: 8px;
}

.cp-competitor-pill {
  border: 1px solid #dbe3ef;
  background: #f8fafc;
  color: #475569;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.cp-competitor-pill.active {
  background: #1565c0;
  border-color: #1565c0;
  color: #fff;
}

.cp-competitor-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.cp-competitor-photo-card {
  margin: 0;
  cursor: pointer;
}

.cp-competitor-photo-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid #e2e8f0;
}

.cp-competitor-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.cp-competitor-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 35%, rgba(15, 23, 42, 0.88) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
}

.cp-competitor-photo-card:hover .cp-competitor-photo-overlay {
  opacity: 1;
}

.cp-competitor-photo-card:hover img {
  transform: scale(1.04);
}

.cp-competitor-photo-meta {
  font-size: 10px;
  color: #fff;
  line-height: 1.45;
  padding-right: 36px;
}

.cp-competitor-photo-dl {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: #1565c0;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.cp-competitor-loading,
.cp-competitor-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #94a3b8;
  padding: 48px 16px;
  font-size: 13px;
}

.cp-competitor-lightbox {
  position: fixed;
  inset: 0;
  z-index: 13000;
}

.cp-competitor-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
}

.cp-competitor-lightbox-panel {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 56px;
  box-sizing: border-box;
}

.cp-competitor-lightbox-top {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
}

.cp-competitor-lb-counter {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.cp-competitor-lb-download {
  margin-left: auto;
  border: none;
  background: #1565c0;
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.cp-competitor-lb-close {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 22px;
  cursor: pointer;
}

.cp-competitor-lb-stage {
  max-width: min(920px, 100%);
  width: 100%;
  text-align: center;
}

.cp-competitor-lb-stage img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.cp-competitor-lb-meta {
  margin-top: 12px;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.5;
}

.cp-competitor-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  z-index: 2;
}

.cp-competitor-lb-prev { left: 12px; }
.cp-competitor-lb-next { right: 12px; }

@media (max-width: 768px) {
  .cp-competitor-overview,
  .cp-competitor-detail {
    padding: 14px 14px 24px;
  }

  .cp-competitor-download-all-btn {
    width: 100%;
  }

  .cp-competitor-lightbox-panel {
    padding: 56px 12px 20px;
  }

  .cp-competitor-lb-nav {
    display: none;
  }
}

/* ===== Competitor Dashboard ===== */
.cp-competitor-viewtabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.cp-competitor-viewtab {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cp-competitor-viewtab.active {
  background: #fff;
  color: #1565c0;
}

.cp-competitor-dashboard {
  padding: 0 18px 24px;
}

.cp-dash-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.cp-dash-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.cp-dash-filter select {
  border: none;
  background: transparent;
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.cp-dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.cp-dash-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.cp-dash-kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
}

.cp-dash-kpi-icon.k-photo { background: #e0edff; }
.cp-dash-kpi-icon.k-acc { background: #e7f7ee; }
.cp-dash-kpi-icon.k-store { background: #ede9fe; }
.cp-dash-kpi-icon.k-chk { background: #fff1e6; }

.cp-dash-kpi-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cp-dash-kpi-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.cp-dash-kpi-val {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.cp-dash-kpi-delta {
  font-size: 11px;
  font-weight: 700;
}

.cp-dash-kpi-delta.up { color: #16a34a; }
.cp-dash-kpi-delta.down { color: #dc2626; }

.cp-dash-kpi-sub {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.cp-dash-charts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.cp-dash-lower {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.cp-dash-card {
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.cp-dash-card-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.cp-dash-canvas-wrap {
  position: relative;
  height: 240px;
}

.cp-dash-card-donut .cp-dash-canvas-wrap {
  height: 220px;
}

.cp-dash-leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cp-dash-lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-bottom: 1px solid #f1f5f9;
}

.cp-dash-lb-row:last-child { border-bottom: none; }

.cp-dash-lb-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
  flex: 0 0 auto;
}

.cp-dash-lb-rank.r1 { background: #fef3c7; color: #b45309; }
.cp-dash-lb-rank.r2 { background: #e2e8f0; color: #475569; }
.cp-dash-lb-rank.r3 { background: #fde4cf; color: #c2410c; }

.cp-dash-lb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1565c0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}

.cp-dash-lb-name {
  flex: 1;
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-dash-lb-count {
  font-size: 12px;
  color: #1565c0;
  font-weight: 700;
  flex: 0 0 auto;
}

.cp-dash-lb-empty,
.cp-dash-recent-empty {
  color: #94a3b8;
  font-size: 13px;
  padding: 8px 0;
}

.cp-dash-recent-card { margin-bottom: 4px; }

.cp-dash-recent {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cp-dash-recent-item {
  position: relative;
  margin: 0;
  flex: 0 0 auto;
  width: 130px;
  cursor: pointer;
}

.cp-dash-recent-item img {
  width: 130px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #f1f5f9;
}

.cp-dash-recent-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.cp-dash-recent-badge.kc { background: #22c55e; }
.cp-dash-recent-badge.comp { background: #f97316; }

.cp-dash-recent-item figcaption {
  font-size: 11px;
  color: #475569;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-dash-empty,
.cp-dash-loading {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  padding: 30px 0;
}

@media (max-width: 1024px) {
  .cp-dash-charts { grid-template-columns: 1fr 1fr; }
  .cp-dash-card-donut { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .cp-competitor-dashboard { padding: 0 14px 24px; }
  .cp-dash-kpis { grid-template-columns: 1fr 1fr; }
  .cp-dash-charts { grid-template-columns: 1fr; }
  .cp-dash-lower { grid-template-columns: 1fr; }
  .cp-dash-kpi-val { font-size: 22px; }
}
