.reviews-content {
  padding-top: 26px;
}

.reviews-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 30px;
}

.reviews-top h1,
.reviews-top p,
.reviews-top small {
  margin: 0;
}

.reviews-top h1 {
  font-size: 30px;
}

.reviews-top p {
  margin-top: 8px;
  font-weight: 800;
}

.reviews-top span,
.reviews-top small {
  color: var(--muted);
}

.reviews-top small {
  display: block;
  margin-top: 8px;
  font-size: 14px;
}

.review-actions {
  display: flex;
  gap: 14px;
}

.review-actions button,
.review-filter button,
.review-table td button,
.review-footer button,
.review-footer select,
.review-side button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.review-actions button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  height: 44px;
  padding: 0 18px;
}

.review-actions .primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green-bright), var(--green));
}

.review-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.review-stats article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 84px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(23, 44, 39, 0.04);
  overflow: hidden;
  min-width: 0;
}

.review-stats article > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  flex-shrink: 0;
}

.review-stats p,
.review-stats small {
  margin: 0;
}

.review-stats p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-stats strong {
  display: block;
  margin: 3px 0 2px;
  font-size: clamp(14px, 1.1vw, 17px);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-stats small {
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.review-stats .up {
  color: var(--green);
}

.review-stats .down {
  color: #e34b5b;
}

/* Filter Bar - Single Row */
.review-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.review-filter label {
  flex: 1;
  min-width: 170px;
}

.review-filter label:first-child {
  flex: 2;
  min-width: 240px;
}

.review-filter label > span {
  position: relative;
  display: block;
}

.review-filter input,
.review-filter select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  outline: 0;
  padding: 0 14px;
  font-family: inherit;
  font-size: 13.5px;
}

.review-filter input {
  padding: 0 42px 0 14px;
}

.review-filter label > span i {
  position: absolute;
  right: 12px;
  top: 11px;
  color: var(--muted);
}

.review-filter button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.review-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.review-table {
  padding: 0;
  overflow: hidden;
}

.review-table h2 {
  height: 62px;
  margin: 0;
  padding: 20px 22px 0;
  font-size: 18px;
}

.table-scroll {
  overflow-x: auto;
}

.review-table table {
  width: 100%;
  min-width: 950px;
  border-collapse: collapse;
}

.review-table th {
  background: #fbfcfc;
  text-align: left;
  font-size: 12.5px;
  color: #64748b;
  font-weight: 800;
  white-space: nowrap;
}

.review-table td {
  padding: 14px 18px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.review-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.review-table tbody tr:hover {
  background: #f8fafc;
}

.review-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.review-product {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
  white-space: nowrap;
}

.review-product .prod-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.review-product .prod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-product .prod-thumb i.sprite {
  display: block;
  width: 32px;
  height: 38px;
  background-image: url("assets/grocery-sprite.png");
  background-repeat: no-repeat;
  background-size: 800% 200%;
  background-position-y: 100%;
  flex-shrink: 0;
}

.stars {
  color: #f59e0b;
  font-size: 14px;
  letter-spacing: 2px;
  font-weight: 800;
}

.review-comment-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #334155;
}

.review-reply-snippet {
  margin-top: 4px;
  padding: 3px 8px;
  background: #f0fdf4;
  border-radius: 6px;
  color: #059669;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.answered {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  white-space: nowrap;
}

.pending {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
  white-space: nowrap;
}

.review-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
  white-space: nowrap;
}

.review-footer p {
  margin: 0;
  font-size: 13.5px;
  color: #64748b;
  font-weight: 700;
}

.review-footer div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-buttons {
  display: flex;
  gap: 4px;
}

.pagination-buttons button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  border-radius: 6px;
}

.pagination-buttons button.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* Side Breakdown Panels */
.review-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rating-summary,
.latest-review {
  padding: 22px;
}

.rating-summary h2,
.latest-review h2 {
  margin: 0 0 16px;
  font-size: 17px;
  color: #0f172a;
}

.rating-score {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.rating-score strong {
  display: block;
  font-size: 42px;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 6px;
}

.rating-score p {
  margin: 6px 0 0;
  font-size: 12px;
  color: #64748b;
}

.rating-summary ul {
  list-style: none;
  padding: 16px 0 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rating-summary li {
  display: grid;
  grid-template-columns: 36px 1fr 40px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.rating-summary li b {
  color: #475569;
}

.rating-summary li span {
  height: 8px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.rating-summary li span::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--fill, 0%);
  background: #f59e0b;
  border-radius: 999px;
}

.rating-summary li em {
  font-style: normal;
  font-weight: 800;
  color: #64748b;
  text-align: right;
  font-size: 12px;
}

.latest-review-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f8fafc;
  font-size: 13px;
}

.latest-review-item:last-child {
  border-bottom: none;
}

.latest-review-item b {
  display: block;
  color: #0f172a;
}

.latest-review-item p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

/* ============================================================
   MODAL DIALOG
============================================================ */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(4, 15, 12, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.admin-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.admin-modal-card {
  width: 100%;
  max-width: 580px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.admin-modal-backdrop.is-open .admin-modal-card {
  transform: translateY(0);
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

.admin-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.admin-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}

.admin-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.admin-modal-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-modal-form label span {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.admin-modal-form input,
.admin-modal-form select,
.admin-modal-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13.5px;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.admin-modal-form input:focus,
.admin-modal-form select:focus,
.admin-modal-form textarea:focus {
  border-color: #008a4b;
}

.admin-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.admin-modal-actions .btn-cancel {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-weight: 700;
  cursor: pointer;
}

.admin-modal-actions .btn-save {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #00b368, #008a4b);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 138, 75, 0.3);
}

@media (max-width: 1200px) {
  .review-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .review-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .review-stats,
  .form-grid-2,
  .review-filter label,
  .review-filter label:first-child {
    grid-template-columns: 1fr;
    min-width: 100%;
  }
  .reviews-top {
    flex-direction: column;
    gap: 16px;
  }
  .review-actions {
    width: 100%;
    flex-direction: column;
  }
  .review-footer {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}
