:root {
  --panel: rgba(255, 255, 255, 0.84);
  --panel-border: rgba(27, 65, 96, 0.12);
  --text: #123047;
  --muted: #5d7285;
  --brand: #0a6c83;
  --brand-deep: #084f61;
  --brand-soft: #e2f5fa;
  --shadow: 0 22px 60px rgba(17, 51, 75, 0.12);
  --radius-lg: 28px;
  --radius-md: 20px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(97, 189, 220, 0.22), transparent 28%),
    linear-gradient(180deg, #f8fbfd 0%, #eef4f8 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  padding: 22px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-mark {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-subtitle,
.section-label,
.detail-label,
.status-label,
.meta-line,
.inline-meta,
.list-row span,
.timeline-item span,
.notification-item p,
.metric-card p,
.page-header p,
.hero-copy p,
.auth-panel p {
  color: var(--muted);
}

.brand-subtitle,
.section-label,
.detail-label,
.status-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.73rem;
  font-weight: 700;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.mobile-shell-actions {
  display: none;
  align-items: center;
  gap: 8px;
}

.error-banner {
  margin-bottom: 18px;
  border-color: rgba(180, 53, 53, 0.2);
  background: rgba(255, 243, 243, 0.92);
}

.error-banner p {
  margin: 10px 0 0;
  color: #8c3030;
}

.app-toast {
  position: fixed;
  top: 28px;
  right: 28px;
  z-index: 1200;
  display: grid;
  gap: 4px;
  min-width: 280px;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(18, 48, 71, 0.96);
  color: #fff;
  box-shadow: 0 18px 40px rgba(17, 51, 75, 0.24);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease;
  animation: toast-lifecycle 3s ease forwards;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes toast-lifecycle {
  0% { opacity: 0; transform: translateY(-8px); }
  10% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); }
}

.inline-form {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin: 0;
}

.top-nav a,
.sidebar-link {
  padding: 8px 12px;
  border-radius: 14px;
  color: var(--muted);
  transition: 160ms ease;
  font-size: 0.95rem;
  font-weight: 600;
}

.top-nav a:hover,
.sidebar-link:hover,
.text-link:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.nav-button {
  padding: 8px 12px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
}

.nav-button:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.workspace-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.sidebar-panel,
.card-panel,
.metric-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.sidebar-panel {
  padding: 18px 16px;
  align-self: start;
  position: sticky;
  top: 28px;
}

.sidebar-links {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.sidebar-link {
  display: block;
  padding: 12px 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(27, 65, 96, 0.08);
  color: var(--text);
  font-weight: 600;
}

.sidebar-link:last-child {
  border-bottom: none;
}

.sidebar-link:hover {
  background: transparent;
  color: var(--brand);
}

.sidebar-section + .sidebar-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--panel-border);
}

.sidebar-status-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.sidebar-status-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.sidebar-status-list span {
  color: var(--muted);
}

.hero-panel,
.content-grid,
.detail-page-grid,
.profile-grid {
  display: grid;
  gap: 22px;
}

.hero-panel {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
}

.hero-copy {
  padding: 18px 6px 10px 6px;
}

.hero-copy h1,
.page-header h1,
.auth-panel h1 {
  margin: 12px 0;
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.hero-copy .lead,
.page-header p {
  font-size: 1.02rem;
  max-width: 62ch;
}

.card-panel,
.auth-panel {
  padding: 20px;
}

.hero-meta-header,
.panel-header,
.notification-head,
.progress-copy,
.list-row,
.list-row-end {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.panel-header {
  align-items: start;
  margin-bottom: 16px;
}

.panel-header h2,
.survey-card h2 {
  margin: 8px 0 0;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.progress-shell {
  margin-top: 20px;
}

.progress-track {
  height: 10px;
  margin-top: 12px;
  border-radius: 999px;
  background: #dce7ee;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #3da7ba);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.status-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(27, 65, 96, 0.08);
}

.badge-token,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-good,
.status-live,
.status-pill-live,
.badge-live {
  color: #0d6444;
  background: #dff5ea;
}

.badge-warn,
.status-limited {
  color: #8c5b04;
  background: #fff2d8;
}

.badge-soft {
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.status-priority {
  color: #0f5860;
  background: #d9f3f5;
}

.metric-grid,
.survey-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.metric-card {
  padding: 22px;
}

.metric-card strong {
  display: block;
  margin-top: 16px;
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.metric-primary {
  background: linear-gradient(160deg, rgba(9, 108, 131, 0.95), rgba(15, 79, 96, 0.98));
  color: #fff;
}

.metric-primary p,
.metric-primary .section-label {
  color: rgba(255, 255, 255, 0.82);
}

.metric-secondary {
  background: linear-gradient(160deg, #ffffff, #eef9fc);
}

.metric-accent {
  background: linear-gradient(160deg, #f4fff8, #e0f3e4);
}

.metric-neutral {
  background: linear-gradient(160deg, #ffffff, #f3f7fa);
}

.content-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  margin-top: 22px;
}

.panel-category-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 22px;
}

.main-column,
.side-column,
.wallet-history,
.timeline,
.notification-list {
  display: grid;
  gap: 18px;
}

.survey-table-shell {
  overflow-x: auto;
}

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

.survey-table th,
.survey-table td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(27, 65, 96, 0.08);
  vertical-align: top;
}

.survey-table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.85rem;
}

.survey-table-compact th,
.survey-table-compact td {
  padding: 10px 8px;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.table-action,
.text-link {
  color: var(--brand);
  font-weight: 700;
}

.inline-meta {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
}

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

.compact-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-grid strong,
.wallet-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.87rem;
  letter-spacing: -0.01em;
}

.btn-sm {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 9px;
  font-size: 0.74rem;
}

.btn-brand {
  background: linear-gradient(135deg, var(--brand), #1799af);
  color: #fff;
}

.btn-brand:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-deep), #117f93);
}

.btn-ghost {
  border-color: rgba(10, 108, 131, 0.16);
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand-deep);
}

.wallet-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.list-row {
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid rgba(27, 65, 96, 0.08);
}

.list-row:first-child,
.timeline-item:first-child,
.notification-item:first-child {
  border-top: none;
  padding-top: 0;
}

.list-row strong {
  display: block;
}

.list-row-end {
  text-align: right;
}

.timeline-item,
.notification-item {
  padding: 16px 0;
  border-top: 1px solid rgba(27, 65, 96, 0.08);
}

.timeline-item p,
.notification-item p {
  margin: 8px 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(10, 108, 131, 0.08);
  color: var(--brand-deep);
  font-weight: 700;
}

.admin-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.admin-review-field {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(27, 65, 96, 0.08);
}

.admin-review-field strong {
  display: block;
  margin-top: 6px;
  font-size: 0.98rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.review-modal {
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: none;
  border-radius: 28px;
  background: transparent;
}

.review-modal::backdrop {
  background: rgba(18, 48, 71, 0.42);
  backdrop-filter: blur(4px);
}

.review-modal-shell {
  display: grid;
  gap: 20px;
  padding: 20px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.review-modal-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.review-modal-meta strong,
.review-summary-card strong {
  display: block;
  margin-top: 6px;
}

.review-summary-card {
  padding: 18px 20px;
}

.review-modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.review-decision-form {
  display: grid;
  gap: 12px;
}

.review-decision-form textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(27, 65, 96, 0.14);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  resize: vertical;
}

.page-header {
  padding: 8px 6px 2px;
}

.page-header h1 {
  margin-bottom: 12px;
}

.auth-shell {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.auth-panel {
  width: min(760px, 100%);
}

.compact-auth {
  width: min(560px, 100%);
}

.auth-form,
.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-span-2 {
  grid-column: span 2;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(27, 65, 96, 0.14);
  border-radius: 12px;
  background: #fff;
}

.auth-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 38px 0 12px;
  border: 1px solid rgba(27, 65, 96, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 253, 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath fill='%23084f61' d='M7 8 0 0h14z'/%3E%3C/svg%3E") no-repeat right 14px center;
  appearance: none;
  color: var(--text);
  font: inherit;
}

.multi-select {
  min-height: 136px !important;
  padding: 10px 12px !important;
  background: #fff !important;
}

.auth-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(27, 65, 96, 0.14);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  resize: vertical;
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  outline: none;
  border-color: rgba(10, 108, 131, 0.42);
  box-shadow: 0 0 0 4px rgba(10, 108, 131, 0.12);
}

.validation-panel {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(180, 53, 53, 0.18);
  background: rgba(255, 245, 245, 0.92);
  color: #8c3030;
}

.validation-banner {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(180, 53, 53, 0.16);
  background: rgba(255, 248, 244, 0.96);
  color: #8c3030;
}

.field-validation-error {
  color: #a13939;
  font-size: 0.82rem;
  font-weight: 700;
}

.validation-list {
  margin: 12px 0 0;
  padding-left: 18px;
}

.field-error {
  color: #a13939;
  font-size: 0.85rem;
  font-weight: 600;
}

.form-section-note {
  margin: -4px 0 18px;
  color: var(--muted);
}

.other-category-field.is-hidden {
  display: none !important;
}

.consent-row {
  display: flex !important;
  align-items: start;
  gap: 12px;
  color: var(--muted);
  font-weight: 500 !important;
}

.consent-row input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.reward-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-subcopy {
  margin: 10px 0 0;
  color: var(--muted);
}

.admin-filter-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-filter-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.admin-filter-form input,
.admin-filter-form select {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(27, 65, 96, 0.14);
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

.admin-filter-form select {
  padding-right: 42px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 253, 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath fill='%23084f61' d='M7 8 0 0h14z'/%3E%3C/svg%3E") no-repeat right 14px center;
  appearance: none;
}

.admin-filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.panel-category-list-card .survey-table td:last-child,
.panel-category-list-card .survey-table th:last-child {
  width: 220px;
}

.directory-toolbar,
.pagination-shell,
.pagination-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.directory-toolbar {
  margin-bottom: 16px;
}

.table-sort-link {
  color: inherit;
  font-weight: 700;
}

.respondent-table td strong + .inline-meta {
  margin-top: 4px;
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 20px 8px;
}

.pagination-shell {
  margin-top: 14px;
}

.pagination-summary {
  color: var(--muted);
  font-weight: 600;
}

.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

@media (max-width: 1280px) {
  .workspace-shell,
  .hero-panel,
  .content-grid,
  .panel-category-layout,
  .profile-grid,
  .survey-card-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-panel {
    position: static;
  }
}

@media (max-width: 1100px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-panel {
    position: static;
  }

  .mobile-shell-actions {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .top-nav {
    width: 100%;
    gap: 10px;
    display: none;
    max-width: 100%;
    overflow: hidden;
  }

  .top-nav.is-open {
    display: flex;
  }

  .sidebar-panel.is-open {
    display: block;
    max-width: 100%;
    overflow: hidden;
  }

  .top-nav a,
  .nav-button {
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  .top-nav {
    flex-direction: column;
    align-items: stretch;
    padding-top: 6px;
    border-top: 1px solid rgba(27, 65, 96, 0.08);
  }

  .top-nav a,
  .top-nav .inline-form,
  .top-nav .nav-button {
    width: 100%;
  }

  .sidebar-panel {
    display: none;
    padding: 18px 16px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .sidebar-links,
  .sidebar-section {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: 14px;
  }

  .app-header {
    align-items: start;
    flex-direction: column;
  }

  .detail-grid,
  .status-grid,
  .wallet-metrics,
  .field-grid,
  .admin-filter-form,
  .compact-detail-grid,
  .reward-metric-grid,
  .admin-review-grid,
  .review-modal-meta,
  .review-modal-actions {
    grid-template-columns: 1fr;
  }

  .app-toast {
    top: 10px;
    right: 10px;
    left: 10px;
    min-width: 0;
    max-width: none;
    padding: 12px 14px;
  }

  .hero-actions,
  .pagination-links,
  .admin-filter-actions,
  .table-actions {
    width: 100%;
  }

  .hero-actions .btn,
  .pagination-links .btn,
  .admin-filter-actions .btn,
  .table-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .panel-header,
  .directory-toolbar,
  .pagination-shell,
  .pagination-links,
  .hero-actions,
  .admin-filter-actions,
  .table-actions,
  .mobile-shell-actions {
    overflow-wrap: anywhere;
  }

  .survey-admin-table th:nth-child(4),
  .survey-admin-table td:nth-child(4),
  .survey-admin-table th:nth-child(5),
  .survey-admin-table td:nth-child(5),
  .survey-admin-table th:nth-child(7),
  .survey-admin-table td:nth-child(7),
  .approval-table th:nth-child(3),
  .approval-table td:nth-child(3),
  .approval-table th:nth-child(4),
  .approval-table td:nth-child(4),
  .profile-change-table th:nth-child(3),
  .profile-change-table td:nth-child(3),
  .panel-category-table th:nth-child(2),
  .panel-category-table td:nth-child(2) {
    display: none;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 10px;
  }

  .app-header,
  .card-panel,
  .auth-panel {
    padding: 14px;
  }

  .workspace-shell {
    gap: 14px;
  }

  .mobile-shell-actions {
    width: 100%;
    justify-content: stretch;
  }

  .mobile-shell-actions .mobile-toggle {
    flex: 1 1 0;
    min-width: 0;
  }

  .survey-table-shell {
    margin: 0 -4px;
  }

  .top-nav,
  .sidebar-panel,
  .card-panel,
  .auth-panel,
  .panel-header,
  .directory-toolbar,
  .pagination-shell {
    max-width: 100%;
    overflow: hidden;
  }

  .panel-header,
  .directory-toolbar,
  .pagination-shell,
  .pagination-links,
  .hero-actions,
  .admin-filter-actions,
  .table-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-header > *,
  .directory-toolbar > *,
  .pagination-shell > *,
  .pagination-links > *,
  .hero-actions > *,
  .admin-filter-actions > *,
  .table-actions > * {
    width: 100%;
    min-width: 0;
  }

  .survey-table th,
  .survey-table td,
  .survey-table-compact th,
  .survey-table-compact td {
    padding: 8px 6px;
    font-size: 0.79rem;
  }

  .btn,
  .btn-sm {
    min-height: 30px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .auth-form input,
  .auth-form select,
  .admin-filter-form input,
  .admin-filter-form select {
    min-height: 34px;
  }

  .multi-select {
    min-height: 108px !important;
  }
}
