/* hub-beergang-reconciliation.css — Beergang Wholesale Reconciliation & Stock Sync */

#view-beergang-reconciliation {
  overflow: hidden !important;
  height: 100% !important;
}

.bgr-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 1.25rem 1.75rem 0.75rem 1.75rem;
  background-color: var(--hub-bg, #0d0f12);
  color: var(--hub-text, #f0f2f5);
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

/* Header & Controls */
.bgr-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bgr-title-group h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.bgr-title-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(212, 160, 23, 0.15);
  color: #d4a017;
  border: 1px solid rgba(212, 160, 23, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bgr-subtitle {
  font-size: 0.85rem;
  color: #8b949e;
  margin: 0;
}

.bgr-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Metric Cards */
.bgr-metrics-grid {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.bgr-metric-card {
  background: rgba(22, 27, 34, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.bgr-metric-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.bgr-metric-card.warning {
  border-left: 4px solid #d29922;
}

.bgr-metric-card.danger {
  border-left: 4px solid #f85149;
}

.bgr-metric-card.success {
  border-left: 4px solid #3fb950;
}

.bgr-metric-card.info {
  border-left: 4px solid #58a6ff;
}

.bgr-metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b949e;
  margin-bottom: 0.35rem;
}

.bgr-metric-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #f0f6fc;
}

/* Filter Bar */
.bgr-filter-bar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.bgr-tab-buttons {
  display: flex;
  background: rgba(22, 27, 34, 0.9);
  padding: 0.25rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 0.25rem;
}

.bgr-tab-btn {
  background: transparent;
  border: none;
  color: #8b949e;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bgr-tab-btn:hover {
  color: #f0f6fc;
  background: rgba(255, 255, 255, 0.04);
}

.bgr-tab-btn.active {
  background: #238636;
  color: #fff;
}

.bgr-tab-count {
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
}

.bgr-search-box {
  position: relative;
  min-width: 260px;
}

.bgr-search-input {
  width: 100%;
  background: #161b22;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  color: #f0f6fc;
  font-size: 0.82rem;
  box-sizing: border-box;
}

.bgr-search-input:focus {
  outline: none;
  border-color: #58a6ff;
}

.bgr-search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8b949e;
  pointer-events: none;
}

/* Tables */
.bgr-table-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  background: rgba(22, 27, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
}

.bgr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.bgr-table th {
  background: #0d1117;
  color: #8b949e;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 5;
}

.bgr-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.bgr-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.bgr-table tr.row-excluded td {
  opacity: 0.45;
  background: rgba(0, 0, 0, 0.2);
}

/* Table Elements */
.bgr-sku-pill {
  font-family: monospace;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #c9d1d9;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bgr-product-name {
  font-weight: 600;
  color: #f0f6fc;
}

.bgr-format-badge {
  font-size: 0.72rem;
  color: #8b949e;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.bgr-num {
  font-family: monospace;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Editable Target Quantity Input */
.bgr-target-input {
  width: 68px;
  background: #0d1117;
  border: 1px solid #30363d;
  color: #f0f6fc;
  font-family: monospace;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  text-align: center;
  transition: all 0.15s ease;
}

.bgr-target-input:focus {
  outline: none;
  border-color: #d4a017;
  box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.25);
  background: #161b22;
}

.bgr-target-input.modified {
  border-color: #d4a017;
  color: #d4a017;
  background: rgba(212, 160, 23, 0.06);
}

/* Delta Indicators */
.bgr-delta {
  font-family: monospace;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.bgr-delta.zero {
  color: #8b949e;
  background: rgba(255, 255, 255, 0.04);
}

.bgr-delta.positive {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.25);
}

.bgr-delta.negative {
  color: #f85149;
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.25);
}

/* Status Badges */
.bgr-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
}

.bgr-status-badge.needs-adj {
  background: rgba(210, 153, 34, 0.15);
  color: #d29922;
  border: 1px solid rgba(210, 153, 34, 0.35);
}

.bgr-status-badge.in-sync {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.35);
}

.bgr-status-badge.discontinue {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.35);
}

/* Floating Action Footer */
.bgr-floating-footer {
  flex-shrink: 0;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  z-index: 10;
  margin-top: 0;
}

.bgr-footer-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.bgr-footer-summary {
  font-size: 0.88rem;
  color: #f0f6fc;
}

.bgr-footer-summary strong {
  color: #d4a017;
}

.bgr-footer-btn-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.bgr-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.bgr-btn-secondary {
  background: #21262d;
  color: #c9d1d9;
  border-color: rgba(255, 255, 255, 0.1);
}

.bgr-btn-secondary:hover {
  background: #30363d;
  color: #fff;
}

.bgr-btn-primary {
  background: #238636;
  color: #fff;
}

.bgr-btn-primary:hover {
  background: #2ea043;
}

.bgr-btn-commit {
  background: #d4a017;
  color: #000;
  font-weight: 700;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
}

.bgr-btn-commit:hover {
  background: #e5b32e;
  transform: translateY(-1px);
}

.bgr-btn-commit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Modal */
.bgr-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1.5rem;
}

.bgr-modal {
  background: #161b22;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: bgrModalFadeIn 0.15s ease-out;
}

@keyframes bgrModalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.bgr-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bgr-modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.bgr-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.85rem;
  color: #c9d1d9;
}

.bgr-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(13, 17, 23, 0.5);
}

.bgr-diff-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.bgr-diff-title {
  font-weight: 600;
  color: #f0f6fc;
}

.bgr-diff-meta {
  font-size: 0.75rem;
  color: #8b949e;
}
