/* hub-keg-tracker.css - Salable Keg Tracker & Warehouse Bay Map Styling */

#view-keg-tracker {
  height: 100%;
  overflow-y: auto !important;
  overflow-x: hidden;
  display: none;
  background: #f8fafc;
}

#view-keg-tracker.active {
  display: block !important;
}

.keg-app-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  max-width: 1700px;
  margin: 0 auto;
  min-height: min-content;
  padding-bottom: 80px;
}

/* Header & Controls */
.keg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: #ffffff;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.keg-header-left h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.keg-header-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

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

/* KPI Summary Bar */
.keg-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.keg-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.keg-kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.keg-kpi-val {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.keg-kpi-val span {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  margin-left: 4px;
}

.keg-kpi-card.kpi-bbl {
  border-left: 4px solid #b38b47;
}

.keg-kpi-card.kpi-20l {
  border-left: 4px solid #0284c7;
}

.keg-kpi-card.kpi-30l {
  border-left: 4px solid #8b5cf6;
}

.keg-kpi-card.kpi-half {
  border-left: 4px solid #10b981;
}

/* View Switcher / Tabs */
.keg-view-toggle-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.keg-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
}

.keg-tab-btn {
  padding: 7px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.keg-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.keg-tab-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #475569;
}

.keg-tab-btn.active .keg-tab-badge {
  background: #0f172a;
  color: #ffffff;
}

.keg-search-wrap {
  position: relative;
  min-width: 260px;
}

.keg-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  font-size: 12.5px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s;
}

.keg-search-input:focus {
  border-color: #b38b47;
  box-shadow: 0 0 0 2px rgba(179, 139, 71, 0.15);
}

.keg-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

/* Warehouse Bay Grid */
.keg-bays-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.keg-bay-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.keg-bay-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}

.keg-bay-header {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.keg-bay-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.keg-bay-name {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
}

.keg-bay-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #475569;
}

.keg-bay-count {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #0284c7;
  border: 1px solid #e2e8f0;
}

.keg-bay-list {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 120px;
  max-height: 480px;
  overflow-y: auto;
}

.keg-bay-empty {
  text-align: center;
  padding: 30px 10px;
  color: #94a3b8;
  font-size: 12px;
  font-style: italic;
}

.keg-subgroup-header {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 6px 6px 2px 6px;
  border-bottom: 1px dashed #e2e8f0;
  margin-top: 6px;
}

.keg-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.12s ease;
}

.keg-item-row:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.keg-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.keg-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keg-item-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Format Pills & Batch Pills */
.keg-size-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.keg-size-pill.size-20l {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.keg-size-pill.size-30l {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.keg-size-pill.size-half {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.keg-batch-pill {
  font-size: 10px;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.keg-tier-pill {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.keg-tier-pill.tier-top {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.keg-tier-pill.tier-bottom {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.keg-tier-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}

.keg-tier-header {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  margin-bottom: 2px;
}

.keg-tier-header.tier-top {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.keg-tier-header.tier-bottom {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.keg-tier-count {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.keg-subgroup-pill {
  font-size: 10px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.keg-bay-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.keg-bay-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.keg-bay-card:hover .keg-bay-actions {
  opacity: 1;
}

.keg-bay-action-btn {
  background: transparent;
  border: none;
  color: #64748b;
  padding: 3px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.keg-bay-action-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.keg-bay-action-btn.btn-delete-bay:hover {
  background: #fee2e2;
  color: #dc2626;
}

.keg-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.keg-stepper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
}

.keg-step-btn {
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: background 0.1s;
}

.keg-step-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.keg-step-val {
  min-width: 22px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.keg-row-action-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.1s, background 0.1s;
}

.keg-row-action-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.keg-row-action-btn.btn-delete:hover {
  color: #dc2626;
  background: #fee2e2;
}

.keg-bay-footer {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
}

.keg-btn-quick-add {
  background: transparent;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  justify-content: center;
  transition: all 0.12s ease;
}

.keg-btn-quick-add:hover {
  border-color: #0284c7;
  color: #0284c7;
  background: #f0f9ff;
}

/* Master Rollup Table View */
.keg-rollup-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.keg-rollup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.keg-rollup-table th {
  background: #f8fafc;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 12px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.keg-rollup-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.keg-rollup-table tr.rollup-parent-row:hover td {
  background: #f8fafc;
}

.keg-rollup-table tr.rollup-batch-row td {
  background: #fafafa;
  padding: 8px 16px 8px 36px;
  font-size: 12px;
  color: #475569;
  border-bottom: 1px dashed #e2e8f0;
}

.keg-loc-pill {
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  padding: 2px 7px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  display: inline-block;
  margin-right: 4px;
  margin-bottom: 2px;
}

/* Autocomplete Dropdown in Modals */
.keg-autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: 2px;
}

.keg-autocomplete-item {
  padding: 8px 12px;
  font-size: 13px;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
}

.keg-autocomplete-item:hover {
  background: #f0f9ff;
  color: #0284c7;
}

/* Sold Out / Zero Count Review Alert Button */
.keg-btn-soldout-alert {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.keg-btn-soldout-alert:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

/* Sync Preview Modal Table */
.keg-sync-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.keg-sync-stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}

.keg-sync-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.keg-sync-stat-val {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 2px;
}

.keg-zeroed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

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

.keg-zeroed-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.keg-zero-badge {
  font-size: 10px;
  font-weight: 700;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 1px 6px;
  border-radius: 4px;
}
