:host { display: block; }

.warehouse-transfers-page {
  .action-buttons { display: flex; gap: 0.25rem; }
  .text-end { text-align: end; }
  .mono { font-family: monospace; }
}

.dialog-form {
  display: flex; flex-direction: column; gap: 1rem;
  .form-field {
    display: flex; flex-direction: column; gap: 0.25rem; flex: 1;
    label { font-weight: 600; font-size: 0.875rem; }
  }
  .form-row {
    display: flex; gap: 1rem;
    @media (max-width: 768px) { flex-direction: column; }
  }
}

.section-title {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.25rem;
}

.sub-table {
  overflow-x: auto;
  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: auto;
    th, td {
      padding: 0.35rem 0.25rem;
      border: 1px solid #e2e8f0;
      white-space: nowrap;
      vertical-align: middle;
    }
    thead th {
      background: #f8fafc;
      font-weight: 600;
      font-size: 0.8rem;
      color: #475569;
    }
    tfoot td {
      background: #f8fafc;
      font-weight: 600;
    }
  }
  ::ng-deep {
    .p-inputnumber, .p-select { max-width: 100%; }
    .p-inputtext { max-width: 100%; box-sizing: border-box; }
  }
}

.detail-view {
  padding: 0.5rem;
}

.detail-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
  strong {
    min-width: 120px;
    color: #64748b;
  }
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.mono { font-family: monospace; }
.text-end { text-align: end; }
.variant-badge {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-inline-start: 0.3rem;
}

.barcode-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  .barcode-icon { font-size: 1.2rem; color: #64748b; }
  .barcode-input { flex: 1; max-width: 350px; font-family: monospace; }
}

.stock-qty-cell { text-align: center; }
.stock-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  background: rgba(16,185,129,0.12);
  color: #059669;
  &.stock-zero { background: rgba(239,68,68,0.12); color: #dc2626; }
  &.stock-low { background: rgba(245,158,11,0.12); color: #d97706; }
}

.product-option {
  display: flex;
  flex-direction: column;
  gap: 0;
  .product-category {
    color: #64748b;
    font-size: 0.7rem;
    line-height: 1;
  }
  .product-name {
    font-size: 0.85rem;
  }
  .product-code {
    color: #94a3b8;
    font-size: 0.75rem;
  }
}

// ─── Dark Mode ───
body.dark-mode {
  .section-title {
    color: var(--color-text-secondary);
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }

  .sub-table table {
    th, td { border-color: rgba(255, 255, 255, 0.06); }
    thead th { background: rgba(8, 12, 26, 0.8); color: #94a3b8; }
    tfoot td { background: rgba(8, 12, 26, 0.8); color: var(--color-text-primary); }
  }

  .detail-row {
    border-bottom-color: rgba(255, 255, 255, 0.06);
    strong { color: #94a3b8; }
  }

  .dialog-actions {
    border-top-color: rgba(255, 255, 255, 0.06);
  }

  .variant-badge {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
  }

  .product-option {
    .product-category { color: #94a3b8; }
    .product-code { color: #64748b; }
  }

  .barcode-row .barcode-icon { color: #94a3b8; }
}
