/* ==========================================================================
   Wholesale Offers - Buyer Portal Dashboard Stylesheet
   Theme: Modern Industrial Clean, Obsidian Slate, Dynamic Scarlet Red
   ========================================================================== */

:root {
  --bg-darkest: #080c14;
  --bg-main: #0b1120;
  --bg-surface: #111827;
  --bg-surface-elevated: #1e293b;
  --bg-card: rgba(17, 24, 39, 0.9);

  --brand-red: #ef4444;
  --brand-red-light: #f87171;
  --brand-crimson: #e11d48;

  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-cyan: #06b6d4;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
}

.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.dashboard-sidebar {
  width: 280px;
  background: var(--bg-darkest);
  border-right: 1px solid var(--border-subtle);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.sidebar-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.4));
}

.sidebar-brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  display: block;
}

.sidebar-brand-sub {
  font-size: 0.7rem;
  color: var(--brand-red-light);
  font-weight: 600;
  display: block;
}

.buyer-profile-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  background: var(--brand-red);
  color: #fff;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-info strong {
  display: block;
  font-size: 0.9rem;
}

.profile-info small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge-tier {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: 0.15s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-link.active {
  background: var(--brand-red);
  color: #fff;
}

.nav-pill {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

/* Main Content */
.dashboard-main {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
}

.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 20px;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  width: 420px;
  color: var(--text-muted);
}

.topbar-search-input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.weekly-cart-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.85rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--brand-red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--brand-red);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.kpi-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.kpi-value {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.text-green { color: var(--accent-emerald); }
.text-amber { color: var(--accent-amber); }
.text-cyan { color: var(--accent-cyan); }
.text-red { color: var(--brand-red-light); }

/* Tabs */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

.tab-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.tab-header-row h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
}

/* Feed Cards */
.deal-feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
}

.feed-lot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feed-lot-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.lot-location {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lot-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 8px 0 16px 0;
}

.lot-specs-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.8rem;
}

.lot-specs-bar small {
  display: block;
  color: var(--text-muted);
}

.strike {
  text-decoration: line-through;
  color: var(--text-muted);
}

.feed-action-row {
  display: flex;
  gap: 10px;
}

.btn-vote-down, .btn-vote-up {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-vote-down:hover { background: rgba(239, 68, 68, 0.2); }
.btn-vote-up:hover { background: rgba(16, 185, 129, 0.2); }

/* Cart Table */
.cart-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 28px;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 28px;
}

.cart-table th {
  text-align: left;
  padding: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}

.cart-table td {
  padding: 16px 12px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--brand-red-light);
  cursor: pointer;
  font-size: 0.85rem;
}

.cart-summary-box {
  max-width: 440px;
  margin-left: auto;
  background: rgba(0, 0, 0, 0.35);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.summary-line.grand-total {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 20px;
}

/* RFQ & Shipment Cards */
.rfq-card, .shipment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.rfq-card-header, .shipment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.badge-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
  text-transform: uppercase;
}
.badge-tag.brand-red { background: rgba(239, 68, 68, 0.2); color: var(--brand-red-light); }
.badge-tag.category { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }
.badge-tag.green { background: rgba(16, 185, 129, 0.2); color: #34d399; }

.btn-brand-primary {
  background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-crimson) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 18px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-medium);
  color: #fff;
  padding: 8px 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-full-width { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
