/* ===========================================================
 *  Dashboard Lari Jadi Patriot — overrides untuk dashboard-patriot.css
 *  Tambahan: rekap ukuran kaos, badge slot, badge prioritas Jabodetabek,
 *  template picker WhatsApp, kolom WA dengan label nomor.
 * =========================================================== */

/* ===== SYNC BANNER ===== */
.lari-sync-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #fff7ed;
  border: 1px solid #fcd9b6;
  border-left: 4px solid #c4561f;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(196, 86, 31, 0.08);
}
.lari-sync-banner__icon {
  font-size: 22px;
  flex-shrink: 0;
}
.lari-sync-banner__body {
  flex: 1;
  min-width: 0;
}
.lari-sync-banner__title {
  font-weight: 600;
  font-size: 14px;
  color: #7a350f;
  margin-bottom: 4px;
}
.lari-sync-banner__lead {
  font-size: 12.5px;
  color: #8a4012;
  line-height: 1.5;
}
.lari-sync-banner__lead strong {
  color: #5e2d0c;
  font-weight: 700;
}
.lari-sync-banner #syncNowBtn {
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .lari-sync-banner { flex-direction: column; align-items: flex-start; }
  .lari-sync-banner #syncNowBtn { align-self: stretch; justify-content: center; }
}

/* Critical state: counter mencapai MAX padahal peserta aktual < MAX.
   Pendaftaran publik kena block — banner di-highlight merah & berkedip. */
.lari-sync-banner.is-blocking {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #ef4444;
  box-shadow:
    0 0 0 3px rgba(239, 68, 68, 0.15),
    0 4px 14px -2px rgba(239, 68, 68, 0.3);
  animation: lari-sync-pulse 1.8s ease-in-out infinite;
}
.lari-sync-banner.is-blocking .lari-sync-banner__title {
  color: #991b1b;
}
.lari-sync-banner.is-blocking .lari-sync-banner__lead { color: #7f1d1d; }
.lari-sync-banner.is-blocking .lari-sync-banner__lead strong { color: #5b0f0f; }
.lari-sync-banner.is-blocking #syncNowBtn {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  font-weight: 700;
}
.lari-sync-banner.is-blocking #syncNowBtn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}
@keyframes lari-sync-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15), 0 4px 14px -2px rgba(239, 68, 68, 0.3); }
  50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.25), 0 4px 14px -2px rgba(239, 68, 68, 0.45); }
}

/* ===== STATS — sub-text "/<max>" ===== */
.lari-stats__sub {
  font-size: 14px;
  color: #94a3b8;
  font-weight: 500;
}

/* ===== UKURAN KAOS BREAKDOWN ===== */
.lari-shirt-breakdown {
  background: #fff;
  border: 1px solid #e5e8ef;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.lari-shirt-breakdown__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.lari-shirt-breakdown__title {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  color: #0d1326;
}
.lari-shirt-breakdown__lead {
  margin: 0;
  font-size: 12.5px;
  color: #6b7385;
}

.lari-shirt-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 600px) {
  .lari-shirt-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
}
.lari-shirt-cell {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 10px;
  background: #f7f8fb;
  border: 1px solid #e5e8ef;
  border-radius: 10px;
  text-align: center;
  transition: transform 120ms ease, border-color 120ms ease;
}
.lari-shirt-cell:hover {
  border-color: #c39a3c;
  transform: translateY(-1px);
}
.lari-shirt-cell__size {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: #1c3c7a;
}
.lari-shirt-cell__count {
  font-size: 22px;
  font-weight: 700;
  color: #0d1326;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.lari-shirt-cell__label {
  font-size: 10.5px;
  color: #6b7385;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lari-shirt-cell.is-zero { opacity: 0.55; }

/* ===== TOOLBAR — beri ruang untuk tombol WA Massal ===== */
.lari-toolbar__actions {
  flex-wrap: wrap;
  gap: 8px;
}
.lari-toolbar__actions .select { min-width: 130px; }

/* ===== TABLE COLUMNS ===== */
.lari-table .pt-th--num,
.lari-table .pt-td--num {
  width: 56px;
  text-align: center;
}
.lari-slot-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px;
  padding: 3px 8px;
  background: rgba(28, 60, 122, 0.1);
  color: #1c3c7a;
  border-radius: 100px;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.lari-shirt-pill {
  display: inline-block;
  min-width: 36px;
  padding: 3px 10px;
  background: rgba(195, 154, 60, 0.16);
  color: #8a6612;
  border-radius: 100px;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
}

.lari-jk-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.lari-jk-pill.is-male   { background: rgba(28, 60, 122, 0.12); color: #1c3c7a; }
.lari-jk-pill.is-female { background: rgba(216, 67, 117, 0.12); color: #b81e5b; }

.lari-domisili {
  display: inline-flex; align-items: center; gap: 6px;
}
.lari-prio-tag {
  font-size: 10px;
  font-weight: 700;
  background: rgba(15, 118, 110, 0.12);
  color: #0F766E;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lari-prio-tag.is-out {
  background: rgba(230, 106, 48, 0.16);
  color: #c4561f;
}

/* ===== Badge "DUPLIKAT" — flag pendaftaran ganda ===== */
.lari-dup-tag {
  display: inline-flex; align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 1.5px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(216, 67, 50, 0.14);
  color: #b8261c;
  border-radius: 4px;
  border: 1px solid rgba(216, 67, 50, 0.28);
  vertical-align: middle;
  white-space: nowrap;
}
.lari-dup-tag svg { flex-shrink: 0; }

/* Row dengan duplikat → background tipis merah supaya gampang dilihat */
.pt-table tbody tr.is-duplicate {
  background: rgba(216, 67, 50, 0.04);
  box-shadow: inset 3px 0 0 #d84332;
}
.pt-table tbody tr.is-duplicate:hover {
  background: rgba(216, 67, 50, 0.08);
}

/* Stat card "Duplikat" — interactive shortcut */
.pt-stat-card--dup {
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 140ms ease;
  -webkit-tap-highlight-color: transparent;
}
.pt-stat-card--dup:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -8px rgba(216, 67, 50, 0.4);
}
.pt-stat-card--dup.is-active {
  background: rgba(216, 67, 50, 0.07);
  box-shadow: inset 0 0 0 1.5px rgba(216, 67, 50, 0.35);
}

/* WA cell — tampilkan nomor + tombol */
.lari-wa-cell {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.lari-wa-cell__phone {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #4b5466;
  white-space: nowrap;
}
.lari-wa-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 140ms ease, transform 80ms ease;
  box-shadow: 0 2px 6px -2px rgba(18, 140, 126, 0.4);
}
.lari-wa-btn:hover { opacity: 0.92; }
.lari-wa-btn:active { transform: translateY(1px); }
.lari-wa-btn:disabled,
.lari-wa-btn.is-disabled {
  background: #d4d8e0; color: #777e8c; cursor: not-allowed;
  box-shadow: none;
}

/* ===== WA TEMPLATE DIALOG ===== */
.lari-wa-dialog {
  max-width: 580px;
  width: 92vw;
}
.lari-wa-dialog .pt-dialog__form { gap: 14px; }

.lari-wa-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}
@media (max-width: 540px) {
  .lari-wa-presets { grid-template-columns: 1fr; }
}
.lari-wa-preset {
  display: flex; flex-direction: column; gap: 2px;
  text-align: left;
  background: #f7f8fb;
  border: 1.5px solid #e5e8ef;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  color: #4b5466;
  transition: border-color 120ms ease, background 120ms ease;
}
.lari-wa-preset > strong {
  color: #0d1326;
  font-size: 13px;
  font-weight: 600;
}
.lari-wa-preset:hover { border-color: #c39a3c; background: #fffbf3; }
.lari-wa-preset.is-active {
  border-color: #c39a3c;
  background: #fffbf3;
  box-shadow: 0 0 0 3px rgba(195, 154, 60, 0.15);
}

.lari-wa-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #4b5466;
  margin-top: 4px;
}
.lari-wa-textarea {
  width: 100%;
  min-height: 180px;
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid #e5e8ef;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  color: #0d1326;
  resize: vertical;
  box-sizing: border-box;
}
.lari-wa-textarea:focus {
  border-color: #1c3c7a;
  outline: none;
  box-shadow: 0 0 0 3px rgba(28, 60, 122, 0.12);
}
.lari-wa-meta {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 11.5px;
  color: #6b7385;
}
.lari-wa-counter {
  font-variant-numeric: tabular-nums;
}

.lari-delete-warn {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px !important;
  line-height: 1.5;
}
.lari-delete-warn code {
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
}

/* ===== MOBILE TWEAK ===== */
@media (max-width: 720px) {
  .lari-toolbar__actions { width: 100%; }
  .lari-toolbar__actions .select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .lari-toolbar__actions .pt-export { margin-left: auto; }
  .lari-shirt-grid { grid-template-columns: repeat(5, 1fr); }
  .lari-shirt-cell { padding: 10px 6px; }
  .lari-shirt-cell__size { font-size: 16px; }
  .lari-shirt-cell__count { font-size: 18px; }
  .lari-wa-cell__phone { display: none; }
}
