/* ==========================================================================
   MetroFood OS — Panel-specific styles
   OCR panel, SKU header, vendor grid, vendor spend modal, vendor compare,
   multi-vendor badge, upload zones, processing overlay.
   ========================================================================== */

/* ── OCR PANEL ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--cream);
  position: relative;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--g); background: var(--gll); }
.upload-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-icon { font-size: 40px; margin-bottom: 10px; }
.upload-title { font-size: 15px; font-weight: 600; color: var(--ink2); margin-bottom: 4px; }
.upload-sub { font-size: 12px; color: var(--muted); }

.ocr-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.ocr-preview {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  position: relative;
}
.ocr-preview img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
}
.ocr-results { display: flex; flex-direction: column; gap: 12px; }
.ocr-field {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.ocr-field-label { font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ocr-field-val { font-size: 13px; color: var(--ink); font-weight: 500; }
.ocr-field-val.mono { font-family: 'DM Mono', monospace; }

.line-items-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.line-items-table th { background: #e8f1ea; color: #0f3a20; padding: 9px 10px; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-bottom: 2px solid #1B5E35; }
.line-items-table th span { color: #5a7865 !important; font-weight: 500 !important; font-size: 9px; letter-spacing: .04em; }
.line-items-table td { padding: 8px 10px; border-bottom: 1px solid var(--borderl); vertical-align: middle; }
.line-items-table tr:last-child td { border: none; }
.line-items-table tr:hover td { background: var(--gll); }
.line-items-table tr.li-editable-row:hover td { background: #eaf3ed; box-shadow: inset 3px 0 0 #1B5E35; }
.line-items-table tr.li-editable-row:hover .bold-cell::after { content: " ✏"; opacity: .5; font-size: 11px; }
.line-items-table input { width: 100%; border: 1px solid transparent; background: transparent; font-family: 'Instrument Sans',sans-serif; font-size: 12px; color: var(--ink); padding: 2px 4px; border-radius: 3px; }
.line-items-table input:focus { border-color: var(--g); background: white; outline: none; }

.processing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  z-index: 10;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gl);
  border-top-color: var(--g);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-text { font-size: 13px; font-weight: 600; color: var(--g3); }
.processing-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── SKU PANEL ── */
.sku-header-card {
  background: linear-gradient(135deg, var(--g3) 0%, var(--g2) 100%);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  color: white;
}
.sku-header-icon { font-size: 40px; }
.sku-header-text h2 { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--gold); margin-bottom: 4px; }
.sku-header-text p { font-size: 13px; color: rgba(255,255,255,.6); }
.sku-actions { margin-left: auto; display: flex; gap: 8px; }

/* ── VENDOR PANEL ── */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.vendor-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all .15s;
  position: relative;
  overflow: hidden;
}
.vendor-card:hover { box-shadow: var(--shadow-lg); border-color: var(--g); transform: translateY(-1px); }
.vendor-card-spend-bar {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: var(--g);
}

/* Vendor Spend Modal */
.vspend-hero {
  background: linear-gradient(135deg, var(--g3) 0%, var(--g2) 100%);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  color: white;
  display: flex;
  align-items: center;
  gap: 18px;
}
.vspend-avatar {
  width: 56px; height: 56px;
  background: rgba(201,168,76,.25);
  border: 2px solid var(--gold);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: var(--gold);
  flex-shrink: 0;
}
.vspend-name { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--gold); margin-bottom: 3px; }
.vspend-meta { font-size: 12px; color: rgba(255,255,255,.55); }
.vspend-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.vspend-kpi {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}
.vspend-kpi-label { font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.vspend-kpi-val { font-family: 'DM Mono', monospace; font-size: 20px; font-weight: 500; color: var(--g3); }
.vspend-kpi-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.month-bars { display: flex; align-items: flex-end; gap: 5px; height: 72px; }
.month-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.month-bar { width: 100%; border-radius: 3px 3px 0 0; background: var(--g); min-height: 3px; }
.month-bar:hover { background: var(--gm); }
.month-bar-label { font-size: 8px; color: var(--muted); font-family: 'DM Mono', monospace; }
.month-bar-amt { font-size: 8px; font-family: 'DM Mono', monospace; color: var(--g2); font-weight: 600; }
.vendor-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.vendor-avatar {
  width: 42px; height: 42px;
  background: var(--g);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-family: 'DM Serif Display', serif;
  color: var(--gold);
  flex-shrink: 0;
}
.vendor-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.vendor-cat { font-size: 11px; color: var(--muted); margin-top: 1px; }
.vendor-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.vendor-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--gl);
  color: var(--g2);
}

/* ── VENDOR COMPARE ── */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.compare-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  transition: box-shadow .15s;
  background: white;
}
.compare-card.best-price {
  border-color: var(--g);
  box-shadow: 0 0 0 2px rgba(27,94,53,.12);
}
.compare-card.best-price::before {
  content: '★ Best Price';
  position: absolute;
  top: -1px; right: 12px;
  background: var(--g);
  color: white;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: 0 0 5px 5px;
}
.compare-card.worst-price {
  border-color: rgba(192,57,43,.35);
  background: #fff9f9;
}
.compare-card.worst-price::before {
  content: '▲ Highest Cost';
  position: absolute;
  top: -1px; right: 12px;
  background: var(--red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: 0 0 5px 5px;
}
.compare-vendor-name { font-weight: 700; font-size: 14px; color: var(--ink); margin-bottom: 2px; }
.compare-price { font-family: 'DM Mono', monospace; font-size: 24px; font-weight: 500; color: var(--g3); margin: 8px 0 4px; }
.compare-meta { font-size: 11px; color: var(--muted); line-height: 1.6; }
.compare-savings { font-size: 11px; font-weight: 700; color: var(--red); margin-top: 6px; }
.compare-savings.save { color: var(--g); }
.compare-actions { display: flex; gap: 6px; margin-top: 10px; }
.preferred-star { color: var(--gold); font-size: 14px; margin-left: 4px; }

/* ── MULTI-VENDOR BADGE ── */
.mv-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: var(--bluel);
  color: var(--blue);
  cursor: pointer;
  border: 1px solid rgba(26,111,168,.2);
  white-space: nowrap;
}
.mv-badge:hover { background: #d0e8f7; }
