/* ==========================================================================
   Incoming Beergang Orders Module CSS (No Emojis)
   Cellador Operations Hub
   ========================================================================== */

.hub-view#view-beergang-orders {
  flex: 1;
  height: 100%;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

#beergangOrdersApp {
  width: 100%;
  min-height: 100%;
}

.bg-container {
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 80px 28px;
  box-sizing: border-box;
  color: #f0f0f2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header */
.bg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid #28292e;
  padding-bottom: 18px;
}

.bg-header-left h2 {
  margin: 0 0 6px 0;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bg-header-left p {
  margin: 0;
  font-size: 13.5px;
  color: #94a3b8;
}

.bg-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.bg-btn-primary {
  background: #15803d;
  color: #ffffff;
  border-color: #166534;
  box-shadow: 0 1px 2px rgba(22, 101, 52, 0.2);
}

.bg-btn-primary:hover {
  background: #166534;
}

.bg-btn-secondary {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

.bg-btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.bg-btn-danger {
  background: #ffffff;
  color: #dc2626;
  border-color: #fca5a5;
}

.bg-btn-danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.bg-btn-sm {
  padding: 5px 12px;
  font-size: 12.5px;
  border-radius: 6px;
}

/* Search and Toolbar */
.bg-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 14px;
  flex-wrap: wrap;
}

.bg-search-box {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.bg-search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13.5px;
  box-sizing: border-box;
}

.bg-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

/* Section Layout & Collapsible Logged Section */
.bg-section {
  margin-bottom: 28px;
}

.bg-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.bg-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.bg-processed-toggle-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1c1d22;
  border: 1px solid #28292e;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.bg-processed-toggle-bar:hover {
  background: #23242a;
  border-color: #3b3c44;
}

.bg-chevron {
  transition: transform 0.2s ease;
  color: #94a3b8;
}

.bg-chevron.open {
  transform: rotate(180deg);
}

.bg-empty-notice {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 36px 20px;
  text-align: center;
  color: #64748b;
}

.bg-empty-notice h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.bg-empty-notice p {
  margin: 0;
  font-size: 13px;
}

/* Order Cards */
.bg-orders-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bg-order-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  padding: 22px 24px;
  transition: all 0.2s ease;
}

.bg-order-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  border-color: #cbd5e1;
}

.bg-order-card.has-custom {
  border-left: 5px solid #d97706;
}

.bg-order-card.status-pushed {
  border-left: 5px solid #16a34a;
  background: #fafafa;
}

.bg-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.bg-card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bg-order-number {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.bg-order-meta {
  font-size: 13px;
  color: #64748b;
}

.bg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.bg-badge-ready {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.bg-badge-custom {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.bg-badge-matched {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.bg-badge-omitted {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}

.bg-badge-pushed {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Customer Details Grid */
.bg-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
  background: #f8fafc;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}

.bg-detail-block label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.bg-detail-block div {
  font-size: 13.5px;
  color: #1e293b;
  line-height: 1.4;
}

.bg-detail-block code {
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #0f172a;
}

/* Line Items Table */
.bg-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.bg-items-table th {
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.bg-items-table td {
  padding: 10px 12px;
  font-size: 13.5px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.bg-items-table tr.custom-row {
  background: #fffbeb;
}

.bg-crv-notice {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 3px;
}

.bg-custom-warning-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  background: #fef3c7;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #fde68a;
  font-size: 12px;
  color: #92400e;
}

/* Footer */
.bg-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.bg-total-box {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.bg-total-val {
  font-size: 20px;
  font-weight: 800;
  color: #15803d;
  margin-left: 6px;
}

@keyframes bg-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
