/* Role dashboards — professional workspace panels inside FarmerVisionLayout */

.rd-page {
  min-height: 0;
  background: transparent;
  color: #0f172a;
}

/* Category dashboards using farmer-vision composition */
.rd-body-vision {
  margin-top: 0.25rem;
}

.rd-body-vision > .rd-tabs {
  margin-bottom: 1rem;
}

button.fv-section-link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: var(--fv-primary, #0F6B3C);
  font-size: 13px;
  font-weight: 600;
}

button.fv-section-link:hover {
  text-decoration: underline;
}

.rd-loading,
.rd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  gap: 0.85rem;
  color: #64748b;
  text-align: center;
  padding: 2rem 1rem;
}

.rd-empty p { margin: 0; max-width: 28rem; line-height: 1.45; }

/* Legacy hero kept minimal when still used */
.rd-hero {
  color: #fff;
  background: #0d2235;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.rd-hero.accent-blue { background: #0d2235; }
.rd-hero.accent-amber { background: #0d2235; }
.rd-hero.accent-slate { background: #0d2235; }
.rd-hero-inner {
  max-width: none;
  margin: 0;
  padding: 1.15rem 1.35rem 1.25rem;
}
.rd-eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.72;
}
.rd-hero h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.rd-sub {
  margin: 0.35rem 0 0;
  opacity: 0.78;
  font-size: 0.82rem;
}
.rd-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.rd-body {
  max-width: none;
  margin: 0;
  padding: 1.25rem 1.35rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.fv-page-body .rd-body {
  padding: 0;
}

.rd-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.rd-card h2 {
  margin: 0 0 0.95rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.rd-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.95rem;
}

.rd-card-head h2 { margin: 0; }

.rd-search { max-width: 16rem; }
.rd-muted { color: #64748b; font-size: 0.85rem; margin: 0; line-height: 1.45; }
.rd-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 650;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.rd-mandate {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}
.rd-mandate p { margin: 0.25rem 0 0; color: #475569; font-size: 0.875rem; }

/* Metric strip */
.rd-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .rd-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rd-kpi-grid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .rd-kpi-grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.rd-kpi {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.03);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.rd-kpi:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgb(15 23 42 / 0.06);
}
.rd-kpi-click {
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
}
.rd-kpi.urgent,
.rd-kpi-click.urgent {
  border-color: #fecaca;
  background: #fff7f7;
}
.rd-kpi.urgent strong,
.rd-kpi-click.urgent strong { color: #b91c1c; }
.rd-kpi strong {
  font-size: 1.55rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.1;
}
.rd-kpi span {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

.rd-metric {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.rd-metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rd-metric-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ecfdf5;
  color: #047857;
}
.rd-metric-icon.blue { background: #eff6ff; color: #1d4ed8; }
.rd-metric-icon.amber { background: #fffbeb; color: #b45309; }
.rd-metric-icon.slate { background: #f1f5f9; color: #334155; }
.rd-metric-icon.warn { background: #fef3c7; color: #b45309; }

.rd-stat-grid { display: grid; gap: 1rem; }
.rd-stat-grid.cols-3 { grid-template-columns: 1fr; }
.rd-stat-grid.cols-4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 768px) {
  .rd-stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .rd-stat-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.rd-stat-grid strong { display: block; color: #334155; font-size: 0.875rem; }

.rd-list { list-style: none; margin: 0; padding: 0; }
.rd-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  margin-bottom: 0.45rem;
  font-size: 0.875rem;
  color: #334155;
}
.rd-list li a { color: #0f172a; font-weight: 600; text-decoration: none; }
.rd-list li a:hover { color: #1d4ed8; }
.rd-list .rd-muted { display: block; font-size: 0.75rem; margin-top: 0.15rem; }

/* Segmented tabs */
.rd-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.2rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}
.rd-tab {
  border: 0;
  background: transparent;
  color: #64748b;
  border-radius: 8px;
  padding: 0.5rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.rd-tab:hover { color: #0f172a; background: rgba(255, 255, 255, 0.65); }
.rd-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}

.rd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 8px;
  padding: 0.55rem 1.05rem;
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  background: #f8fafc;
  color: #334155;
  border-color: #e2e8f0;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.rd-btn:hover { background: #f1f5f9; }
.rd-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.rd-btn.accent-blue { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.rd-btn.accent-blue:hover { background: #1e40af; }
.rd-btn.accent-amber { background: #d97706; border-color: #d97706; color: #fff; }
.rd-btn.accent-slate { background: #334155; border-color: #334155; color: #fff; }
.rd-btn.accent-emerald { background: #059669; border-color: #059669; color: #fff; }
.rd-btn.accent-emerald:hover { background: #047857; }
.rd-btn.accent-teal { background: #0f766e; border-color: #0f766e; color: #fff; }
.rd-btn.accent-blue-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.rd-btn.ghost {
  background: transparent;
  border-color: transparent;
  color: #64748b;
}
.rd-btn.ghost:hover { color: #b91c1c; background: #fef2f2; }
.rd-btn.sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; }

.rd-link {
  font-size: 0.8rem;
  font-weight: 650;
  color: #1d4ed8;
  text-decoration: none;
}
.rd-link:hover { text-decoration: underline; }

.rd-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: #e2e8f0;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rd-badge.urgent { background: #fee2e2; color: #b91c1c; }
.rd-badge.ok { background: #d1fae5; color: #047857; }
.rd-badge.warn { background: #fef3c7; color: #b45309; }

.rd-alert {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1.05rem;
  border-radius: 12px;
  border: 1px solid #fde68a;
  background: #fffbeb;
}
.rd-alert-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fef3c7;
  color: #b45309;
  flex-shrink: 0;
}
.rd-alert strong {
  display: block;
  color: #92400e;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.rd-alert ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #a16207;
  font-size: 0.84rem;
}
.rd-alert a { color: #92400e; font-weight: 650; }

.rd-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.rd-toolbar .reg-field { flex: 1 1 10rem; min-width: 8rem; }
.rd-toolbar .reg-field-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
}

.rd-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.rd-chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 900px) {
  .rd-chart-grid { grid-template-columns: 1fr 1fr; }
}

.rd-bar-list { list-style: none; margin: 0; padding: 0; }
.rd-bar-list li { margin-bottom: 0.75rem; }
.rd-bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #334155;
  margin-bottom: 0.25rem;
}
.rd-bar-track {
  height: 0.45rem;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}
.rd-bar-fill {
  height: 100%;
  background: #1d4ed8;
  border-radius: 9999px;
  min-width: 2%;
}
.rd-bar-fill.teal { background: #0d9488; }

.fu-drop {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}
.fu-preview { width: 100%; border-collapse: collapse; font-size: 0.7rem; }
.fu-preview th,
.fu-preview td { padding: 0.35rem 0.5rem; border-bottom: 1px solid #f1f5f9; text-align: left; }
.fu-preview th { background: #f8fafc; color: #64748b; font-weight: 600; }

@media (max-width: 720px) {
  .rd-body { padding: 1rem; }
  .rd-kpi-grid { grid-template-columns: 1fr 1fr; }
  .rd-tabs { width: 100%; }
  .rd-tab { flex: 1 1 auto; text-align: center; }
}
