/* FieldBase Trends Pro */
:root {
  --trend-bg: #0f172a;
  --trend-panel: rgba(15, 23, 42, 0.88);
  --trend-card: rgba(30, 41, 59, 0.86);
  --trend-border: rgba(148, 163, 184, 0.22);
  --trend-text: #e5e7eb;
  --trend-muted: #94a3b8;
  --trend-accent: #60a5fa;
  --trend-good: #34d399;
  --trend-warn: #fbbf24;
  --trend-danger: #fb7185;
}

body {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.25), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.14), transparent 34rem),
    var(--trend-bg);
  color: var(--trend-text);
}

body.light-theme {
  --trend-bg: #f5f7fb;
  --trend-panel: rgba(255, 255, 255, 0.94);
  --trend-card: #ffffff;
  --trend-border: #dbe4ef;
  --trend-text: #0f172a;
  --trend-muted: #64748b;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.12), transparent 34rem),
    var(--trend-bg);
  color: var(--trend-text);
}

.trends-shell {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 42px;
}

.trends-hero,
.trends-filters,
.trends-customize,
.trend-section-card,
.trends-pro-gate {
  background: var(--trend-panel);
  border: 1px solid var(--trend-border);
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.trends-hero {
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}

.back-link {
  color: var(--trend-accent);
  text-decoration: none;
  font-weight: 800;
}

.pro-pill {
  display: inline-flex;
  margin-left: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #111827;
  font-size: 0.75rem;
  font-weight: 900;
  vertical-align: middle;
}

.trends-hero h1 {
  margin: 12px 0 6px;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.trends-hero p,
.section-heading p,
.trends-customize p,
.trends-pro-gate p,
.trend-card p {
  color: var(--trend-muted);
}

.trends-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-btn,
.outline-btn,
.trends-shell button {
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: white;
}

.outline-btn {
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--trend-border);
  color: var(--trend-text);
}

.trends-filters {
  display: grid;
  grid-template-columns: 180px 190px minmax(220px, 1fr);
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.field-wrap label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.82rem;
  color: var(--trend-muted);
  font-weight: 800;
}

.trends-shell input,
.trends-shell select,
.trends-shell textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--trend-border);
  background: rgba(15, 23, 42, 0.72);
  color: var(--trend-text);
  padding: 10px 12px;
  outline: none;
  box-sizing: border-box;
}

.trends-shell input::placeholder {
  color: rgba(148, 163, 184, 0.82);
}

body.light-theme .trends-shell input,
body.light-theme .trends-shell select,
body.light-theme .trends-shell textarea {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

.trends-shell input:focus,
.trends-shell select:focus {
  border-color: rgba(96, 165, 250, 0.8);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14);
}

.trends-customize {
  padding: 16px;
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

.trend-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.trend-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--trend-border);
  border-radius: 16px;
  padding: 12px;
  color: var(--trend-text);
}

.trend-toggle input {
  width: auto;
  min-height: auto;
  accent-color: #2563eb;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.kpi-grid {
  margin-bottom: 16px;
}

.trend-section-card {
  padding: 18px;
  margin-bottom: 16px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0 0 4px;
}

.trend-card {
  background: var(--trend-card);
  border: 1px solid var(--trend-border);
  border-radius: 20px;
  padding: 16px;
  min-width: 0;
}

.trend-card h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.trend-number {
  font-size: clamp(1.55rem, 4vw, 2.3rem);
  line-height: 1;
  margin: 8px 0;
  font-weight: 950;
}

.trend-sub {
  color: var(--trend-muted);
  font-size: 0.86rem;
}

.trend-list {
  display: grid;
  gap: 12px;
}

.trend-row {
  background: var(--trend-card);
  border: 1px solid var(--trend-border);
  border-radius: 18px;
  padding: 13px;
  display: grid;
  gap: 4px;
}

.trend-row strong {
  color: var(--trend-text);
}

.trend-row span {
  color: var(--trend-muted);
  font-size: 0.86rem;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-item {
  display: grid;
  gap: 5px;
}

.bar-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.86rem;
}

.bar-track {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.16);
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #0ea5e9, #34d399);
}

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

.trend-tag {
  display: inline-flex;
  border: 1px solid var(--trend-border);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--trend-muted);
  font-size: 0.8rem;
}

.trends-pro-gate {
  padding: 22px;
  margin-bottom: 16px;
  text-align: center;
}

@media (max-width: 760px) {
  .trends-shell {
    width: min(100% - 16px, 1280px);
    padding-top: 10px;
  }

  .trends-hero {
    display: block;
    padding: 18px;
    border-radius: 20px;
  }

  .trends-actions {
    margin-top: 14px;
    justify-content: stretch;
  }

  .trends-actions button,
  .trends-actions a {
    width: 100%;
  }

  .trends-filters {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .trend-section-card {
    padding: 14px;
  }

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

  .trend-card {
    border-radius: 18px;
    padding: 14px;
  }
}

/* Rev 1.4.1 finance expansion polish */
.trend-card .bar-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.trend-card .bar-list::-webkit-scrollbar {
  width: 8px;
}

.trend-card .bar-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.trend-number:empty {
  display: none;
}

.trend-section-card[data-trend-section="money-timeline"],
.trend-section-card[data-trend-section="project-money"],
.trend-section-card[data-trend-section="employee-money"],
.trend-section-card[data-trend-section="item-money"],
.trend-section-card[data-trend-section="dependency-money"] {
  border-color: rgba(34, 197, 94, 0.25);
}

.trend-section-card[data-trend-section="money-timeline"] .section-heading h2,
.trend-section-card[data-trend-section="project-money"] .section-heading h2,
.trend-section-card[data-trend-section="employee-money"] .section-heading h2,
.trend-section-card[data-trend-section="item-money"] .section-heading h2,
.trend-section-card[data-trend-section="dependency-money"] .section-heading h2 {
  color: #86efac;
}

body.light-theme .trend-section-card[data-trend-section="money-timeline"] .section-heading h2,
body.light-theme .trend-section-card[data-trend-section="project-money"] .section-heading h2,
body.light-theme .trend-section-card[data-trend-section="employee-money"] .section-heading h2,
body.light-theme .trend-section-card[data-trend-section="item-money"] .section-heading h2,
body.light-theme .trend-section-card[data-trend-section="dependency-money"] .section-heading h2 {
  color: #166534;
}
