/* BOM Builder Module Styles - GrabRaw Design System */
.bom-builder-wrapper {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1a1a1a;
  line-height: 1.5;
  width: 100%;
}

/* Tabs Header */
.worktable-tabs-nav {
  display: inline-flex;
  background: #f1f3f4;
  border-radius: 100px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.worktable-tab-btn {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.worktable-tab-btn:hover {
  color: #1a1a1a;
}

.worktable-tab-btn.active {
  background: #ffffff;
  color: #4285F4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.worktable-tab-content {
  display: none;
}

.worktable-tab-content.active {
  display: block;
}

/* Layout Cards */
.bom-card {
  background: #ffffff;
  border: 1px solid #e1e3e5;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.bom-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.bom-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.bom-card-subtitle {
  font-size: 13px;
  color: #5f6368;
  margin-top: 4px;
}

/* Form Fields Grid */
.bom-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.bom-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bom-form-group.span-full {
  grid-column: 1 / -1;
}

.bom-label {
  font-size: 12px;
  font-weight: 600;
  color: #3c4043;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.bom-input, .bom-select, .bom-textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: #1a1a1a;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.bom-input:focus, .bom-select:focus, .bom-textarea:focus {
  border-color: #4285F4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.12);
}

.bom-textarea {
  resize: vertical;
  min-height: 60px;
}

/* Search Autocomplete */
.bom-search-container {
  position: relative;
  width: 100%;
}

.bom-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.bom-search-icon {
  position: absolute;
  left: 14px;
  color: #9aa0a6;
  pointer-events: none;
}

.bom-search-input {
  padding-left: 42px !important;
}

.bom-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.bom-search-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.15s;
}

.bom-search-item:last-child {
  border-bottom: none;
}

.bom-search-item:hover {
  background: #f8f9fa;
}

.bom-search-item-name {
  font-weight: 600;
  font-size: 14px;
  color: #1a1a1a;
}

.bom-search-item-cat {
  font-size: 12px;
  color: #5f6368;
  background: #e8eaed;
  padding: 2px 8px;
  border-radius: 100px;
}

/* Summary Panel */
.bom-summary-card {
  background: linear-gradient(135deg, #4285F4 0%, #1a73e8 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(66, 133, 244, 0.2);

}

.bom-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

.bom-cost-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.bom-cost-main {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.bom-summary-metrics {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.bom-metric-item {
  display: flex;
  flex-direction: column;
}

.bom-metric-value {
  font-size: 18px;
  font-weight: 700;
}

.bom-metric-label {
  font-size: 11px;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.bom-summary-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.bom-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.95;
}

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

.bom-btn-light {
  background: #ffffff;
  color: #1a73e8;
  border: none;
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.bom-btn-light:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.bom-btn-outline-light {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bom-btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
}

/* Guest Banner */
.bom-guest-banner {
  background: #FEF7E0;
  border: 1px solid #FCE8E6;
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bom-guest-text {
  font-size: 13px;
  color: #202124;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* Components Table Responsive Container */
.bom-table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e1e3e5;
  border-radius: 12px;
  background: #ffffff;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.bom-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  font-size: 13px;
}

.bom-table th {
  background: #f8f9fa;
  color: #5f6368;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #e1e3e5;
  white-space: nowrap;
}

.bom-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f3f4;
  vertical-align: middle;
}

.bom-table tr.bom-row-parent {
  background: #f8fafd;
}

.bom-table tr:hover {
  background: #f8f9fa;
}

.bom-table tr.bom-row-parent:hover {
  background: #f0f4f9;
}

.bom-cell-indent {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bom-indent-arrow {
  color: #4285F4;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}

.bom-table-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s;
}

.bom-table-input:focus {
  border-color: #4285F4;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.15);
}

.bom-table-input:disabled {
  background: #e8eaed;
  color: #5f6368;
  cursor: not-allowed;
  font-style: italic;
}

.bom-table-select {
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  outline: none;
  background: #ffffff;
  font-family: inherit;
}

.bom-line-cost {
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bom-rolls-up-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  background: #e8f0fe;
  color: #1a73e8;
  padding: 2px 8px;
  border-radius: 100px;
}

/* Row Action Buttons */
.bom-actions-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.bom-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #5f6368;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.bom-icon-btn:hover {
  background: #f1f3f4;
  color: #1a1a1a;
  border-color: #bdc1c6;
}

.bom-icon-btn.btn-danger:hover {
  background: #fce8e6;
  color: #c5221f;
  border-color: #f5c2c7;
}

.bom-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f8f9fa;
  border-color: #e1e3e5;
}

/* My BOMs Cards Grid */
.my-boms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.my-bom-card {
  background: #ffffff;
  border: 1px solid #e1e3e5;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.my-bom-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}

.my-bom-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.my-bom-meta {
  font-size: 12px;
  color: #5f6368;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.my-bom-cost {
  font-size: 20px;
  font-weight: 800;
  color: #1a1a1a;
  margin-top: 8px;
}

.my-bom-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #f1f3f4;
}

/* Empty State */
.bom-empty-state {
  text-align: center;
  padding: 56px 24px;
  background: #f8f9fa;
  border-radius: 16px;
  border: 1px dashed #dadce0;
  color: #5f6368;
}

.bom-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e8f0fe;
  color: #4285F4;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
