:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: #1f2937;
  background: #f3f5f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #f3f5f7;
}

.page {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 36px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow:
    0 18px 50px rgba(17, 24, 39, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 38px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eef2f7;
  font-weight: 700;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
}

.brand p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 14px;
}

.auth-intro h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.auth-intro p {
  margin: 0;
  color: #4b5563;
  line-height: 1.6;
}

.foundation-state {
  margin-top: 28px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f6f7f9;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .auth-shell {
    padding: 18px;
  }

  .auth-card {
    padding: 26px;
  }
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.auth-form label {
  font-size: 14px;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font: inherit;
}

.auth-form input:focus {
  outline: 2px solid #cbd5e1;
  outline-offset: 2px;
}

.auth-form button {
  margin-top: 6px;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.form-error {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand span {
  margin-top: 2px;
  color: #6b7280;
  font-size: 13px;
}

.sidebar-nav {
  margin-top: 36px;
}

.nav-link {
  display: block;
  padding: 11px 12px;
  border-radius: 9px;
  color: #374151;
  text-decoration: none;
}

.nav-link-active {
  background: #f3f4f6;
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
}

.role-label {
  margin-bottom: 10px;
  color: #6b7280;
  font-size: 12px;
}

.logout-button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  background: #ffffff;
  cursor: pointer;
  font: inherit;
}

.admin-content {
  min-width: 0;
  padding: 36px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 26px;
}

.content-header h1 {
  margin: 0;
  font-size: 28px;
}

.content-header p {
  margin: 8px 0 0;
  color: #6b7280;
}

.queue-table-wrap {
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}

.queue-table {
  width: 100%;
  border-collapse: collapse;
}

.queue-table th,
.queue-table td {
  padding: 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #eef0f2;
}

.queue-table th {
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.queue-table tbody tr:last-child td {
  border-bottom: 0;
}

.listing-title {
  max-width: 520px;
  font-weight: 600;
}

.listing-meta {
  margin-top: 5px;
  color: #9ca3af;
  font-size: 11px;
}

.status-badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 12px;
  white-space: nowrap;
}

.queue-action {
  text-align: right !important;
}

.open-link {
  font-weight: 600;
  text-decoration: none;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  font-size: 14px;
}

.pagination a {
  text-decoration: none;
}

.empty-state {
  padding: 56px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}

.empty-state h2 {
  margin-top: 0;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .admin-content {
    padding: 22px;
  }
}

.detail-back {
  margin-bottom: 20px;
}

.detail-back a {
  text-decoration: none;
}

.detail-header {
  margin-bottom: 24px;
}

.detail-header h1 {
  margin: 10px 0 0;
  font-size: 30px;
}

.photo-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.photo-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  aspect-ratio: 4 / 3;
}

.photo-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-no-photo {
  margin-bottom: 24px;
  padding: 32px;
  border: 1px dashed #d1d5db;
  border-radius: 14px;
  text-align: center;
  color: #6b7280;
}

.detail-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 2fr) minmax(280px, 1fr);
  gap: 20px;
}

.detail-card {
  padding: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}

.detail-card h2 {
  margin-top: 0;
  font-size: 18px;
}

.description-text {
  margin-bottom: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.detail-properties dl {
  margin: 0;
}

.detail-properties dl > div {
  padding: 12px 0;
  border-bottom: 1px solid #eef0f2;
}

.detail-properties dl > div:last-child {
  border-bottom: 0;
}

.detail-properties dt {
  margin-bottom: 4px;
  color: #6b7280;
  font-size: 12px;
}

.detail-properties dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1000px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.moderation-actions {
  margin-top: 20px;
}

.moderation-action-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.moderation-action-grid form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.moderation-action-grid label {
  font-size: 14px;
  font-weight: 600;
}

.moderation-action-grid textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font: inherit;
}

.action-button {
  margin-top: auto;
  padding: 12px 16px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.action-approve {
  border: 1px solid #166534;
}

.action-reject {
  border: 1px solid #991b1b;
}

.feedback-success {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  background: #f0fdf4;
}

@media (max-width: 900px) {
  .moderation-action-grid {
    grid-template-columns: 1fr;
  }
}

.nav-section-label {
  margin: 26px 12px 7px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reference-toolbar {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
}

.reference-toolbar label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.reference-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reference-search-row input {
  min-width: 0;
  width: min(520px, 100%);
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  font: inherit;
}

.reference-search-row button {
  padding: 10px 16px;
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.reference-search-row a {
  font-size: 14px;
  text-decoration: none;
}

.reference-readonly-note {
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
}

.status-badge-inactive {
  background: #fef2f2;
  color: #991b1b;
}

.reference-category-list {
  display: grid;
  gap: 18px;
}

.reference-category-card {
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
}

.reference-category-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.reference-category-header h2 {
  margin: 0;
  font-size: 20px;
}

.reference-order {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 12px;
}

.reference-empty-inline {
  padding: 20px;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  color: #6b7280;
  text-align: center;
}

@media (max-width: 700px) {
  .reference-search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .reference-search-row input {
    width: 100%;
  }

  .reference-category-header {
    flex-direction: column;
  }
}

.reference-write-card {
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
}

.reference-write-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.reference-form-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr))
    auto;
  align-items: end;
  gap: 12px;
}

.reference-form-grid label,
.reference-edit-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.reference-form-grid input,
.reference-edit-form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
}

.reference-form-action {
  display: flex;
  align-items: flex-end;
}

.reference-warning {
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  color: #78350f;
  font-size: 13px;
}

.reference-feedback-error {
  margin-top: 0;
  margin-bottom: 20px;
}

.reference-edit-details {
  position: relative;
  text-align: left;
}

.reference-edit-details summary {
  cursor: pointer;
  color: #2563eb;
  font-weight: 600;
  list-style: none;
}

.reference-edit-details summary::-webkit-details-marker {
  display: none;
}

.reference-edit-form {
  position: absolute;
  z-index: 10;
  right: 0;
  top: 30px;
  width: min(420px, 80vw);
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.12);
}

.reference-checkbox {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: flex-start;
  gap: 8px !important;
}

.reference-checkbox input {
  width: auto;
}

@media (max-width: 1000px) {
  .reference-form-grid {
    grid-template-columns: 1fr;
  }

  .reference-form-action {
    display: block;
  }
}

.reference-help {
  margin: -5px 0 16px;
  color: #6b7280;
  font-size: 13px;
}

.reference-import-form {
  display: flex;
  align-items: end;
  gap: 14px;
}

.reference-import-form label {
  display: grid;
  flex: 1;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}

.reference-import-form input[type="file"] {
  padding: 9px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  font: inherit;
}

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

.reference-stat {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.reference-stat span,
.reference-stat strong {
  display: block;
}

.reference-stat span {
  color: #6b7280;
  font-size: 12px;
}

.reference-stat strong {
  margin-top: 6px;
  font-size: 24px;
}

.reference-confirm-form {
  display: flex;
  align-items: center;
  gap: 16px;
}

.reference-hidden-content {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.reference-cancel-link {
  text-decoration: none;
}

.reference-result-actions {
  margin-top: 24px;
}

.reference-button-link {
  display: inline-block;
  text-decoration: none;
}

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

  .reference-import-form {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .reference-stats-grid {
    grid-template-columns: 1fr;
  }

  .reference-confirm-form {
    align-items: stretch;
    flex-direction: column;
  }
}

.reference-category-create-form {
  display: grid;
  grid-template-columns:
    minmax(240px, 1fr)
    140px
    auto;
  align-items: end;
  gap: 12px;
}

.reference-category-create-form label,
.reference-subcategory-create label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.reference-category-create-form input,
.reference-subcategory-create input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
}

.reference-category-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reference-subcategory-create {
  display: grid;
  grid-template-columns:
    minmax(220px, 1fr)
    140px
    auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  background: #f9fafb;
}

@media (max-width: 900px) {
  .reference-category-create-form,
  .reference-subcategory-create {
    grid-template-columns: 1fr;
  }

  .reference-category-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* DEV-123 Help Center */

.help-faq-form {
  display: grid;
  gap: 14px;
}

.help-faq-form label,
.help-filter-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.help-faq-form input[type="text"],
.help-faq-form input[type="number"],
.help-faq-form textarea,
.help-faq-edit-form textarea,
.help-faq-edit-form input[type="number"],
.help-filter-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  font: inherit;
}

.help-faq-form textarea,
.help-faq-edit-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.help-faq-form-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: end;
  gap: 18px;
}

.help-faq-list {
  display: grid;
  gap: 16px;
}

.help-faq-answer {
  margin-top: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #374151;
  line-height: 1.55;
}

.help-filter-form {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.help-filter-form label {
  min-width: 220px;
}

.help-request-preview {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.help-request-detail dl {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.help-request-detail dl div {
  padding: 14px;
  border-radius: 10px;
  background: #f9fafb;
}

.help-request-detail dt {
  margin-bottom: 5px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
}

.help-request-detail dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.help-request-message {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.help-request-message h2 {
  margin-top: 0;
}

.help-request-message p {
  margin-bottom: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .help-faq-form-row,
  .help-request-detail dl {
    grid-template-columns: 1fr;
  }

  .help-filter-form {
    align-items: stretch;
    flex-direction: column;
  }

  .help-filter-form label {
    min-width: 0;
  }
}
