/* ─────────────────────────────────────────────
   BLACKBRIDGE FREIGHT — Daily Operating Dashboard
   Command center styles
   ───────────────────────────────────────────── */

/* ── Base ── */
body.freight-dashboard { overflow-y: auto; background: #0A0A0A; }

/* ── Top Metrics Bar ── */
.metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.metric-card {
  background: #111111;
  padding: 24px 28px;
  position: relative;
}

.metric-label {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(240,238,230,0.35);
  margin-bottom: 10px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--white);
}
.metric-value.gold {
  background: var(--gold-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.metric-value.green { color: #4ADE80; }
.metric-value.red { color: #F87171; }
.metric-value.muted { color: rgba(240,238,230,0.45); }

.metric-sub {
  font-size: 0.65rem;
  color: rgba(240,238,230,0.3);
  margin-top: 5px;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}

.metric-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 32px;
  margin-top: 10px;
}

.metric-bar-segment {
  flex: 1;
  background: rgba(201,168,76,0.25);
  border-radius: 2px 2px 0 0;
  transition: all 0.3s;
}
.metric-bar-segment:hover { background: rgba(201,168,76,0.45); }

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 5px;
  flex-shrink: 0;
}
.dot-quote_sent      { background: #9CA3AF; }
.dot-quote_accepted  { background: #93C5FD; }
.dot-carrier_matched { background: #C4B5FD; }
.dot-pickup_scheduled{ background: #FCD34D; }
.dot-in_transit      { background: #4ADE80; }
.dot-delivered       { background: #86EFAC; }
.dot-invoice_sent    { background: var(--gold); }
.dot-payment_received{ background: #86EFAC; }

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.status-legend-item {
  display: flex;
  align-items: center;
  font-size: 0.6rem;
  color: rgba(240,238,230,0.35);
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}

/* ── Dashboard Layout ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.dashboard-grid .full-width { grid-column: 1 / -1; }
.dashboard-grid .two-thirds  { grid-column: 1 / 2; }
.dashboard-grid .one-third  { grid-column: 2 / 3; }

.dashboard-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* ── Section Card ── */
.section-card {
  background: #111111;
  border: 1px solid rgba(201,168,76,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.section-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(201,168,76,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-card-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(240,238,230,0.45);
}

.section-card-body { padding: 20px; }

/* ── Pipeline Funnel ── */
.pipeline-funnel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pipeline-stage {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.pipeline-stage-name {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(240,238,230,0.4);
}

.pipeline-stage-bar-wrap {
  height: 22px;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  overflow: hidden;
}

.pipeline-stage-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(201,168,76,0.4), rgba(201,168,76,0.7));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.pipeline-stage-count {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  text-align: right;
  min-width: 24px;
}

/* Carrier pipeline */
.carrier-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.carrier-stat-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.1);
  padding: 16px;
  text-align: center;
  border-radius: 4px;
}

.carrier-stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}

.carrier-stat-value.green { color: #4ADE80; }
.carrier-stat-value.gold { color: var(--gold); }

.carrier-stat-label {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(240,238,230,0.3);
  margin-top: 6px;
}

/* ── Revenue Math ── */
.revenue-math-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.revenue-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.08);
  padding: 16px;
  border-radius: 4px;
}

.revenue-stat-label {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(240,238,230,0.3);
  margin-bottom: 8px;
}

.revenue-stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--white);
}

.revenue-stat-value.gold { color: var(--gold); }
.revenue-stat-value.green { color: #4ADE80; }

.revenue-stat-sub {
  font-size: 0.62rem;
  color: rgba(240,238,230,0.3);
  margin-top: 4px;
}

.target-calc-box {
  background: rgba(201,168,76,0.06);
  border: 1px solid rgba(201,168,76,0.15);
  padding: 20px;
  border-radius: 4px;
  grid-column: 1 / -1;
}

.target-calc-title {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.target-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(201,168,76,0.08);
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: rgba(240,238,230,0.6);
}
.target-calc-row:last-child { border-bottom: none; }
.target-calc-row .calc-key { color: rgba(240,238,230,0.4); }
.target-calc-row .calc-val { color: var(--white); font-weight: 700; }
.target-calc-row .calc-val.gold { color: var(--gold); }
.target-calc-row .calc-val.green { color: #4ADE80; }
.target-calc-row .calc-val.danger { color: #F87171; }
.target-calc-row.highlight { background: rgba(201,168,76,0.06); margin: 0 -20px; padding: 8px 20px; border-radius: 2px; }

.progress-bar-wrap {
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 14px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gold-grad);
  border-radius: 5px;
  transition: width 0.6s ease;
}

/* ── Active Loads Table ── */
.loads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.loads-table th {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(240,238,230,0.3);
  padding: 10px 12px;
  border-bottom: 1px solid rgba(201,168,76,0.1);
  text-align: left;
  white-space: nowrap;
}

.loads-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(240,238,230,0.75);
  vertical-align: middle;
}

.loads-table tr:last-child td { border-bottom: none; }
.loads-table tr:hover td { background: rgba(201,168,76,0.03); }
.loads-table tr.at-risk td { background: rgba(239,68,68,0.04); }

.load-id-tag {
  font-family: var(--font-display);
  font-size: 0.62rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.load-route { line-height: 1.4; }
.load-route .city { color: var(--white); font-weight: 600; }
.load-route .arrow { color: var(--gold); margin: 0 5px; }
.load-route .state { color: rgba(240,238,230,0.35); font-size: 0.78em; }

.load-profit {
  font-family: var(--font-display);
  font-weight: 700;
  text-align: right;
}
.load-profit.positive { color: #4ADE80; }
.load-profit.total { color: var(--white); }

.load-age {
  font-size: 0.72rem;
  color: rgba(240,238,230,0.35);
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(201,168,76,0.08);
}

.filter-pill {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.12);
  color: rgba(240,238,230,0.4);
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 2px;
}
.filter-pill:hover { border-color: var(--gold); color: var(--gold); }
.filter-pill.active { background: rgba(201,168,76,0.12); border-color: var(--gold); color: var(--gold); }

/* ── Leads Table ── */
.leads-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(201,168,76,0.08);
}

.leads-panel { background: #111111; }

.leads-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(201,168,76,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.leads-panel-title {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(240,238,230,0.4);
}

.leads-panel-count {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--gold);
}

.leads-list { max-height: 280px; overflow-y: auto; }

.lead-item {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.lead-item:last-child { border-bottom: none; }

.lead-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--white);
}

.lead-detail {
  font-size: 0.72rem;
  color: rgba(240,238,230,0.35);
  margin-top: 2px;
}

.lead-time {
  font-size: 0.65rem;
  color: rgba(240,238,230,0.25);
  font-family: var(--font-display);
  white-space: nowrap;
}

.lead-badge {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
}
.lead-badge.quote { background: rgba(96,165,250,0.15); color: #93C5FD; }
.lead-badge.pending { background: rgba(251,191,36,0.15); color: #FCD34D; }
.lead-badge.shipper { background: rgba(167,139,250,0.15); color: #C4B5FD; }
.lead-badge.carrier { background: rgba(74,222,128,0.1); color: #4ADE80; }

/* ── Outreach Activity ── */
.outreach-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(201,168,76,0.08);
  margin-bottom: 16px;
}

.outreach-stat {
  background: #111111;
  padding: 16px;
  text-align: center;
}

.outreach-stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--white);
}

.outreach-stat-value.green { color: #4ADE80; }
.outreach-stat-value.gold { color: var(--gold); }

.outreach-stat-label {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(240,238,230,0.3);
  margin-top: 5px;
}

.channel-row {
  display: grid;
  grid-template-columns: 80px 1fr 60px 60px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.75rem;
}
.channel-row:last-child { border-bottom: none; }

.channel-name {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(240,238,230,0.45);
}

.channel-bar-wrap {
  height: 18px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.channel-bar {
  height: 100%;
  background: rgba(201,168,76,0.5);
  border-radius: 2px;
}

.channel-stat {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--white);
  text-align: right;
}
.channel-stat.replies { color: #4ADE80; }

/* ── Upcoming Actions ── */
.action-list { display: flex; flex-direction: column; gap: 0; }

.action-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}
.action-item:last-child { border-bottom: none; }

.action-icon {
  width: 28px;
  height: 28px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.action-icon.urgent { background: rgba(239,68,68,0.15); color: #F87171; }
.action-icon.warning { background: rgba(251,191,36,0.15); color: #FCD34D; }
.action-icon.ready { background: rgba(74,222,128,0.1); color: #4ADE80; }
.action-icon.neutral { background: rgba(255,255,255,0.05); color: rgba(240,238,230,0.35); }

.action-body {}

.action-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--white);
}

.action-meta {
  font-size: 0.7rem;
  color: rgba(240,238,230,0.35);
  margin-top: 2px;
}

.action-time {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: right;
  white-space: nowrap;
}
.action-time.urgent { color: #F87171; }
.action-time.warning { color: #FCD34D; }
.action-time.muted { color: rgba(240,238,230,0.3); }

/* ── Weekly Charts ── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-card { background: #111111; border: 1px solid rgba(201,168,76,0.08); border-radius: 4px; overflow: hidden; }
.chart-header { padding: 12px 16px; border-bottom: 1px solid rgba(201,168,76,0.08); }
.chart-title { font-family: var(--font-display); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(240,238,230,0.4); }
.chart-body { padding: 16px; }

.bar-chart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.bar-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: rgba(240,238,230,0.3);
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}

.bar-chart-wrap {
  flex: 1;
  height: 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.bar-fill.revenue { background: linear-gradient(90deg, rgba(201,168,76,0.5), rgba(201,168,76,0.8)); }
.bar-fill.profit { background: linear-gradient(90deg, rgba(74,222,128,0.4), rgba(74,222,128,0.7)); }
.bar-fill.loads { background: linear-gradient(90deg, rgba(96,165,250,0.4), rgba(96,165,250,0.7)); }
.bar-fill.leads { background: linear-gradient(90deg, rgba(167,139,250,0.4), rgba(167,139,250,0.7)); }

.bar-value {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--white);
  width: 60px;
  flex-shrink: 0;
}
.bar-value.green { color: #4ADE80; }

.empty-chart {
  text-align: center;
  padding: 32px;
  color: rgba(240,238,230,0.2);
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Header Nav ── */
.dashboard-nav {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  background: #0A0A0A;
  border-bottom: 1px solid rgba(201,168,76,0.08);
  overflow-x: auto;
}

.nav-tab {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 18px;
  color: rgba(240,238,230,0.35);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.nav-tab:hover { color: rgba(240,238,230,0.6); }
.nav-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Dashboard Sections (show/hide) ── */
.dash-section { display: none; }
.dash-section.active { display: block; }

/* ── Loading state ── */
.skeleton {
  background: linear-gradient(90deg, #111 25%, #1a1a1a 50%, #111 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 3px;
  height: 16px;
  width: 100%;
  margin: 4px 0;
}

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

/* ── Responsive ── */
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .two-thirds,
  .dashboard-grid .one-third { grid-column: 1; }
  .metrics-bar { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .revenue-math-grid { grid-template-columns: 1fr; }
  .carrier-pipeline-grid { grid-template-columns: repeat(2, 1fr); }
  .leads-grid { grid-template-columns: 1fr; }
  .outreach-stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .metrics-bar { grid-template-columns: 1fr; }
  .loads-table { font-size: 0.72rem; }
  .loads-table th, .loads-table td { padding: 8px 6px; }
}