/* ============================================================
   Ringkasan Pengumuman — panel setelah carousel
   Menyesuaikan tema terang/gelap lewat variabel --sd-*.
   ============================================================ */

.ann-summary-panel {
  margin-top: 16px;
  padding: 18px 20px 20px;
  border: 1px solid var(--sd-line);
  border-radius: 18px;
  background: var(--sd-panel);
  box-shadow: var(--sd-shadow);
  box-sizing: border-box;
}

.ann-summary-panel *,
.ann-summary-panel *::before,
.ann-summary-panel *::after {
  box-sizing: border-box;
}

/* ---------- kepala panel ---------- */
.ann-sum-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.ann-sum-ikon {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--sd-line);
  border-radius: 13px;
  background: var(--sd-chip);
  color: var(--sd-chip-text);
  font-size: 20px;
  line-height: 1;
}

.ann-sum-head h2 {
  margin: 0;
  color: var(--sd-text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.ann-sum-head p {
  margin: 3px 0 0;
  color: var(--sd-text-soft);
  font-size: 13px;
  line-height: 1.4;
}

/* ---------- tata letak: 3 kotak atas + 1 kotak bawah ---------- */
.ann-sum-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "total senders types"
    "chart chart   chart";
  gap: 16px;
  align-items: stretch;
}

.ann-sum-total    { grid-area: total; }
.ann-sum-senders  { grid-area: senders; }
.ann-sum-types    { grid-area: types; }
.ann-sum-chart    { grid-area: chart; }

/* ---------- kartu ---------- */
.ann-sum-total,
.ann-sum-senders,
.ann-sum-types,
.ann-sum-chart {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--sd-line);
  border-radius: 16px;
  background: var(--sd-panel);
}

.ann-sum-senders,
.ann-sum-types,
.ann-sum-chart {
  display: flex;
  flex-direction: column;
}

/* ---------- kepala kartu (ikon + judul) ---------- */
.ann-sum-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ann-sum-card-ikon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.ann-sum-card-ikon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.ikon-biru  { background: #e3f0fd; color: #1573c4; }
.ikon-hijau { background: #e3f7ec; color: #16a34a; }
.ikon-ungu  { background: #efe6fb; color: #7c3aed; }

html[data-theme="dark"] .ikon-biru  { background: rgba(21, 115, 196, .18); color: #6cb6f5; }
html[data-theme="dark"] .ikon-hijau { background: rgba(22, 163, 74, .18);  color: #4ade80; }
html[data-theme="dark"] .ikon-ungu  { background: rgba(124, 58, 237, .20); color: #a78bfa; }

.ann-sum-card-head h3,
.ann-sum-total-label {
  margin: 0;
  color: var(--sd-text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.5;
  text-transform: uppercase;
}

/* ---------- kartu total ---------- */
.ann-sum-total {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Gelombang halus di dasar kartu, seperti sorotan air. */
.ann-sum-total::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 34c40-24 80-24 120 0s80 24 120 0 80-24 160 0v26H0z' fill='%23d8eafd'/%3E%3C/svg%3E") bottom center / 100% 100% no-repeat;
  pointer-events: none;
}

html[data-theme="dark"] .ann-sum-total::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 34c40-24 80-24 120 0s80 24 120 0 80-24 160 0v26H0z' fill='%231e3358'/%3E%3C/svg%3E");
  opacity: .85;
}

.ann-sum-total > * {
  position: relative;
  z-index: 1;
}

.ann-sum-total-value {
  display: block;
  margin-top: 2px;
  color: var(--sd-text);
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------- pengirim terbanyak ---------- */
.ann-sum-sender-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ann-sum-sender-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--sd-text);
  font-size: 13px;
  font-weight: 600;
}

.ann-sum-sender-list li:nth-child(3n+1) { background: #e8f1fd; }
.ann-sum-sender-list li:nth-child(3n+2) { background: #e6f7ec; }
.ann-sum-sender-list li:nth-child(3n+3) { background: #fdf3e0; }

html[data-theme="dark"] .ann-sum-sender-list li:nth-child(3n+1) { background: rgba(21, 115, 196, .16); }
html[data-theme="dark"] .ann-sum-sender-list li:nth-child(3n+2) { background: rgba(22, 163, 74, .16); }
html[data-theme="dark"] .ann-sum-sender-list li:nth-child(3n+3) { background: rgba(217, 119, 6, .16); }

.ann-sum-sender-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ann-sum-sender-count {
  flex: none;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ann-sum-sender-list li:nth-child(3n+1) .ann-sum-sender-count { color: #1573c4; }
.ann-sum-sender-list li:nth-child(3n+2) .ann-sum-sender-count { color: #16a34a; }
.ann-sum-sender-list li:nth-child(3n+3) .ann-sum-sender-count { color: #d97706; }

html[data-theme="dark"] .ann-sum-sender-list li:nth-child(3n+1) .ann-sum-sender-count { color: #6cb6f5; }
html[data-theme="dark"] .ann-sum-sender-list li:nth-child(3n+2) .ann-sum-sender-count { color: #4ade80; }
html[data-theme="dark"] .ann-sum-sender-list li:nth-child(3n+3) .ann-sum-sender-count { color: #fbbf24; }

/* ---------- jenis pengumuman ---------- */
.ann-sum-type-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ann-sum-type-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
}

.ann-sum-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}

.ann-sum-type-badge.an { background: #e3f0fd; color: #1573c4; }
.ann-sum-type-badge.up { background: #fdf3e0; color: #d97706; }
.ann-sum-type-badge.re { background: #fde8e8; color: #dc2626; }
.ann-sum-type-badge.in { background: #efe6fb; color: #7c3aed; }

html[data-theme="dark"] .ann-sum-type-badge.an { background: rgba(21, 115, 196, .18); color: #6cb6f5; }
html[data-theme="dark"] .ann-sum-type-badge.up { background: rgba(217, 119, 6, .18);  color: #fbbf24; }
html[data-theme="dark"] .ann-sum-type-badge.re { background: rgba(220, 38, 38, .18);   color: #fca5a5; }
html[data-theme="dark"] .ann-sum-type-badge.in { background: rgba(124, 58, 237, .20);  color: #a78bfa; }

.ann-sum-type-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--sd-line-soft);
}

.ann-sum-type-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.ann-sum-type-row.is-an .ann-sum-type-track i { background: linear-gradient(90deg, #1573c4, #63b3ed); }
.ann-sum-type-row.is-up .ann-sum-type-track i { background: linear-gradient(90deg, #d97706, #fbbf24); }
.ann-sum-type-row.is-re .ann-sum-type-track i { background: linear-gradient(90deg, #dc2626, #f87171); }
.ann-sum-type-row.is-in .ann-sum-type-track i { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.ann-sum-type-count {
  color: var(--sd-text);
  font-size: 12.5px;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- grafik per bulan ---------- */
.ann-sum-chart h3 {
  margin: 0 0 12px;
  color: var(--sd-text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.ann-sum-bars {
  display: flex;
  align-items: stretch;
  height: 230px;
  margin-top: 4px;
}

.ann-sum-bar {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 0 8px;
}

.ann-sum-bar-val {
  margin-bottom: 8px;
  color: var(--sd-accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.ann-sum-bar-track {
  display: flex;
  flex: 1;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  border-bottom: 1px solid var(--sd-line);
}

.ann-sum-bar-track i {
  display: block;
  width: 66%;
  max-width: 46px;
  border-radius: 9px 9px 0 0;
  background: linear-gradient(180deg, #4fc3f7, #0f4c81);
}

html[data-theme="dark"] .ann-sum-bar-track i {
  background: linear-gradient(180deg, #7dd3fc, #1d4ed8);
}

.ann-sum-bar-lab {
  margin-top: 8px;
  color: var(--sd-text-faint);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

/* ---------- keadaan kosong ---------- */
.ann-sum-kosong {
  padding: 8px 0;
  color: var(--sd-text-faint);
  font-size: 12.5px;
  list-style: none;
}

.ann-sum-sender-list li.ann-sum-kosong,
.ann-sum-type-list li.ann-sum-kosong {
  background: transparent;
  padding-left: 0;
  padding-right: 0;
  font-weight: 400;
}

/* ---------- responsif ---------- */
@media (max-width: 1024px) {
  .ann-sum-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "total senders"
      "types types"
      "chart chart";
    gap: 14px;
  }
}

@media (max-width: 760px) {
  .ann-sum-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "total"
      "senders"
      "types"
      "chart";
    gap: 12px;
  }

  .ann-sum-bars {
    height: 200px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .ann-sum-bar {
    min-width: 32px;
    padding: 0 2px;
  }

  .ann-sum-bar-val { font-size: 11px; }

  .ann-sum-bar-lab {
    font-size: 9px;
    line-height: 1.15;
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .ann-summary-panel { padding: 14px; }

  .ann-sum-head h2 { font-size: 18px; }
  .ann-sum-head p  { font-size: 11.5px; }

  .ann-sum-total,
  .ann-sum-senders,
  .ann-sum-types { padding: 14px; }

  .ann-sum-chart { padding: 14px 12px 12px; }

  .ann-sum-total-value { font-size: 60px; }

  .ann-sum-type-row {
    grid-template-columns: 96px minmax(0, 1fr) 26px;
    gap: 8px;
  }

  .ann-sum-type-badge {
    padding: 3px 7px;
    font-size: 9px;
  }
}
