:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #05070d;
  --muted: #68707c;
  --line: #e5e5e5;
  --soft: #f6f7f9;
  --accent: #ff2b16;
  --accent-2: #ff7046;
  --danger: #bd1e17;
  --success: #10865d;
  --warning: #b7791f;
  --shadow: 0 8px 18px rgba(10, 18, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 16px;
}

button:hover {
  background: #df220f;
}

button.secondary {
  background: #eef3f7;
  color: var(--ink);
}

button.danger {
  background: var(--danger);
}

button.warning {
  background: #ff8a00;
}

button.success {
  background: #34c759;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

select[multiple] {
  min-height: 120px;
}

label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #222;
  font-size: 13px;
  font-weight: 800;
}

label small {
  color: var(--muted);
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f6f7f9;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0;
  font-size: 34px;
}

.error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 28px;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 16px 10px;
  overflow: hidden;
}

.brand {
  margin: 0;
  padding: 0 52px;
  font-size: 30px;
  line-height: 54px;
  font-weight: 950;
  letter-spacing: 0;
}

.nav {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #cfcfcf transparent;
}

.nav::-webkit-scrollbar {
  width: 8px;
}

.nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cfcfcf;
}

.nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav hr {
  width: 100%;
  height: 1px;
  margin: 12px 0;
  border: 0;
  background: #cfcfcf;
}

.nav button {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 999px;
  background: transparent;
  color: #05070d;
  text-align: left;
  padding: 0 20px;
}

.nav button span {
  width: 20px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
}

.nav button:hover,
.nav button.active {
  background: var(--accent);
  color: #fff;
}

.workspace {
  min-width: 0;
  background: #fff;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
}

.icon-button {
  width: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-size: 18px;
}

.icon-button:hover {
  background: var(--soft);
}

.logout {
  min-width: 112px;
  border-radius: 999px;
  background: #e9f0f6;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.logout:hover {
  background: #dbe6ee;
}

.page {
  display: none;
  padding: 30px 26px;
}

.active-page {
  display: block;
}

.analytics-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel-head {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 20px 26px;
}

.panel-head h2,
.resource-head h2,
.form-title h3 {
  margin: 0;
}

.date-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-pills span {
  min-width: 132px;
  display: inline-flex;
  justify-content: center;
  border: 1px solid #dce4ff;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 18px;
}

#analyticsChart {
  width: 100%;
  height: 340px;
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 30px 24px;
  margin-top: 30px;
}

.metric-card {
  min-height: 180px;
  display: grid;
  align-content: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px 16px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02);
}

.metric-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 8px 14px rgba(255, 43, 22, 0.26);
  font-weight: 900;
}

.metric-card h3 {
  margin: 4px 0 0;
  font-size: 15px;
}

.metric-card strong {
  font-size: 30px;
  line-height: 1;
}

.resource-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.overline {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.record-form {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 18px;
  padding: 18px;
}

.content-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.content-head {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 20px 26px;
}

.content-head h2 {
  margin: 0;
  font-size: 18px;
}

.preview-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  padding: 0 30px;
  font-weight: 900;
  text-decoration: none;
}

.content-body {
  display: grid;
  gap: 16px;
  padding: 22px 26px;
}

.content-editor textarea {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  line-height: 1.6;
  resize: vertical;
}

.form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.check-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: auto;
}

.checklist-field {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
}

.checklist-field legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 800;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px 14px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.thumb {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  object-fit: cover;
  background: #eef1f5;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  background: #eef1f5;
  color: #4c5562;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
}

.pill.approved,
.pill.published,
.pill.active,
.pill.eligible,
.pill.verified {
  background: #e7f7ef;
  color: var(--success);
}

.pill.pending,
.pill.draft {
  background: #fff8e5;
  color: var(--warning);
}

.pill.blocked,
.pill.hidden,
.pill.expired,
.pill.inactive {
  background: #ffe9e7;
  color: var(--danger);
}

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

.row-actions button {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 13px;
}

.mini-action {
  min-height: 30px;
  padding: 5px 12px;
  font-size: 12px;
}

.user-detail-card,
.user-profile-card,
.user-post-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.user-detail-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.user-title,
.user-detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-photo-strip {
  min-height: 160px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 18px;
}

.user-photo {
  position: relative;
  width: 88px;
  margin: 0;
}

.user-photo img {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  object-fit: cover;
}

.user-photo button {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  min-height: 22px;
  border-radius: 999px;
  padding: 0;
  font-size: 14px;
}

.add-image {
  align-self: flex-end;
  min-height: 38px;
  border-radius: 999px;
}

.user-detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.8fr);
  gap: 18px;
  margin-top: 18px;
}

.user-profile-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.user-profile-card p {
  margin: 0;
  font-size: 13px;
}

.wallet-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-add {
  width: 28px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.user-profile-card hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
}

.follow-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid #d9e0e7;
  border-radius: 999px;
  background: #edf1f5;
  text-align: center;
  font-weight: 800;
}

.follow-row span {
  padding: 8px;
}

.follow-row span + span {
  border-left: 1px solid #d9e0e7;
}

.detail-tabs {
  display: flex;
  gap: 4px;
  padding: 0 0 12px;
  border-radius: 999px;
}

.detail-tabs button {
  min-height: 34px;
  border-radius: 999px;
  background: #f1f3f5;
  color: var(--ink);
}

.detail-tabs button.active {
  background: var(--accent);
  color: #fff;
}

.user-post-card {
  padding: 0 0 16px;
}

.detail-table {
  overflow: auto;
  border-top: 1px solid var(--line);
}

.table-tools,
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.table-tools {
  justify-content: flex-start;
}

.table-tools span {
  min-width: 62px;
  border: 1px solid #d9e0ff;
  border-radius: 999px;
  padding: 8px 20px;
  text-align: center;
}

.table-tools select {
  width: auto;
  min-width: 72px;
  border: 1px solid #d9e0ff;
  border-radius: 999px;
  padding: 8px 14px;
}

.table-foot button {
  min-height: 34px;
  padding: 7px 12px;
}

.view-post-btn {
  min-height: 34px;
  border-radius: 999px;
  padding: 8px 20px;
}

.link-button {
  min-height: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-decoration: underline;
  font-weight: 800;
}

.link-button:hover {
  background: transparent;
  color: var(--accent);
}

.detail-table h3 {
  margin: 0;
  padding: 16px;
  font-size: 14px;
}

.empty-cell {
  padding: 28px !important;
  text-align: center;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(5, 7, 13, 0.35);
  padding: 18px;
}

.post-modal {
  width: min(360px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.confirm-modal {
  width: min(320px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  border-radius: 8px;
  background: #fff;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.confirm-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 2px solid #ffba7a;
  border-radius: 999px;
  color: #ff9d45;
  font-size: 38px;
  line-height: 1;
}

.confirm-modal h3 {
  margin: 0;
  color: #6b6f76;
  font-size: 20px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions button {
  min-width: 72px;
  border-radius: 999px;
}

.coin-modal {
  width: min(340px, 100%);
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.coin-modal header {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.coin-modal h3 {
  margin: 0;
  font-size: 15px;
}

.coin-body {
  display: grid;
  gap: 12px;
  padding: 14px 16px 28px;
}

.coin-body input {
  border-color: #111;
  border-radius: 999px;
}

.coin-body button {
  width: max-content;
  border-radius: 999px;
  padding: 10px 22px;
}

.post-modal header,
.post-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.post-modal footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.post-modal h3,
.post-modal h4,
.post-modal p {
  margin: 0;
}

.modal-close {
  min-height: 32px;
  background: transparent;
  color: var(--muted);
  padding: 0 4px;
  font-size: 24px;
}

.post-modal-body {
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.post-media-preview {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 4px;
  background: #fafafa;
}

.post-media-preview img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.media-count {
  text-align: center;
  font-size: 12px;
}

.empty {
  padding: 28px;
  color: var(--muted);
  font-weight: 800;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}

.report-head h2 {
  margin: 0;
  font-size: 18px;
}

.report-tabs {
  padding: 0;
}

.report-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-search input {
  width: 160px;
  border-radius: 999px;
}

@media (max-width: 1180px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .brand {
    padding: 0 12px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 52vh;
    overflow-y: auto;
  }

  .nav hr {
    grid-column: 1 / -1;
  }

  .page {
    padding: 18px 14px;
  }

  .panel-head,
  .resource-head,
  .form-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .date-pills span {
    min-width: 110px;
    font-size: 16px;
  }

  .metrics,
  .form-grid,
  .user-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Settings Page */
.settings-container {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  min-height: calc(100vh - 100px);
}

.settings-sidebar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 8px 14px;
  font-weight: 800;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}

.settings-nav button span {
  width: 18px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
}

.settings-nav button:hover {
  background: var(--soft);
}

.settings-nav button.active {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
}

.settings-content {
  min-width: 0;
  padding: 0;
  overflow-y: auto;
}

.settings-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  max-width: none;
}

.settings-card h2 {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 20px 26px;
  font-size: 20px;
  color: var(--ink);
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 18px 24px;
  padding: 22px 26px 26px;
}

.settings-form.settings-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.settings-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
  color: var(--ink);
}

.settings-form input[type="text"],
.settings-form input[type="number"],
.settings-form input[type="password"],
.settings-form input[type="email"],
.settings-form select,
.settings-form textarea {
  padding: 10px 12px;
  border: 1px solid #dce4ff;
  border-radius: 999px;
  background: white;
  font-size: 14px;
}

.settings-form textarea {
  min-height: 96px;
  border-radius: 8px;
  resize: vertical;
}

.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 43, 22, 0.1);
}

.settings-form .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
  align-self: end;
  margin-top: 4px;
}

.settings-form .check-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.settings-form button {
  width: max-content;
  grid-column: 1 / -1;
  margin-top: 8px;
  border-radius: 999px;
  padding: 10px 30px;
}

@media (max-width: 1240px) {
  .settings-form.settings-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .settings-container {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    width: 100%;
    padding: 8px;
  }

  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding: 0 12px;
  }

  .settings-nav button {
    width: auto;
    flex-shrink: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
  }

  .settings-form,
  .settings-form.settings-grid {
    grid-template-columns: 1fr;
    padding: 18px;
  }
}
