/* Private carbon buyer dashboard — loaded after site-polish.css.
   Uses the same FarmWallet brand tokens as the public site. */
/* The public stylesheet does not set border-box globally, so an element with
   width:100% plus padding overflows its column. Scope the fix to these pages. */
.fw-dash *, .fw-dash *::before, .fw-dash *::after,
.fw-auth-wrap *, .fw-auth-wrap *::before, .fw-auth-wrap *::after {
  box-sizing: border-box;
}
.fw-dash { min-height: 100vh; background: var(--fw-bg); color: var(--fw-ink); }
.fw-dash-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }

.fw-dash-side {
  background: var(--fw-green-dark); color: #d1fae5; padding: 24px 16px;
  display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.fw-dash-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.fw-dash-brand img { width: 36px; height: 36px; object-fit: contain; }
.fw-dash-brand b { color: #fff; font-size: 17px; letter-spacing: -.01em; }
.fw-dash-brand span { display: block; color: var(--fw-gold); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.fw-dash-nav-label { color: #6ee7b7; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 0 10px; margin-bottom: 6px; }
.fw-dash-nav { display: flex; flex-direction: column; gap: 3px; }
.fw-dash-nav a {
  color: #d1fae5; text-decoration: none; padding: 10px 12px; border-radius: 9px;
  font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: center;
}
.fw-dash-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.fw-dash-nav a.is-active { background: var(--fw-gold); color: #3f3000; font-weight: 800; }
.fw-dash-nav a .fw-dash-count { background: rgba(255,255,255,.14); border-radius: 999px; padding: 1px 7px; font-size: 10px; }
.fw-dash-nav a.is-active .fw-dash-count { background: rgba(63,48,0,.16); }
.fw-dash-side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.14); font-size: 11px; color: #a7f3d0; line-height: 1.6; }
.fw-dash-side-foot a { color: #fff; text-decoration: underline; }

.fw-dash-main { min-width: 0; display: flex; flex-direction: column; }
.fw-dash-top {
  background: #fff; border-bottom: 1px solid #e2e8f0; padding: 16px 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; min-width: 0;
}
.fw-dash-top h1 { font-size: 19px; margin: 0; letter-spacing: -.02em; }
.fw-dash-top p { margin: 3px 0 0; font-size: 12px; color: var(--fw-muted); }
.fw-dash-who { display: flex; align-items: center; gap: 12px; }
.fw-dash-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--fw-green-soft);
  color: var(--fw-green-deep); display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.fw-dash-who b { display: block; font-size: 13px; }
.fw-dash-who small { display: block; color: var(--fw-muted); font-size: 11px; }
.fw-dash-content { padding: 26px 30px 60px; max-width: 1240px; width: 100%; }

.fw-dash-banner {
  background: #fffbeb; border: 1px solid #fde68a; border-left: 4px solid var(--fw-gold);
  border-radius: 10px; padding: 14px 18px; margin-bottom: 22px; font-size: 13px; color: #713f12;
  display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.fw-dash-banner strong { color: #78350f; }
.fw-dash-banner button, .fw-dash-banner a {
  border: 0; background: var(--fw-green-deep); color: #fff; border-radius: 999px;
  padding: 8px 14px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none;
}

.fw-dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.fw-dash-kpi { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 20px; box-shadow: var(--fw-shadow-sm); }
.fw-dash-kpi span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--fw-muted); font-weight: 700; }
.fw-dash-kpi b { display: block; font-size: 27px; color: var(--fw-green-deep); margin-top: 9px; letter-spacing: -.03em; }
.fw-dash-kpi small { display: block; color: var(--fw-muted); font-size: 11px; margin-top: 4px; }

.fw-dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.fw-dash-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 22px; box-shadow: var(--fw-shadow-sm); min-width: 0; }
.fw-dash-card > h2, .fw-dash-card > h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.01em; }
.fw-dash-card > p.fw-dash-sub { margin: 0 0 18px; color: var(--fw-muted); font-size: 12px; }
.fw-dash-card.wide { grid-column: 1 / -1; }

.fw-dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fw-dash-table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--fw-muted); padding: 9px 10px; border-bottom: 1px solid #e2e8f0; white-space: nowrap;
}
.fw-dash-table td { padding: 11px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.fw-dash-table tr:last-child td { border-bottom: 0; }
.fw-dash-table a { color: var(--fw-green-deep); font-weight: 700; text-decoration: none; }
.fw-dash-table a:hover { text-decoration: underline; }
.fw-dash-scroll { overflow-x: auto; }

.fw-dash-pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: #f1f5f9; color: #475569; }
.fw-dash-pill.ok { background: #dcfce7; color: #166534; }
.fw-dash-pill.warn { background: #fef3c7; color: #92400e; }
.fw-dash-pill.bad { background: #fee2e2; color: #991b1b; }
.fw-dash-pill.info { background: #dbeafe; color: #1e40af; }

.fw-dash-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.fw-dash-btn {
  border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer;
  background: var(--fw-green-deep); color: #fff; font: inherit; font-size: 12px; font-weight: 800; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.fw-dash-btn:hover { background: var(--fw-green-dark); }
.fw-dash-btn.ghost { background: #fff; color: var(--fw-green-deep); border: 1px solid var(--fw-green-deep); }
.fw-dash-btn.danger { background: #b91c1c; }
.fw-dash-btn[disabled] { opacity: .5; cursor: not-allowed; }

.fw-dash-form { display: grid; gap: 14px; }
.fw-dash-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--fw-ink); }
.fw-dash-form input, .fw-dash-form select, .fw-dash-form textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd5e1;
  border-radius: 9px; font: inherit; font-size: 14px; color: var(--fw-ink); background: #fff;
}
.fw-dash-form input:focus, .fw-dash-form select:focus {
  outline: 3px solid var(--fw-ring); border-color: var(--fw-green);
}
.fw-dash-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fw-dash-msg { font-size: 12px; min-height: 16px; margin: 0; color: var(--fw-muted); }
.fw-dash-msg.is-error { color: #b91c1c; font-weight: 600; }
.fw-dash-msg.is-ok { color: #15803d; font-weight: 600; }

.fw-dash-switch { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.fw-dash-switch:last-child { border-bottom: 0; }
.fw-dash-switch div b { display: block; font-size: 13px; }
.fw-dash-switch div small { display: block; font-size: 11px; color: var(--fw-muted); margin-top: 3px; line-height: 1.5; }
.fw-dash-switch input { width: 42px; height: 24px; accent-color: var(--fw-green-deep); }

.fw-dash-notif { padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.fw-dash-notif:last-child { border-bottom: 0; }
.fw-dash-notif.unread { border-left: 3px solid var(--fw-gold); padding-left: 12px; }
.fw-dash-notif b { font-size: 13px; }
.fw-dash-notif p { margin: 4px 0; font-size: 12px; color: #475569; line-height: 1.55; }
.fw-dash-notif time { font-size: 10px; color: var(--fw-muted); }
.fw-dash-notif button { border: 0; background: none; color: var(--fw-green-deep); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; text-decoration: underline; }

.fw-dash-empty { text-align: center; padding: 36px 20px; color: var(--fw-muted); font-size: 13px; }
.fw-dash-note { background: var(--fw-green-soft); border-radius: 10px; padding: 14px 16px; font-size: 12px; color: #14532d; line-height: 1.6; }
.fw-dash-note a { color: #14532d; font-weight: 700; }
.fw-dash-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 18px 0; }
.fw-dash-detail div { background: var(--fw-bg); border-radius: 10px; padding: 12px 14px; }
.fw-dash-detail dt { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--fw-muted); font-weight: 700; }
.fw-dash-detail dd { margin: 5px 0 0; font-size: 14px; font-weight: 700; }

.fw-dash-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.fw-dash-filters input, .fw-dash-filters select {
  min-height: 38px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px;
  font: inherit; font-size: 12px; background: #fff;
}
.fw-dash-mobile-btn {
  display: none; border: 0; background: var(--fw-green-dark); color: #fff; border-radius: 8px;
  padding: 8px 12px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}

/* Auth pages */
.fw-auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.fw-auth-art {
  background: linear-gradient(160deg, rgba(6,78,59,.94), rgba(11,128,67,.78)), url('/field/home-hero.jpg') center/cover;
  color: #fff; padding: 46px; display: flex; flex-direction: column; justify-content: space-between;
}
.fw-auth-art img { width: 46px; height: 46px; object-fit: contain; }
.fw-auth-art h2 { font-size: 34px; line-height: 1.2; max-width: 480px; margin: 0 0 14px; letter-spacing: -.03em; }
.fw-auth-art p { max-width: 470px; color: #d1fae5; line-height: 1.7; font-size: 14px; }
.fw-auth-art small { color: #a7f3d0; font-size: 11px; }
.fw-auth-panel { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.fw-auth-card { width: 100%; max-width: 420px; }
.fw-auth-card h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.02em; }
.fw-auth-card > p { color: var(--fw-muted); font-size: 13px; margin: 0 0 26px; line-height: 1.6; }
.fw-auth-card .fw-dash-form { gap: 16px; }
.fw-auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: 12px; }
.fw-auth-links a { color: var(--fw-green-deep); font-weight: 700; text-decoration: none; }
.fw-auth-links a:hover { text-decoration: underline; }
.fw-auth-back { display: inline-block; margin-top: 26px; font-size: 12px; color: var(--fw-green-deep); font-weight: 700; text-decoration: none; }

@media (max-width: 900px) {
  .fw-dash-layout { grid-template-columns: 1fr; }
  .fw-dash-side { position: relative; height: auto; display: none; }
  .fw-dash-side.is-open { display: flex; }
  .fw-dash-mobile-btn { display: inline-block; }
  .fw-dash-content { padding: 20px 16px 50px; }
  .fw-dash-top { padding: 14px 16px; }
  .fw-auth-wrap { grid-template-columns: 1fr; }
  .fw-auth-art { display: none; }
  .fw-dash-form .two { grid-template-columns: 1fr; }
}
