/* ============================================================
 *  Dashboard Pertanyaan — selaras dashboard-lari / patriot
 * ============================================================ */

.tq-status-breakdown {
  margin-bottom: 18px;
}
.tq-status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tq-charts {
  margin: 6px 0 22px;
}
.tq-charts__head {
  margin: 0 0 14px;
}
.tq-charts__title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 750;
  color: #0b1330;
}
.tq-charts__lead {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}
.tq-chart-block {
  margin-bottom: 18px;
}

.tq-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 8px;
}

.tq-card {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(13, 19, 38, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tq-card:hover {
  border-color: #d5dde9;
  box-shadow: 0 6px 18px -12px rgba(13, 19, 38, 0.25);
}

.tq-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}
.tq-card__who {
  min-width: 0;
  flex: 1;
}
.tq-card__name {
  font-size: 15px;
  font-weight: 700;
  color: #0d1326;
  line-height: 1.25;
}
.tq-card__meta {
  margin-top: 3px;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.4;
}
.tq-card__meta strong {
  color: #1c3c7a;
  font-weight: 650;
}
.tq-card__ketua {
  margin-top: 6px;
  font-size: 12.5px;
  color: #334155;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(195, 154, 60, 0.12);
  border: 1px solid rgba(195, 154, 60, 0.28);
}
.tq-card__ketua strong {
  color: #0b1330;
  font-weight: 700;
}

.tq-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.tq-badge--baru { background: #e8eef8; color: #1c3c7a; }
.tq-badge--dikurasi { background: #fff4df; color: #9a6b12; }
.tq-badge--dipilih { background: #e6f6ef; color: #0f766e; }

.tq-card__qs {
  margin: 0;
  padding: 12px 14px;
  list-style: none;
  background: #f7f9fc;
  border-radius: 10px;
  border: 1px solid #eef2f7;
}
.tq-card__qs li {
  position: relative;
  padding-left: 22px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #1e293b;
}
.tq-card__qs li + li {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}
.tq-card__qs li::before {
  content: attr(data-n);
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0b1330;
  color: #ead29c;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tq-card__qs li + li::before {
  top: 10px;
}

.tq-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}
.tq-card__time {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.tq-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.tq-card__actions .select,
.tq-card__actions select {
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d5dde9;
  background: #fff;
  font-family: inherit;
  color: #0d1326;
  min-height: 32px;
}
.tq-card__actions .btn {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12.5px;
}

/* —— Detail / delete dialogs —— */
.lari-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: min(560px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  max-height: min(92vh, 900px);
  background: #fff;
  color: #0d1326;
  box-shadow: 0 24px 64px -16px rgba(11, 19, 48, 0.45);
}
.lari-dialog::backdrop {
  background: rgba(11, 19, 48, 0.55);
  backdrop-filter: blur(4px);
}
.lari-dialog__form {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 900px);
  padding: 0;
}
.lari-dialog__title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0b1330;
  line-height: 1.3;
}
.lari-dialog__lead {
  margin: 0;
  padding: 0 22px 4px;
  color: #475569;
  font-size: 14px;
  line-height: 1.55;
}
.lari-dialog__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid #eef2f7;
  background: #fff;
}

.tq-detail-dialog {
  width: min(640px, calc(100vw - 28px));
}
.tq-detail__head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(180deg, #fff 70%, rgba(255, 255, 255, 0.92));
}
.tq-detail__actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.tq-detail__body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 22px 8px;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
  text-align: left;
}

.tq-detail__hero {
  margin: 0 0 18px;
  padding: 16px 16px 14px;
  border-radius: 12px;
  background: linear-gradient(145deg, #0b1330 0%, #1c3c7a 100%);
  color: #f8fafc;
}
.tq-detail__hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 14px;
}
.tq-detail__name {
  flex: 1 1 180px;
  min-width: 0;
  font-size: 1.2rem;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.01em;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.tq-detail__hero .tq-badge {
  background: rgba(234, 210, 156, 0.22);
  color: #ead29c;
  border: 1px solid rgba(234, 210, 156, 0.35);
}
.tq-detail__hero .tq-badge--dikurasi {
  background: rgba(255, 244, 223, 0.18);
  color: #ffe4a8;
  border-color: rgba(255, 228, 168, 0.4);
}
.tq-detail__hero .tq-badge--dipilih {
  background: rgba(230, 246, 239, 0.2);
  color: #b8f0dc;
  border-color: rgba(184, 240, 220, 0.4);
}
.tq-detail__hero-meta {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(248, 250, 252, 0.78);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.tq-detail__hero-email {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: rgba(234, 210, 156, 0.9);
  word-break: break-all;
}

.tq-detail__block {
  margin: 0 0 20px;
}
.tq-detail__block--qs {
  margin-bottom: 22px;
}
.tq-detail__section {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c39a3c;
  line-height: 1.3;
}

.tq-detail__chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tq-detail__chip {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid #eef2f7;
}
.tq-detail__chip-label {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.tq-detail__chip-value {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: #0f172a;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.tq-detail__fields {
  border: 1px solid #eef2f7;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.tq-detail__row {
  display: grid;
  grid-template-columns: minmax(96px, 118px) minmax(0, 1fr);
  gap: 10px 14px;
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  align-items: start;
}
.tq-detail__row:last-child {
  border-bottom: none;
}
.tq-detail__row span {
  color: #64748b;
  font-weight: 550;
  font-size: 12.5px;
  line-height: 1.45;
  padding-top: 1px;
}
.tq-detail__row strong {
  color: #0f172a;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.tq-detail__qs {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tq-detail__q {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0;
  padding: 14px 14px 14px 12px;
  border-radius: 12px;
  background: #f7f9fc;
  border: 1px solid #e8edf5;
}
.tq-detail__q-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0b1330;
  color: #ead29c;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.tq-detail__q-text {
  margin: 0;
  padding-top: 3px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.65;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.tq-detail__empty-q {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #d5dde9;
  color: #64748b;
  font-size: 13.5px;
  line-height: 1.5;
}

/* Delete dialog padding (no sticky head) */
#deleteDialog .lari-dialog__form {
  padding: 22px 22px 0;
}
#deleteDialog .lari-dialog__title {
  margin-bottom: 10px;
  padding: 0;
}
#deleteDialog .lari-dialog__lead {
  padding: 0 0 8px;
}
#deleteDialog .lari-dialog__actions {
  margin: 8px -22px 0;
  padding: 14px 22px 18px;
}

body.is-viewer .tq-card__actions .tq-status-select,
body.is-viewer .tq-card__actions .tq-btn-del {
  display: none;
}

/* —— Kelola akses: tautan kecil di footer, bukan topbar —— */
.tq-foot {
  margin: 28px 0 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(28, 60, 122, 0.12);
  display: flex;
  justify-content: flex-end;
}
.tq-foot__link {
  font-size: 12px;
  color: rgba(28, 60, 122, 0.55);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.tq-foot__link:hover {
  color: #1c3c7a;
  text-decoration: underline;
}
.tq-access-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: min(88dvh, 720px);
}
.tq-access-dialog__head {
  padding: 18px 22px 0;
}
.tq-access-dialog__head .lari-dialog__lead {
  margin: 6px 0 0;
}
.tq-access-dialog__body {
  padding: 14px 22px 4px;
  overflow: auto;
  max-height: min(58dvh, 460px);
}
.tq-access-dialog .lari-dialog__actions {
  margin: 8px 0 0;
  padding: 12px 22px 18px;
}
.tq-access__form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.tq-access__input {
  flex: 1 1 220px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #d5dde9;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  color: #0d1326;
  background: #fff;
}
.tq-access__input:focus {
  outline: none;
  border-color: #1c3c7a;
  box-shadow: 0 0 0 3px rgba(28, 60, 122, 0.12);
}
.tq-access__note {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: #0f766e;
  font-weight: 550;
}
.tq-access__note.is-error {
  color: #b42318;
}
.tq-access__list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tq-access__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 10px;
}
.tq-access__meta {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}
.tq-access__email {
  font-size: 13.5px;
  font-weight: 650;
  color: #0d1326;
  word-break: break-all;
}
.tq-access__role {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8eef8;
  color: #1c3c7a;
}
.tq-access__locked {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}
.tq-access__empty {
  font-size: 13px;
  color: #64748b;
  padding: 4px 2px;
}

@media (max-width: 640px) {
  .tq-status-grid { grid-template-columns: 1fr; }
  .tq-card__foot { flex-direction: column; align-items: stretch; }
  .tq-card__actions { width: 100%; }
  .tq-card__actions select,
  .tq-card__actions .btn { flex: 1; }
  .tq-access__form { flex-direction: column; align-items: stretch; }
  .tq-charts { margin-bottom: 16px; }
  .tq-charts__title { font-size: 15.5px; }
  .chart-row--2 { grid-template-columns: 1fr !important; gap: 10px; }

  .lari-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }
  .lari-dialog__form {
    max-height: calc(100dvh - 16px);
  }
  .tq-detail-dialog {
    width: calc(100vw - 16px);
  }
  .tq-detail__head {
    padding: 14px 16px 12px;
  }
  .tq-detail__body {
    padding: 14px 16px 6px;
  }
  .tq-detail__actions,
  .lari-dialog__actions {
    padding: 12px 16px 16px;
  }
  .tq-detail__name {
    font-size: 1.1rem;
  }
  .tq-detail__chips {
    grid-template-columns: 1fr;
  }
  .tq-detail__row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 14px;
  }
  .tq-detail__q {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .tq-detail__q-text {
    font-size: 14.5px;
    line-height: 1.65;
  }
  #deleteDialog .lari-dialog__form {
    padding: 18px 16px 0;
  }
  #deleteDialog .lari-dialog__actions {
    margin: 8px -16px 0;
    padding: 12px 16px 16px;
  }
}

.tq-filters {
  flex-wrap: wrap;
  gap: 8px;
}
.tq-filters .select,
.tq-filters select {
  max-width: 100%;
  min-width: 0;
}
.tq-filters select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
