/* ══════════════════════════════════════════════════════════
   Ad Performance Module — Professional Dashboard Styles
   ══════════════════════════════════════════════════════════ */

/* ── General Badges ── */
.adp-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.adp-badge-meta { background: #E8F0FE; color: #1877F2; }
.adp-badge-google { background: #FEF7E0; color: #B06000; }

.status-label-active { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.status-label-paused { background: #F3F4F6; color: #4B5563; border: 1px solid #D1D5DB; }

/* Progress bars (existing pages) */
.adp-progress-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}
.adp-progress-bar.meta-bar { background: linear-gradient(90deg, #1877F2, #63A4FF); }
.adp-progress-bar.google-bar { background: linear-gradient(90deg, #E8A200, #FBBF24); }
.adp-progress-bar.balance-bar { background: linear-gradient(90deg, #4F46E5, #818CF8); }


/* ══════════════════════════════════════════════════════════
   HOME WIDGET — Professional Card Dashboard
   ══════════════════════════════════════════════════════════ */

/* ── Root Container ── */
.adp-home-widget {
  margin-top: 28px;
  margin-bottom: 20px;
  width: 100%;
}

/* Reset Perfex panels inside our widget */
.adp-home-widget .panel_s {
  background: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: 0;
  padding: 0;
}
.adp-home-widget .panel_s .panel-body {
  padding: 0;
  background: transparent;
}

/* ── Section Block ── */
.adp-section {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid #f0f0f5;
}

/* ── Section Header ── */
.adp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f4f5f9;
}
.adp-section-header h4 {
  margin: 0;
  padding: 0;
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}
.adp-section-header h4 .adp-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.adp-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.adp-period-label {
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
  border: 1px solid #e5e7eb;
}

/* ── Project Cards Grid ── */
.adp-projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) {
  .adp-projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .adp-projects-grid { grid-template-columns: 1fr; }
}

.adp-project-card {
  text-decoration: none !important;
  color: inherit;
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.adp-project-card:hover {
  transform: translateY(-3px);
  text-decoration: none !important;
}

.adp-project-card-inner {
  background: #ffffff;
  border: 1px solid #e8ecf1;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  min-height: 105px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.adp-project-card:hover .adp-project-card-inner {
  border-color: #818cf8;
  box-shadow: 0 8px 24px rgba(99,102,241,0.12);
}

.adp-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.adp-project-card-inner h5 {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.45;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.adp-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  line-height: 1.6;
  flex-shrink: 0;
}

.adp-card-meta {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 10px;
  gap: 4px;
}

.adp-progress-wrap { margin-top: auto; }
.adp-progress-text {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.adp-progress-track {
  background: #e5e7eb;
  border-radius: 8px;
  height: 6px;
  overflow: hidden;
}
.adp-progress-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.8s ease;
}

/* ── KPI Cards Grid ── */
.adp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) {
  .adp-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .adp-kpi-grid { grid-template-columns: 1fr; }
}

.adp-kpi-card {
  background: #ffffff;
  border: 1px solid #eef0f4;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.adp-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--kpi-color, #6366f1);
  border-radius: 14px 14px 0 0;
}
.adp-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.adp-kpi-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.adp-kpi-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.adp-kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

/* ── Widget Row (2 columns) ── */
.adp-widget-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .adp-widget-row { grid-template-columns: 1fr; }
}

.adp-widget-col-half { min-width: 0; }

.adp-chart-box {
  background: #ffffff;
  border: 1px solid #eef0f4;
  border-radius: 14px;
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.adp-chart-box h5 {
  margin: 0 0 18px 0;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.adp-chart-box h5 i {
  color: #6366f1;
}

.adp-chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0 4px;
}
.adp-chart-container canvas {
  max-width: 200px !important;
  max-height: 200px !important;
}

/* ── Platform Legend ── */
.adp-platform-legend {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.adp-legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
  transition: all 0.15s ease;
}
.adp-legend-item:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.adp-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.adp-legend-label {
  flex: 1;
  color: #334155;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.adp-legend-value {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

/* ── Conversion Funnel ── */
.adp-funnel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.adp-funnel-step {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  align-items: center;
  gap: 12px;
}

.adp-funnel-label-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adp-funnel-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
.adp-funnel-rate {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.adp-funnel-bar-col {
  position: relative;
  height: 32px;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
}

.adp-funnel-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 0.8s ease;
  min-width: 5%;
}

.adp-funnel-value-col {
  text-align: right;
}
.adp-funnel-value {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
}

/* ── Win Rate & CPL Badges ── */
.adp-win-rate-badge {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid #f4f5f9;
}
.adp-win-rate-inner {
  flex: 1;
  background: linear-gradient(135deg, #fafaff 0%, #f5f3ff 100%);
  border: 2px solid #e0e7ff;
  border-radius: 14px;
  padding: 16px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.25s ease;
}
.adp-win-rate-inner:hover {
  border-color: #a5b4fc;
  box-shadow: 0 4px 12px rgba(99,102,241,0.12);
  transform: translateY(-1px);
}
.adp-win-rate-inner i {
  font-size: 18px;
  color: #6366f1;
  margin-bottom: 2px;
}
.adp-win-rate-label {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.adp-win-rate-value {
  font-size: 24px;
  font-weight: 800;
  color: #111827;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

/* ── Empty State ── */
.adp-empty-state {
  text-align: center;
  padding: 48px 20px;
}
.adp-empty-state i {
  font-size: 48px;
  color: #d1d5db;
  margin-bottom: 14px;
  display: block;
}
.adp-empty-state p {
  color: #9ca3af;
  font-size: 14px;
  margin: 0;
  font-weight: 500;
}

/* ── More link ── */
.adp-more-link {
  text-align: center;
  margin-top: 16px;
}
.adp-more-link a {
  color: #6366f1;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}
.adp-more-link a:hover {
  color: #4f46e5;
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════
   STICKY NOTES — Catatan dari Tim
   ══════════════════════════════════════════════════════════ */

.adp-sticky-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

@media (max-width: 576px) {
  .adp-sticky-board {
    grid-template-columns: 1fr;
  }
}

.adp-sticky-note {
  position: relative;
  padding: 28px 18px 16px 18px;
  border: 1px solid #f9e44c;
  border-radius: 2px 2px 4px 4px;
  min-height: 140px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
  line-height: 1.5;
  /* Paper texture effect */
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 23px,
    rgba(0,0,0,0.03) 23px,
    rgba(0,0,0,0.03) 24px
  );
}

.adp-sticky-note:hover {
  z-index: 10;
  transform: rotate(0deg) scale(1.04) !important;
  box-shadow: 6px 6px 20px rgba(0,0,0,0.12) !important;
}

/* Tape effect at top */
.adp-sticky-tape {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 60px;
  height: 18px;
  border-radius: 2px;
  opacity: 0.55;
  z-index: 2;
}

.adp-sticky-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.adp-sticky-text {
  font-size: 13.5px;
  color: #374151;
  line-height: 1.65;
  margin-bottom: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex: 1;
}

.adp-sticky-text p {
  margin: 0 0 4px 0;
}

/* Fold effect at bottom-right corner */
.adp-sticky-note::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.06) 50%);
  border-radius: 0 0 4px 0;
}

.adp-sticky-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #6b7280;
  padding-top: 10px;
  border-top: 1px dashed rgba(0,0,0,0.1);
  margin-top: auto;
}

.adp-sticky-author {
  font-weight: 600;
  color: #4b5563;
}

.adp-sticky-author i,
.adp-sticky-date i {
  margin-right: 3px;
  font-size: 10px;
}

.adp-sticky-date {
  color: #9ca3af;
}

.adp-sticky-contacted {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
  letter-spacing: 0.2px;
}

.adp-sticky-contacted i {
  margin-right: 3px;
  font-size: 10px;
}
