:root {
  --indigo-900: #1E1B4B;
  --indigo-800: #272357;
  --indigo-700: #3730A3;
  --indigo-600: #4338CA;
  --amber-500: #F59E0B;
  --amber-600: #D97706;
  --gray-bg: #F7F8FA;
  --gray-border: #E4E6EB;
  --text-dark: #1A1A1A;
  --text-muted: #6B7280;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--gray-bg);
  color: var(--text-dark);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--indigo-900);
  padding: 24px 16px;
  color: white;
}

.sidebar-logo {
  font-size: 20px;
  font-weight: 700;
  color: white;
  padding: 0 12px 24px;
}

.sidebar-logo span {
  color: var(--amber-500);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #C7C6E8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-link:hover {
  background: var(--indigo-800);
  color: white;
}

.sidebar-link.active {
  background: var(--indigo-700);
  color: white;
  border-left: 3px solid var(--amber-500);
  padding-left: 9px;
}

.sidebar-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  background: var(--indigo-800);
  margin: 12px 4px;
}

/* Buyer/Seller mode switch — a segmented control at the top of the sidebar
   nav, always visible for a logged-in account. */
.mode-switch {
  display: flex;
  background: var(--indigo-800);
  border-radius: 8px;
  padding: 3px;
  margin: 0 4px 4px;
  gap: 3px;
}

.mode-switch-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: #C7C6E8;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 0;
  border-radius: 6px;
  cursor: pointer;
}

.mode-switch-btn:hover:not(.active) {
  color: white;
}

.mode-switch-btn.active {
  background: var(--amber-500);
  color: var(--indigo-900);
}

.mode-switch-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Mode-gated page block — shown on a buyer page while in seller mode, or
   vice versa, instead of that page's normal content. Reuses .coming-soon-box
   sizing/spacing via the same class on the container; this just styles the
   button inside it. */
.mode-switch-cta {
  margin-top: 16px;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: #ffffff;
  padding: 20px 32px;
  border-bottom: 1px solid var(--gray-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.page-content {
  padding: 32px;
}

#auth-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-area-flex {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-email {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.auth-btn {
  background: var(--indigo-700);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.auth-btn:hover {
  background: var(--indigo-600);
}

.auth-btn.cta {
  background: var(--amber-500);
  color: var(--indigo-900);
}

.auth-btn.cta:hover {
  background: var(--amber-600);
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar input,
.toolbar select {
  padding: 8px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

#search-input {
  flex: 1;
  min-width: 200px;
}

#min-dr-input,
#min-da-input {
  width: 100px;
}

.site-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.site-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 2px solid var(--gray-border);
  background: #fafbfc;
}

.site-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #eef0f2;
  font-size: 14px;
}

.site-table tr:last-child td {
  border-bottom: none;
}

.site-table tr:hover td {
  background: #f9fafb;
}

.domain-cell {
  font-weight: 600;
  color: var(--text-dark);
}

.domain-link {
  color: var(--indigo-900);
  text-decoration: none;
}

.domain-trust-note {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

.domain-link:hover {
  color: var(--indigo-700);
  text-decoration: underline;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
}

.badge.dr {
  background: #E6F4EA;
  color: #1E7E34;
}

.badge.da {
  background: #E8F0FE;
  color: #1A56DB;
}

.buy-btn {
  background: var(--amber-500);
  color: var(--indigo-900);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.buy-btn:hover {
  background: var(--amber-600);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 27, 75, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: white;
  padding: 32px;
  border-radius: 10px;
  width: 100%;
  max-width: 360px;
  position: relative;
}

.auth-modal-box {
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
}

.buy-modal-box {
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.deliver-modal-box {
  max-width: 520px;
}

.orders-box {
  max-width: 480px;
  max-height: 70vh;
  overflow-y: auto;
}

.detail-box {
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-box h2 {
  margin: 0 0 20px;
  font-size: 20px;
  color: var(--indigo-900);
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#auth-form input {
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
}

.modal-submit-btn {
  background: var(--amber-500);
  color: var(--indigo-900);
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}

.modal-submit-btn:hover {
  background: var(--amber-600);
}

.modal-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.reject-submit-btn {
  background: #DC2626;
  color: white;
}

.reject-submit-btn:hover {
  background: #B91C1C;
}

.auth-message {
  font-size: 13px;
  color: #DC2626;
  min-height: 18px;
  margin: 10px 0 0;
}

.toggle-mode {
  font-size: 13px;
  color: var(--text-muted);
  margin: 14px 0 0;
  text-align: center;
}

.toggle-mode a {
  color: var(--indigo-700);
  text-decoration: none;
  font-weight: 600;
}

.buy-domain-label {
  font-weight: 600;
  color: var(--text-muted);
  margin: -12px 0 16px;
}

.radio-label {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 8px;
}

.radio-label input {
  margin-right: 8px;
}

.order-row-wrap {
  border-bottom: 1px solid #eef0f2;
  padding: 14px 0;
}

.order-row-wrap:last-child {
  border-bottom: none;
}

.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.order-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-pending_payment { background: #FEF3C7; color: #92400E; }
.status-paid            { background: #D1FAE5; color: #065F46; }
.status-in_progress     { background: #DBEAFE; color: #1E40AF; }
.status-delivered       { background: #FDE68A; color: #92400E; }
.status-revision_requested { background: #FBCFE8; color: #9D174D; }
.status-completed       { background: #D1FAE5; color: #065F46; }
.status-rejected        { background: #F3E8FF; color: #6B21A8; }
.status-cancelled       { background: #FEE2E2; color: #991B1B; }

/* Wallet top-up request statuses — same .status-badge base. .status-rejected
   above (purple) is shared with dispute statuses; safe since the value sets
   never collide. */
.status-pending         { background: #FEF3C7; color: #92400E; }
.status-approved        { background: #D1FAE5; color: #065F46; }

/* Dispute statuses reuse .status-badge for sizing/shape; values never
   collide with order statuses above so the same class naming is safe. */
.status-open              { background: #FEF3C7; color: #92400E; }
.status-under_review      { background: #DBEAFE; color: #1E40AF; }
.status-resolved_refund   { background: #D1FAE5; color: #065F46; }
.status-resolved_redo     { background: #E0E7FF; color: #3730A3; }
.status-resolved_denied   { background: #FEE2E2; color: #991B1B; }

/* Link-monitoring statuses — same .status-badge base, own color set. */
.status-live              { background: #D1FAE5; color: #065F46; }
.status-removed           { background: #FEE2E2; color: #991B1B; }
.status-check_failed      { background: #F3F4F6; color: #4B5563; }

/* Seller-submitted site statuses — .status-pending/.status-approved/
   .status-rejected above are reused as-is; only "inactive" (a seller's own
   site deactivated because it has order history) is new. */
.status-inactive          { background: #F3F4F6; color: #4B5563; }

.status-select {
  padding: 6px 10px;
  border-radius: 20px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  cursor: pointer;
}

.user-id-cell {
  font-size: 12px;
  color: #9CA3AF;
  font-family: monospace;
}

.coming-soon-box {
  background: white;
  border-radius: 10px;
  padding: 48px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.coming-soon-box h2 {
  color: var(--indigo-900);
  margin-top: 0;
}

.coming-soon-box p {
  color: var(--text-muted);
}

.stat-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 10px;
  padding: 20px 24px;
  flex: 1;
  min-width: 180px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--indigo-900);
}

.form-card {
  background: white;
  border-radius: 10px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  max-width: 720px;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-field input,
.form-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.form-field input:disabled {
  background: #f3f4f6;
  color: var(--text-muted);
}

.form-save-btn {
  margin-top: 24px;
  max-width: 200px;
}

.public-page {
  background: white;
}

.public-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 48px;
  border-bottom: 1px solid var(--gray-border);
}

.public-nav-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--indigo-900);
}

.public-nav-logo span {
  color: var(--amber-500);
}

.public-nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-right: 8px;
}

.public-nav-link:hover {
  color: var(--indigo-700);
}

.hero {
  text-align: center;
  padding: 96px 24px 72px;
  max-width: 780px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 42px;
  line-height: 1.2;
  color: var(--indigo-900);
  margin: 0 0 20px;
}

.hero-subtext {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 36px;
}

.hero-cta-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-btn-primary {
  background: var(--amber-500);
  color: var(--indigo-900);
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}

.hero-btn-primary:hover {
  background: var(--amber-600);
}

.hero-btn-secondary {
  background: white;
  color: var(--indigo-900);
  border: 1.5px solid var(--indigo-700);
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}

.hero-btn-secondary:hover {
  background: #F5F4FF;
}

.trust-section {
  background: var(--indigo-900);
  display: flex;
  justify-content: center;
  gap: 64px;
  padding: 48px 24px;
  flex-wrap: wrap;
}

.trust-item {
  text-align: center;
  color: white;
}

.trust-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--amber-500);
  margin-bottom: 6px;
}

.trust-label {
  font-size: 14px;
  color: #C7C6E8;
  max-width: 200px;
}

.features-section {
  display: flex;
  gap: 24px;
  padding: 80px 48px;
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.feature-card {
  flex: 1;
  min-width: 240px;
  padding: 28px;
  border-radius: 10px;
  border: 1px solid var(--gray-border);
}

.feature-card h3 {
  color: var(--indigo-900);
  margin: 0 0 10px;
  font-size: 17px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.public-footer {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--gray-border);
}

.public-footer a {
  color: var(--text-muted);
  text-decoration: underline;
}

.public-footer a:hover {
  color: var(--indigo-700);
}

.quick-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.quick-action-link {
  background: white;
  border: 1px solid var(--gray-border);
  color: var(--indigo-900);
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.quick-action-link:hover {
  background: #F5F4FF;
  border-color: var(--indigo-700);
}

.dashboard-section {
  margin-top: 8px;
}

.section-heading {
  font-size: 16px;
  color: var(--indigo-900);
  margin: 0 0 14px;
}

.order-list-card {
  background: white;
  border-radius: 10px;
  padding: 8px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.analytics-charts-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.analytics-chart-card {
  background: white;
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.analytics-chart-card h3 {
  font-size: 15px;
  color: var(--indigo-900);
  margin: 0 0 16px;
}

.analytics-chart-wrap {
  position: relative;
  height: 280px;
}

.analytics-range-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.hidden-form {
  display: none;
}

.remember-me-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.remember-me-label input {
  width: auto;
  margin: 0;
}

.forgot-subtext {
  font-size: 13px;
  color: var(--text-muted);
  margin: -12px 0 16px;
  line-height: 1.5;
}

.centered-card-wrap {
  display: flex;
  justify-content: center;
  padding: 80px 24px;
}

.narrow-card {
  max-width: 400px;
  width: 100%;
}

.reset-title {
  color: var(--indigo-900);
  margin: 0 0 20px;
  font-size: 20px;
}

.reset-status {
  color: var(--text-muted);
  font-size: 14px;
}

.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px;
}

.legal-page h1 {
  color: var(--indigo-900);
  font-size: 32px;
  margin: 0 0 8px;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 32px;
}

.legal-page h2 {
  color: var(--indigo-900);
  font-size: 18px;
  margin: 32px 0 10px;
}

.legal-page p {
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 4px;
}

.legal-page p a {
  color: var(--indigo-700);
  font-weight: 600;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--indigo-900);
  padding: 4px 8px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 199;
}

.sidebar-overlay.sidebar-open {
  display: block;
}

.detail-category {
  display: inline-block;
  background: #EEF2FF;
  color: var(--indigo-700);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.detail-domain {
  color: var(--indigo-900);
  font-size: 22px;
  margin: 0 0 20px;
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-stat {
  background: var(--gray-bg);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.detail-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--indigo-900);
}

.detail-pricing-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

.detail-price-box {
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.detail-price-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--amber-600);
}

/* ---------- Support page ---------- */
.support-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  padding: 20px;
  margin: 24px 0;
}

.support-icon {
  font-size: 28px;
  color: var(--amber-600);
}

.support-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.support-email {
  color: var(--indigo-700);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.support-email:hover {
  text-decoration: underline;
}

/* ---------- Pagination controls ---------- */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.pagination-btn {
  background: white;
  border: 1px solid var(--gray-border);
  color: var(--indigo-900);
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
  background: #F5F4FF;
  border-color: var(--indigo-700);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-label {
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Favorites ---------- */
.favorites-filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.favorites-filter-label input {
  width: auto;
}

.favorite-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #D1D5DB;
  padding: 4px;
  line-height: 1;
}

.favorite-btn.favorited {
  color: #DC2626;
}

.favorite-btn:hover {
  color: #EF4444;
}

.favorite-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.detail-favorite-btn {
  float: right;
  font-size: 24px;
  margin-top: -4px;
}

/* ---------- My Projects ---------- */
.projects-toolbar {
  margin-bottom: 20px;
}

.project-card {
  background: white;
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
}

.project-name {
  color: var(--indigo-900);
  font-size: 17px;
  margin: 0 0 12px;
}

.project-empty {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.unassigned-card {
  border: 1px dashed var(--gray-border);
  box-shadow: none;
}

.assign-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 8px;
}

.assign-btn {
  background: white;
  border: 1px solid var(--gray-border);
  color: var(--indigo-900);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.assign-btn:hover {
  background: #F5F4FF;
  border-color: var(--indigo-700);
}

/* ---------- Order cancellation ---------- */
.cancel-order-btn {
  background: white;
  border: 1px solid #FCA5A5;
  color: #DC2626;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cancel-order-btn:hover {
  background: #FEF2F2;
}

.cancel-order-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Messaging / details / deliver / accept / reject buttons ---------- */
.message-order-btn,
.details-order-btn,
.deliver-order-btn,
.accept-order-btn {
  background: white;
  border: 1px solid var(--gray-border);
  color: var(--indigo-900);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.message-order-btn:hover,
.details-order-btn:hover {
  background: #F5F4FF;
  border-color: var(--indigo-700);
}

.deliver-order-btn,
.accept-order-btn {
  background: var(--amber-500);
  color: var(--indigo-900);
  border-color: var(--amber-500);
}

.deliver-order-btn:hover,
.accept-order-btn:hover {
  background: var(--amber-600);
}

.reject-order-btn {
  background: white;
  border: 1px solid #FCA5A5;
  color: #DC2626;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.reject-order-btn:hover {
  background: #FEF2F2;
}

.rejected-reason-row {
  font-size: 13px;
  color: #6B21A8;
  margin-top: 4px;
}

.message-thread {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px 2px;
}

.thread-loading {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.message-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.own-message {
  align-self: flex-end;
  background: var(--indigo-700);
  color: white;
}

.other-message {
  align-self: flex-start;
  background: var(--gray-bg);
  color: var(--text-dark);
}

.message-text {
  line-height: 1.4;
  word-wrap: break-word;
}

.message-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
}

.message-textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

/* ---------- Signup form ---------- */
.signup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

#signup-form .form-field {
  margin-bottom: 12px;
}

#signup-form select {
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: white;
}

.terms-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 4px 0 8px;
  cursor: pointer;
}

.terms-checkbox-label input {
  margin-top: 3px;
  width: auto;
  flex-shrink: 0;
}

.terms-checkbox-label a {
  color: var(--indigo-700);
  font-weight: 600;
  text-decoration: none;
}

.terms-checkbox-label a:hover {
  text-decoration: underline;
}

/* ---------- User menu dropdown (header) ---------- */
.notif-btn {
  background: none;
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
}

.notif-btn:hover {
  background: var(--gray-bg);
}

.cart-btn {
  position: relative;
  background: none;
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
}

.cart-btn:hover {
  background: var(--gray-bg);
}

.cart-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--amber-500);
  color: var(--indigo-900);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.notif-wrap {
  position: relative;
}

.notif-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--amber-500);
  color: var(--indigo-900);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

.notif-count-badge.hidden {
  display: none;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: white;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  width: 340px;
  max-width: 88vw;
  max-height: 420px;
  overflow-y: auto;
  z-index: 50;
}

.notif-dropdown.hidden {
  display: none;
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-border);
  position: sticky;
  top: 0;
  background: white;
}

.notif-dropdown-header strong {
  font-size: 14px;
  color: var(--indigo-900);
}

.notif-mark-all-btn {
  background: none;
  border: none;
  color: var(--indigo-700);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.notif-mark-all-btn:hover {
  text-decoration: underline;
}

.notif-list {
  padding: 4px 0;
}

.notif-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: none;
  border-bottom: 1px solid var(--gray-bg);
  background: none;
  cursor: pointer;
}

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

.notif-item:hover {
  background: var(--gray-bg);
}

.notif-item.unread {
  background: var(--gray-bg);
}

.notif-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--indigo-700);
  flex-shrink: 0;
}

.notif-item-body {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.notif-item-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.notif-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.user-menu-wrap {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  padding: 6px 12px 6px 6px;
  cursor: pointer;
}

.user-menu-btn:hover {
  background: var(--gray-bg);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--indigo-700);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 220px;
  z-index: 300;
  overflow: hidden;
}

.user-menu-dropdown.hidden {
  display: none;
}

.user-menu-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-border);
}

.user-menu-header strong {
  display: block;
  color: var(--indigo-900);
  font-size: 14px;
}

.user-menu-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-dark);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.user-menu-item:hover {
  background: var(--gray-bg);
}

.logout-item {
  color: #DC2626;
}

/* ---------- Buy modal: content mode / editor / file upload ---------- */
.buy-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--indigo-900);
  margin: 20px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.content-mode-tabs,
.content-input-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0 12px;
}

.content-mode-tab,
.content-input-tab {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--gray-border);
  background: white;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.content-mode-tab.active,
.content-input-tab.active {
  background: var(--indigo-700);
  color: white;
  border-color: var(--indigo-700);
}

.content-input-tabs {
  margin: 8px 0 10px;
}

.writer-fee-badge {
  font-size: 11px;
  opacity: 0.85;
}

.writer-fee-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
  line-height: 1.5;
}

.editor-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--gray-bg);
  border: 1px solid var(--gray-border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}

.editor-toolbar button {
  background: white;
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  width: 32px;
  height: 30px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-dark);
}

.editor-toolbar button:hover {
  background: var(--gray-bg);
}

.content-editor {
  min-height: 160px;
  max-height: 260px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--gray-border);
  border-radius: 0 0 6px 6px;
  font-size: 14px;
  line-height: 1.6;
}

.content-editor:empty:before {
  content: attr(data-placeholder);
  color: #9CA3AF;
}

.content-editor img {
  max-width: 100%;
  border-radius: 6px;
  margin: 6px 0;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  border: 2px dashed var(--gray-border);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.file-upload-label:hover {
  border-color: var(--indigo-700);
  background: #F5F4FF;
}

.file-upload-label input[type="file"] {
  display: none;
}

/* ---------- Multiple anchor/target link rows ---------- */
.link-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.link-row input {
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.remove-link-btn {
  background: none;
  border: none;
  color: #DC2626;
  font-size: 20px;
  cursor: pointer;
  width: 28px;
  height: 28px;
}

.add-link-btn {
  background: white;
  border: 1px dashed var(--gray-border);
  color: var(--indigo-700);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}

.add-link-btn:hover {
  background: #F5F4FF;
  border-color: var(--indigo-700);
}

.total-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--gray-border);
  margin-top: 16px;
  font-size: 15px;
}

.total-price-row strong {
  color: var(--indigo-900);
  font-size: 20px;
}

/* ---------- Deliver modal (domain-validated, full-width box) ---------- */
.deliver-domain-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: -12px 0 16px;
  line-height: 1.5;
}

.deliver-domain-hint strong {
  color: var(--indigo-900);
}

.deliver-url-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

/* ---------- Admin settings bar ---------- */
.settings-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.settings-bar label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.settings-bar input {
  width: 100px;
  padding: 8px 10px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
}

.fee-save-message {
  font-size: 13px;
  color: #065F46;
}

/* ---------- Delivered link + details ---------- */
.delivered-link-row {
  font-size: 13px;
  color: #065F46;
  margin-top: 4px;
}

.delivered-link-row a {
  color: #065F46;
  font-weight: 600;
}

.delivered-action-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 10px;
}

.revision-pending-box {
  background: #FDF2F8;
  border-color: #FBCFE8;
}

.revision-pending-box .delivered-notice {
  color: #9D174D;
}

.delivered-notice {
  font-size: 13px;
  color: #92400E;
  margin: 0 0 10px;
  line-height: 1.5;
}

.delivered-action-buttons {
  display: flex;
  gap: 10px;
}

.accept-delivery-btn {
  background: var(--indigo-700);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.accept-delivery-btn:hover {
  background: var(--indigo-600);
}

.request-revision-btn {
  background: white;
  border: 1px solid var(--gray-border);
  color: var(--indigo-900);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.request-revision-btn:hover {
  background: #F5F4FF;
  border-color: var(--indigo-700);
}

.detail-row {
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1.5;
  word-wrap: break-word;
}

.detail-row strong {
  color: var(--indigo-900);
}

.detail-content-box {
  background: var(--gray-bg);
  border-radius: 6px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.detail-content-box img {
  max-width: 100%;
  border-radius: 6px;
}

.admin-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-row-actions .delete-site-btn {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.admin-row-actions .delete-site-btn:hover {
  background: #FECACA;
}

/* ---------- Manage Sites (admin) ---------- */
.manage-sites-toolbar {
  justify-content: space-between;
}

.manage-sites-toolbar #sites-search-input {
  flex: 1;
  min-width: 200px;
}

.manage-sites-modal-box {
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
}

.csv-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: -8px 0 16px;
}

.csv-hint code {
  font-size: 11px;
  background: var(--gray-bg);
  padding: 2px 4px;
  border-radius: 4px;
}

.csv-or-divider {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 14px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#csv-preview-area {
  margin-top: 16px;
}

.form-field select {
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: white;
}

/* ---------- Admin status tabs ---------- */
.status-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--gray-border);
  padding-bottom: 0;
}

.status-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-tab:hover {
  color: var(--indigo-700);
}

.status-tab.active {
  color: var(--indigo-700);
  border-bottom-color: var(--indigo-700);
}

.status-tab-count {
  background: var(--gray-bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 14px;
  text-align: center;
}

.status-tab.active .status-tab-count {
  background: var(--indigo-700);
  color: white;
}

.post-link-cell {
  max-width: 220px;
}

.truncated-link {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  color: var(--indigo-700);
  text-decoration: none;
}

.truncated-link:hover {
  text-decoration: underline;
}

.days-remaining-hint {
  font-size: 11px;
  color: #92400E;
  margin-top: 3px;
}

/* ---------- Orders page toolbar (export) ---------- */
.orders-page-toolbar {
  margin-bottom: 16px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .hamburger-btn {
    display: inline-block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    height: 100%;
    z-index: 200;
    transition: left 0.25s ease;
    overflow-y: auto;
  }

  .sidebar.sidebar-open {
    left: 0;
  }

  .topbar {
    padding: 16px 20px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .page-title {
    font-size: 17px;
  }

  .page-content {
    padding: 18px;
  }

  #auth-area {
    gap: 8px;
  }

  .user-email {
    display: none;
  }

  .user-menu-name {
    display: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 20px;
  }

  .stat-cards {
    flex-direction: column;
  }

  .quick-actions {
    flex-direction: column;
  }

  .quick-action-link {
    text-align: center;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  #search-input,
  #min-dr-input,
  #min-da-input,
  .toolbar select {
    width: 100%;
  }

  .site-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .site-table {
    min-width: 760px;
  }

  .modal-box {
    max-width: 92vw;
    padding: 24px;
  }

  .signup-grid {
    grid-template-columns: 1fr;
  }

  .detail-stats-grid {
    grid-template-columns: 1fr;
  }

  .public-nav {
    padding: 16px 20px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .public-nav-link {
    display: none;
  }

  .hero {
    padding: 56px 20px 48px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero-subtext {
    font-size: 15px;
  }

  .trust-section {
    gap: 32px;
    padding: 36px 20px;
  }

  .features-section {
    padding: 48px 20px;
  }

  .order-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .legal-page {
    padding: 40px 20px;
  }

  .support-card {
    flex-direction: column;
    text-align: center;
  }

  .content-mode-tabs,
  .content-input-tabs {
    flex-direction: column;
  }

  .link-row {
    grid-template-columns: 1fr;
  }

  .settings-bar {
    flex-wrap: wrap;
  }

  .delivered-action-buttons {
    flex-direction: column;
  }

  .status-tabs {
    -webkit-overflow-scrolling: touch;
  }

  .analytics-charts-grid {
    grid-template-columns: 1fr;
  }
}