/* ============================================
   AgroLink Africa — Farmer Dashboard Styles
   ============================================ */

/* --- Welcome Banner --- */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-900) 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  margin-bottom: var(--sp-8);
  position: relative;
  overflow: hidden;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -60%;
  left: 10%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
}

.welcome-banner h2 {
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--sp-2);
  position: relative;
  z-index: 1;
}

.welcome-banner p {
  font-size: var(--text-base);
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

/* --- Stats Grid --- */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-6);
  margin-bottom: var(--sp-8);
}

/* --- Stat Card Changes (alias) --- */
.stat-card__change {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--sp-1);
}

.stat-card__change svg {
  width: 14px;
  height: 14px;
}

.stat-card__change--up {
  color: var(--success);
}

.stat-card__change--down {
  color: var(--error);
}

/* --- Dashboard Card --- */
.dash-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  margin-bottom: var(--sp-6);
}

.dash-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border-light);
}

.dash-card__header h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
}

.dash-card__link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.dash-card__link:hover {
  color: var(--primary-800);
}

.dash-card__body {
  padding: var(--sp-5) var(--sp-6);
}

/* --- Dashboard Table --- */
.dash-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-sec);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.dash-table td {
  padding: var(--sp-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text);
}

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

.dash-table tr:hover td {
  background: var(--bg);
}

.dash-table__action {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.dash-table__action:hover {
  color: var(--primary-800);
}

/* --- Profile Card --- */
.profile-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  margin-bottom: var(--sp-6);
}

.profile-card__ring {
  flex-shrink: 0;
}

.profile-card__details {
  flex: 1;
}

.profile-card__details h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--sp-2);
  color: var(--text);
}

.profile-card__details p {
  font-size: var(--text-sm);
  color: var(--text-sec);
  margin-bottom: var(--sp-4);
}

.profile-card__checklist {
  list-style: none;
}

.profile-card__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  padding: var(--sp-1) 0;
  color: var(--text-sec);
}

.profile-card__item--done {
  color: var(--success);
}

.profile-card__item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.profile-card__circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: inline-block;
}

/* --- Dashboard Grid Layout --- */
.dash-grid {
  display: grid;
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.dash-grid--3 {
  grid-template-columns: 2fr 1fr;
}

.dash-grid__main {
  min-width: 0;
}

.dash-grid__side {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

/* --- Inquiry List --- */
.inquiry-list {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.inquiry-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
  cursor: pointer;
}

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

.inquiry-item--unread {
  background: var(--primary-50);
  margin: 0 calc(-1 * var(--sp-6));
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--radius-md);
}

.inquiry-item__avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--info-bg);
  color: var(--info);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.inquiry-item__info {
  flex: 1;
  min-width: 0;
}

.inquiry-item__info h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inquiry-item__info p {
  font-size: var(--text-xs);
  color: var(--text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.inquiry-item__meta {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-1);
}

.inquiry-item__time {
  font-size: var(--text-xs);
  color: var(--text-light);
}

.inquiry-item__dot {
  width: 8px;
  height: 8px;
  background: var(--primary-500);
  border-radius: 50%;
}

/* --- Trust Score Panel --- */
.trust-panel {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: var(--sp-6);
}

.trust-panel__circle {
  display: flex;
  justify-content: center;
  margin-bottom: var(--sp-6);
}

.trust-panel__factors {
  list-style: none;
}

.trust-factor {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border-light);
}

.trust-factor:last-child {
  border-bottom: none;
}

.trust-factor__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--text);
}

.trust-factor__weight {
  font-size: var(--text-xs);
  color: var(--text-sec);
  font-weight: 500;
}

.trust-factor__bar {
  width: 100%;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.trust-factor__fill {
  height: 100%;
  background: var(--primary-500);
  border-radius: 3px;
  transition: width 1s ease;
}

/* --- Price Alerts --- */
.price-alerts {
  list-style: none;
}

.price-alerts__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border-light);
}

.price-alerts__item:last-child {
  border-bottom: none;
}

.price-alerts__crop {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  min-width: 100px;
}

.price-alerts__rule {
  font-size: var(--text-xs);
  color: var(--text-sec);
}

/* --- Quick Actions --- */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

.quick-actions__btn {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.quick-actions__btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-200);
  color: var(--primary-700);
}

.quick-actions__btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--primary-600);
}

/* --- Export Readiness --- */
.export-readiness__list {
  list-style: none;
}

.export-readiness__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-light);
}

.export-readiness__item:last-child {
  border-bottom: none;
}

.export-readiness__item--done {
  color: var(--success);
}

.export-readiness__item--pending {
  color: var(--text-sec);
}

.export-readiness__item svg {
  flex-shrink: 0;
}

.export-readiness__circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: inline-block;
}

/* --- Notification Bell --- */
.notification-bell {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-alt);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.notification-bell:hover {
  background: var(--border-light);
}

.notification-bell svg {
  width: 20px;
  height: 20px;
  color: var(--text-sec);
}

.notification-bell__count {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--error);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* --- User Menu --- */
.user-menu {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

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

.user-menu__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.user-menu__role {
  font-size: var(--text-xs);
  color: var(--text-sec);
}

/* --- Sidebar Overlay (mobile) --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: calc(var(--z-sticky) - 1);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar.active ~ .sidebar-overlay,
.sidebar-overlay--active {
  display: block;
  opacity: 1;
}

/* --- Badge Yellow Alias --- */
.badge--yellow {
  background: #FFFDE7;
  color: var(--accent-600);
}

/* --- Responsive --- */
@media (max-width: 1200px) {
  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-grid--3 {
    grid-template-columns: 1fr;
  }
}

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

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

  .profile-card__item {
    justify-content: center;
  }

  .dashboard__content {
    padding: var(--sp-4);
  }

  .dash-card__body {
    padding: var(--sp-4);
    overflow-x: auto;
  }
}
