/* =========================================================
   Revomart Trust List — page-specific visual system
   Path: /trust/trust.css
   ========================================================= */

:root {
  --tr-ink: #121820;
  --tr-muted: #5c6b7a;
  --tr-line: #e4e9ef;
  --tr-paper: #f7f8fa;
  --tr-surface: #ffffff;
  --tr-navy: #0e1a2b;
  --tr-navy-soft: #1a2b40;
  --tr-accent: #8a7340;
  --tr-accent-soft: #f4efe4;
  --tr-ok: #1f6b4a;
  --tr-ok-bg: #e8f5ef;
  --tr-warn: #8a5a12;
  --tr-warn-bg: #fff6e8;
  --tr-danger: #9b2c2c;
  --tr-danger-bg: #fdecec;
  --tr-neutral: #4a5568;
  --tr-neutral-bg: #eef1f5;
  --tr-max: 1080px;
  --tr-sans: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --tr-serif: "IBM Plex Serif", "Songti SC", "Noto Serif SC", Georgia, serif;
}

body.trust-page {
  margin: 0;
  color: var(--tr-ink);
  background:
    linear-gradient(180deg, #eef1f5 0%, var(--tr-paper) 180px, var(--tr-paper) 100%);
  font-family: var(--tr-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.trust-wrap {
  width: min(100% - 40px, var(--tr-max));
  margin: 0 auto;
  padding: 28px 0 72px;
}

/* ---------- Hero ---------- */
.trust-hero {
  padding: 8px 0 22px;
  border-bottom: 1px solid var(--tr-line);
}

.trust-hero-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tr-accent);
}

.trust-hero h1 {
  margin: 0;
  font-family: var(--tr-serif);
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--tr-navy);
  line-height: 1.25;
}

.trust-hero-lead {
  margin: 10px 0 0;
  max-width: 36em;
  font-size: 16px;
  color: var(--tr-muted);
}

/* ---------- Summary ---------- */
.trust-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding: 18px 0;
  border-bottom: 1px solid var(--tr-line);
}

.trust-summary-item {
  min-width: 72px;
}

.trust-summary-item span {
  display: block;
  font-size: 13px;
  color: var(--tr-muted);
  margin-bottom: 2px;
}

.trust-summary-item strong {
  font-size: 22px;
  font-weight: 700;
  color: var(--tr-navy);
  font-variant-numeric: tabular-nums;
}

/* ---------- Toolbar ---------- */
.trust-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0 12px;
}

.trust-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--tr-muted);
}

.trust-filters select {
  min-width: 148px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--tr-line);
  border-radius: 8px;
  background: var(--tr-surface);
  color: var(--tr-ink);
  font-size: 15px;
}

.trust-sort-note {
  font-size: 14px;
  color: var(--tr-muted);
}

.trust-records-heading {
  margin: 28px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--tr-navy);
}

.trust-pending-section {
  margin: 18px 0 8px;
  padding: 16px 18px;
  border: 1px solid var(--tr-line);
  border-left: 3px solid var(--tr-accent);
  border-radius: 12px;
  background: var(--tr-surface);
}

.trust-pending-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.trust-pending-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--tr-navy);
}

.trust-pending-note {
  margin: 0;
  font-size: 13px;
  color: var(--tr-muted);
}

.trust-pending-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trust-pending-card {
  padding: 12px 14px;
  border: 1px solid var(--tr-line);
  border-radius: 8px;
  background: var(--tr-paper);
  cursor: pointer;
}

.trust-pending-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--tr-ink);
}

.trust-pending-meta {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--tr-muted);
}

.trust-pending-cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--tr-accent);
  text-decoration: none;
}

.trust-pending-cta:hover {
  text-decoration: underline;
}

/* ---------- Ledger list ---------- */
.trust-ledger {
  margin-top: 8px;
  border-top: 1px solid var(--tr-navy);
}

.trust-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 4px;
  border-bottom: 1px solid var(--tr-line);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease;
}

.trust-row:hover {
  background: rgba(14, 26, 43, 0.025);
}

.trust-row:focus-visible {
  outline: 2px solid var(--tr-accent);
  outline-offset: 2px;
}

.trust-row-rail {
  width: 10px;
  align-self: stretch;
  border-radius: 999px;
  background: var(--tr-neutral-bg);
}

.trust-row-rail.is-active { background: #3d6b8a; }
.trust-row-rail.is-pending { background: #c4a35a; }
.trust-row-rail.is-done { background: #3f7a5c; }
.trust-row-rail.is-risk { background: #a85555; }
.trust-row-rail.is-closed { background: #94a3b8; }

.trust-row-main {
  min-width: 0;
}

.trust-row-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--tr-ink);
  line-height: 1.4;
  word-break: break-word;
}

.trust-row-number {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--tr-navy-soft);
  font-variant-numeric: tabular-nums;
}

.trust-row-meta {
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 14px;
  color: var(--tr-muted);
}

.trust-row-meta .dot {
  opacity: 0.45;
}

.trust-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.trust-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--tr-neutral-bg);
  color: var(--tr-neutral);
}

.trust-status.is-active { background: #e8f0f5; color: #1f4e6b; }
.trust-status.is-pending { background: var(--tr-warn-bg); color: var(--tr-warn); }
.trust-status.is-done { background: var(--tr-ok-bg); color: var(--tr-ok); }
.trust-status.is-risk { background: var(--tr-danger-bg); color: var(--tr-danger); }
.trust-status.is-closed { background: var(--tr-neutral-bg); color: var(--tr-neutral); }

.trust-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--tr-line);
  border-radius: 8px;
  background: var(--tr-surface);
  color: var(--tr-navy);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.trust-open-btn:hover {
  border-color: #c5ced8;
  background: #fafbfc;
}

.trust-open-btn.is-disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed;
}

/* ---------- States ---------- */
.trust-state {
  margin-top: 28px;
  padding: 36px 24px;
  text-align: center;
  border: 1px dashed #c9d2dc;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.trust-state h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--tr-navy);
}

.trust-state p {
  margin: 10px auto 0;
  max-width: 28em;
  font-size: 15px;
  color: var(--tr-muted);
}

.trust-state .trust-retry {
  margin-top: 18px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--tr-navy);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.trust-skeleton .sk-row {
  display: grid;
  grid-template-columns: 10px 1fr 120px;
  gap: 16px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--tr-line);
}

.trust-skeleton .sk-bar {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e8edf3, #f4f6f8, #e8edf3);
  background-size: 200% 100%;
  animation: trust-shimmer 1.2s ease-in-out infinite;
}

.trust-skeleton .sk-rail {
  border-radius: 999px;
  background: #e8edf3;
}

.trust-skeleton .sk-title { width: 62%; height: 18px; margin-bottom: 10px; }
.trust-skeleton .sk-sub { width: 38%; height: 13px; margin-bottom: 8px; }
.trust-skeleton .sk-meta { width: 48%; height: 12px; }
.trust-skeleton .sk-side { height: 28px; width: 100%; }

@keyframes trust-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.trust-hidden {
  display: none !important;
}

/* ---------- Header tweaks for Trust page ---------- */
.trust-page .rv-navigation a.is-active {
  color: var(--tr-navy);
  font-weight: 800;
}

.trust-user-email {
  font-size: 14px;
  color: var(--tr-muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .trust-wrap {
    width: min(100% - 28px, var(--tr-max));
    padding-top: 20px;
  }

  .trust-row {
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 12px;
  }

  .trust-row-side {
    grid-column: 2;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .trust-summary {
    gap: 18px 24px;
  }
}
