/* ===========================================================
 *  PATRIOT MOVE — Dashboard Lead
 *  Reuse beberapa style dari dashboard.css (btn, spinner) +
 *  layout custom untuk single-collection table view.
 * =========================================================== */

body { background: #f7f8fb; margin: 0; }

/* ============= TOPBAR ============= */
.pt-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 32px);
  background: linear-gradient(135deg, #0b1330 0%, #14224d 100%);
  color: #fff;
  border-bottom: 3px solid #c39a3c;
}
.pt-topbar__brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: #fff;
  min-width: 0;
}
.pt-topbar__brand img { width: 38px; height: 38px; flex-shrink: 0; }
.pt-topbar__title {
  font-weight: 700; font-size: 16px; line-height: 1.2;
}
.pt-topbar__title .serif {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-style: italic;
  color: #ead29c;
}
.pt-topbar__sub {
  font-size: 11.5px; color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.pt-topbar__nav {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.pt-topbar__link {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: inherit;
  font-size: 13px; font-weight: 500;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease;
}
.pt-topbar__link:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ============= MAIN ============= */
.pt-main {
  max-width: 1280px; margin: 0 auto;
  padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 32px) 60px;
  display: flex; flex-direction: column;
  gap: clamp(18px, 2.5vw, 24px);
}

/* ============= STATS ============= */
.pt-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.pt-stat-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid #e5e8ef;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.pt-stat-card__icon {
  flex-shrink: 0;
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
}
.pt-stat-card__num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 26px; font-weight: 700;
  color: #0d1326;
  line-height: 1;
}
.pt-stat-card__label {
  font-size: 12.5px;
  color: #6b7385;
  margin-top: 4px;
  letter-spacing: 0.02em;
}
@media (max-width: 900px) {
  .pt-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .pt-stats { grid-template-columns: 1fr; }
  .pt-stat-card__num { font-size: 22px; }
}

/* ============= TOOLBAR ============= */
.pt-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.pt-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 240px; max-width: 480px;
  background: #fff;
  padding: 10px 14px;
  border: 1px solid #e5e8ef;
  border-radius: 10px;
  color: #6b7385;
}
.pt-search input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 14px; color: #0d1326;
}
.pt-search input::placeholder { color: #94a3b8; }

.pt-toolbar__actions {
  display: flex; gap: 8px;
}

/* Export dropdown — variasi dari dashboard.css export-menu */
.pt-export { position: relative; }
.pt-export__trigger {
  display: inline-flex; align-items: center; gap: 8px;
}
.pt-export__caret { transition: transform 140ms ease; }
.pt-export__trigger[aria-expanded="true"] .pt-export__caret {
  transform: rotate(180deg);
}
.pt-export__dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff;
  border: 1px solid #e5e8ef;
  border-radius: 12px;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  z-index: 20;
  padding: 6px;
}
.pt-export__item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 12px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  color: #0d1326;
}
.pt-export__item:hover { background: #f1f4f9; }
.pt-export__icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1c3c7a 0%, #14224d 100%);
  color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 8px;
}
.pt-export__text { display: flex; flex-direction: column; }
.pt-export__title { font-size: 13.5px; font-weight: 600; }
.pt-export__desc  { font-size: 11.5px; color: #6b7385; margin-top: 1px; }

/* ============= TABLE ============= */
.pt-table-wrap {
  background: #fff;
  border: 1px solid #e5e8ef;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}
.pt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.pt-table thead th {
  background: #f7f8fb;
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7385;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e8ef;
  white-space: nowrap;
}
.pt-table thead th[data-sort] { cursor: pointer; user-select: none; }
.pt-table thead th[data-sort]:hover { color: #0d1326; }
.pt-table thead th.is-active { color: #0d1326; }
.pt-sort {
  display: inline-block;
  margin-left: 4px;
  color: #cbd2e0;
  font-size: 11px;
  vertical-align: middle;
}
.pt-table thead th.is-active .pt-sort { color: #1c3c7a; }
.pt-th--num { width: 48px; text-align: center; }
.pt-th--actions { width: 220px; text-align: right; }

.pt-table tbody tr {
  border-bottom: 1px solid #f1f4f9;
  transition: background 100ms ease;
}
.pt-table tbody tr:hover { background: #fafbfd; }
.pt-table tbody tr:last-child { border-bottom: none; }

.pt-table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  color: #0d1326;
}
.pt-table tbody td.pt-td--num {
  text-align: center;
  color: #94a3b8;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.pt-cell-name {
  font-weight: 600;
}
.pt-cell-domisili {
  color: #4a5568;
}
.pt-cell-email a {
  color: #1c3c7a;
  text-decoration: none;
}
.pt-cell-email a:hover { text-decoration: underline; }
.pt-cell-phone {
  font-variant-numeric: tabular-nums;
  color: #4a5568;
}
.pt-cell-date {
  color: #6b7385;
  font-size: 12.5px;
  white-space: nowrap;
}
.pt-cell-actions {
  text-align: right;
  white-space: nowrap;
}
.pt-cell-actions .btn { margin-left: 4px; }

.pt-action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent;
  border: 1px solid #e5e8ef;
  color: #4a5568;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.pt-action-btn:hover {
  background: #f1f4f9;
  border-color: #cbd2e0;
  color: #0d1326;
}
.pt-action-btn--wa {
  background: #25D366;
  border-color: #25D366;
  color: #fff;
}
.pt-action-btn--wa:hover {
  background: #1ebe5a;
  border-color: #1ebe5a;
  color: #fff;
}
.pt-action-btn--danger:hover {
  background: #fdecea;
  border-color: #f5c6c2;
  color: #b8261c;
}
.pt-action-btn svg { flex-shrink: 0; }

/* ============= EMPTY / LOADING ============= */
.pt-empty,
.pt-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  padding: 60px 24px;
  text-align: center;
  color: #6b7385;
}
.pt-empty svg { color: #cbd2e0; }
.pt-empty h3 { margin: 4px 0 0; color: #0d1326; font-size: 18px; }
.pt-empty p { margin: 0; max-width: 420px; font-size: 13.5px; }
.pt-loading { flex-direction: row; }

/* ============= PAGINATION ============= */
.pt-pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 4px 0;
}
.pt-pagination__info {
  color: #6b7385;
  font-size: 13px;
}
.pt-pagination__controls {
  display: flex; align-items: center; gap: 10px;
}
#pageIndicator {
  color: #4a5568;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ============= DELETE DIALOG ============= */
.pt-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 460px;
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.4);
}
.pt-dialog::backdrop {
  background: rgba(11, 19, 48, 0.5);
  backdrop-filter: blur(4px);
}
.pt-dialog__form {
  padding: 24px;
}
.pt-dialog__title {
  margin: 0 0 8px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px;
  color: #0d1326;
}
.pt-dialog__lead {
  margin: 0 0 20px;
  color: #4a5568;
  font-size: 14px;
  line-height: 1.5;
}
.pt-dialog__lead code {
  background: #f1f4f9;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #1c3c7a;
}
.pt-dialog__actions {
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 900px) {
  .pt-table thead {
    /* Sembunyikan header — tabel jadi card-list di mobile */
    display: none;
  }
  .pt-table, .pt-table tbody, .pt-table tr, .pt-table td {
    display: block;
    width: 100%;
  }
  .pt-table tbody tr {
    background: #fff;
    border: 1px solid #e5e8ef;
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 4px 0;
  }
  .pt-table tbody tr:last-child { margin-bottom: 0; }
  .pt-table tbody td {
    padding: 8px 16px;
    border-bottom: none;
  }
  .pt-table tbody td.pt-td--num {
    display: inline-block;
    padding: 8px 16px 4px;
    text-align: left;
    font-weight: 700;
    color: #94a3b8;
  }
  .pt-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 2px;
  }
  .pt-table tbody td.pt-td--num::before { content: none; }
  .pt-table tbody td.pt-cell-actions {
    text-align: left;
    padding-top: 12px;
    border-top: 1px solid #f1f4f9;
    margin-top: 4px;
  }
  .pt-table tbody td.pt-cell-actions::before { content: none; }
  .pt-cell-actions .btn,
  .pt-cell-actions .pt-action-btn { margin-left: 0; margin-right: 4px; }
}

@media (max-width: 600px) {
  .pt-topbar__sub { display: none; }
  .pt-topbar__title { font-size: 14px; }
  .pt-topbar__link span { display: none; }
}
