/* ---- Ads tab: creative grid ---- */
.creative-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.creative-card {
  background: #201e1a;
  border: 1px solid rgba(245,239,230,0.07);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.creative-card:hover { border-color: rgba(224,78,36,0.35); }

.creative-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0f0e0c;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.creative-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-fallback {
  color: #403d39;
  font-size: 11px;
  text-align: center;
  padding: 16px;
}

.creative-body { padding: 11px 12px; }

.creative-name {
  font-size: 12px;
  font-weight: 600;
  color: #F5EFE6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.creative-adset {
  font-size: 10px;
  color: #8A8478;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
}

.crd-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}

.crd-metric { display: flex; flex-direction: column; gap: 1px; }

.crd-l {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8A8478;
}

.crd-v {
  font-size: 13px;
  font-weight: 700;
  color: #F5EFE6;
}

.crd-v.cpa-good  { color: #79B08F; }
.crd-v.cpa-warn  { color: #C99A4B; }
.crd-v.cpa-bad   { color: #C2694F; }

/* ---- Ads tab: table view (campaign-grouped rows) ---- */
.camp-head-metrics {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-left: auto;
}

.camp-head-metric {
  font-size: 11px;
  color: #8A8478;
  white-space: nowrap;
}

.camp-head-metric b {
  color: #F5EFE6;
  font-size: 13px;
  font-weight: 700;
  margin-right: 4px;
}

.ads-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

.ads-table thead th {
  text-align: right;
  padding: 8px 10px;
  color: #8A8478;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(245,239,230,0.08);
  white-space: nowrap;
}

.ads-table thead th:first-child { text-align: left; }

.ads-table thead th.sortable { cursor: pointer; user-select: none; }
.ads-table thead th.sortable:hover { color: #F5EFE6; }

.ads-table thead th.sortable[data-dir="asc"]::after { content: ' \25B2'; font-size: 8px; }
.ads-table thead th.sortable[data-dir="desc"]::after { content: ' \25BC'; font-size: 8px; }

.ads-table tbody td {
  padding: 10px;
  text-align: right;
  border-bottom: 1px solid rgba(245,239,230,0.04);
  vertical-align: middle;
  white-space: nowrap;
}

.ads-table tbody tr:last-child td { border-bottom: none; }
.ads-table tbody tr:hover { background: rgba(245,239,230,0.02); }
.ads-table tbody td:first-child { text-align: left; white-space: normal; }

.ads-row-creative { display: flex; align-items: center; gap: 10px; }

.ads-row-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #0f0e0c;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  cursor: zoom-in;
}

.ads-row-thumb img { width: 100%; height: 100%; object-fit: cover; }

.ads-row-play::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent rgba(245,239,230,0.9);
  transform: translate(-45%, -50%);
}

.ads-row-info { min-width: 0; }

.ads-row-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #F5EFE6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.ads-row-adset {
  font-size: 10.5px;
  color: #8A8478;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.ads-cell-good { color: #79B08F; font-weight: 700; }
.ads-cell-warn { color: #C99A4B; font-weight: 700; }
.ads-cell-bad  { color: #C2694F; font-weight: 700; }
